agentsclimarketplace

Code review

Skill adriancodes/skills/skills/code-review

Use when a user asks to "review this branch", "review this PR", "review my changes", or "review since main". Also use for pre-merge review, work-in-progress diffs, staged changes, suspected regressions in a patch, or checking implementation against a specification.From its SKILL.md

Install
npx -y skills add adriancodes/skills --skill code-review

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its file declares

Copied from the file, not written here

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

16.4 KB, as published. Nobody here has run it

Code Review

Overview

Review changed behavior, not code aesthetics. Report a finding only when the scoped change introduces a concrete defect, violates an applicable contract, or creates demonstrable engineering risk. Attempt to falsify every candidate before reporting it; no evidence means no finding.

Review is read-only by default: a request to review, assess, or inspect authorizes repository inspection and safe diagnostics, not edits. Explicitly requested fixes follow the completed report, never precede it.

When to Use

  • Review a branch, PR, commit range, patch, or work-in-progress change.
  • Check implementation against an issue, PRD, specification, acceptance criteria, or migration plan.
  • Assess staged, unstaged, or newly added files before commit.
  • Investigate whether a patch introduces correctness, security, data, concurrency, compatibility, or regression risk.
  • Check changed code against documented repository standards and coherent local patterns.

Do Not Use When

  • The request asks how unchanged code works; use understand-codebase when installed, otherwise trace the current path read-only.
  • A reported runtime failure needs root-cause discovery; use diagnose when installed, otherwise reproduce and isolate it before proposing changes.
  • A finished artifact needs hostile-input verification; use verify-work when installed, otherwise execute adversarial fixtures against its stated promise.
  • The request is a broad architecture assessment or refactor plan without a bounded diff; use engineering-best-practices when installed, otherwise assess the architecture separately.
  • The task is to summarize changes or draft a pull-request description; write that artifact instead of inventing review findings.

Required Context

Establish four facts before reviewing:

  • Scope: branch, PR, commit range, patch, or working-tree changes
  • Endpoints: immutable base and head identities, plus whether staged, unstaged, and untracked files are included
  • Contracts: applicable specification, repository instructions, standards, tests, and migration or compatibility promises
  • Authority: review-only unless fixes were explicitly requested

Honor an explicit base; otherwise resolve the PR target, configured upstream, or repository default branch, in that order, and state the inferred base. Ask one pointed question only when plausible bases produce materially different diffs. Done when scope, endpoints, contracts, and authority mode are written down.

Workflow

1. Pin the exact change set

For committed branch work, record the merge base and review git diff <base>...<head>. Record git log <base>..<head> --oneline for intent clues, never as a diff substitute.

For work-in-progress changes, also inspect:

  • staged changes with git diff --cached;
  • unstaged changes with git diff;
  • relevant untracked files from git status --short, read directly because Git has no diff base for them.

Capture the resolved base SHA, head SHA, worktree status, changed-file list, and exact diff commands. Reject an invalid ref. On an empty diff, report the resolved scope and stop; never review unrelated files. Done when every reviewed file belongs to one frozen, reproducible scope.

2. Load the governing contracts

Read the binding instructions for each changed path — the nearest AGENTS.md, contributor guidance, coding standards, test conventions, schemas, and migration rules — then locate the originating specification in this order:

  1. A user-provided path or linked issue/PR
  2. Issue references in the branch or commit metadata
  3. A matching specification, PRD, decision log, or ticket under repository documentation
  4. Explicit acceptance criteria in the request

If none is available, mark the Spec lens unavailable and continue with Correctness and Standards. Never invent requirements from branch names or commit messages.

Treat formatter, linter, type-checker, and compiler output as diagnostic evidence; restate their issues only when the review exposes a missing enforcement path or a user-visible consequence they do not explain.

Done when each lens has named sources or an explicit unavailable status:

LensGoverning evidence
CorrectnessRuntime contracts, callers, tests, types, schemas, invariants
SpecIssue, PRD, specification, acceptance criteria
StandardsBinding repository docs and coherent analogous code

3. Understand the changed behavior

Read the diff, then enough surrounding code to understand every changed behavior. Follow changed symbols through callers, callees, state owners, configuration, persistence, asynchronous boundaries, and externally visible outcomes. Check which important conditions the changed path's tests prove or omit.

Classify every changed file as behavioral code, test, configuration, schema/migration, generated/vendor/lock output, or documentation, giving extra scrutiny to trust boundaries, durable state, destructive operations, compatibility edges, concurrency, retries, error paths, and migrations.

