kiro-review

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<EXTREMELY-IMPORTANT> This skill orchestrates an external reviewer and must stay disciplined.
Non-negotiable rules:
  1. Read the real diff before writing the Kiro prompt.
  2. Make the prompt specific to the changed areas and likely risks.
  3. Never put secrets or credentials in the prompt.
  4. Carry forward exclusion lists on later rounds.
  5. Verify returned findings before acting on them.
</EXTREMELY-IMPORTANT>
<EXTREMELY-IMPORTANT> 本技能用于协调外部评审工具,必须严格遵循规则。
不可妥协的规则:
  1. 在编写Kiro提示词前,先读取真实的代码差异。
  2. 提示词需针对变更区域和潜在风险定制。
  3. 绝不在提示词中包含机密信息或凭证。
  4. 在后续评审轮次中沿用排除列表。
  5. 在根据评审结果采取行动前,先验证返回的发现。
</EXTREMELY-IMPORTANT>

Kiro Review

Kiro 评审

Inputs

输入

  • $request
    : Optional scope hint such as
    last commit
    ,
    uncommitted
    ,
    auth focus
    , or
    round 2
  • $request
    :可选的范围提示,例如
    last commit
    (最后一次提交)、
    uncommitted
    (未提交变更)、
    auth focus
    (聚焦认证模块)或
    round 2
    (第二轮评审)

Goal

目标

Use
kiro-cli
to get an external review pass that:
  • uses the right diff scope
  • focuses on the actual change surface
  • returns structured findings instead of generic commentary
使用
kiro-cli
完成一次外部评审,要求:
  • 使用正确的差异范围
  • 聚焦实际变更内容
  • 返回结构化的评审结果,而非泛泛的评论

Step 0: Verify Kiro availability

步骤0:验证Kiro可用性

Check:
  • which kiro-cli
  • kiro-cli whoami
    or the minimal auth check needed in this environment
If the CLI is unavailable or not authenticated, explain the blocker and stop.
Success criteria: Kiro can run successfully from the current repository.
检查:
  • which kiro-cli
  • kiro-cli whoami
    或当前环境所需的最小化认证检查
如果CLI不可用或未完成认证,说明阻塞原因并停止操作。
成功标准:可从当前仓库成功运行Kiro。

Step 1: Resolve review scope

步骤1:确定评审范围

Determine whether to review:
  • the full branch
  • uncommitted changes
  • a specific commit
Read the diff summary and changed-file list first.
If there is nothing to review, stop and say so explicitly.
Success criteria: The review target is explicit and backed by a real diff.
决定评审对象:
  • 完整分支
  • 未提交变更
  • 特定提交
先读取差异摘要和变更文件列表。
如果没有可评审的内容,明确告知并停止操作。
成功标准:评审目标明确,且有真实的代码差异作为依据。

Step 2: Build the focused Kiro prompt

步骤2:构建聚焦的Kiro提示词

Create a compact prompt that includes:
  • what changed
  • the major risk areas
  • any previously fixed issues to exclude on later rounds
  • an instruction to verify findings against the actual code
  • the expected compact output format
Avoid generic prompts. They produce weak results.
Success criteria: The prompt is specific to the change set rather than reusable boilerplate.
创建简洁的提示词,包含:
  • 变更内容
  • 主要风险区域
  • 后续轮次中需排除的已修复问题
  • 验证评审结果与实际代码一致性的指令
  • 预期的简洁输出格式
避免使用通用提示词,这类提示词会导致结果质量低下。
成功标准:提示词针对当前变更集定制,而非可复用的模板。

Step 3: Run Kiro in non-interactive mode

步骤3:以非交互模式运行Kiro

Invoke
kiro-cli chat
with:
  • --no-interactive
    -- runs without expecting user input, returns output directly
  • -a
    (trust all tools) -- kiro needs file read access to verify findings against source
Always capture stderr with
2>&1
(kiro logs to stderr).
Optional flags:
  • --model <model>
    -- specify a particular model if needed
  • --agent <agent>
    -- use a specific agent profile for the review
If the run is likely to take a while, background execution is acceptable, but keep the scope tight enough that the review stays focused.
Success criteria: Kiro runs on the intended scope and returns parseable findings.
调用
kiro-cli chat
命令,参数包括:
  • --no-interactive
    :无需用户输入,直接返回输出结果
  • -a
    (信任所有工具):Kiro需要文件读取权限以验证评审结果与源代码的一致性
始终通过
2>&1
捕获stderr(Kiro日志输出到stderr)。
可选参数:
  • --model <model>
    :如有需要,指定特定模型
  • --agent <agent>
    :使用特定的Agent配置文件进行评审
如果运行时间可能较长,可后台执行,但需确保范围足够聚焦,保证评审针对性。
成功标准:Kiro在指定范围内运行,并返回可解析的评审结果。

Step 4: Summarize findings

步骤4:总结评审结果

Report:
  • review scope
  • findings by priority
  • file and line references when available
  • explicit clean result when no material findings are returned
If the user wants fixes, verify each finding locally before changing code.
Success criteria: The user gets a readable review summary instead of raw CLI logs.
报告内容包括:
  • 评审范围
  • 按优先级排序的评审发现
  • 可用时提供文件和行号引用
  • 若无实质性发现,明确给出“无问题”结果
如果用户需要修复代码,在修改前先本地验证每个评审发现。
成功标准:用户获得易读的评审摘要,而非原始CLI日志。

Step 5: Iterate only with exclusions

步骤5:仅基于排除项进行迭代

On later rounds:
  • list prior fixed findings in the exclusion block
  • narrow the scope to newly changed files when possible
  • avoid repeated full-branch reviews unless the code changed broadly again
Success criteria: Follow-up rounds target new issues instead of recycling old ones.
后续评审轮次:
  • 在排除块中列出之前已修复的问题
  • 尽可能将范围缩小到新变更的文件
  • 除非代码再次发生大范围变更,否则避免重复进行全分支评审
成功标准:后续轮次针对新问题,而非重复处理已修复的旧问题。

Guardrails

防护规则

  • Do not run this skill proactively.
  • Do not put secrets, tokens, or private config into the prompt.
  • Do not trust findings blindly without local verification.
  • Do not skip diff reading before prompt construction.
  • 不得主动运行本技能。
  • 不得在提示词中包含机密、令牌或私有配置。
  • 不得盲目信任评审结果,需先本地验证。
  • 在构建提示词前不得跳过读取代码差异的步骤。

Output Contract

输出约定

Report:
  1. the review scope
  2. the main focus areas given to Kiro
  3. findings by priority with locations when available
  4. explicit clean result if nothing material was found
  5. whether a next round should exclude previously fixed issues
报告需包含:
  1. 评审范围
  2. 提供给Kiro的主要聚焦领域
  3. 按优先级排序的评审发现(含位置信息,如有)
  4. 若无实质性发现,明确给出“无问题”结果
  5. 下一轮评审是否需要排除之前已修复的问题