# Code Review

> Review a branch or PR diff against a fixed revision, reporting repository standards and originating requirements as separate axes.

- Skill: `c1trusovo831/code-review` (Agent Skill, multi-file: 4 files)
- Install (CLI): `npx skillmds@latest add c1trusovo831/code-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/c1trusovo831/code-review/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: C1TRuSovo831 (https://skillmd.com/u/c1trusovo831)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/c1trusovo831/code-review

---


Two-axis review of the diff between `HEAD` and a fixed point the user supplies:

- **Standards** — does the code conform to this repo's documented coding standards?
- **Spec** — does the code faithfully implement the originating issue / spec?

Use **parallel sub-agents** to keep the axes independent when delegation is permitted, then aggregate their findings. The execution fallback in step 4 preserves role restrictions.

Use `docs/agents/issue-tracker.md` when fetching an issue. If it is absent, use an explicitly supplied spec or an established read-only tracker workflow; missing setup does not require reconfiguring the repository during a review.

## Process

### 1. Pin the fixed point

Use the fixed point supplied by the user — a commit SHA, branch, tag, `main`, `HEAD~5`, etc. A PR with an explicit base supplies that choice. Ask only when the intended comparison base remains unresolved.

Capture the diff command once: `git diff <fixed-point>...HEAD` (three-dot, so the comparison is against the merge-base). Also note the list of commits via `git log <fixed-point>..HEAD --oneline`.

Before going further, confirm the fixed point resolves (`git rev-parse <fixed-point>`) and the diff is non-empty. A bad ref or empty diff should fail here — not inside two parallel sub-agents.

### 2. Identify the spec source

Look for the originating spec, in this order:

1. Issue references in the commit messages (`#123`, `Closes #45`, GitLab `!67`, etc.) — fetch via the workflow in `docs/agents/issue-tracker.md`.
2. A path the user passed as an argument.
3. A spec file under `docs/`, `specs/`, or `.scratch/` matching the branch name or feature.
4. If nothing is found, ask the user where the spec is while continuing the independent Standards review. If they say there isn't one, the **Spec** sub-agent will skip and report "no spec available".

### 3. Identify the standards sources

Anything in the repo that documents how code should be written, such as `CODING_STANDARDS.md` or `CONTRIBUTING.md`.

On top of whatever the repo documents, the Standards axis always carries the linked **smell baseline** — a fixed set of Fowler code smells (_Refactoring_, ch.3) that applies even when a repo documents nothing. Two rules bind it:

- **The repo overrides.** A documented repo standard always wins; where it endorses something the baseline would flag, suppress the smell.
- **Always a judgement call.** Each smell is a labelled heuristic ("possible Feature Envy"), never a hard violation — and, like any standard here, skip anything tooling already enforces.

For the Standards review, read [references/standards-baseline.md](references/standards-baseline.md) and apply its full baseline. The Spec reviewer does not need that reference.

### 4. Run the two independent reviews

Use parallel sub-agents when the active workflow permits delegation. Preserve no-delegation and Herdr role boundaries; when delegation is prohibited, perform the axes separately within the permitted read-only scope and disclose that they were not independent agent runs.

**Standards sub-agent prompt** — include:

- The full diff command and commit list.
- The standards-source files from step 3 and the absolute path to `references/standards-baseline.md`. Instruct the sub-agent to read and apply the full baseline; paste its contents only if the agent cannot access that file.
- The brief: "Report — per file/hunk where relevant — (a) every place the diff violates a documented standard: cite the standard (file + the rule); and (b) any baseline smell you spot: name it and quote the hunk. Distinguish hard violations from judgement calls — documented-standard breaches can be hard, but baseline smells are always judgement calls, and a documented repo standard overrides the baseline. Skip anything tooling enforces. Under 400 words."

**Spec sub-agent prompt** — include:

- The diff command and commit list.
- The path or fetched contents of the spec.
- The brief: "Report: (a) requirements the spec asked for that are missing or partial; (b) behaviour in the diff that wasn't asked for (scope creep); (c) requirements that look implemented but where the implementation looks wrong. Quote the spec line for each finding. Under 400 words."

If the spec is missing, skip the Spec sub-agent and note this in the final report.

### 5. Aggregate

Present the two reports under `## Standards` and `## Spec` headings, verbatim or lightly cleaned. Do **not** merge or rerank findings — the two axes are deliberately separate (see _Why two axes_).

End with a one-line summary: total findings per axis, and the worst issue _within each axis_ (if any). Don't pick a single winner across axes — that's the reranking the separation exists to prevent.

## Why two axes

A change can pass one axis and fail the other:

- Code that follows every standard but implements the wrong thing → **Standards pass, Spec fail.**
- Code that does exactly what the issue asked but breaks the project's conventions → **Spec pass, Standards fail.**

Reporting them separately stops one axis from masking the other.