Run focused read-only or safely isolated diagnostics when they can confirm a candidate defect. Never install dependencies, update snapshots, regenerate outputs, or mutate external systems to complete a review; report the unexecuted check as residual risk.

Done when every changed file is classified and every behaviorally significant hunk is traced to its contract and observable consequence.

4. Generate candidates through three lenses

Review the same frozen scope through all available lenses:

Correctness and regression risk

  • Trace validation, authorization, state transitions, error behavior, cleanup, retries, concurrency, ordering, idempotency, compatibility, and data migration where applicable.
  • Check boundary values and failure paths, not only the happy path.
  • Treat a missing test as a finding only when a concrete changed behavior is both risky and unprotected; test preference alone is not a defect.

Specification compliance

  • Identify missing, partial, or incorrectly implemented requirements.
  • Flag additions outside the agreed scope that create cost, risk, or incompatibility.
  • Cite the exact contract language for every Spec finding.

Repository standards

  • Apply documented rules and coherent patterns from analogous code.
  • Use engineering-best-practices when installed only when the request explicitly includes maintainability or architecture; otherwise apply project-local evidence directly.
  • Report maintainability issues only when the diff creates a concrete defect risk or demonstrable change cost. Never manufacture findings from a generic smell checklist.

For each candidate, record the trigger, actual behavior, consequence, changed location, and supporting contract. Done when every available lens is examined and every candidate has a falsifiable consequence.

5. Use parallel reviewers only when they earn their cost

When the harness supports subagents and the diff spans at least two independent subsystems or more than 500 non-generated changed lines, dispatch at most three reviewers: Correctness, Spec, and Standards. Give each the same frozen scope and only its governing sources. Ask for candidate findings, not a verdict.

For smaller diffs or harnesses without subagents, run the lenses sequentially. Parallel output never becomes a finding automatically; the primary reviewer must validate, deduplicate, and rank every candidate. Done when all reviewer output passes the same evidence gate.

6. Falsify and rank every candidate

Attempt to disprove each candidate before reporting it:

  1. Confirm the scoped change introduces or materially worsens the issue.
  2. Read surrounding implementation, callers, tests, and configuration for a handling path that invalidates it.
  3. Execute the smallest safe reproducer or focused check when feasible.
  4. Confirm a realistic trigger and concrete consequence.
  5. Deduplicate findings that share one root cause.

Drop candidates that are pre-existing, purely stylistic, speculative, automatically enforced, outside scope, or preference without consequence. Record unverified concerns as residual risk, not findings.

Assign the lowest defensible severity:

SeverityThreshold
P0Immediate broad outage, irreversible loss, or critical security compromise
P1Likely security, data, or core-function failure requiring merge blockage
P2Real bounded correctness, reliability, compatibility, or significant maintenance defect
P3Small but concrete defect with a realistic trigger; never a nitpick

Done when every retained finding survives falsification, has one severity, and cites the changed line plus supporting evidence.

7. Report findings first

Sort findings by severity, then file location, in one unified list; tag each with its lens or lenses so duplicate Correctness and Spec reports remain one issue.

Format each finding as:

### [P1][Correctness, Spec] Cross-tenant export bypass: `src/export.js:3`

When an authenticated requester supplies a workspace ID it does not own, the new path calls
`store.export(workspaceId)` without checking membership. This violates the specification's
cross-tenant `404` requirement and can expose another tenant's data. Add the ownership predicate
at this boundary and cover the cross-tenant case.

Keep each finding to one short paragraph with the trigger, behavior, consequence, evidence, and correction direction. Do not praise the patch, narrate the process, or bury findings under a summary.

After the findings, report:

  • frozen scope and contracts reviewed;
  • commands or tests run;
  • unavailable lenses, unreviewed files, and residual risk.

If no candidate survives, lead with No findings. and still report coverage and residual risk. In review-only mode, stop there. If fixes were explicitly requested, apply only supported fixes through the repository's implementation or TDD workflow after the report, then re-review the resulting diff. Done when every finding is actionable and evidenced, every gap is explicit, and no unauthorized edit occurred.

Core Example

Specification: “Export data only when the requester belongs to the workspace; return 404 for cross-tenant access.”

Scoped diff:

 export function exportWorkspace(requester, workspaceId, store) {
   if (!requester) return { status: 401 };
-  if (!requester.workspaceIds.includes(workspaceId)) return { status: 404 };
   return { status: 200, body: store.export(workspaceId) };
 }

Report:

[P1][Correctness, Spec] Workspace export loses tenant authorization: candidate-auth.js:3

