Aller au contenu

Review API

One pass, three lenses, one report. The lenses own their checklists; this skill fixes the scope, runs them in parallel, merges, and fixes on demand. Never commits, never posts.

Arguments

Free text after the skill name, any order:

  • none → the current branch vs its base, committed and uncommitted
  • pending → uncommitted work only
  • a base branch → diff against it
  • a PR number → its head must be the current branch (otherwise say so and stop)
  • --fix → apply the findings after the report (see Step 4)
  • --artifact → also publish the report as an Artifact (Claude Code only; Cursor ignores it)
  • --skip=correctness,review-integration-tests,review-like-denis → drop lenses

Executor

Opus 5.5 writes every lens. The parent orchestrates and merges; it does not review. Both roles load this file; only the parent launches subagents.

Cursor Claude Code
tool Task Agent
subagent_type generalPurpose general-purpose
model claude-opus-5-5-high (claude-opus-5-5-max if the user asked for max) opus
  • All lens subagents launch in one message, in parallel. The parent merges only once every lens has returned (Cursor: run_in_background: false; Claude Code: wait for each completion notification).
  • Each prompt states: you are the <lens> subagent; read the skill named below (correctness: this file, §Correctness); do not launch a subagent; do not edit, post, or commit; return only your shape; SCOPE replaces the scope your skill computes. Then paste base, the SCOPE diff command and file list, and known context.

Step 0 — Scope

  1. Resolve <base>: the base-branch argument, else the PR's baseRefName (stacked PRs sit on another branch), else develop. Then git fetch origin <base>.
  2. SCOPE = git diff HEAD with pending, else git diff --merge-base origin/<base> (committed and uncommitted), plus untracked files from git status --porcelain. No projects/api/ file in SCOPE → "pas un changement API → review-like-denis" and stop.
  3. Known context, gathered once: gh pr view --json number,title,body,baseRefName,headRefName when a PR exists, plus the Linear issue whose id appears in the title, body, or branch (description, and comments when it is thin). No PR, or Linear unreachable: say so in the report header.
  4. Print: base, file count, lenses kept, --fix and --artifact or not.

Step 1 — Lenses

Lens Runs when Reuses skill Returns
correctness always none — §Correctness below the Correctness shape
review-integration-tests SCOPE has *.integration-test.ts or projects/api/tests/integration/** .cursor/skills/review-integration-tests/SKILL.md — Étapes 0–3 on SCOPE, report only its report, by check
review-like-denis always .cursor/skills/review-like-denis/SKILL.md — runs Procedure as the reviewer subagent, in-diff = SCOPE its Shape (verdict + [IA] comments)

A lens that is skipped or not triggered shows as n/a in the recap.

Correctness

Correctness only. Modeling, useless code, architecture, naming, domain vocabulary (band C), and conventions belong to review-like-denis; tests belong to review-integration-tests — never report them here.

Read SCOPE and every touched file in full, then the callers and callees a finding depends on. Hunt for:

  • Logic — inverted or missing condition, wrong branch, off-by-one, CalendarDate vs instant / timezone, a null path a type hides
  • Money — cents vs euros, rounding, sign, sums that drift, a bare number where Cents is due
  • Data — a new constraint vs existing rows, a nullable column read as required, update/delete without the right WHERE, a wrong join or filter
  • Transactions — read-modify-write without getAndLock*, a side effect (email, Slack, HTTP) inside the transaction, a job retry that is not idempotent
  • Contract — response vs the api-communication* descriptor, a breaking change for front/BO consumers, a wrong status code
  • Errors — an ignored Result, a swallowed Err, a match branch that cannot be reached
  • Perimeter — a missing ownership check (investor, project owner, admin)

Each finding is on an in-diff line, verified by reading the code (not guessed), with a concrete scenario. At most ~10, most severe first. A hit off the diff is a follow-up.

bloquant = reachable through a normal flow and it loses or corrupts money or data, breaks the contract, or opens the perimeter. recommandé = needs an unusual sequence, or the damage is recoverable.

### Correctness
1. `path/file.ts:L42` [bloquant|recommandé] — <constat> · scénario : <input/state → wrong output> · correction : <fix>
### Follow-ups
- <one line>

Step 2 — Merge

  • Severity → bloquant | recommandé | nit:
  • correctness and review-integration-tests: keep the lens severity
  • review-like-denis: a point that drives REQUEST_CHANGES → bloquant; a band C domain-vocabulary point → recommandé, even when prefixed nit:; any other nit: or a comment-wording suggestion → nit; a question known context leaves open → Questions à trancher; praise stays in the Shape; the rest → recommandé
  • Dedupe: same root cause → one finding tagged with every lens ([correctness+review-like-denis]), even when the lenses anchor on different lines. Keep the most concrete wording (the scenario beats the question). review-like-denis band H vs review-integration-tests: keep the review-integration-tests wording.
  • Questions à trancher are never auto-fixed.

Step 3 — Report

In French, printed in chat. With --artifact in Claude Code: also publish it as an Artifact and give the link. The review-like-denis Shape stays available verbatim for posting; post only on explicit ask, under its [IA] rule.

## Review API — <branch> vs <base> · <n> fichiers · review-like-denis : APPROVE|COMMENT|REQUEST_CHANGES
Contexte : PR #<n> · <LINEAR-ID> | pas de PR | Linear injoignable

### Bloquants
1. `path:L` [correctness] — <constat> → <correction>
### Recommandés
### Nits
### Questions à trancher
### Follow-ups (hors diff)

Récap : X bloquants / Y recommandés / Z nits — lentilles : correctness ✓ · review-integration-tests ✓|n/a · review-like-denis ✓

Step 4 — Fix

  • Without --fix: stop after the report. Edit only on explicit request (all, or selected numbers).
  • With --fix, or on request:
  • apply bloquant and recommandé findings whose fix is concrete and inside SCOPE; nits only when local and trivial
  • never apply Questions à trancher, product calls, or follow-ups
  • search before creating: reuse the existing helper or type the finding names
  • no commit, no stash, no comment narrating the fix
  • Then pnpm --filter @bricks/api lint and pnpm --filter @bricks/api typecheck; report failures verbatim. Never start docker: list the edited *.integration-test.ts files for the user to run.
  • Recap: applied (by number) / left for human.