review-local

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Local Review

本地审查

Review current local git changes from multiple expert perspectives using team orchestration.
通过团队编排,从多个专家视角审查当前的本地Git变更。

Arguments

参数

ArgumentDefaultDescription
--staged-only
false
Only review staged changes (
git diff --cached
)
--file
noneWrite report to
review-local-YYYY-MM-DD-HHmm.md
参数默认值说明
--staged-only
false
仅审查已暂存的变更(
git diff --cached
--file
none将报告写入
review-local-YYYY-MM-DD-HHmm.md
文件

Workflow

工作流程

1. Collect Changes ──► 2. Read Context ──► 3. Team Review ──► 4. Synthesize ──► 5. Report
1. 收集变更 ──► 2. 读取上下文 ──► 3. 团队审查 ──► 4. 整合结果 ──► 5. 生成报告

Phase 1: Collect Changes

阶段1:收集变更

Gather local changes:
bash
undefined
收集本地变更:
bash
undefined

Staged changes (always collected)

已暂存的变更(始终收集)

git diff --cached
git diff --cached

Unstaged changes (skip if --staged-only)

未暂存的变更(如果设置--staged-only则跳过)

git diff
git diff

Untracked files (skip if --staged-only)

未跟踪的文件(如果设置--staged-only则跳过)

git status --porcelain | grep '^??'

If all produce empty results, inform the user: "No local changes detected. Nothing to review." and exit.

For untracked files, read the full file content as a pseudo-diff.

If more than 30 files changed, warn the user and ask whether to proceed or narrow scope.
git status --porcelain | grep '^??'

如果所有命令都返回空结果,则告知用户:「未检测到本地变更,无可审查内容。」并退出。

对于未跟踪文件,读取完整文件内容作为伪差异内容。

如果变更文件数量超过30个,则向用户发出警告,并询问是否继续或缩小审查范围。

Phase 2: Read Context

阶段2:读取上下文

For each changed file, read the full file to give reviewers surrounding context. Skip deleted files and binary files.
对于每个变更文件,读取完整文件内容为审查者提供上下文信息。跳过已删除文件和二进制文件。

Phase 3: Team Review

阶段3:团队审查

Create an agent team to explore this from different angles: one teammate on software architecture, one on security, one on infrastructure design, one on QA/QC, one on TDD, one on BDD, one on idempotence, and one playing devil's advocate.
Each teammate receives:
  1. The combined diff from Phase 1
  2. The file context from Phase 2
  3. Their perspective-specific prompt — read from
    references/perspectives/<perspective>.md
Read
references/perspectives/
for each teammate's detailed review prompt, questions, output format, and severity guidance.
创建一个Agent团队,从不同角度审查变更:一名负责软件架构、一名负责安全、一名负责基础设施设计、一名负责QA/QC、一名负责TDD、一名负责BDD、一名负责幂等性,还有一名扮演唱反调的角色。
每个团队成员会收到:
  1. 阶段1收集的合并差异内容
  2. 阶段2的文件上下文
  3. 与其视角对应的提示词——从
    references/perspectives/<perspective>.md
    读取
请查看
references/perspectives/
目录下的文件,获取每个团队成员详细的审查提示、问题、输出格式和严重度指导。

Phase 4: Synthesize Findings

阶段4:整合审查结果

After all teammates complete their reviews, synthesize findings. Read
references/synthesis-protocol.md
for the full protocol:
  1. Collect all findings from each teammate
  2. Categorize by severity: Critical, Important, Nice-to-have
  3. Deduplicate overlapping concerns
  4. Prioritize by risk and effort
所有团队成员完成审查后,整合结果。请查看
references/synthesis-protocol.md
获取完整的整合规则:
  1. 收集所有团队成员的审查结果
  2. 按严重度分类:严重、重要、建议优化
  3. 去重重叠的问题
  4. 按风险和修复优先级排序

Phase 5: Present Report

阶段5:生成报告

Present the consolidated report inline. If
--file
is set, write to
review-local-YYYY-MM-DD-HHmm.md
in the current directory.
Read
references/report-template.md
for the exact report format.
直接展示整合后的报告。如果设置了
--file
参数,则将报告写入当前目录下的
review-local-YYYY-MM-DD-HHmm.md
文件。
请查看
references/report-template.md
获取报告的具体格式。

Behavior Scenarios

行为场景

gherkin
Scenario: Full team review of local changes
  Given the user has local changes (staged, unstaged, or untracked)
  When /review-local is invoked
  Then a team is created with all 8 perspectives, each reviews the diff,
  findings are synthesized into a consolidated severity report inline

Scenario: Staged-only review
  Given the user has staged changes ready to commit
  When /review-local --staged-only is invoked
  Then only the staged diff is reviewed by the team

Scenario: Write report to file
  Given the user wants a persistent record
  When /review-local --file is invoked
  Then the report is written to review-local-YYYY-MM-DD-HHmm.md
  and the file path is confirmed to the user

Scenario: No local changes
  Given the working tree is clean
  When /review-local is invoked
  Then the user is told "No local changes detected" and the skill exits

Scenario: Large changeset warning
  Given more than 30 files are changed
  When /review-local is invoked
  Then the user is warned and asked whether to proceed or narrow scope
gherkin
Scenario: Full team review of local changes
  Given the user has local changes (staged, unstaged, or untracked)
  When /review-local is invoked
  Then a team is created with all 8 perspectives, each reviews the diff,
  findings are synthesized into a consolidated severity report inline

Scenario: Staged-only review
  Given the user has staged changes ready to commit
  When /review-local --staged-only is invoked
  Then only the staged diff is reviewed by the team

Scenario: Write report to file
  Given the user wants a persistent record
  When /review-local --file is invoked
  Then the report is written to review-local-YYYY-MM-DD-HHmm.md
  and the file path is confirmed to the user

Scenario: No local changes
  Given the working tree is clean
  When /review-local is invoked
  Then the user is told "No local changes detected" and the skill exits

Scenario: Large changeset warning
  Given more than 30 files are changed
  When /review-local is invoked
  Then the user is warned and asked whether to proceed or narrow scope

References

参考资料

  • references/perspectives/
    — One file per review perspective with prompts, questions, output format, and severity guidance
  • references/synthesis-protocol.md
    — How to merge, deduplicate, and categorize findings
  • references/report-template.md
    — Exact markdown format for the consolidated report
  • references/perspectives/
    — 每个审查视角对应一个文件,包含提示词、问题、输出格式和严重度指导
  • references/synthesis-protocol.md
    — 如何合并、去重和分类审查结果的规则
  • references/report-template.md
    — 整合报告的具体Markdown格式