Skip to content
Back to skills

Code Review

ASecurity

Use when reviewing a diff, branch, or PR, when asked whether it is safe to merge, and when acting on review comments (the reviewer says X, address the feedback). Covers giving reviews on two separate axes (spec and standards) and verifying feedback before applying it.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 6, 2026
ai-agentsrustgocode-reviewgitsecurity

Security analysis

A100/100

Pro scans all 15 files and shows the line behind each finding

Scanned November 6, 2026

npx -y skills add PeanutGT/NutsSkills --skill code-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/peanutgt-code-review/badge)](https://www.skillsdirectory.com/skills/peanutgt-code-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: code-review
description: "Use when reviewing a diff, branch, or PR, when asked whether it is safe to merge, and when acting on review comments (the reviewer says X, address the feedback). Covers giving reviews on two separate axes (spec and standards) and verifying feedback before applying it."
license: Apache-2.0
metadata:
  version: "1.1.0"
  author: PeanutGT
  suite: nuts-engineering
  repository: https://github.com/PeanutGT/NutsSkills
---

# Code review

## Part A — Giving a review

**Core rule:** Every reported finding has been checked against the code and names a concrete failure: this input, in this state, gives this wrong result.

### 1. Pin what you are reviewing
- Find the base (the user's ref, or the merge-base with the default branch) and capture `git diff <base>...HEAD` plus `git log <base>..HEAD --oneline`.
- Stop early if the ref does not resolve or the diff is empty.
- Read the whole diff, then the surrounding code it touches. Bugs often live in what the diff did not change.

### 2. Find what the change is judged against
- **Spec:** issue references in commit messages, the PR description, a file under `docs/specs/` matching the branch. If none exists, ask; if there truly is none, say the spec axis was skipped.
- **Standards:** `CONTRIBUTING.md`, `CLAUDE.md` / `AGENTS.md`, style guides, lint and formatter config. Skip anything tooling already enforces.

### 3. Review on two axes, kept separate
A change can follow every rule and build the wrong thing, or build the right thing badly. Report the axes separately so one cannot hide the other.

**Spec axis**
- Requirements missing or only partly done
- Requirements that look done but behave wrongly
- Behavior nobody asked for (scope creep)

**Standards & quality axis**
- Documented repo rules first; cite the rule.
- Then this checklist:
  - [ ] Security: injection, missing authorization, secrets, untrusted input at boundaries
  - [ ] Errors surfaced, not swallowed
  - [ ] Edge cases: empty, null, huge, repeated, concurrent
  - [ ] Data: N+1 queries, transactions, reversible migrations
  - [ ] Tests cover the new behavior and would fail if it broke
- Then design smells, always labelled as judgement calls and overridden by repo rules: unclear name, duplicated logic, feature envy, data clumps, primitive obsession, speculative generality, shotgun surgery, middle man.

### 4. Check every finding before reporting it
Confirm it against the code. When it is cheap, prove it: a few lines of script or a throwaway test that shows the wrong result. Drop findings you cannot support; say "possible" only for genuine judgement calls.

For a large diff, if you can start subagents, give each axis to a reviewer with a fresh context (see `fresh-eyes`): it sees the diff, not your assumptions.

### 5. Report
Per axis, most severe first. Do not merge the axes into one ranking.
```
[blocker] path/file.py:42 — <one-sentence defect>
Scenario: <input/state> → <wrong result>   (verified: <how>)
Fix: <suggestion>
```
Labels: `blocker` / `should-fix` / `nit`. End with one line per axis: count and worst finding. Say briefly what is good.

## Part B — Receiving a review

**Core rule:** Verify before you agree. Feedback is a claim to check, not an order to follow.

1. Read all feedback before changing anything.
2. Check each item against the code. Is it right for *this* codebase?
3. If right: fix it, one item at a time, running tests after each.
4. If wrong or unclear: say so with technical reasons, or ask. Do not implement something you believe is wrong.
5. No performative agreement ("Great catch!"). State what you changed, or why you did not.

## Rationalizations to reject
| Excuse | Answer |
|---|---|
| "Looks good to me" without reading the tests | Rubber stamp. Read them. |
| "I'm fairly sure this is a bug" | Then a three-line script proves it. Run it. |
| "The reviewer is senior, just do it" | Seniority is not evidence. Check the claim. |

Related: `verify`, `simplify`, `ship`, `fresh-eyes`.

Files in this skill

  • CHANGELOG.md393 B
  • SKILL.md3.9 KB
  • evals/behavior/case.yaml164 B
  • evals/behavior/graders/01-expected-behavior.md212 B
  • evals/behavior/prompt.md186 B
  • evals/review-planted-bugs/case.yaml259 B
  • evals/review-planted-bugs/files/branch/service.py1.5 KB
  • evals/review-planted-bugs/files/branch/test_details.py578 B
  • evals/review-planted-bugs/files/main/db.py418 B
  • evals/review-planted-bugs/files/main/service.py422 B
  • evals/review-planted-bugs/files/main/test_service.py365 B
  • evals/review-planted-bugs/graders/01-planted-defects.md844 B
  • evals/review-planted-bugs/place-files.sh918 B
  • evals/review-planted-bugs/prompt.md100 B
  • evals/triggers.json288 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.