一键导入
review-code
Reviews code changes for logical correctness, design quality, and security. Use after code has been written to validate implementation quality.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Reviews code changes for logical correctness, design quality, and security. Use after code has been written to validate implementation quality.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use for non-trivial implementation tasks that require meaningful code changes.
Shared mailbox transport protocol for Agent Deck workflows.
Handles a `closeout_delivered` workflow message and completes planner-side closeout.
Generates a browser-check mailbox message for runtime page validation and sends it to a browser-tester session.
Claim pending agent mail with `mailbox_recv` and immediately execute the requested workflow action.
Send an `execute_plan` workflow message to a planner that should complete one supervisor-assigned goal inside one workspace and report back to a supervisor.
| name | review-code |
| description | Reviews code changes for logical correctness, design quality, and security. Use after code has been written to validate implementation quality. |
Review code changes for logical correctness, design quality, and security.
Workflow protocol baseline: use the agent-deck-workflow skill.
Provide one of:
review_requestedbrowser_check_report plus current review contextBefore reviewing quality, verify:
start_branch, integration_branch, task_branch)If critical context is missing:
NEEDS_REVISIONCritical IssuesBefore enumerating issues, build a short frame:
Use this frame to filter findings. Promote only findings that are:
Demote or drop findings that are:
If a concern may be real but evidence is incomplete, prefer:
Design Concerns for architectural cautionVerification Questions for missing proofDo not inflate the Critical Issues section with low-confidence or low-impact commentary.
Default mode is single-reviewer, multi-lens analysis. Do not automatically launch extra agents or specialist lanes. Recommend a focused follow-up review only when one risk area is important, evidence is insufficient, and the extra review could change the decision.
Use these thresholds unless overridden by workflow_policy:
review_round_convergence_check_threshold = 3review_round_hard_stop_threshold = 5When round >= review_round_convergence_check_threshold, check for non-convergence:
A -> B -> A)A -> B -> C)At or above review_round_convergence_check_threshold, also check whether coder is solving the wrong problem by preserving extra self-imposed constraints:
If non-convergence is visible:
Design Concerns to call out likely design failure, not just the latest local defectcode-health-review or equivalent structural follow-up when a local fix is unlikely to convergeround >= review_round_hard_stop_threshold and the work is still not converging, stop iterating with coder and escalate to the user instead of sending another normal rework loop1Detect likely user-facing UI changes. Human confirmation is opt-in by workflow policy, not the default.
Heuristics:
*.tsx, *.jsx, *.vue, *.svelte, *.html, *.css, *.scss, *.less)Policy rules:
workflow_policy.ui_manual_confirmation:
skip (default)requiredautorequired only when the user or workflow policy explicitly wants a human UI gateauto is an explicit heuristic mode, not the defaultChecks Already Run in review_requested as the primary record of coder-run verificationUse this exact structure as the full review report. When reviewer sends follow-up mail, the Action: line must match the outbound workflow action.
Task: <task_id>
Action: <rework_required | stop_recommended>
From: reviewer <reviewer_session_id>
To: <requester_role> <requester_session_id>
Planner: <planner_session_id>
Planner workspace: <planner_workspace_or_N/A>
Round: <round>
### Summary
[APPROVED / NEEDS_REVISION]: Brief rationale (1-2 sentences)
### Request Completeness Check
- Scope clarity: [PASS / FAIL]
- Branch plan continuity: [PASS / FAIL]
- Intent clarity: [PASS / FAIL]
- Behavior/compatibility constraints: [PASS / FAIL]
- Review focus/risk angles: [PASS / FAIL]
- Verification evidence: [PASS / FAIL]
If any FAIL, explain why in `Critical Issues`.
### Intent And Constraints
- Intended change: [summary]
- Must-preserve behavior: [summary]
- Non-goals / out-of-scope: [summary or `None`]
### Recorded Branch Plan
- Start branch: [start_branch]
- Integration branch: [integration_branch]
- Task branch: [task_branch]
- Stability rule: preserve this branch plan unchanged through closeout unless the user explicitly changes it
### Critical Issues
Must fix before merge:
- [ ] **[CATEGORY]**: Description | Suggestion: How to fix
If none, write: `- None.`
### Design Concerns
Architecture/decision questions:
- **[Concern]**: Description | Suggestion: Alternative approach
If none, write: `- None.`
### Minor Suggestions
Optional improvements:
- [ ] Description
If none, write: `- None.`
### Security Check
- Injection risks: [PASS / FAIL / UNKNOWN] - [brief basis]
- Unsafe data exposure: [PASS / FAIL / UNKNOWN] - [brief basis]
- Input validation: [PASS / FAIL / UNKNOWN] - [brief basis]
### Verification Questions
For the implementer/author:
- [Q1] Question
### UI Manual Confirmation Package
- UI impact: [none detected | detected]
- Changed UI surfaces: [routes/pages/components]
- Manual check steps (human-run): [short checklist]
- Expected visible outcomes: [what user should see]
- Notes: [optional, no screenshot/recording required]
Use the agent-deck-workflow skill for shared protocol:
Agent Deck Mode DetectionContext Resolution PriorityError Handling and DiagnosticsSkill-specific context resolution:
task_id: explicit -> mailbox body -> askplanner_session_id: explicit -> mailbox body -> askplanner_workspace: explicit -> mailbox body Planner workspace -> default N/Areviewer_session_id: explicit -> mailbox body To header -> bound mailbox sender context -> askrequester_role: explicit -> mailbox body From header label -> default coderrequester_session_id: explicit -> mailbox body From header -> askreview_lane: explicit -> mailbox body -> default taskbrowser_tester_session_id (optional): explicit actual id -> mailbox/review context -> omitbrowser_tester_session_ref (optional): explicit -> mailbox/review context -> default browser-testerbrowser_tester_workspace (optional): explicit -> mailbox/review context -> current workspaceround: explicit -> mailbox body Round header -> default 1start_branch: explicit -> mailbox body -> askintegration_branch: explicit -> mailbox body -> asktask_branch: explicit -> mailbox body -> askworkflow_policy (optional): explicit -> request context -> unattended defaultsspecial_requirements (optional fallback): explicit -> request context -> omitchecks_already_run (optional): explicit -> mailbox body -> use for rerun decisionsBranch-plan guard:
integration_branch must be the non-task landing branch; if it looks like task/*, treat branch plan continuity as FAIL and ask for the real integration branch before approval/closeoutImportant identity clarification:
planner_session_id must come from explicit/context workflow metadataDefault policy when missing:
mode = "unattended"auto_accept_if_no_must_fix = trueui_manual_confirmation = "skip"review_round_convergence_check_threshold = 3review_round_hard_stop_threshold = 5Execution flow in Agent Deck mode:
review_requested unchanged in the review reportrework_required if NEEDS_REVISION, must-fix exists, or completeness FAIL, unless the non-convergence stop rule below appliesbrowser_check_requested if code review is acceptable so far but runtime browser evidence is still requiredstop_recommended if no must-fix remains and browser validation is not required or already passedround >= review_round_hard_stop_threshold and similar issues are still recurring or progress is clearly non-converging, do not send another routine rework_required; present the situation to the user and wait for a decisionrework_required, send the full review report back to the requester session from review_requested
coder or plannerbrowser_check_requested, run browser-test-request; it should reuse the long-lived browser tester when available and create it only if missing, then the browser report will return to the requester sessionstop_recommended:
review_lane = integration_final, return the final review result to requester and let planner decide whether to fix locally, spawn another task, or finish the planauto_accept_if_no_must_fix=true, the final no-must-fix review report should proceed to review-closeoutreview-closeoutreview-closeout from that report instead of treating it as another rework roundauto_accept_if_no_must_fix=false, present user decision summary and wait for explicit acceptance or iteration decisionreview-closeout for task-lane review, or finish the integration review for integration_finalui_manual_confirmation=required, or when ui_manual_confirmation=auto and explicit policy wants heuristic UI gatingMailbox subject (rework_required):
rework required: <task_id> r<round>Mailbox body rules (rework_required):
Action: rework_requiredagent_mailboxagent_deck_require_session with:
session_id = <requester_session_id>workdir = <current workspace>mailbox_send
from_address = agent-deck/<reviewer_session_id>to_address = agent-deck/<requester_session_id>subject = "rework required: <task_id> r<round>"body = <full review report>Mailbox subject (user_requested_iteration after user chooses iterate):
iteration requested: <task_id> r<round>Mailbox body rules (user_requested_iteration):
Action: user_requested_iterationagent_mailboxagent_deck_require_session with:
session_id = <requester_session_id>workdir = <current workspace>mailbox_send
from_address = agent-deck/<reviewer_session_id>to_address = agent-deck/<requester_session_id>subject = "iteration requested: <task_id> r<round>"body = <iteration mailbox body>User-facing output requirement for stop_recommended:
### Review Decision### Key Findings Snapshot### Residual Risk### Verification Summary### UI Confirmation Gate### Decision NeededWhen auto_accept_if_no_must_fix=true, skip decision prompt and state Auto-accepted by workflow policy.
Required interaction behavior:
rework_required, send automatically after the report is readystop_recommended with manual decision, do that only when auto_accept_if_no_must_fix=false; wait for explicit user choice, then either run review-closeout or send user_requested_iterationreview-closeout input, not as another rework cycleintegration_final reports return directly to planner/requester; do not route them into review-closeoutworkflow_policy unchanged in outbound messagesspecial_requirements unchanged in outbound messagesrework_required, user_requested_iteration, or review-closeout, complete that workflow step before ending the turnSender identity rule:
rework_required, user_requested_iteration) use from_session_id = reviewer_session_idcloseout_delivered uses the session id of the agent that actually executes review-closeout; preserve reviewer_session_id in the closeout body as the source of the accepted review