一键导入
reviewing-code
Use when reviewing code changes on the current branch, before merging or creating a PR, or when asked to do a code review
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when reviewing code changes on the current branch, before merging or creating a PR, or when asked to do a code review
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
You MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation.
Use when you have a TDD plan from writing-tdd-plans with triplet tasks (RED/GREEN/REVIEW) and dependency graph, ready for execution
Use when you have a design document and need to create an implementation plan with enforced TDD and adversarial review gates per task
Use when you have a complex design document where feature decomposition has multiple valid approaches, unclear dependencies, or architectural tradeoffs that benefit from adversarial debate before creating a TDD plan
Use when test suite needs cleanup, when tests are brittle or break on refactors without behavior change, when there are tests coupled to implementation details, or when test maintenance burden is high
Generate codebase specs (semantic) for comprehensive project documentation
| name | reviewing-code |
| description | Use when reviewing code changes on the current branch, before merging or creating a PR, or when asked to do a code review |
Multi-agent code review that auto-detects whether to review a PR or local diff. Produces a detailed report in the terminal and writes it to docs/reviews/.
Core principle: HIGH SIGNAL ONLY. Flag issues where the code will definitely fail, produce wrong results, or clearly violates documented rules. If you're not certain, don't flag it. False positives erode trust and waste reviewer time.
Announce at start: "I'm using the reviewing-code skill to review changes on this branch."
All tools are functional and will work without error. Do not test tools or make exploratory calls. Every tool call should have a clear purpose. Make this clear to every subagent you launch.
digraph process {
rankdir=TB;
"Step 0: Detect source\n(controller)" [shape=box];
"On base branch?\nEmpty diff?\nDraft/closed PR?" [shape=diamond];
"STOP" [shape=box, style=filled, fillcolor=lightyellow];
subgraph cluster_parallel_1 {
label="Parallel";
"Step 1A: Skip check" [shape=box];
"Step 1B: CLAUDE.md discovery" [shape=box];
}
"Trivial/automated?" [shape=diamond];
"Step 2: Summarize changes" [shape=box];
subgraph cluster_parallel_2 {
label="Parallel Review";
"CLAUDE.md ×2\n(if CLAUDE.md found)" [shape=box];
"Bug scan: diff only" [shape=box];
"Bug scan: introduced" [shape=box];
}
"Step 4: Dedup + Validate\n(parallel agents)" [shape=box];
"Step 5: Filter + Report" [shape=box, style=filled, fillcolor=lightgreen];
"Step 0: Detect source\n(controller)" -> "On base branch?\nEmpty diff?\nDraft/closed PR?";
"On base branch?\nEmpty diff?\nDraft/closed PR?" -> "STOP" [label="yes"];
"On base branch?\nEmpty diff?\nDraft/closed PR?" -> "Step 1A: Skip check" [label="no"];
"On base branch?\nEmpty diff?\nDraft/closed PR?" -> "Step 1B: CLAUDE.md discovery" [label="no"];
"Step 1A: Skip check" -> "Trivial/automated?";
"Trivial/automated?" -> "STOP" [label="yes"];
"Trivial/automated?" -> "Step 2: Summarize changes" [label="no"];
"Step 1B: CLAUDE.md discovery" -> "Step 2: Summarize changes";
"Step 2: Summarize changes" -> "CLAUDE.md ×2\n(if CLAUDE.md found)";
"Step 2: Summarize changes" -> "Bug scan: diff only";
"Step 2: Summarize changes" -> "Bug scan: introduced";
"CLAUDE.md ×2\n(if CLAUDE.md found)" -> "Step 4: Dedup + Validate\n(parallel agents)";
"Bug scan: diff only" -> "Step 4: Dedup + Validate\n(parallel agents)";
"Bug scan: introduced" -> "Step 4: Dedup + Validate\n(parallel agents)";
"Step 4: Dedup + Validate\n(parallel agents)" -> "Step 5: Filter + Report";
}
You (the controller) determine the review source directly. Do NOT delegate this to a subagent.
git rev-parse --abbrev-ref HEADmain or master → stop ("Nothing to review — on base branch")gh pr view --json number,title,body,state,isDraft,baseRefName 2>/dev/nullDIFF_CMD="gh pr diff <number>"TITLE = PR titleDESCRIPTION = PR bodyBASE_BRANCH = PR baseRefNamegit remote show origin 2>/dev/null | grep 'HEAD branch' | awk '{print $NF}'main, then masterDIFF_CMD="git diff <base>...HEAD"TITLE = branch nameDESCRIPTION = output of git log <base>..HEAD --onelineBASE_BRANCH = detected baseStore MODE, DIFF_CMD, TITLE, DESCRIPTION, BASE_BRANCH for use in all subsequent steps.
Agent A — Skip check:
Agent B — CLAUDE.md discovery:
DIFF_CMD), then find all relevant CLAUDE.md files:
If Agent A returns SKIP → stop.
Launch agents in parallel. Each gets: DIFF_CMD, TITLE, DESCRIPTION, MODE (PR or LOCAL), and the HIGH SIGNAL criteria from this skill.
Agents 1 + 2 — CLAUDE.md Compliance — ONLY if CLAUDE.md files were found in Step 1:
Agent 3 — Bug Scanner, Diff Only:
Agent 4 — Bug Scanner, Introduced Code:
Each agent returns a list of issues. Each issue includes:
Share this with every review agent.
DO flag:
Do NOT flag:
If you are not certain an issue is real, do not flag it.
First, deduplicate issues across all agents. Multiple agents may flag the same issue — merge duplicates (same file + same line range + same root cause = one issue).
For each unique issue, launch a validation subagent in parallel:
Terminal output:
Write review file:
mkdir -p docs/reviews/ and other non-alphanumeric chars (except -) with -docs/reviews/<sanitized-branch>-YYYY-MM-DD.mdUse this template:
# Code Review: <branch-name>
**Date**: YYYY-MM-DD
**Source**: PR #N / Local diff
**Base branch**: <base>
**Reviewer**: Claude (automated)
## Summary
<summary from Step 2>
## Issues Found
### Issue N: <title>
- **Severity**: Critical / Important / Minor
- **Category**: Bug / CLAUDE.md violation / Security / Logic error
- **File**: `path/to/file` (lines X-Y)
- **Description**: <description>
- **Suggested Fix**: <fix>
## Conclusion
<N issues found / No issues found. Checked for bugs and CLAUDE.md compliance.>
If no issues were found, replace the "Issues Found" section with: "No issues found."
| Mistake | Fix |
|---|---|
| Posting GitHub comments | This skill NEVER posts comments — report only |
| Flagging style/quality issues | Only HIGH SIGNAL: compile failures, clear bugs, explicit CLAUDE.md violations |
| Flagging pre-existing issues | Only flag issues INTRODUCED in this diff |
| Running review agents sequentially | All 4 review agents must run in parallel |
| Skipping issue validation | Every issue must be validated by a separate agent |
| Not writing the MD file | Always write to docs/reviews/ |
| Delegating source detection to a subagent | Controller handles Step 0 directly |
| Running CLAUDE.md agents when no CLAUDE.md files exist | Skip agents 1+2 if Step 1B found no CLAUDE.md files |
| Not deduplicating issues before validation | Merge duplicates first — same file + line + root cause = one issue |
| CLAUDE.md agents flagging bugs instead of compliance | CLAUDE.md agents check ONLY CLAUDE.md compliance, nothing else |
NEVER:
gh pr comment, no inline comments)docs/reviews/