@venturekit/cli 0.0.0-dev.20260815190251 → 0.0.0-dev.20260816114351
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.js +2 -2
- package/dist/commands/review.d.ts +18 -2
- package/dist/commands/review.d.ts.map +1 -1
- package/dist/commands/review.js +83 -24
- package/dist/commands/review.js.map +1 -1
- package/dist/templates/review-workflow.d.ts +16 -3
- package/dist/templates/review-workflow.d.ts.map +1 -1
- package/dist/templates/review-workflow.js +21 -5
- package/dist/templates/review-workflow.js.map +1 -1
- package/package.json +4 -4
package/dist/commands/help.js
CHANGED
|
@@ -39,8 +39,8 @@ ${chalk.bold('COMMANDS')}
|
|
|
39
39
|
${chalk.green('migrate')} Apply pending pure-SQL migrations from db/migrations/.
|
|
40
40
|
${chalk.dim('vk migrate, vk migrate --seed, vk migrate status')}
|
|
41
41
|
|
|
42
|
-
${chalk.green('review')} Prepare an AI branch review (installs the /review
|
|
43
|
-
|
|
42
|
+
${chalk.green('review')} Prepare an AI branch review (installs the /review workflow
|
|
43
|
+
at .devin/workflows/ and writes branch/base context for the agent).
|
|
44
44
|
${chalk.dim('vk review <branch> [base] # base defaults to dev')}
|
|
45
45
|
|
|
46
46
|
${chalk.bold('GETTING STARTED')}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vk review — Prepare an AI-driven branch review inside
|
|
2
|
+
* vk review — Prepare an AI-driven branch review inside the IDE agent.
|
|
3
3
|
*
|
|
4
4
|
* The CLI itself does not call any LLM. Its job is to:
|
|
5
5
|
* 1. Validate that <branch> and <base> exist in the local repo.
|
|
6
|
-
* 2. Drop
|
|
6
|
+
* 2. Drop an agent workflow at `.devin/workflows/review.md`
|
|
7
7
|
* so the user can run `/review` from the IDE.
|
|
8
8
|
* 3. Persist the review parameters to `.vk/review/context.json`
|
|
9
9
|
* so the workflow knows which branch/base to compare without
|
|
@@ -14,5 +14,21 @@
|
|
|
14
14
|
* venturekit itself, when run from its own root.
|
|
15
15
|
*/
|
|
16
16
|
import { Command } from 'commander';
|
|
17
|
+
/**
|
|
18
|
+
* True when `content` came from this CLI (any template revision). The
|
|
19
|
+
* first heading is deliberately stable across revisions precisely so
|
|
20
|
+
* generated files can be refreshed without prompting, while a
|
|
21
|
+
* hand-authored `review.md` is left alone.
|
|
22
|
+
*/
|
|
23
|
+
declare function isGeneratedWorkflow(content: string): boolean;
|
|
17
24
|
export declare function reviewCommand(program: Command): void;
|
|
25
|
+
/** Test-only — exposes the install paths and the generated-file
|
|
26
|
+
* heuristic so unit tests can pin them without running the action
|
|
27
|
+
* (which shells out to git and writes to disk). */
|
|
28
|
+
export declare const _internals: {
|
|
29
|
+
WORKFLOW_PATH_SEGMENTS: readonly [".devin", "workflows", "review.md"];
|
|
30
|
+
LEGACY_WORKFLOW_PATH_SEGMENTS: readonly [".windsurf", "workflows", "review.md"];
|
|
31
|
+
isGeneratedWorkflow: typeof isGeneratedWorkflow;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
18
34
|
//# sourceMappingURL=review.d.ts.map
|
|
@@ -1 +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;
|
|
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;AAyBpC;;;;;GAKG;AACH,iBAAS,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAErD;AA0CD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwIpD;AAED;;mDAEmD;AACnD,eAAO,MAAM,UAAU;;;;CAItB,CAAC"}
|
package/dist/commands/review.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vk review — Prepare an AI-driven branch review inside
|
|
2
|
+
* vk review — Prepare an AI-driven branch review inside the IDE agent.
|
|
3
3
|
*
|
|
4
4
|
* The CLI itself does not call any LLM. Its job is to:
|
|
5
5
|
* 1. Validate that <branch> and <base> exist in the local repo.
|
|
6
|
-
* 2. Drop
|
|
6
|
+
* 2. Drop an agent workflow at `.devin/workflows/review.md`
|
|
7
7
|
* so the user can run `/review` from the IDE.
|
|
8
8
|
* 3. Persist the review parameters to `.vk/review/context.json`
|
|
9
9
|
* so the workflow knows which branch/base to compare without
|
|
@@ -15,9 +15,29 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import chalk from 'chalk';
|
|
17
17
|
import { execSync } from 'node:child_process';
|
|
18
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
18
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
|
19
19
|
import { dirname, join, resolve } from 'node:path';
|
|
20
|
-
import { REVIEW_WORKFLOW_MD } from '../templates/review-workflow.js';
|
|
20
|
+
import { REVIEW_WORKFLOW_MARKER, REVIEW_WORKFLOW_MD } from '../templates/review-workflow.js';
|
|
21
|
+
/**
|
|
22
|
+
* Where current IDE builds look for slash-command workflows. Relative
|
|
23
|
+
* to the repo root, POSIX-style segments joined per-platform below.
|
|
24
|
+
*/
|
|
25
|
+
const WORKFLOW_PATH_SEGMENTS = ['.devin', 'workflows', 'review.md'];
|
|
26
|
+
/**
|
|
27
|
+
* Pre-rename location. Older `vk review` runs installed here; leaving
|
|
28
|
+
* that file behind would expose a second, stale `/review` command, so
|
|
29
|
+
* we retire it whenever it is recognisably CLI-generated.
|
|
30
|
+
*/
|
|
31
|
+
const LEGACY_WORKFLOW_PATH_SEGMENTS = ['.windsurf', 'workflows', 'review.md'];
|
|
32
|
+
/**
|
|
33
|
+
* True when `content` came from this CLI (any template revision). The
|
|
34
|
+
* first heading is deliberately stable across revisions precisely so
|
|
35
|
+
* generated files can be refreshed without prompting, while a
|
|
36
|
+
* hand-authored `review.md` is left alone.
|
|
37
|
+
*/
|
|
38
|
+
function isGeneratedWorkflow(content) {
|
|
39
|
+
return content.includes(REVIEW_WORKFLOW_MARKER);
|
|
40
|
+
}
|
|
21
41
|
/**
|
|
22
42
|
* Run a git command silently and return stdout (trimmed). Returns
|
|
23
43
|
* `null` instead of throwing so callers can branch on missing repo /
|
|
@@ -62,9 +82,9 @@ function branchExists(name, repoRoot) {
|
|
|
62
82
|
export function reviewCommand(program) {
|
|
63
83
|
program
|
|
64
84
|
.command('review <branch> [base]')
|
|
65
|
-
.description('Prepare an AI review of <branch> vs [base] (default: dev) and install the /review
|
|
85
|
+
.description('Prepare an AI review of <branch> vs [base] (default: dev) and install the /review agent workflow')
|
|
66
86
|
.option('--no-fetch', 'Skip `git fetch` before validating refs')
|
|
67
|
-
.option('--force', 'Overwrite an existing .
|
|
87
|
+
.option('--force', 'Overwrite an existing .devin/workflows/review.md without prompting')
|
|
68
88
|
.action((branch, base, options) => {
|
|
69
89
|
const cwd = process.cwd();
|
|
70
90
|
const repoRoot = findRepoRoot(cwd);
|
|
@@ -96,32 +116,33 @@ export function reviewCommand(program) {
|
|
|
96
116
|
console.error(chalk.dim(` Pass an existing base explicitly: \`vk review ${branch} <base>\`\n`));
|
|
97
117
|
process.exit(1);
|
|
98
118
|
}
|
|
99
|
-
// Write the workflow. We
|
|
100
|
-
// the existing file
|
|
101
|
-
// keeping it in sync is the whole
|
|
102
|
-
//
|
|
103
|
-
|
|
104
|
-
const workflowPath = join(
|
|
105
|
-
mkdirSync(
|
|
119
|
+
// Write the workflow. We overwrite when --force, when the file
|
|
120
|
+
// is absent, or when the existing file is one we generated (even
|
|
121
|
+
// an older template revision) — keeping it in sync is the whole
|
|
122
|
+
// point of shipping it via the CLI. A hand-authored file is only
|
|
123
|
+
// touched with --force.
|
|
124
|
+
const workflowPath = join(repoRoot, ...WORKFLOW_PATH_SEGMENTS);
|
|
125
|
+
mkdirSync(dirname(workflowPath), { recursive: true });
|
|
106
126
|
let wroteWorkflow = false;
|
|
107
127
|
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
128
|
let current = null;
|
|
111
129
|
try {
|
|
112
130
|
current = readFileSync(workflowPath, 'utf-8');
|
|
113
131
|
}
|
|
114
132
|
catch {
|
|
115
|
-
current = null;
|
|
116
|
-
}
|
|
117
|
-
if (current === null) {
|
|
118
133
|
// Couldn't read it; safest to overwrite so the workflow is
|
|
119
134
|
// guaranteed present.
|
|
120
|
-
|
|
121
|
-
wroteWorkflow = true;
|
|
135
|
+
current = null;
|
|
122
136
|
}
|
|
123
|
-
|
|
124
|
-
|
|
137
|
+
if (current === null || isGeneratedWorkflow(current)) {
|
|
138
|
+
// Identical content is a silent no-op, not a rewrite.
|
|
139
|
+
if (current !== REVIEW_WORKFLOW_MD) {
|
|
140
|
+
writeFileSync(workflowPath, REVIEW_WORKFLOW_MD, 'utf-8');
|
|
141
|
+
wroteWorkflow = true;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
console.warn(chalk.yellow(`⚠ ${workflowPath} looks hand-authored and was not overwritten.`));
|
|
125
146
|
console.warn(chalk.dim(' Re-run with `--force` to refresh it from the CLI template.\n'));
|
|
126
147
|
}
|
|
127
148
|
}
|
|
@@ -129,6 +150,30 @@ export function reviewCommand(program) {
|
|
|
129
150
|
writeFileSync(workflowPath, REVIEW_WORKFLOW_MD, 'utf-8');
|
|
130
151
|
wroteWorkflow = true;
|
|
131
152
|
}
|
|
153
|
+
// Retire the pre-rename copy so the IDE only sees one /review.
|
|
154
|
+
const legacyPath = join(repoRoot, ...LEGACY_WORKFLOW_PATH_SEGMENTS);
|
|
155
|
+
let legacyState = null;
|
|
156
|
+
if (existsSync(legacyPath)) {
|
|
157
|
+
let legacy = null;
|
|
158
|
+
try {
|
|
159
|
+
legacy = readFileSync(legacyPath, 'utf-8');
|
|
160
|
+
}
|
|
161
|
+
catch {
|
|
162
|
+
legacy = null;
|
|
163
|
+
}
|
|
164
|
+
if (legacy !== null && isGeneratedWorkflow(legacy)) {
|
|
165
|
+
try {
|
|
166
|
+
rmSync(legacyPath);
|
|
167
|
+
legacyState = 'removed';
|
|
168
|
+
}
|
|
169
|
+
catch {
|
|
170
|
+
legacyState = 'kept';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
legacyState = 'kept';
|
|
175
|
+
}
|
|
176
|
+
}
|
|
132
177
|
// Persist context for the workflow to consume.
|
|
133
178
|
const contextPath = join(repoRoot, '.vk', 'review', 'context.json');
|
|
134
179
|
mkdirSync(dirname(contextPath), { recursive: true });
|
|
@@ -146,11 +191,25 @@ export function reviewCommand(program) {
|
|
|
146
191
|
console.log('');
|
|
147
192
|
console.log(` ${chalk.bold('Workflow:')} ${chalk.dim(workflowPath)} ${wroteWorkflow ? chalk.green('(written)') : chalk.dim('(unchanged)')}`);
|
|
148
193
|
console.log(` ${chalk.bold('Context:')} ${chalk.dim(contextPath)}`);
|
|
194
|
+
if (legacyState === 'removed') {
|
|
195
|
+
console.log(` ${chalk.bold('Legacy:')} ${chalk.dim(legacyPath)} ${chalk.green('(removed)')}`);
|
|
196
|
+
}
|
|
197
|
+
else if (legacyState === 'kept') {
|
|
198
|
+
console.log(` ${chalk.bold('Legacy:')} ${chalk.dim(legacyPath)} ${chalk.yellow('(still present — delete it to avoid a duplicate /review)')}`);
|
|
199
|
+
}
|
|
149
200
|
console.log('');
|
|
150
201
|
console.log(chalk.bold('Next step:'));
|
|
151
|
-
console.log(` Open this repo in
|
|
152
|
-
console.log(chalk.dim('
|
|
202
|
+
console.log(` Open this repo in your IDE and run ${chalk.cyan('/review')} in the agent panel.`);
|
|
203
|
+
console.log(chalk.dim(' The agent will read the context file, diff the branch, propose fixes,'));
|
|
153
204
|
console.log(chalk.dim(' apply approved changes, and prepare a commit for you to push.\n'));
|
|
154
205
|
});
|
|
155
206
|
}
|
|
207
|
+
/** Test-only — exposes the install paths and the generated-file
|
|
208
|
+
* heuristic so unit tests can pin them without running the action
|
|
209
|
+
* (which shells out to git and writes to disk). */
|
|
210
|
+
export const _internals = {
|
|
211
|
+
WORKFLOW_PATH_SEGMENTS,
|
|
212
|
+
LEGACY_WORKFLOW_PATH_SEGMENTS,
|
|
213
|
+
isGeneratedWorkflow,
|
|
214
|
+
};
|
|
156
215
|
//# sourceMappingURL=review.js.map
|
|
@@ -1 +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;
|
|
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,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAE7F;;;GAGG;AACH,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAU,CAAC;AAE7E;;;;GAIG;AACH,MAAM,6BAA6B,GAAG,CA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;aAAM,IAAI,WAAW,KAAK,MAAM,EAAE,CAAC;YAClC,OAAO,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,0DAA0D,CAAC,EAAE,CAAC,CAAC;QACpJ,CAAC;QACD,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,sBAAsB,CAAC,CAAC;QAClG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0EAA0E,CAAC,CAAC,CAAC;QACnG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oEAAoE,CAAC,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;AACP,CAAC;AAED;;mDAEmD;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,sBAAsB;IACtB,6BAA6B;IAC7B,mBAAmB;CACpB,CAAC"}
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Source-of-truth for the `/review`
|
|
2
|
+
* Source-of-truth for the `/review` agent workflow that ships with
|
|
3
3
|
* `vk review`. Kept as an inlined string (not a `.md` file) so the
|
|
4
4
|
* compiled `dist/` package can write it without a separate copy step
|
|
5
5
|
* in the build pipeline.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Installed at `.devin/workflows/review.md`, the path current IDE
|
|
8
|
+
* builds read slash-command workflows from. The pre-rename
|
|
9
|
+
* `.windsurf/workflows/` copy is retired by `vk review` itself so a
|
|
10
|
+
* repo never exposes two divergent `/review` commands.
|
|
11
|
+
*
|
|
12
|
+
* The workflow is meant to be driven by the IDE agent after
|
|
8
13
|
* `vk review <branch> [base]` has prepared `.vk/review/context.json`
|
|
9
14
|
* with the branch / base / repo metadata.
|
|
10
15
|
*/
|
|
11
|
-
|
|
16
|
+
/**
|
|
17
|
+
* First heading of every generated workflow, and the only part of the
|
|
18
|
+
* template that must stay byte-stable across revisions: `vk review`
|
|
19
|
+
* matches on it to recognise files it wrote earlier (including older
|
|
20
|
+
* template versions) so it can refresh them in place instead of
|
|
21
|
+
* warning about a hand-authored file.
|
|
22
|
+
*/
|
|
23
|
+
export declare const REVIEW_WORKFLOW_MARKER = "# /review \u2014 AI pull-request review";
|
|
24
|
+
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// turbo\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// turbo\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// turbo\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 plan / todo list, **blockers and majors first**.\nFor each item:\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: vk review (AI-assisted)\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
25
|
//# sourceMappingURL=review-workflow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/review-workflow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"review-workflow.d.ts","sourceRoot":"","sources":["../../src/templates/review-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,4CAAuC,CAAC;AAE3E,eAAO,MAAM,kBAAkB,80KAyL9B,CAAC"}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Source-of-truth for the `/review`
|
|
2
|
+
* Source-of-truth for the `/review` agent workflow that ships with
|
|
3
3
|
* `vk review`. Kept as an inlined string (not a `.md` file) so the
|
|
4
4
|
* compiled `dist/` package can write it without a separate copy step
|
|
5
5
|
* in the build pipeline.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* Installed at `.devin/workflows/review.md`, the path current IDE
|
|
8
|
+
* builds read slash-command workflows from. The pre-rename
|
|
9
|
+
* `.windsurf/workflows/` copy is retired by `vk review` itself so a
|
|
10
|
+
* repo never exposes two divergent `/review` commands.
|
|
11
|
+
*
|
|
12
|
+
* The workflow is meant to be driven by the IDE agent after
|
|
8
13
|
* `vk review <branch> [base]` has prepared `.vk/review/context.json`
|
|
9
14
|
* with the branch / base / repo metadata.
|
|
10
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* First heading of every generated workflow, and the only part of the
|
|
18
|
+
* template that must stay byte-stable across revisions: `vk review`
|
|
19
|
+
* matches on it to recognise files it wrote earlier (including older
|
|
20
|
+
* template versions) so it can refresh them in place instead of
|
|
21
|
+
* warning about a hand-authored file.
|
|
22
|
+
*/
|
|
23
|
+
export const REVIEW_WORKFLOW_MARKER = '# /review — AI pull-request review';
|
|
11
24
|
export const REVIEW_WORKFLOW_MD = `---
|
|
12
25
|
description: Review a git branch with AI, fix detected issues, and prepare a commit
|
|
13
26
|
---
|
|
@@ -35,6 +48,7 @@ first and stop.
|
|
|
35
48
|
|
|
36
49
|
Before checking anything out, verify the working tree is clean:
|
|
37
50
|
|
|
51
|
+
// turbo
|
|
38
52
|
\`\`\`
|
|
39
53
|
git status --porcelain
|
|
40
54
|
\`\`\`
|
|
@@ -44,6 +58,7 @@ stash. Do **not** auto-stash — the user might be mid-edit.
|
|
|
44
58
|
|
|
45
59
|
Record the current branch so you can restore it at the end:
|
|
46
60
|
|
|
61
|
+
// turbo
|
|
47
62
|
\`\`\`
|
|
48
63
|
git rev-parse --abbrev-ref HEAD
|
|
49
64
|
\`\`\`
|
|
@@ -64,6 +79,7 @@ force anything.
|
|
|
64
79
|
Compute the merge-base diff so you only see what \`<branch>\` adds on
|
|
65
80
|
top of \`<base>\`:
|
|
66
81
|
|
|
82
|
+
// turbo
|
|
67
83
|
\`\`\`
|
|
68
84
|
git merge-base <base> <branch>
|
|
69
85
|
git diff <merge-base>...<branch> --stat
|
|
@@ -116,8 +132,8 @@ branch name to \`-\`). Show a concise summary in chat.
|
|
|
116
132
|
|
|
117
133
|
## 6. Apply fixes
|
|
118
134
|
|
|
119
|
-
Group issues into a todo list, **blockers and majors first**.
|
|
120
|
-
item:
|
|
135
|
+
Group issues into a plan / todo list, **blockers and majors first**.
|
|
136
|
+
For each item:
|
|
121
137
|
|
|
122
138
|
- Show the proposed change.
|
|
123
139
|
- Apply it via the \`edit\` / \`multi_edit\` tool — never rewrite
|
|
@@ -158,7 +174,7 @@ Addresses review of <branch> against <base>.
|
|
|
158
174
|
- <blocker/major fix 2>
|
|
159
175
|
- ...
|
|
160
176
|
|
|
161
|
-
Reviewed-by:
|
|
177
|
+
Reviewed-by: vk review (AI-assisted)
|
|
162
178
|
\`\`\`
|
|
163
179
|
|
|
164
180
|
Show the staged diff (\`git diff --cached\`) and the proposed message,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review-workflow.js","sourceRoot":"","sources":["../../src/templates/review-workflow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"review-workflow.js","sourceRoot":"","sources":["../../src/templates/review-workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oCAAoC,CAAC;AAE3E,MAAM,CAAC,MAAM,kBAAkB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyLjC,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.20260816114351",
|
|
4
4
|
"description": "CLI for VentureKit - scaffolding and deploy orchestration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
}
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@venturekit/core": "0.0.0-dev.
|
|
37
|
-
"@venturekit/data": "0.0.0-dev.
|
|
36
|
+
"@venturekit/core": "0.0.0-dev.20260816114351",
|
|
37
|
+
"@venturekit/data": "0.0.0-dev.20260816114351",
|
|
38
38
|
"@aws-sdk/client-acm": "^3.1091.0",
|
|
39
39
|
"@aws-sdk/client-cloudformation": "^3.1091.0",
|
|
40
40
|
"@aws-sdk/client-cloudwatch-logs": "^3.1091.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@types/node": "^26.1.2",
|
|
56
56
|
"@types/prompts": "^2.4.9",
|
|
57
57
|
"@types/ws": "^8.5.13",
|
|
58
|
-
"@venturekit/runtime": "0.0.0-dev.
|
|
58
|
+
"@venturekit/runtime": "0.0.0-dev.20260816114351",
|
|
59
59
|
"typescript": "^5.3.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|