원클릭으로
code-review
Use when you want a thorough code review of files, changes, or the entire project before shipping.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when you want a thorough code review of files, changes, or the entire project before shipping.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Use when you want structured feedback on a plan or document before implementation.
Use when you want to implement the next batch of a plan. Handles module implementation, testing, and validation.
Use when you want a thorough security review of the codebase, a specific file/directory, or a set of changes before shipping.
Save all session progress to status tracking files. Use when you want to checkpoint work mid-session or before ending.
SOC 직업 분류 기준
| name | code-review |
| description | Use when you want a thorough code review of files, changes, or the entire project before shipping. |
| risk | safe |
| argument-hint | [file/dir/changes] |
This skill must only be invoked from the main session, never from a subagent.
a. If the user specified file paths, directories, or a description of what to review, use that as the scope.
b. If the user said "review my changes" or similar, use git diff HEAD (unstaged + staged) and git diff --cached as the scope. Include full file context for changed functions, not just the diff hunks. If no changes exist, tell the user and stop.
c. If no scope is specified, ask the user: "What should I review? Options: specific files/directories, recent changes (git diff), or the entire project."
d. For entire-project scope, identify all source files (exclude vendored/generated code, build artifacts, lock files, and test fixtures). Prioritize by architectural significance: import fan-in/fan-out, file size, and recent change frequency. Distribute files across agents by relevance to each agent's domain.
e. Confirm scope with the user before proceeding: "I'll code-review [scope description]. Correct?"
After determining scope, detect the primary language(s) and framework(s):
package-lock.json, Pipfile.lock, Cargo.lock), and config/module files (tsconfig.json, pyproject.toml, Cargo.toml, go.mod, go.sum)primary_language and note the framework(s) in userules/<language>.md, e.g., rules/python.md) and instruct agents to read them if present for project-specific conventions.Language detection shapes agent behavior — agents should apply language-idiomatic checks:
except:, missing type hints on public APIs, os.path vs pathlib== vs ===, var usage, unhandled promise rejections, missing async/await error handling, prototype pollution patternsdefer for cleanup, context propagation.clone(), missing error propagation with ?, overly broad lifetimes@Override, raw typesSpawn 5 subagents on the latest, most capable model available — omit the per-agent model override so each subagent inherits the session's model rather than pinning a version-specific name. Do not add an override that downgrades the breadth passes (Quality/Readability, Performance, Maintainability) to a cheaper tier such as sonnet: measured 2026-06-11, sonnet's false-positive rate in these slots cost more main-session verification time than its savings. (CLAUDE_CODE_SUBAGENT_MODEL, if set in the environment Claude launches subagents under, overrides the inherited model.)
Each agent reviews from a senior distinguished engineer's perspective — not looking for vulnerabilities (that's /security-audit), but evaluating whether this code is well-designed, maintainable, and correct.
Agent 1 — Architecture & Design (module-level and above):
Agent 2 — Code Quality & Readability (within-function and expression-level):
Agent 3 — Correctness & Robustness (does the code actually work?):
Agent 4 — Performance & Efficiency (is it fast enough and resource-conscious?):
Agent 5 — Maintainability & Testing (can this code be changed and trusted?):
/security-audit's job — this agent focuses on maintenance burden only.it()/test()/test_*() function bodies. Exclude beforeEach/beforeAll/setup*/fixture* at any nesting level, describe() wrappers, and conftest.py.toHaveBeenCalled/assert_called_with with no value assertions (assertEqual, toBe, toEqual) — verifies wiring, not correctnessEach subagent's prompt MUST be assembled verbatim from the shared fragments in ~/.claude/rules/review-output-contract.md plus this skill's domain-specific content. Read that file (when working inside the claude_extensions repo itself it is also at rules/review-output-contract.md) and inline the named fragment in place of each <<shared:…>> marker below; inline every other line exactly as written:
Review from a senior distinguished engineer's perspective. For each issue found, verify it is a genuine problem — not a reasonable trade-off for this codebase's context. Check if there is a project convention or framework constraint that justifies the pattern before flagging it.
- Severity: critical | major | minor
- Category: short label (e.g., "Complexity", "Dead Code", "N+1 Query", "God Function", "Missing Tests")
- Location: file path and line number or function name
- Issue: one-sentence description of the problem and why it matters (e.g., "function handles both validation and persistence, making it impossible to test either in isolation" not just "function does too much")
- Risk: HIGH | MED | LOW — blast radius of the finding. HIGH: public API surface, auth/security-critical path, data migration, or shared utility in a common/shared/utils package. MED: internal shared module (used by more than one sibling), configuration change, or test infrastructure. LOW: leaf module (single-use helper, private to one package), documentation, or cosmetic change.
- Suggestion: concrete remediation — state what to do, not "consider" or "review" (e.g., "extract lines 45-80 into a
validate_input()function" not "consider refactoring")Severity guide:
- critical: Will cause bugs in production, data corruption, or makes the codebase unmaintainable. Must fix before shipping.
- major: Significant design flaw, substantial tech debt, or correctness risk that will bite you later. Should fix.
- minor: Style/convention issue, minor improvement, or defense-in-depth. Nice to fix but non-blocking.
Rationalizations to Reject — Do not accept these dismissals as justification for downgrading or omitting findings:
- "It works" — correctness is necessary but not sufficient; maintainability and clarity matter
- "It's just a prototype / we'll refactor later" — prototypes become production; refactors rarely happen
- "Nobody else touches this code / it's only called from one place" — people leave, teams change, call sites multiply; design for the interface, not the current caller or author
- "The tests pass" — tests can be incomplete or wrong; passing tests don't prove correctness
- "It's how the old code did it" — legacy patterns aren't automatically correct; evaluate on merit
- "Performance doesn't matter here" — maybe, but O(n²) in a loop is still a bug waiting for data growth
Red Flags — STOP and Re-examine — If you catch yourself thinking any of these, stop and reconsider:
- "This file looks fine, I'll skim it" — STOP. Read it. Skimming misses subtle bugs.
- "The function is small, it can't have issues" — STOP. Size doesn't correlate with correctness.
- "I haven't read all files in scope yet, but I'll stop early" — STOP. Finish reading the full scope before concluding. Hitting the 10-item cap is fine; abandoning unread files is not.
- "This is just boilerplate / glue code" — STOP. Glue code is where integration bugs hide.
- "I don't fully understand this, but it looks okay" — STOP. If you don't understand it, you can't review it. Read the context.
After all subagents complete, the main session:
If the user wants to fix issues:
validate_user in auth.py") — do not use line numbers for BEFORE evidence, as they shift after edits. Note: the findings Location field format (which may include line numbers) is unchanged.After applying fixes, automatically verify them:
model override so they inherit the session model; fix verification is high-stakes — don't downgrade to a cheaper tier; CLAUDE_CODE_SUBAGENT_MODEL overrides if set):
~/.claude/rules/review-output-contract.md as described there), with only the first line (the <<shared:scope-and-context>> fragment) replaced: "Review ONLY the following changed files/sections: [list]. Read at most 3 additional context files. Max 5 items. Also verify that the applied fixes are correct and complete — check for regressions." All other instructions (severity guide, field format, <<shared:findings-format>>, <<shared:closing-instruction>>) remain unchanged.When the stop condition is met, present a final summary:
If the user does not approve fixes at any point, present the findings as a reference and end. Do not modify any files.
The final synthesized report MUST include all of the following:
pass (0 critical, 0 major), conditional-pass (0 critical, 1+ major), or fail (1+ critical)