Any authenticated requester can now export an arbitrary workspace because the changed path reaches store.export(workspaceId) without verifying membership. The removed condition enforced the specification's cross-tenant 404 requirement, so this change creates cross-tenant data exposure. Restore ownership enforcement at this boundary and add a cross-tenant regression test.

Do not add generic naming, abstraction, or style findings: the authorization regression is the evidence-backed review result.

Tool Guidance

Prefer:

  • git rev-parse, git merge-base, git status --short, focused git diff, and git log
  • rg --files and rg for contracts, symbols, callers, and tests
  • Read-only issue or PR retrieval when linked context is available
  • Existing focused tests, type checks, linters, and analyzers that do not rewrite files
  • Independent subagents only for genuinely substantial diffs

Avoid:

  • Reviewing only commit messages, filenames, or the diff without surrounding code
  • Whole-repository audits unrelated to the frozen scope
  • Formatter, dependency, snapshot, generated-file, or external-system mutation
  • Mandatory subagent use for small reviews

Common Rationalizations

ShortcutReality
“Two independent reports can be pasted verbatim.”Validate, deduplicate, and rank candidates before reporting.
“A universal smell baseline catches maintainability issues.”Generic smells manufacture noise; require repository evidence and concrete consequence.
“No base was supplied, so review must stop for a question.”Resolve the PR target, upstream, or default branch and state the inference.
“Parallel agents always improve review quality.”Parallelism adds cost and duplicates; use it only for substantial independent surfaces.
“No specification means the review is blocked.”Mark that lens unavailable and continue with correctness and standards.
“A review request implies permission for small fixes.”Review-only authority ends at the findings report.

Stop Conditions

  • “This looks suspicious.”
  • “The code could be cleaner.”
  • “The linter will catch the important parts.”
  • “The other reviewer already validated it.”
  • “This probably existed before.”
  • “It is only a tiny fix.”

Each thought maps to the Rationalization Table or evidence gate. Return to the unfinished workflow step.

Success Criteria

  • Pin an immutable, reproducible review scope and account for dirty worktree files when included.
  • Examine Correctness, Spec, and Standards, marking unavailable lenses explicitly.
  • Trace every behaviorally significant hunk through enough context to establish its consequence.
  • Report only defects introduced or worsened by the scoped change.
  • Make every finding survive falsification and include severity, lens, changed location, trigger, consequence, and evidence.
  • Remove duplicates, generic smells, nitpicks, tooling restatements, and unsupported speculation.
  • Preserve review-only authority and leave files and external systems unchanged.
  • Report honest coverage and residual risk even when no findings survive.

Common Mistakes

MistakeFix
Reviewing base..HEAD without confirming intentResolve the merge base and use the frozen comparison the review actually promises.
Ignoring staged, unstaged, or untracked workState whether each category is in scope and inspect included files separately.
Treating the diff as complete contextFollow changed symbols into callers, state owners, tests, and configuration.
Reporting missing tests as defects by defaultName the concrete unprotected behavior and consequence or leave it as residual risk.
Reporting a pre-existing issueDrop it unless the scoped change materially worsens it.
Trusting subagent outputReproduce or trace each candidate through the primary evidence gate.
Returning a review summary before findingsLead with findings or No findings.

Failure Modes

  • Invalid or unavailable base: Report the failed ref resolution and ask for one valid fixed point; do not guess across materially different histories.
  • Diff too large for complete review: Split by independent subsystem or commit range, state the completed partitions, and name every unreviewed one. Never sample silently.
  • Specification unavailable: Continue with other lenses and avoid spec-completeness claims.
  • External issue or PR inaccessible: Ask for pasted acceptance criteria only when Spec coverage is required; otherwise mark the lens unavailable.
  • Generated or binary change: Review its source and generation contract when available; mark opaque output as residual risk.
  • Diagnostics would mutate state: Skip them, use read-only evidence, and report the unexecuted check.
  • Conflicting standards: Cite the conflict and apply the more local binding instruction; ask only when precedence remains ambiguous.

Genuine Exceptions

When complete review is genuinely impossible, name the blocked lens or scope, show the evidence for the block, review every unaffected part, and state the weaker conclusion. Time pressure, diff size, absent subagents, sunk cost, and an expectation of “just a quick look” do not justify silent sampling or unsupported findings.

Summary

Review the pinned change, falsify every candidate, and report only evidence-backed findings. In review-only mode, stop without editing.

Keep looking

Skills are one crate of 608,666. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.