Loading...
Loading...
Compare original and translation side by side
stagereview prepstagereview showstagereview prepstagereview showstagereviewwhich stagereviewstagereview is not installed. Run:
npm install -g stagereview
Then retry /stage-chapters.git rev-parse --is-inside-work-treetrue/stage-chapters must be run inside a git repository.stagereviewwhich stagereviewstagereview is not installed. Run:
npm install -g stagereview
Then retry /stage-chapters.git rev-parse --is-inside-work-treetrue/stage-chapters must be run inside a git repository.PREP_FILE=$(stagereview prep)stagereview prepfeature-a--base <ref>prepshowPREP_FILE=$(stagereview prep --base feature-a)PREP_FILE=$(stagereview prep)stagereview prepfeature-aprepshow--base <ref>PREP_FILE=$(stagereview prep --base feature-a)
If `prep` exits non-zero, relay its stderr to the user and stop.
**Do not modify files in the working tree between running `prep` and running `show`.** Both commands independently snapshot the git state. If the diff changes between them, `show` will reject the chapters with a hunk coverage error because the hunks no longer match.
如果`prep`返回非零退出码,将其标准错误信息转发给用户并停止操作。
**在运行`prep`和`show`之间不要修改工作区中的文件**。两个命令会独立快照Git状态。如果期间差异发生变化,`show`会因代码块覆盖错误而拒绝章节,因为代码块不再匹配。$PREP_FILEoffsetlimit=== COMMIT MESSAGES ===git log --oneline=== HUNKS ====== File: src/app.ts (modified) | filePath: "src/app.ts", oldStart: 1 ===
=== Hunk @1: @@ -1,5 +1,6 @@ ===
1 1 | const a = 1;
2 |-const b = 2;
2 |+const b = 3;
3 |+const c = 4;
3 4 | const d = 5;lineRefscommits.txtgit log --oneline$PREP_FILEoffsetlimit=== COMMIT MESSAGES ===git log --oneline=== HUNKS ====== File: src/app.ts (modified) | filePath: "src/app.ts", oldStart: 1 ===
=== Hunk @1: @@ -1,5 +1,6 @@ ===
1 1 | const a = 1;
2 |-const b = 2;
2 |+const b = 3;
3 |+const c = 4;
3 4 | const d = 5;lineRefscommits.txtgit log --onelinehunks.txtchaptershunks.txtchaptersoldStartoldStart=== File: <path> (<status>) | filePath: "<path>", oldStart: <N> ===filePatholdStarthunkRefsstagereview show=== File: <path> (<status>) | filePath: "<path>", oldStart: <N> ===filePatholdStarthunkRefsstagereview show**bold***italics*`backticks`**粗体***斜体*`反引号`keyChanges[]lineRefshunks.txtside: "deletions"startLineendLineside: "additions"startLineendLinestartLineendLineendLine >= startLineretryCountkeyChanges[]lineRefshunks.txtside: "deletions"startLineendLineside: "additions"startLineendLinestartLineendLineendLine >= startLineretryCount{
"id": "chapter-1", // unique within the run, e.g. "chapter-1", "chapter-2", …
"order": 1, // positive integer, 1-indexed
"title": "Short imperative title",
"summary": "Why this chapter matters to the reviewer.",
"hunkRefs": [
// one entry per hunk in the chapter
{ "filePath": "path/to/file.ts", "oldStart": 42 }
],
"keyChanges": [
// zero or more judgment-call questions
{
"content": "A judgment-call question for the reviewer.",
"lineRefs": [
{
"filePath": "path/to/file.ts",
"side": "additions",
"startLine": 50,
"endLine": 55
}
]
}
]
}hunkRefs(filePath, oldStart)keyChanges[].lineRefs{
"id": "chapter-1", // 本次运行内唯一,例如 "chapter-1", "chapter-2", …
"order": 1, // 正整数,从1开始索引
"title": "简短的祈使句标题",
"summary": "本章对评审者的重要性。",
"hunkRefs": [
// 本章中的每个代码块对应一个条目
{ "filePath": "path/to/file.ts", "oldStart": 42 }
],
"keyChanges": [
// 零个或多个判断性问题
{
"content": "给评审者的判断性问题。",
"lineRefs": [
{
"filePath": "path/to/file.ts",
"side": "additions",
"startLine": 50,
"endLine": 55
}
]
}
]
}hunkRefs(filePath, oldStart)keyChanges[].lineRefscommits.txtprologuecommits.txtprologuenullnullsummarydescriptionsummary: "Audit runs are now tracked in a database"description: "Uses new Drizzle ORM schema with full history retention"summary: "Adds Drizzle ORM layer"summarydescriptionsummary: "审计运行现在在数据库中跟踪"description: "使用具有完整历史保留功能的新Drizzle ORM Schema"summary: "添加Drizzle ORM层"typesecuritybreaking-changehigh-complexitydata-integritynew-patternarchitectureperformancetesting-gapseveritycriticalhighmediuminfotitledescriptionlocationstype: "security", severity: "high", title: "Unvalidated user input", description: "User-provided ID passed directly to database query — confirm input is validated and parameterized"description: "Worth understanding"typesecuritybreaking-changehigh-complexitydata-integritynew-patternarchitectureperformancetesting-gapseveritycriticalhighmediuminfotitledescriptionlocationstype: "security", severity: "high", title: "未验证的用户输入", description: "用户提供的ID直接传递给数据库查询——确认输入已验证且参数化"description: "值得理解"levellowmediumhighvery-highreasoninglevellowmediumhighvery-highreasoningAGENT_OUTPUT=$(mktemp "${TMPDIR:-/tmp}/stage-agent-output.XXXXXX")
cat > "$AGENT_OUTPUT" << 'AGENT_EOF'
{
"chapters": [ ... ],
"prologue": { ... }
}
AGENT_EOFXXXXXXmktempcat| Field | Constraint |
|---|---|
| Non-empty, unique within the run |
| Positive integer (1-indexed) |
| Non-negative integer — the pre-image start line from the |
| Array with at least one entry |
| |
| Positive integers; |
| Optional object; omit entirely if not desired |
| String or |
| String or |
| Array of 2–5 objects with |
| Array of 1–5 objects |
| One of: |
| One of: |
| One of: |
AGENT_OUTPUT=$(mktemp "${TMPDIR:-/tmp}/stage-agent-output.XXXXXX")
cat > "$AGENT_OUTPUT" << 'AGENT_EOF'
{
"chapters": [ ... ],
"prologue": { ... }
}
AGENT_EOFXXXXXXmktempcat| 字段 | 约束 |
|---|---|
| 非空,本次运行内唯一 |
| 正整数(从1开始索引) |
| 非负整数——格式化代码块标题中 |
| 至少包含一个条目的数组 |
| |
| 正整数; |
| 可选对象;如果不需要可完全省略 |
| 字符串或 |
| 字符串或 |
| 包含2-5个带 |
| 包含1-5个对象的数组 |
| 以下之一: |
| 以下之一: |
| 以下之一: |
stagereviewstagereview show "$AGENT_OUTPUT"stagereview showrun_in_backgroundstagereviewstagereview show "$AGENT_OUTPUT"stagereview showrun_in_background