Skip to content
Development
Skill

/code-critic

Reviews code changes against project standards and the approved plan; returns PASS/FAIL/NEEDS_DECISION per checklist item plus open questions. Use when the user asks for a code review of a branch or change, or after implementation and before opening a PR.

From plugin
ai-workflow
59 skills4 agents2 MCP

Claude Code

$ npx -y skills add cunhaax/ai-workflow --skill code-critic --agent claude-code

SKILL.md

code-critic.SKILL.md
name: code-critic
description: >
  Reviews code changes against project standards and the approved
  plan; returns PASS/FAIL/NEEDS_DECISION per checklist item plus open
  questions. Use when the user asks for a code review of a branch or change,
  or after implementation and before opening a PR.
license: MIT
metadata:
  author: André Cunha

/code-critic

Review code changes against project standards.

Stance: the implementation is a hypothesis under attack. Assume something is wrong and try to disconfirm it; don't verify that it "looks reasonable". No fault found after genuine effort → state that explicitly (*Disconfirmation Attempt*). Apply the same stance to the tests (see *Tests*).

Input

  • Plan text (optional; inline or file path)
  • Test evidence: summary of the latest full test run (optional)
  • The diff is not an input: step 1 selects it

Steps

1. Select the diff

  • Work committed: `git diff <default-branch>...HEAD` or

`git log -p <default-branch>..HEAD`; default branch from `AGENTS.md` → *Commands*

  • Work uncommitted: working-tree diff
  • Unsure → `git status`, `git log --oneline`
  • You may read any file in the repo; the diff is the unit under review

2. ADRs

  • `docs/adr/` exists → list the ADRs read by number in the output; none

relevant → say so explicitly (silence reads as skipped)

  • Diff contradicts an ADR → `FAIL`; quote the ADR clause and the diff line

3. Plan compliance (skip entirely if no plan)

Per plan section:

  • **Approval Summary / Acceptance Criteria**: every `AC-<slug>-n` has a

committed test tagged `[AC-<slug>-n]` that would fail if the criterion broke. Missing → `FAIL`

  • **Edge Cases**: same for every `EDGE-<slug>-n` / `[EDGE-<slug>-n]`.

Missing → `FAIL`

  • No automated test suite (`AGENTS.md` → *Commands* says so): in the two

checks above, each ID instead needs a tagged walkthrough in the plan's Test Strategy and a recorded passing result for it in the test evidence. Missing or failed → `FAIL`; not run → `FAIL` unless the evidence records the user waived it

  • **Contract** (skip if "None"): diff's routes, fields/params, response

shapes, error rendering, schema match. Undiscussed deviation → `FAIL`

  • **Types anywhere in the plan** (Contract, Approach, Requirements, even

when Contract is "None"): nullable/non-null and optional/required are part of the contract

  • Diff every parameter/field type the plan states against the actual

signature; don't infer from the tests' inputs

  • Mismatch either way → `FAIL`, even if tests pass, unless the review input

documents an approved deviation

  • **Requirements**: all addressed (source of truth for what to build)
  • **Approach**: code follows it; no undiscussed alternative design; all plan

steps accounted for

  • **Files**: diff matches the manifest. File in diff but not listed (or

listed but untouched) → undiscussed change; flag, judge scope

  • **Out of Scope**: don't flag listed items as missing; flag code straying

into it as scope creep

  • **Test Strategy**: cross-reference against actual tests
  • Quote the exact plan line and the exact violating diff line; never

paraphrase the plan

4. Test evidence

  • Judge test coverage by reading the code and tests; never run the suite
  • Test run summary provided → treat it as the implementer's record that the

suite ran and passed, not as independent proof

  • No summary provided → raise Open Question: "no evidence the test suite ran

on the reviewed state"; never assume green

5. Apply standards

**Single responsibility**

  • Functions do one thing. Branch for a different concern (admin path in a

user path, parsing inside persistence):

  • New function with mixed concerns → `FAIL`
  • Existing function extended with an unrelated branch → `FAIL`
  • Borderline, extraction hurts readability → `NEEDS_DECISION`
  • Classes: too many responsibilities = more than one independent reason to

change

  • New class with too many → `FAIL`
  • Change significantly worsens an existing violation → `FAIL`
  • Change extends an oversized class without making it meaningfully worse →

`NEEDS_DECISION` (flag the debt; developer chooses refactor / tech debt / accept)

**Error handling**

  • No generic catch-all in business logic. At process boundaries (top-level

controllers, scheduled jobs, async entry points) a catch-all that logs and translates to a domain error is fine; judge by where it lives

  • Every error carries context: what operation failed and why
  • Critical-path errors logged with structured fields

**Naming**

  • Functions say what they do (`calculateShippingCost`, not `calc`/`process`)
  • Booleans read as questions (`isValid`, `hasPermission`)

**Tests** (you own quality AND completeness)

  • No automated test suite (`AGENTS.md` → *Commands* says so): read "test"

below as the plan's walkthroughs plus any extra ones recorded in the test evidence; only a passing or waived one covers anything. No plan → a coverage gap is an Open Question ("no walkthrough evidence"), not a `FAIL`

  • Quality:
  • Every public function with non-trivial behaviour has happy-path and edge

tests. Exempt: trivial delegators, generated code, plain data classes, pure getters. State each exemption and why

  • Names describe the scenario (`test_order_fails_when_inventory_insufficient`)
  • Given-When-Then; test behaviour, not implementation details
  • Check what each assertion actually compares, not its name/comment. A test

that passes regardless of correctness (expression compared to itself) proves nothing

  • Diff weakens, loosens, or deletes a plan-derived test (esp. `[AC-…]`) to

pass the suite → `FAIL`, unless the input documents an approved plan deviation

  • Completeness, against the plan: every Requirement and Edge Case has a test

that would fail if it broke; every branch the implementation introduces (error paths, validation failures, authorization denials, empty/null) is exercised

  • Completeness, beyond the
Read more
@cunhaax
Ships withai-workflow

Turns Claude Code into a small development team instead of one agent guessing alone — with a git-level gate that keeps the humans in charge of what actually ships.

59 skills4 agents2 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
5
Star history of cunhaax/ai-workflow on GitHub, a chart by star-history.com

Other skills on ai-workflow.

adversarial-qa

adversarial-qa

Exploratory QA of a running feature through its UI (Playwright) and/or API (curl) to find issues the plan and committed tests…

@cunhaax@cunhaaxInstall Skill
feature

feature

Runs the full AI-assisted workflow for a non-trivial feature or change: plan, plan critique, user approval, implementation with…

@cunhaax@cunhaaxInstall Skill
init-workflow

init-workflow

Sets up and checks the AI workflow in a project that has this plugin installed: scaffolds missing AGENTS.md, CLAUDE.md, hooks,…

@cunhaax@cunhaaxInstall Skill
plan-critic

plan-critic

Critiques a draft implementation plan with pre-mortem, inversion, load-bearing-assumption and consistency checks; returns…

@cunhaax@cunhaaxInstall Skill
plan-draft

plan-draft

Drafts a structured implementation plan (approval summary with acceptance criteria, contract, files, edge cases, test strategy)…

@cunhaax@cunhaaxInstall Skill
review-guide

review-guide

Computes a PR's Tier floor and unplanned-changes list with a bundled read-only script, then writes the PR's Tier line and Review…

@cunhaax@cunhaaxInstall Skill

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about code-critic.

Which coding agents can use code-critic?
code-critic installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.