一键导入
code-review
Use when the operator says "code-review" or "/code-review", asks to review code, requests a code review, or asks for feedback on changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when the operator says "code-review" or "/code-review", asks to review code, requests a code review, or asks for feedback on changes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when the operator says "skill-author", asks to write a new agent skill, create a skill, author a skill, update an existing skill's SKILL.md, or requests help with skill structure and conventions.
Use when the operator requests a PR description, pull request summary, or commit message for a squash merge, says "pr-description" or "/pr-description", or when opening a pull request as part of task execution.
Use when user says "project plan", "plan the spec", "implementation plan", or wants to turn a spec into phased build steps.
Use when the operator provides an outcome-focused prompt, asks for a spec or specification, or says "project-spec" or "/project-spec".
Use when the operator says "pr-response" or "/pr-response", asks to address PR review feedback, or asks to reply to review comments on an open PR.
Use when user says "execute the plan", "implement the plan", "run the plan", "implement phase", "start implementation", "build phase", or wants to begin implementation from a plan file.
| name | code-review |
| description | Use when the operator says "code-review" or "/code-review", asks to review code, requests a code review, or asks for feedback on changes. |
| metadata | {"author":"Tyler Benfield","version":"2026.5.30"} |
Review code changes against a target. Produce concise, labeled feedback. You are a peer reviewer — not a gatekeeper, not a rubber stamp.
Determine what to review using these rules, evaluated in order:
git diff, git diff --cached), review those. Stop — no need to compare branches.git diff <target>...HEAD. Use that.main unless the repo indicates otherwise. git diff <default-branch>...HEAD.When reviewing pending changes, also check for unstaged files and untracked files that may be relevant.
Evaluate each changed file against the criteria below. Skip criteria that don't apply rather than forcing commentary.
Is the code behavior correct? Consider:
Is the code straightforward and unambiguous? Is it easy to interpret the intent? Consider:
Is there unnecessary cognitive complexity that could be avoided? Consider:
Is the contract of the code exposing only what is necessary? Could it be misused? Consider:
Are there obvious performance issues? Consider:
Do not flag micro-optimizations or speculative performance concerns. Only raise when the issue is concrete and measurable.
Is the code secure against common vulnerabilities? Consider:
Is the code idiomatic for the language and frameworks? Consider:
Does the code prioritize the verification hierarchy? Prefer verification as close to the point of editing as possible:
Consider:
git diff and git diff --cached. For branch comparison: git diff <target>...HEAD..agents/reviews/<short-hash>.md for branch comparisons or .agents/reviews/pending-<short-hash>.md for uncommitted changes, where <short-hash> is the current HEAD short hash. Create the directory if it doesn't exist. Follow the output format below. If there are no feedback items, skip the file entirely.Examples:
assets/example-1.md): Branch review with multiple findings. Context: a new RateLimiter class in src/lib/rate-limiter.ts that tracks requests per window using a fixed-size array, plus a basic test file.assets/example-2.md): Pending changes with two findings. Context: a new handleEvent function in src/handlers/analytics.ts that processes analytics events via a switch on event type.assets/example-3.md): Branch review with an existing issue. Context: a new paginated user-list API endpoint in src/routes/users.ts that depends on an existing authenticate middleware.## Code Review: <target description>
<One-sentence overall assessment.>
### Feedback
#### F1: [Brief title]
**Location**: `path/to/file:line`
[Description — 1-3 sentences]
**Suggestion**: [1-3 sentence suggestion]
```lang
[code snippet if applicable]
Location: path/to/file:line, also path/to/other/file:line
[Description — 1-3 sentences]
Suggestion: [1-3 sentence suggestion]
Location: path/to/file:line
[Description — 1-3 sentences]
Suggestion: [1-3 sentence suggestion]
Concise summary of the most significant themes, not a re-listing of items.
### Labeling
- Number feedback items sequentially: `F1`, `F2`, `F3`.
- Omit the **Suggestion** block and code snippet when the description alone is sufficient (e.g., a straightforward fix).
- Reference labels in discussion — don't re-describe the finding.
### Repetition
Do not repeat the same feedback across multiple locations. State it once, listing additional files in the **Location** line: `path/to/file:line`, also `path/to/other/file:line`.
## Constraints
- **Areas of improvement only.** Do not list things the code does well — positive observations add noise without actionable value. No obligation to find issues — do not manufacture feedback to appear thorough. If the code is sound, say LGTM and move on.
- **Skip formatting.** Indentation, line breaks, spacing, alignment — these belong to the formatter, not the review.
- **Don't nitpick style that doesn't affect readability.** Prefer the existing approach when it's acceptable. Don't suggest rewrites unless the current approach has a concrete drawback.
- **No premature stop.** If there are genuine concerns, raise all of them. No limit on feedback items.
- **Repo-relative paths only.** `src/lib.rs`, never absolute paths.
- **Review the change, not the codebase.** Focus feedback on issues introduced or worsened by the change. Pre-existing issues may be flagged as **existing issues** only when they are genuine bugs or clearly problematic code — the bar is higher than for change-introduced concerns. Style preferences, suboptimal patterns, and minor improvements in existing code are out of scope.