@venturekit/cli 0.0.0-dev.20260516011532 → 0.0.0-dev.20260522100701
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/help.d.ts.map +1 -1
- package/dist/commands/help.js +4 -0
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/review.d.ts +18 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +156 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/templates/review-workflow.d.ts +12 -0
- package/dist/templates/review-workflow.d.ts.map +1 -0
- package/dist/templates/review-workflow.js +194 -0
- package/dist/templates/review-workflow.js.map +1 -0
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmFpC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAOlD;AAED,wBAAgB,QAAQ,IAAI,IAAI,CAE/B"}
|
package/dist/commands/help.js
CHANGED
|
@@ -35,6 +35,10 @@ ${chalk.bold('COMMANDS')}
|
|
|
35
35
|
${chalk.green('migrate')} Apply pending pure-SQL migrations from db/migrations/.
|
|
36
36
|
${chalk.dim('vk migrate, vk migrate --seed, vk migrate status')}
|
|
37
37
|
|
|
38
|
+
${chalk.green('review')} Prepare an AI branch review (installs the /review Windsurf
|
|
39
|
+
workflow and writes branch/base context for Cascade).
|
|
40
|
+
${chalk.dim('vk review <branch> [base] # base defaults to dev')}
|
|
41
|
+
|
|
38
42
|
${chalk.bold('GETTING STARTED')}
|
|
39
43
|
|
|
40
44
|
1. Create a new project:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,SAAS,GAAG;EAChB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC;;EAEjC,KAAK,CAAC,MAAM,CAAC,oEAAoE,CAAC;EAClF,KAAK,CAAC,MAAM,CAAC,yEAAyE,CAAC;;EAEvF,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;;IAEjB,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC;;EAEtC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;;IAEpB,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;0BACG,KAAK,CAAC,GAAG,CAAC,yBAAyB,CAAC;;IAE1D,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC;;;IAGlB,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;;;IAGrB,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC;;IAErB,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC,0CAA0C,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC;eACxE,KAAK,CAAC,GAAG,CAAC,+CAA+C,CAAC;eAC1D,KAAK,CAAC,GAAG,CAAC,qBAAqB,CAAC;;IAE3C,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC;eACR,KAAK,CAAC,GAAG,CAAC,2CAA2C,CAAC;;IAEjE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;eACX,KAAK,CAAC,GAAG,CAAC,kDAAkD,CAAC;;
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;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AC,IAAI,CAAC,WAAW,CAAC;;EAE5B,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC;;;;;;;;;2BASN,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;2BAC1B,KAAK,CAAC,GAAG,CAAC,cAAc,CAAC;2BACzB,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;2BAC1B,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC;;EAEvD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;;yBAEE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAC7C,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,4CAA4C,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC;;EAElG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;;mBAEF,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC;mBACnC,KAAK,CAAC,GAAG,CAAC,8CAA8C,CAAC;mBACzD,KAAK,CAAC,GAAG,CAAC,sCAAsC,CAAC;CACnE,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,OAAO;SACJ,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,oDAAoD,CAAC;SACjE,MAAM,CAAC,GAAG,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,QAAQ;IACtB,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vk review — Prepare an AI-driven branch review inside Windsurf.
|
|
3
|
+
*
|
|
4
|
+
* The CLI itself does not call any LLM. Its job is to:
|
|
5
|
+
* 1. Validate that <branch> and <base> exist in the local repo.
|
|
6
|
+
* 2. Drop a Windsurf workflow at `.windsurf/workflows/review.md`
|
|
7
|
+
* so the user can run `/review` from the IDE.
|
|
8
|
+
* 3. Persist the review parameters to `.vk/review/context.json`
|
|
9
|
+
* so the workflow knows which branch/base to compare without
|
|
10
|
+
* re-prompting.
|
|
11
|
+
*
|
|
12
|
+
* One source-of-truth template (`templates/review-workflow.ts`)
|
|
13
|
+
* means the same workflow ends up in every consumer repo — including
|
|
14
|
+
* venturekit itself, when run from its own root.
|
|
15
|
+
*/
|
|
16
|
+
import { Command } from 'commander';
|
|
17
|
+
export declare function reviewCommand(program: Command): void;
|
|
18
|
+
//# sourceMappingURL=review.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoDpC,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4GpD"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* vk review — Prepare an AI-driven branch review inside Windsurf.
|
|
3
|
+
*
|
|
4
|
+
* The CLI itself does not call any LLM. Its job is to:
|
|
5
|
+
* 1. Validate that <branch> and <base> exist in the local repo.
|
|
6
|
+
* 2. Drop a Windsurf workflow at `.windsurf/workflows/review.md`
|
|
7
|
+
* so the user can run `/review` from the IDE.
|
|
8
|
+
* 3. Persist the review parameters to `.vk/review/context.json`
|
|
9
|
+
* so the workflow knows which branch/base to compare without
|
|
10
|
+
* re-prompting.
|
|
11
|
+
*
|
|
12
|
+
* One source-of-truth template (`templates/review-workflow.ts`)
|
|
13
|
+
* means the same workflow ends up in every consumer repo — including
|
|
14
|
+
* venturekit itself, when run from its own root.
|
|
15
|
+
*/
|
|
16
|
+
import chalk from 'chalk';
|
|
17
|
+
import { execSync } from 'node:child_process';
|
|
18
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
19
|
+
import { dirname, join, resolve } from 'node:path';
|
|
20
|
+
import { REVIEW_WORKFLOW_MD } from '../templates/review-workflow.js';
|
|
21
|
+
/**
|
|
22
|
+
* Run a git command silently and return stdout (trimmed). Returns
|
|
23
|
+
* `null` instead of throwing so callers can branch on missing repo /
|
|
24
|
+
* missing ref without try/catch noise.
|
|
25
|
+
*/
|
|
26
|
+
function git(args, cwd) {
|
|
27
|
+
try {
|
|
28
|
+
return execSync(`git ${args}`, {
|
|
29
|
+
cwd,
|
|
30
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
31
|
+
encoding: 'utf-8',
|
|
32
|
+
}).trim();
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Resolve the repo root for `cwd`, or null if not inside a git repo.
|
|
40
|
+
* Using `--show-toplevel` rather than walking parents ourselves keeps
|
|
41
|
+
* worktree / submodule edge-cases honest.
|
|
42
|
+
*/
|
|
43
|
+
function findRepoRoot(cwd) {
|
|
44
|
+
const top = git('rev-parse --show-toplevel', cwd);
|
|
45
|
+
if (!top)
|
|
46
|
+
return null;
|
|
47
|
+
// git on Windows reports POSIX-style paths; normalize.
|
|
48
|
+
return resolve(top);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Confirm a branch exists either locally or on a remote. Accepts the
|
|
52
|
+
* remote variant (\`origin/<name>\`) too so users can review a branch
|
|
53
|
+
* they haven't checked out yet — the workflow will fetch + checkout.
|
|
54
|
+
*/
|
|
55
|
+
function branchExists(name, repoRoot) {
|
|
56
|
+
if (git(`rev-parse --verify --quiet refs/heads/${name}`, repoRoot))
|
|
57
|
+
return true;
|
|
58
|
+
if (git(`rev-parse --verify --quiet refs/remotes/origin/${name}`, repoRoot))
|
|
59
|
+
return true;
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
export function reviewCommand(program) {
|
|
63
|
+
program
|
|
64
|
+
.command('review <branch> [base]')
|
|
65
|
+
.description('Prepare an AI review of <branch> vs [base] (default: dev) and install the /review Windsurf workflow')
|
|
66
|
+
.option('--no-fetch', 'Skip `git fetch` before validating refs')
|
|
67
|
+
.option('--force', 'Overwrite an existing .windsurf/workflows/review.md without prompting')
|
|
68
|
+
.action((branch, base, options) => {
|
|
69
|
+
const cwd = process.cwd();
|
|
70
|
+
const repoRoot = findRepoRoot(cwd);
|
|
71
|
+
if (!repoRoot) {
|
|
72
|
+
console.error(chalk.red('\n❌ Not inside a git repository.'));
|
|
73
|
+
console.error(chalk.dim(' Run `vk review` from a project that is checked out via git.\n'));
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
const baseBranch = base ?? 'dev';
|
|
77
|
+
// Refresh remote refs so a "freshly-pushed branch" is visible
|
|
78
|
+
// without forcing the user to fetch manually.
|
|
79
|
+
if (options.noFetch !== true) {
|
|
80
|
+
try {
|
|
81
|
+
execSync('git fetch --all --prune', { cwd: repoRoot, stdio: 'ignore' });
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Network failure is non-fatal — local refs may still be enough.
|
|
85
|
+
console.warn(chalk.yellow('⚠ `git fetch` failed; continuing with local refs only.'));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (!branchExists(branch, repoRoot)) {
|
|
89
|
+
console.error(chalk.red(`\n❌ Branch not found: ${branch}`));
|
|
90
|
+
console.error(chalk.dim(' Checked refs/heads and refs/remotes/origin.'));
|
|
91
|
+
console.error(chalk.dim(' If it lives on a different remote, fetch it first.\n'));
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
if (!branchExists(baseBranch, repoRoot)) {
|
|
95
|
+
console.error(chalk.red(`\n❌ Base branch not found: ${baseBranch}`));
|
|
96
|
+
console.error(chalk.dim(` Pass an existing base explicitly: \`vk review ${branch} <base>\`\n`));
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
// Write the workflow. We always overwrite when --force or when
|
|
100
|
+
// the existing file looks like one we generated (same header) —
|
|
101
|
+
// keeping it in sync is the whole point of shipping it via the
|
|
102
|
+
// CLI. If a user has hand-edited it, ask before clobbering.
|
|
103
|
+
const workflowDir = join(repoRoot, '.windsurf', 'workflows');
|
|
104
|
+
const workflowPath = join(workflowDir, 'review.md');
|
|
105
|
+
mkdirSync(workflowDir, { recursive: true });
|
|
106
|
+
let wroteWorkflow = false;
|
|
107
|
+
if (existsSync(workflowPath) && options.force !== true) {
|
|
108
|
+
// Only warn when the existing file diverges from the shipped
|
|
109
|
+
// template — identical content is a silent no-op.
|
|
110
|
+
let current = null;
|
|
111
|
+
try {
|
|
112
|
+
current = readFileSync(workflowPath, 'utf-8');
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
current = null;
|
|
116
|
+
}
|
|
117
|
+
if (current === null) {
|
|
118
|
+
// Couldn't read it; safest to overwrite so the workflow is
|
|
119
|
+
// guaranteed present.
|
|
120
|
+
writeFileSync(workflowPath, REVIEW_WORKFLOW_MD, 'utf-8');
|
|
121
|
+
wroteWorkflow = true;
|
|
122
|
+
}
|
|
123
|
+
else if (current !== REVIEW_WORKFLOW_MD) {
|
|
124
|
+
console.warn(chalk.yellow(`⚠ ${workflowPath} already exists and was not overwritten.`));
|
|
125
|
+
console.warn(chalk.dim(' Re-run with `--force` to refresh it from the CLI template.\n'));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
writeFileSync(workflowPath, REVIEW_WORKFLOW_MD, 'utf-8');
|
|
130
|
+
wroteWorkflow = true;
|
|
131
|
+
}
|
|
132
|
+
// Persist context for the workflow to consume.
|
|
133
|
+
const contextPath = join(repoRoot, '.vk', 'review', 'context.json');
|
|
134
|
+
mkdirSync(dirname(contextPath), { recursive: true });
|
|
135
|
+
writeFileSync(contextPath, JSON.stringify({
|
|
136
|
+
branch,
|
|
137
|
+
base: baseBranch,
|
|
138
|
+
repoRoot,
|
|
139
|
+
generatedAt: new Date().toISOString(),
|
|
140
|
+
}, null, 2) + '\n', 'utf-8');
|
|
141
|
+
// ── Output ────────────────────────────────────────────────
|
|
142
|
+
console.log(chalk.blue('\n🔍 VentureKit Review prepared\n'));
|
|
143
|
+
console.log(` ${chalk.bold('Branch:')} ${chalk.cyan(branch)}`);
|
|
144
|
+
console.log(` ${chalk.bold('Base:')} ${chalk.cyan(baseBranch)}`);
|
|
145
|
+
console.log(` ${chalk.bold('Repo:')} ${chalk.dim(repoRoot)}`);
|
|
146
|
+
console.log('');
|
|
147
|
+
console.log(` ${chalk.bold('Workflow:')} ${chalk.dim(workflowPath)} ${wroteWorkflow ? chalk.green('(written)') : chalk.dim('(unchanged)')}`);
|
|
148
|
+
console.log(` ${chalk.bold('Context:')} ${chalk.dim(contextPath)}`);
|
|
149
|
+
console.log('');
|
|
150
|
+
console.log(chalk.bold('Next step:'));
|
|
151
|
+
console.log(` Open this repo in Windsurf and run ${chalk.cyan('/review')} in Cascade.`);
|
|
152
|
+
console.log(chalk.dim(' Cascade will read the context file, diff the branch, propose fixes,'));
|
|
153
|
+
console.log(chalk.dim(' apply approved changes, and prepare a commit for you to push.\n'));
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=review.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../src/commands/review.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAOrE;;;;GAIG;AACH,SAAS,GAAG,CAAC,IAAY,EAAE,GAAW;IACpC,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KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QACvE,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,yCAAyC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;QAC1F,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC,CAAC;QACjG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmCpC,QAAA,MAAM,OAAO,SAAgB,CAAC;AA2B9B;;GAEG;AACH,wBAAgB,GAAG,IAAI,IAAI,CAE1B;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ import { statusCommand } from './commands/status.js';
|
|
|
19
19
|
import { openCommand } from './commands/open.js';
|
|
20
20
|
import { certCommand } from './commands/cert.js';
|
|
21
21
|
import { ghaCommand } from './commands/gha.js';
|
|
22
|
+
import { reviewCommand } from './commands/review.js';
|
|
22
23
|
import { helpCommand, showHelp } from './commands/help.js';
|
|
23
24
|
/**
|
|
24
25
|
* Read the CLI version from this package's own `package.json` so
|
|
@@ -57,6 +58,7 @@ statusCommand(program);
|
|
|
57
58
|
openCommand(program);
|
|
58
59
|
certCommand(program);
|
|
59
60
|
ghaCommand(program);
|
|
61
|
+
reviewCommand(program);
|
|
60
62
|
helpCommand(program);
|
|
61
63
|
// Show detailed help when called without a command
|
|
62
64
|
program.action(() => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;;;;;;;GASG;AACH,SAAS,cAAc;IACrB,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;QACxG,OAAO,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC;IAClC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,IAAI,CAAC;KACV,WAAW,CAAC,+CAA+C,CAAC;KAC5D,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;AAE7B,oBAAoB;AACpB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,UAAU,CAAC,OAAO,CAAC,CAAC;AACpB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,eAAe,CAAC,OAAO,CAAC,CAAC;AACzB,cAAc,CAAC,OAAO,CAAC,CAAC;AACxB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,WAAW,CAAC,OAAO,CAAC,CAAC;AACrB,UAAU,CAAC,OAAO,CAAC,CAAC;AACpB,aAAa,CAAC,OAAO,CAAC,CAAC;AACvB,WAAW,CAAC,OAAO,CAAC,CAAC;AAErB,mDAAmD;AACnD,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;IAClB,QAAQ,EAAE,CAAC;AACb,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,UAAU,GAAG;IACjB,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-of-truth for the `/review` Windsurf workflow that ships with
|
|
3
|
+
* `vk review`. Kept as an inlined string (not a `.md` file) so the
|
|
4
|
+
* compiled `dist/` package can write it without a separate copy step
|
|
5
|
+
* in the build pipeline.
|
|
6
|
+
*
|
|
7
|
+
* The workflow is meant to be driven by Cascade inside the IDE after
|
|
8
|
+
* `vk review <branch> [base]` has prepared `.vk/review/context.json`
|
|
9
|
+
* with the branch / base / repo metadata.
|
|
10
|
+
*/
|
|
11
|
+
export declare const REVIEW_WORKFLOW_MD = "---\ndescription: Review a git branch with AI, fix detected issues, and prepare a commit\n---\n\n# /review \u2014 AI pull-request review\n\nThis workflow reviews a branch against a base, fixes issues you approve,\nand prepares a commit you can push. It is invoked by the user via the\n`vk review` CLI, which writes `.vk/review/context.json` with the\ntarget branch and base before they trigger this slash command.\n\n## 0. Load context\n\nRead `.vk/review/context.json` from the repo root. It contains:\n\n- `branch` \u2014 the branch under review\n- `base` \u2014 the comparison base (default `dev`)\n- `repoRoot` \u2014 absolute path to the repo\n- `generatedAt` \u2014 ISO timestamp\n\nIf the file is missing, ask the user to run `vk review <branch> [base]`\nfirst and stop.\n\n## 1. Snapshot the working tree\n\nBefore checking anything out, verify the working tree is clean:\n\n```\ngit status --porcelain\n```\n\nIf there are uncommitted changes, stop and ask the user to commit or\nstash. Do **not** auto-stash \u2014 the user might be mid-edit.\n\nRecord the current branch so you can restore it at the end:\n\n```\ngit rev-parse --abbrev-ref HEAD\n```\n\n## 2. Fetch and check out the branch\n\n```\ngit fetch --all --prune\ngit checkout <branch>\ngit pull --ff-only\n```\n\nIf `pull --ff-only` fails, stop and surface the divergence \u2014 do not\nforce anything.\n\n## 3. Gather the diff\n\nCompute the merge-base diff so you only see what `<branch>` adds on\ntop of `<base>`:\n\n```\ngit merge-base <base> <branch>\ngit diff <merge-base>...<branch> --stat\ngit diff <merge-base>...<branch>\ngit log <merge-base>..<branch> --oneline\n```\n\nFor each changed file, read the **full current content** (not just\nthe hunk) so you understand context. Use `code_search` for any\nsymbols referenced from outside the diff.\n\n## 4. Run the project's own checks\n\nRun whatever the project ships, in this order, capturing output:\n\n1. **Typecheck** \u2014 e.g. `pnpm -w typecheck`, `pnpm typecheck`,\n `tsc --noEmit`. Pick the one defined in `package.json`.\n2. **Lint** \u2014 e.g. `pnpm lint`, `pnpm -w lint`, `eslint .`.\n3. **Unit tests** \u2014 e.g. `pnpm test`, `pnpm -w test`,\n `vitest run`, `jest`. Skip if the project has none.\n4. **Build** (only if fast and not network-dependent).\n\nIf any of these is unavailable, note it and move on \u2014 don't invent\ncommands.\n\n## 5. Produce the review\n\nWrite a structured review covering, in this order:\n\n1. **Correctness** \u2014 bugs, race conditions, broken edge cases,\n incorrect error handling, missing await, leaked promises.\n2. **Security** \u2014 injection, authz/authn gaps, secrets, unsafe\n deserialization, SSRF, path traversal.\n3. **API / contract changes** \u2014 backwards-incompatible schema, route,\n or config changes; missing migrations; broken consumers.\n4. **Tests** \u2014 coverage gaps for new behaviour, weakened assertions,\n skipped or deleted tests.\n5. **Performance** \u2014 obvious N+1, unbounded loops, large allocations,\n missing indexes.\n6. **Style / maintainability** \u2014 only call out items that materially\n hurt readability or violate the project's conventions. Do not\n nitpick.\n\nFor every issue, include: file path with line range, severity\n(`blocker` / `major` / `minor` / `nit`), what's wrong, and the\nsuggested fix. Cite using the standard `@/abs/path:start-end` format.\n\nSave the review to `.vk/review/<branch>.md` (sanitize slashes in the\nbranch name to `-`). Show a concise summary in chat.\n\n## 6. Apply fixes\n\nGroup issues into a todo list, **blockers and majors first**. For each\nitem:\n\n- Show the proposed change.\n- Apply it via the `edit` / `multi_edit` tool \u2014 never rewrite\n whole files unless the file is new.\n- After each cluster of fixes, re-run typecheck (and lint if it was\n fast). Don't accumulate unverified changes.\n\nDo **not** fix `nit`-level items by default. Ask the user once\nwhether to include them.\n\nIf a fix is risky or the right behaviour is ambiguous, leave the issue\nin the review with a `needs-decision` tag instead of guessing.\n\n## 7. Re-run checks\n\nRepeat step 4 in full. All previously-passing checks must still pass.\nIf anything regressed, revert the offending fix or address it before\nmoving on.\n\n## 8. Prepare the commit\n\nStage only the files **you** modified during step 6 (not unrelated\nworking-tree noise that may have appeared):\n\n```\ngit status --porcelain\ngit add <files>\n```\n\nCompose a commit message of the form:\n\n```\nreview: <short summary of fixes>\n\nAddresses review of <branch> against <base>.\n\n- <blocker/major fix 1>\n- <blocker/major fix 2>\n- ...\n\nReviewed-by: Cascade (vk review)\n```\n\nShow the staged diff (`git diff --cached`) and the proposed message,\nthen **stop and ask the user to confirm** before committing. On\nconfirmation:\n\n```\ngit commit -m \"<message>\"\n```\n\n## 9. Push (only on explicit confirmation)\n\nAfter the commit, ask the user whether to push. If yes:\n\n```\ngit push origin <branch>\n```\n\nNever push without explicit confirmation, even if the user pre-\napproved `git` commands earlier in the session.\n\n## 10. Restore\n\nCheck the original branch back out:\n\n```\ngit checkout <original-branch>\n```\n\nPrint a final summary: number of issues found by severity, fixes\napplied, checks re-run, and the commit SHA (if one was made).\n";
|
|
12
|
+
//# sourceMappingURL=review-workflow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/review-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,qyKAsL9B,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Source-of-truth for the `/review` Windsurf workflow that ships with
|
|
3
|
+
* `vk review`. Kept as an inlined string (not a `.md` file) so the
|
|
4
|
+
* compiled `dist/` package can write it without a separate copy step
|
|
5
|
+
* in the build pipeline.
|
|
6
|
+
*
|
|
7
|
+
* The workflow is meant to be driven by Cascade inside the IDE after
|
|
8
|
+
* `vk review <branch> [base]` has prepared `.vk/review/context.json`
|
|
9
|
+
* with the branch / base / repo metadata.
|
|
10
|
+
*/
|
|
11
|
+
export const REVIEW_WORKFLOW_MD = `---
|
|
12
|
+
description: Review a git branch with AI, fix detected issues, and prepare a commit
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# /review — AI pull-request review
|
|
16
|
+
|
|
17
|
+
This workflow reviews a branch against a base, fixes issues you approve,
|
|
18
|
+
and prepares a commit you can push. It is invoked by the user via the
|
|
19
|
+
\`vk review\` CLI, which writes \`.vk/review/context.json\` with the
|
|
20
|
+
target branch and base before they trigger this slash command.
|
|
21
|
+
|
|
22
|
+
## 0. Load context
|
|
23
|
+
|
|
24
|
+
Read \`.vk/review/context.json\` from the repo root. It contains:
|
|
25
|
+
|
|
26
|
+
- \`branch\` — the branch under review
|
|
27
|
+
- \`base\` — the comparison base (default \`dev\`)
|
|
28
|
+
- \`repoRoot\` — absolute path to the repo
|
|
29
|
+
- \`generatedAt\` — ISO timestamp
|
|
30
|
+
|
|
31
|
+
If the file is missing, ask the user to run \`vk review <branch> [base]\`
|
|
32
|
+
first and stop.
|
|
33
|
+
|
|
34
|
+
## 1. Snapshot the working tree
|
|
35
|
+
|
|
36
|
+
Before checking anything out, verify the working tree is clean:
|
|
37
|
+
|
|
38
|
+
\`\`\`
|
|
39
|
+
git status --porcelain
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
If there are uncommitted changes, stop and ask the user to commit or
|
|
43
|
+
stash. Do **not** auto-stash — the user might be mid-edit.
|
|
44
|
+
|
|
45
|
+
Record the current branch so you can restore it at the end:
|
|
46
|
+
|
|
47
|
+
\`\`\`
|
|
48
|
+
git rev-parse --abbrev-ref HEAD
|
|
49
|
+
\`\`\`
|
|
50
|
+
|
|
51
|
+
## 2. Fetch and check out the branch
|
|
52
|
+
|
|
53
|
+
\`\`\`
|
|
54
|
+
git fetch --all --prune
|
|
55
|
+
git checkout <branch>
|
|
56
|
+
git pull --ff-only
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
If \`pull --ff-only\` fails, stop and surface the divergence — do not
|
|
60
|
+
force anything.
|
|
61
|
+
|
|
62
|
+
## 3. Gather the diff
|
|
63
|
+
|
|
64
|
+
Compute the merge-base diff so you only see what \`<branch>\` adds on
|
|
65
|
+
top of \`<base>\`:
|
|
66
|
+
|
|
67
|
+
\`\`\`
|
|
68
|
+
git merge-base <base> <branch>
|
|
69
|
+
git diff <merge-base>...<branch> --stat
|
|
70
|
+
git diff <merge-base>...<branch>
|
|
71
|
+
git log <merge-base>..<branch> --oneline
|
|
72
|
+
\`\`\`
|
|
73
|
+
|
|
74
|
+
For each changed file, read the **full current content** (not just
|
|
75
|
+
the hunk) so you understand context. Use \`code_search\` for any
|
|
76
|
+
symbols referenced from outside the diff.
|
|
77
|
+
|
|
78
|
+
## 4. Run the project's own checks
|
|
79
|
+
|
|
80
|
+
Run whatever the project ships, in this order, capturing output:
|
|
81
|
+
|
|
82
|
+
1. **Typecheck** — e.g. \`pnpm -w typecheck\`, \`pnpm typecheck\`,
|
|
83
|
+
\`tsc --noEmit\`. Pick the one defined in \`package.json\`.
|
|
84
|
+
2. **Lint** — e.g. \`pnpm lint\`, \`pnpm -w lint\`, \`eslint .\`.
|
|
85
|
+
3. **Unit tests** — e.g. \`pnpm test\`, \`pnpm -w test\`,
|
|
86
|
+
\`vitest run\`, \`jest\`. Skip if the project has none.
|
|
87
|
+
4. **Build** (only if fast and not network-dependent).
|
|
88
|
+
|
|
89
|
+
If any of these is unavailable, note it and move on — don't invent
|
|
90
|
+
commands.
|
|
91
|
+
|
|
92
|
+
## 5. Produce the review
|
|
93
|
+
|
|
94
|
+
Write a structured review covering, in this order:
|
|
95
|
+
|
|
96
|
+
1. **Correctness** — bugs, race conditions, broken edge cases,
|
|
97
|
+
incorrect error handling, missing await, leaked promises.
|
|
98
|
+
2. **Security** — injection, authz/authn gaps, secrets, unsafe
|
|
99
|
+
deserialization, SSRF, path traversal.
|
|
100
|
+
3. **API / contract changes** — backwards-incompatible schema, route,
|
|
101
|
+
or config changes; missing migrations; broken consumers.
|
|
102
|
+
4. **Tests** — coverage gaps for new behaviour, weakened assertions,
|
|
103
|
+
skipped or deleted tests.
|
|
104
|
+
5. **Performance** — obvious N+1, unbounded loops, large allocations,
|
|
105
|
+
missing indexes.
|
|
106
|
+
6. **Style / maintainability** — only call out items that materially
|
|
107
|
+
hurt readability or violate the project's conventions. Do not
|
|
108
|
+
nitpick.
|
|
109
|
+
|
|
110
|
+
For every issue, include: file path with line range, severity
|
|
111
|
+
(\`blocker\` / \`major\` / \`minor\` / \`nit\`), what's wrong, and the
|
|
112
|
+
suggested fix. Cite using the standard \`@/abs/path:start-end\` format.
|
|
113
|
+
|
|
114
|
+
Save the review to \`.vk/review/<branch>.md\` (sanitize slashes in the
|
|
115
|
+
branch name to \`-\`). Show a concise summary in chat.
|
|
116
|
+
|
|
117
|
+
## 6. Apply fixes
|
|
118
|
+
|
|
119
|
+
Group issues into a todo list, **blockers and majors first**. For each
|
|
120
|
+
item:
|
|
121
|
+
|
|
122
|
+
- Show the proposed change.
|
|
123
|
+
- Apply it via the \`edit\` / \`multi_edit\` tool — never rewrite
|
|
124
|
+
whole files unless the file is new.
|
|
125
|
+
- After each cluster of fixes, re-run typecheck (and lint if it was
|
|
126
|
+
fast). Don't accumulate unverified changes.
|
|
127
|
+
|
|
128
|
+
Do **not** fix \`nit\`-level items by default. Ask the user once
|
|
129
|
+
whether to include them.
|
|
130
|
+
|
|
131
|
+
If a fix is risky or the right behaviour is ambiguous, leave the issue
|
|
132
|
+
in the review with a \`needs-decision\` tag instead of guessing.
|
|
133
|
+
|
|
134
|
+
## 7. Re-run checks
|
|
135
|
+
|
|
136
|
+
Repeat step 4 in full. All previously-passing checks must still pass.
|
|
137
|
+
If anything regressed, revert the offending fix or address it before
|
|
138
|
+
moving on.
|
|
139
|
+
|
|
140
|
+
## 8. Prepare the commit
|
|
141
|
+
|
|
142
|
+
Stage only the files **you** modified during step 6 (not unrelated
|
|
143
|
+
working-tree noise that may have appeared):
|
|
144
|
+
|
|
145
|
+
\`\`\`
|
|
146
|
+
git status --porcelain
|
|
147
|
+
git add <files>
|
|
148
|
+
\`\`\`
|
|
149
|
+
|
|
150
|
+
Compose a commit message of the form:
|
|
151
|
+
|
|
152
|
+
\`\`\`
|
|
153
|
+
review: <short summary of fixes>
|
|
154
|
+
|
|
155
|
+
Addresses review of <branch> against <base>.
|
|
156
|
+
|
|
157
|
+
- <blocker/major fix 1>
|
|
158
|
+
- <blocker/major fix 2>
|
|
159
|
+
- ...
|
|
160
|
+
|
|
161
|
+
Reviewed-by: Cascade (vk review)
|
|
162
|
+
\`\`\`
|
|
163
|
+
|
|
164
|
+
Show the staged diff (\`git diff --cached\`) and the proposed message,
|
|
165
|
+
then **stop and ask the user to confirm** before committing. On
|
|
166
|
+
confirmation:
|
|
167
|
+
|
|
168
|
+
\`\`\`
|
|
169
|
+
git commit -m "<message>"
|
|
170
|
+
\`\`\`
|
|
171
|
+
|
|
172
|
+
## 9. Push (only on explicit confirmation)
|
|
173
|
+
|
|
174
|
+
After the commit, ask the user whether to push. If yes:
|
|
175
|
+
|
|
176
|
+
\`\`\`
|
|
177
|
+
git push origin <branch>
|
|
178
|
+
\`\`\`
|
|
179
|
+
|
|
180
|
+
Never push without explicit confirmation, even if the user pre-
|
|
181
|
+
approved \`git\` commands earlier in the session.
|
|
182
|
+
|
|
183
|
+
## 10. Restore
|
|
184
|
+
|
|
185
|
+
Check the original branch back out:
|
|
186
|
+
|
|
187
|
+
\`\`\`
|
|
188
|
+
git checkout <original-branch>
|
|
189
|
+
\`\`\`
|
|
190
|
+
|
|
191
|
+
Print a final summary: number of issues found by severity, fixes
|
|
192
|
+
applied, checks re-run, and the commit SHA (if one was made).
|
|
193
|
+
`;
|
|
194
|
+
//# sourceMappingURL=review-workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review-workflow.js","sourceRoot":"","sources":["../../src/templates/review-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsLjC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venturekit/cli",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.20260522100701",
|
|
4
4
|
"description": "CLI for VentureKit - scaffolding and deploy orchestration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@venturekit/core": "0.0.0-dev.
|
|
33
|
-
"@venturekit/data": "0.0.0-dev.
|
|
32
|
+
"@venturekit/core": "0.0.0-dev.20260522100701",
|
|
33
|
+
"@venturekit/data": "0.0.0-dev.20260522100701",
|
|
34
34
|
"@aws-sdk/client-acm": "^3.668.0",
|
|
35
35
|
"@aws-sdk/client-cloudformation": "^3.500.0",
|
|
36
36
|
"@aws-sdk/client-iam": "^3.668.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^25.6.0",
|
|
48
48
|
"@types/prompts": "^2.4.9",
|
|
49
|
-
"@venturekit/runtime": "0.0.0-dev.
|
|
49
|
+
"@venturekit/runtime": "0.0.0-dev.20260522100701",
|
|
50
50
|
"@aws-sdk/client-cloudwatch-logs": "^3.500.0",
|
|
51
51
|
"@aws-sdk/client-cognito-identity-provider": "^3.668.0",
|
|
52
52
|
"@aws-sdk/client-lambda": "^3.500.0",
|