---
name: code-review
description: "Review a complete local change set against a fixed point on two separate axes: repository Standards and the originating Spec. Use before opening a pull request or when the user asks to review a branch, diff, or work in progress. Report only evidence-backed, actionable findings and keep the two axes distinct."
title: code-review
canonical_url: https://skilld.dev/gh/nnennandukwe/skills/code-review
last_updated: 2026-09-26T13:01:40.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> Supporting files, fetch one when the Skill refers to it: [agents/openai.yaml](https://skilld.dev/api/skills-raw/nnennandukwe/skills/code-review/agents/openai.yaml).
>
> If the user asked to install this Skill, run `npx skilld install nnennandukwe/skills/code-review`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/code-review`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/nnennandukwe/skills/code-review) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/code-review`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/code-review --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/code-review --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Code Review

Review the complete local change set against one pinned fixed point. Keep two
questions separate:

- **Standards**: does the change follow the repository's documented rules and
  established implementation patterns?
- **Spec**: does the change completely and correctly implement the controlling
  ticket, brief, or specification without unrequested behavior?

This skill is self-contained. Do not require an external review service, model,
account, or repository-specific setup command.

## Review Boundary

- Review is read-only. Do not modify code, resolve findings, commit, push, or
  open a pull request unless the user separately authorizes those actions.
- Review the complete change set, including committed, staged, unstaged, and
  relevant untracked files.
- Treat test results and other reviewer output as evidence, not authority.
- Report a finding only when the current change introduces or exposes a
  concrete, actionable defect. Do not report preferences, speculative risks, or
  issues unrelated to the change.

## Process

### 1. Pin the fixed point

Use the commit, branch, tag, or merge-base the user supplied. If none was
supplied, infer the repository's normal base from its upstream or default remote
branch only when that choice is unambiguous; otherwise ask for the fixed point.

Confirm the ref resolves, record its commit SHA, and compute its merge-base with
`HEAD`. Review tracked changes from that merge-base through the working tree,
not only the committed range. List untracked files separately and inspect those
that belong to the change. Stop if the ref is invalid or the change set is
empty.

### 2. Resolve the controlling spec

Find the current source of intended behavior in this order:

1. a ticket, brief, PRD, or path supplied by the user;
2. an issue reference in the branch name or commit messages;
3. a matching file under the repository's documentation or specification
   directories;
4. the active user request, when it is sufficiently explicit.

Use live issue content when the repository's available tooling can read it.
Never invent inaccessible requirements. If no spec can be found, state that the
Spec axis is `NOT ASSESSED` and explain what source is missing; do not present it
as passed.

### 3. Resolve repository standards

Read all applicable instruction and contribution files for the changed paths,
including nested variants. Typical sources include `AGENTS.md`, `CLAUDE.md`,
`CONTRIBUTING.md`, coding standards, formatter and linter configuration, and
nearby tests that establish local patterns.

Repository rules outrank generic preferences. Do not duplicate findings that a
required formatter, compiler, linter, or test already reports unless the
failure reveals a distinct behavioral problem.

### 4. Run two independent passes

Run the Standards and Spec passes independently. Use isolated subagents in
parallel when the current agent supports them; otherwise run the passes
sequentially without allowing conclusions from the first axis to substitute for
analysis on the second.

For the **Standards pass**:

- inspect each changed file against the applicable repository instructions;
- check ownership, boundaries, error handling, names, duplication, and
  consistency with directly owning code only where the diff gives concrete
  evidence of a defect; and
- cite the controlling rule or established repository pattern for each
  finding.

For the **Spec pass**:

- map every accepted requirement to implementation and proof;
- identify missing or partial requirements, incorrect behavior, compatibility
  breaks, and scope creep; and
- quote or precisely paraphrase the controlling requirement for each finding.

Inspect tests as proof of intent, but verify the production behavior rather
than assuming a passing test is sufficient. Run only focused, non-mutating
checks needed to reproduce a suspected finding unless the user asked for the
full suite.

### 5. Validate and report findings

Before reporting a finding:

- reproduce it against the current working tree where practical;
- confirm it is caused by or materially affected by the reviewed change;
- identify the smallest concrete failure scenario;
- cite the exact file and tight line range; and
- state the requirement, rule, or observable behavior that is violated.

Use these priorities:

- **P0**: release-blocking data loss, security compromise, or broadly
  catastrophic behavior.
- **P1**: a required behavior is broken or a common path cannot safely ship.
- **P2**: a real defect with bounded impact or a meaningful maintainability
  failure in the changed design.
- **P3**: minor but actionable correctness or developer-experience defect.

Do not inflate severity. If evidence is insufficient, record the question under
`Verification Gaps` rather than turning it into a finding.

## Output Contract

Return:

```markdown
## Review Scope

- Fixed point: `<ref>` (`<sha>`)
- Change set: <tracked and untracked scope>
- Spec source: <source or NOT ASSESSED>
- Standards sources: <files>

## Standards

<findings ordered P0 to P3, or CLEAN>

## Spec

<findings ordered P0 to P3, CLEAN, or NOT ASSESSED>

## Verification Gaps

<unverified claims and the command or source that would settle each one, or None>

## Summary

<finding count per axis and the highest priority in each>
```

Each finding must include priority, title, file and line, evidence, impact, and
the smallest useful remediation direction. Do not merge or rerank Standards and
Spec findings across axes. If no actionable finding remains after validation,
say `CLEAN` explicitly for that axis.

<!-- Source: https://github.com/nnennandukwe/skills · Author: Nnenna Ndukwe · Apache-2.0 -->
