Skip to content
Back to skills

Review

ASecurity

Senior-level review against the PR. Per SPEC-019, delegates correctness + security passes to runtime /code-review and /security-review (primary path), or falls back to the kit's degraded reviewer agent (degraded path) when those runtime skills are not exposed. Layers kit-distinctive checks (over-engineering minimality axis, Figma 3.5-3.10, ui-reviewer, design-auditor, a11y-auditor, tech-debt ledger, native-memory review-lessons learning) on top.

  • 11 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added October 9, 2026
developmentpythonrustgoshellbashtestingcode-reviewgitfrontendsecurity

Works with

  • claude code

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 10, 2026

npx -y skills add pillip/claude-dev-kit --skill review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pillip-review/badge)](https://www.skillsdirectory.com/skills/pillip-review)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: review
description: Senior-level review against the PR. Per SPEC-019, delegates correctness + security passes to runtime /code-review and /security-review (primary path), or falls back to the kit's degraded reviewer agent (degraded path) when those runtime skills are not exposed. Layers kit-distinctive checks (over-engineering minimality axis, Figma 3.5-3.10, ui-reviewer, design-auditor, a11y-auditor, tech-debt ledger, native-memory review-lessons learning) on top.
argument-hint: '[ISSUE-number]'
disable-model-invocation: true
allowed-tools: Task, Skill, SlashCommand, Read, Glob, Grep, Write, Edit, Bash(bash scripts/checkpoint.sh *), Bash(bash scripts/wt_setup.sh *), Bash(bash scripts/wt_cleanup.sh *), Bash(bash scripts/registry_edit.sh *), Bash(bash scripts/flock_edit.sh *), Bash(bash scripts/worktree.sh *), Bash(python3 scripts/*), Bash(git *), Bash(gh *), Bash(pytest *), Bash(npm *), Bash(bash ${CLAUDE_PLUGIN_ROOT}/scripts/*), Bash(python3 ${CLAUDE_PLUGIN_ROOT}/scripts/*)
---
<!-- AUTO-GENERATED by scripts/gen_skills.py — DO NOT EDIT. Edit SKILL.md.tmpl instead. -->

## Kit Preamble — review

### Kit Script Root
Kit root: `${CLAUDE_PLUGIN_ROOT}`
- Absolute path above → plugin install (substituted at load time; no project
  `scripts/` dir): prefix every kit script command with it, e.g.
  `bash <kit-root>/scripts/checkpoint.sh …`. Absolute paths also work from worktrees.
- Literal `${…}` placeholder above → standalone layout: run commands as written.

### Project Context Detection
Run these checks silently at the start. Use results to adapt behavior:
- `[ -f issues.md ]` — if true, this project uses the sprint system. Respect issue numbering and STATUS.md.
- `[ -f docs/sprint_state.md ]` — if true and Status shows `running`, a sprint is active. Be aware of parallel work in worktrees.
- `[ -f docs/prd_digest.md ]` — if true, read it for quick project context before starting.

### Kit Rules
- Verify `gh auth status` before any GitHub operation.

### Checkpoint Verification Pattern
Every phase has a checkpoint. Run the verification command and check the exit code.
- Exit non-zero (blocking gate): **STOP immediately**, report failure, do NOT proceed.
- Exit 0 with an `ADVISORY:` line (advisory gate): report the gap, self-correct, continue.
Standard prefix:
```
bash scripts/checkpoint.sh
```
Append `--skill <name> --phase <phase> --issue <ID>` for the specific check.
`checkpoint.sh` resolves the main repo root internally, so the command stays
a single prefix-matchable form (safe to allowlist as `Bash(bash scripts/checkpoint.sh *)`).

### Worktree Setup Pattern
Pipeline skills operate in git worktrees to isolate changes from main.
- Create + freeze: `WT="$(bash scripts/wt_setup.sh <branch>)"` — creates the
  worktree via `scripts/worktree.sh create` and writes `.claude-kit/freeze-dir.txt`
  inside it in a single step.
- Resolve main root: `bash scripts/worktree.sh root`
- Remove safely: `bash scripts/wt_cleanup.sh <branch>` — cd's to main root
  inside a subshell, then removes the worktree (never leaves CWD dangling).
All file operations happen inside `$WT/`. Shared files live on main only.

### Registry Update Pattern
Shared files (`issues.md`, `STATUS.md`, `CHANGELOG.md`) are managed on main only.
Always use `registry_edit.sh` for concurrent-safe writes — it resolves the
main repo root internally and delegates to `flock_edit.sh`:
```bash
bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'
```
Never commit these files to feature branches.
Steps:
1) Find PR from issues.md (PR field) or `gh pr status`.
2) Checkout the PR branch in a worktree + auto-freeze in one step:
   ```bash
   BRANCH="$(gh pr view <pr_number> --json headRefName -q .headRefName)"
   WT="$(bash scripts/wt_setup.sh "$BRANCH")"
   ```
   `wt_setup.sh` creates the worktree and writes the freeze marker inside
   `.claude-kit/freeze-dir.txt` atomically. All subsequent file operations
   happen inside `$WT/`.

> **CHECKPOINT — ADVISORY (report & continue)**
> Run: `bash scripts/checkpoint.sh --skill review --phase checkout --issue $ARGUMENTS`
> Advisory: exits 0 even on failure, printing an `ADVISORY:` line — report the gap, self-correct, then continue.

3) Gather review context:
   **Read all applicable context files via parallel Read tool calls in a single message.**
   - **Recalled review lessons** — recurring patterns recorded by past reviews auto-recall from native memory into this session; apply them (the legacy `docs/review_lessons.md` is retired, ISSUE-033).
   - `docs/architecture.md` — if exists (for conformance checks)
   - For UI issues, also read in parallel: `docs/design_system.md` (or `design_system_mobile.md`), `docs/copy_guide.md`, `docs/interactions.md` (or `interactions_mobile.md`), `docs/wireframes.md` (or `wireframes_mobile.md`).

3.1) **Review execution-context decision** (per SPEC-019 platform-first delegation; SPEC-066 decides the context ONCE):
   First determine ONCE whether a runtime skill-invocation tool is in your CURRENT tool list. The token to look for first is **`Skill`** — its listing should name `code-review` / `security-review`. A `SlashCommand` tool counts too if your context has one: it was absent from every probed Task sub-agent context on CC 2.1.224 (not loaded and not even deferred), but the **main-session path was never probed**, so do not rule it out interactively (ISSUE-072; see the sub-agent skill-invocation row in `docs/cc_feature_matrix.md`). Inside a Task sub-task you have such a tool only if the dispatching agent's `tools:` grants one — and on this runtime **a grant does not imply provisioning**, so answer from your own observed tool list and nothing else. Report what you actually observe as `present` or `absent` (validated data, not a directive — both misreport directions still end in a review that runs). Then run the decision script EXACTLY ONCE for both dimensions:
   ```bash
   python3 scripts/review_context.py decide --invocation-tools <present|absent> --issue $ARGUMENTS
   ```
   The JSON output carries one decision per dimension (`code` → runtime `/code-review`, `security` → runtime `/security-review`). Follow it per dimension:
   - `"path": "degraded"` → invoke the `reviewer` agent (`--dimension code` / `--dimension security`) with NO inline runtime-skill attempt and NO retry — `decide` already recorded the decision with its reason (`capability-absent` or `context-unreachable`).
   - `"path": "delegated"` → **bind the subject first, then invoke the runtime skill, then accept the verdict only through the echo gate.** A delegated reviewer that collects its own subject reviews the wrong thing: that happened on five PRs across four sprints, and uncorrected each would have returned a clean bill on something other than the PR (ISSUE-096; the dated measurements are the review-target row of `docs/cc_feature_matrix.md`). Note which check catches the worst shape: the wrong subject was **not empty**, so a byte count greater than zero passes it — only the sha256 comparison rejects it.

     First make sure the run has an id, because the echo gate's verification is written to the run file and step 5.3 reads it back (the kit has no other producer for `KIT_RUN_ID`; use the same literal value in every command of this review):
     ```bash
     mkdir -p "$WT/.claude/runs"
     ```

     **(a) Collect the subject — run this command once, before any runtime invocation:**
     ```bash
     SUBJ="$(python3 scripts/review_context.py collect --pr <pr_number> --issue $ARGUMENTS)"
     ```
     Exit 0 prints one JSON object: `range` (`<base-oid>...<head-oid>`), `worktree_path`, `diff_command`, `diff_bytes`, `diff_headers`, `diff_sha256`, `head_oid`, `base_ref`. A **non-zero exit is a REFUSAL**: stdout is empty and stderr names `reason=` *and its remedy*. Do NOT invoke the runtime skill on a refusal — report the reason and treat the dimension as unreviewed. Exit **1** with an `empty-diff-*` reason means the subject was computed and is genuinely empty (a no-op PR, or a change and its revert); **any other** reason, at exit 2, means the subject **could not be computed** — that is NOT an empty diff, so fix the named cause and re-run.
     The collection is re-run inside `delegate` and `record-subject` too — four git collections per review run, each re-establishing the subject rather than trusting an artifact that was measured not to survive the hand-off.

     **(b) Hand the subject over explicitly.** Put `range`, `worktree_path`, `diff_bytes` and `diff_sha256` verbatim into the runtime skill's prompt, tell it to run the payload's **`diff_command` exactly as printed** (it already carries `-C <worktree_path>`, `--no-ext-diff` and `--no-textconv`; a differently-flagged diff produces a different digest and an honest review would be rejected), and require it to **echo back the byte count and sha256 it measured** before stating its verdict. Do not let it auto-collect its own subject, and do not hand it a file path as the only carrier — a materialised diff file was measured "not present" from the code reviewer's own context on PR #145, and only the byte-count echo caught it. **Do not fabricate an echo**, and do not copy the digest from (a) on the reviewer's behalf: a pasted digest is the one remaining way past this gate, and using it means recording a verdict on a diff nobody read.

     > **Measured constraint (2026-10-31, ISSUE-096 / PR #147 review) — the runtime `/security-review` accepts no review target.** Its harness **discarded** the pinned subject arguments (they appeared nowhere in the prompt it produced) and auto-collected instead: from the main checkout it arrived with `GIT STATUS: On branch main` and 48.5KB of the wrong subject; from the worktree it collects nothing at all (`(Bash completed with no output)`). **Neither CWD works, so step (b) cannot be executed for the security dimension on this runtime.** Its echo can never match, `delegate` will refuse with `reason=echo-mismatch`, and the security dimension therefore **degrades to the `reviewer` agent** through the `inline-attempt-failed` token below — report it as degraded, do not fabricate an echo to get past it. The code dimension is unmeasured in this shape and is attempted normally. Recorded as a dated row in `docs/cc_feature_matrix.md`; re-probe it when the runtime changes.

     **(c) Record the delegation through the echo gate** (it re-collects and compares; it emits `review_delegated_to_code_review` / `review_delegated_to_security_review` only on a match, and that event is the receipt step 5.3 consumes):
     ```bash
     KIT_RUN_ID=review-$ARGUMENTS python3 scripts/review_context.py delegate --dimension <code|security> --pr <pr_number> --issue $ARGUMENTS \
       --head-oid <the head_oid from (a)> \
       --echoed-bytes <the number the reviewer reported> --echoed-sha256 <the sha256 the reviewer reported>
     ```
     A non-zero exit means the verdict is not usable:
     - `reason=echo-mismatch` — the reviewer's verdict is about something other than this PR: **discard the verdict** and do not use its findings.
     - `reason=head-moved` — the branch advanced while the reviewer was reading. The verdict is about the older head; re-run (a) and re-review rather than discarding the reviewer's work as dishonest.
     - `reason=verification-unconfigured` — the receipt had nowhere to go; create `$WT/.claude/runs` and set `KIT_RUN_ID` as above, then re-run.

     On `echo-mismatch` (and for the security dimension per the measurement above), fall back to the degraded `reviewer` agent for that dimension and record the fallback with the existing token (this issue added no fourth reason). **Run it from `$WT/`, with the run id**: `emit` anchors its append on the CWD, so from `$WT/` the event lands in the SAME run file as the receipts, and without `KIT_RUN_ID` an unset run id is a silent no-op at exit 0 — which would drop the one event that records WHY this dimension degraded:
     ```bash
     KIT_RUN_ID=review-$ARGUMENTS python3 scripts/review_context.py emit --event review_degraded_path_used --dimension <code|security> --reason inline-attempt-failed --issue $ARGUMENTS
     ```
     The same `emit` call covers an inline invocation that fails outright despite the decision (probe-2 ambiguity).

   Mixed mode (one runtime + one degraded) is supported. Run code-quality and security in parallel where possible; capture outputs to `docs/.review/code-review.md` and `docs/.review/security-review.md` (the synthesizer expects these paths). Decide-time degradations are emitted by `decide` itself — do not re-emit `review_degraded_path_used` for them.

3.2) **Over-engineering audit (minimality axis)** — kit-distinctive, runs on BOTH paths:
   Scan the diff for unnecessary complexity only — not correctness (that is the code dimension above). Tag each finding `delete` / `stdlib` / `native` / `yagni` / `shrink`, one line per finding (`path:line: <tag> <what to cut> → <replacement>`), ending with net removable lines — or `Lean already. Ship.` if nothing to cut. This axis never overrides safety (validation, error handling, security, a11y, explicitly-requested work).
   - On the degraded code path, this is folded into the same `reviewer` agent invocation (the agent's Over-Engineering section covers it) — do not run it twice.
   - On the primary path, ask the `reviewer` subagent to run ONLY this axis; capture output to `docs/.review/minimality.md`.
   - When building `docs/.review/findings.json` (step 3.14), put each minimality finding into the `minimality_findings` array with its tag prefixed in the title (e.g. `[yagni] …`); the synthesizer renders these under the always-on **Over-Engineering** section (the kit's SSOT review-notes contract).
   - Pass gathered context (recalled review lessons, architecture) so recurring patterns are recognized. Because separate-context subagents do not receive auto-recall, include the relevant recalled lessons verbatim in the subagent prompt.

_(Synthesis + merge-audit happen AFTER all kit-distinctive checks 3.5–3.13 complete — see steps 3.14 and 3.15 below. This sequencing lets the synthesizer merge runtime findings, kit-distinctive findings, and any degraded-path findings in a single pass.)_

3.5) **Figma compliance check** (auto-skips if no Figma data) — **runs BEFORE UI review to ensure Figma fidelity first**:

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase figma-compliance --issue $ARGUMENTS`
> Compares ALL implementation style properties (24 categories) against `figma-export/design_data.json`.
> Auto-passes when no Figma data exists. Fails if implementation deviates from Figma design tokens.
> If exit code ≠ 0: STOP immediately. Fix all violations before proceeding.
> **Figma is the absolute source of truth.** Any deviation is a blocking violation.

3.6) **Computed style verification** (auto-skips if no Figma data):

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase computed-styles --issue $ARGUMENTS`
> Renders the implementation in Chromium, extracts ACTUAL computed CSS values from every visible element, and compares against Figma tokens. Catches CSS cascade conflicts, specificity overrides, and inheritance issues that static source analysis (figma-compliance) misses.
> If exit code ≠ 0: STOP immediately. Fix the rendered style mismatches.

3.7) **Structural match** (auto-skips if no Figma data):

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase structural-match --issue $ARGUMENTS`
> Verifies all Figma elements exist per viewport, with responsive CSS.
> If exit code ≠ 0: STOP immediately. Add the missing elements.

3.8) **Layout verification** (auto-skips if no Figma data):

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase layout --issue $ARGUMENTS`
> Verifies element spatial relationships (row/column, sibling ordering).
> If exit code ≠ 0: STOP immediately. Fix layout.

3.9) **Same-renderer visual diff** (blocking — prototype HTML vs implementation, both Chromium):

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase visual-diff --issue $ARGUMENTS`
> Renders both prototype HTML and implementation in the SAME Chromium engine — eliminates font hinting and anti-aliasing differences. Threshold: 1%.
> Falls back to Figma render PNG comparison (5% threshold) if no prototype HTML.
> If exit code ≠ 0: STOP immediately. Fix visual discrepancies.

3.10) **Visual diff debug images** (for reviewer reference):
   Diff images saved to `figma-export/visual-diff/` — red = real diff, yellow = AA.
   Reviewer should inspect these alongside the diff percentage.
   Run: `python3 scripts/verify_visual_diff.py --project-path $WT --threshold 5`
   This is a **non-blocking advisory signal**, NOT a gate. Pixel comparison across different renderers (Figma vs Chromium) inherently produces false positives due to font hinting, anti-aliasing, and sub-pixel rendering differences.
   - Generates diff images in `figma-export/visual-diff/` (red = real diff, yellow = AA)
   - Log the diff percentage in `docs/review_notes/$ARGUMENTS.md` for the reviewer to assess
   - If diff > 5%: flag as a **warning** in review notes — reviewer should inspect the diff images
   - Do NOT block the review based on pixel diff alone. The **figma-compliance checkpoint** (step 3.5) is the authoritative Figma fidelity gate.

3.11) IF the issue involves UI/frontend work (check `UI: true` field first; fall back to Track/title keywords: "UI", "screen", "component", "prototype"):
   Ask ui-reviewer subagent to perform UI state review:
   - Pass the UI context files gathered in step 3 plus any recalled review lessons (inject them into the subagent prompt — subagents get no auto-recall).
   - Reviewer checks state coverage, copy compliance, token usage, accessibility, interaction fidelity.
   - Output: `docs/ui_review_notes/$ARGUMENTS.md` with severity-classified findings.

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase ui-review --issue $ARGUMENTS`
> The script auto-detects UI issues via Track field/title keywords. Non-UI issues pass automatically.
> If exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.

3.12) IF UI issue AND design system docs exist (`docs/design_system.md`, `design_system_mobile.md`, or `design_system_desktop.md`):
   Ask design-auditor subagent to audit the design system:
   - Pass all design context files gathered in step 3.
   - **Also pass `figma-export/design_data.json`** (if exists) so auditor can verify design system covers all Figma tokens.
   - Auditor checks: token consistency, component completeness, cross-platform alignment, philosophy compliance, copy coverage, **Figma token coverage**.
   - Output: `docs/design_audit.md` with severity-classified findings.

3.13) IF UI issue:
   Ask a11y-auditor subagent to perform WCAG 2.1 AA accessibility audit:
   - Pass design context files + source code files from the PR diff.
   - Auditor checks all 4 WCAG principles: Perceivable, Operable, Understandable, Robust.
   - Output: `docs/a11y_audit.md` with findings and fix suggestions.

3.14) **Synthesize** runtime code/security outputs (from step 3.1) + kit-distinctive findings (Figma 3.5–3.10, UI review 3.11, design audit 3.12, a11y audit 3.13) into `docs/review_notes/$ARGUMENTS.md`:
   - Build the structured intermediate `docs/.review/findings.json` with `code_findings` and `security_findings` (extracted verbatim from runtime outputs or the degraded reviewer agent), plus optional `ui_findings` / `design_findings` / `a11y_findings` / `figma_findings` arrays from whichever kit-distinctive checks ran.
   - Run: `python3 scripts/synthesize_review_notes.py --input docs/.review/findings.json --out docs/review_notes/$ARGUMENTS.md`
   - The synthesizer preserves severity verbatim from upstream, sorts findings within each section by severity (Critical → Low), and renders empty runtime sections with the `_No findings._` literal. Kit-distinctive sections appear only when they ran.

4) Apply minimal fixes for Critical/High findings (code + UI + design audit + a11y audit + Figma compliance); re-run tests inside `$WT/`.

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase test --issue $ARGUMENTS`
> If exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.

4.5) **Test quality verification**: Validate that all test files in the branch contain real assertions (no hollow tests). This catches test files that exist to satisfy checkpoints but don't actually verify behavior.

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase test-quality --issue $ARGUMENTS`
> If exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.

4.7) **Tech-debt ledger** (advisory — harvests `KIT-DEBT` markers):

> **CHECKPOINT — advisory (non-blocking)**
> Run: `bash scripts/checkpoint.sh --skill review --phase debt --issue $ARGUMENTS`
> Always exits 0. Lists every `KIT-DEBT(ceiling=…, trigger=…)` marker; flags markers missing a `trigger=` as **silent-rot risk**.
> Record any `no-trigger` markers as Low-severity `code_findings` entries (title prefixed `[debt]`) in `docs/.review/findings.json` so deferrals don't become permanent. Does NOT block the review.

5) `docs/review_notes/$ARGUMENTS.md` is **already produced by step 3.14** (synthesizer) with the canonical 2-section format (Code Review + Security Findings, minimality/debt findings folded into Code Review with their tags) plus any kit-distinctive sections (UI Review / Design Audit / Accessibility Audit / Figma Compliance) that ran. If fixes applied in step 4 changed the underlying findings, or step 4.7 added `[debt]` entries, re-run `python3 scripts/synthesize_review_notes.py` with the updated `docs/.review/findings.json`. Do not edit `docs/review_notes/$ARGUMENTS.md` by hand — the kit's SSOT contract (`/ship`, `/sprint` consumers) depends on the synthesizer-produced shape.

5.3) **Record the review subject in the notes** (ISSUE-096 counter-evidence). This runs HERE, downstream of the synthesizer at step 3.14 and of any re-synthesis in step 5, because those rewrite the very file it checks — placed upstream it would gate a surface that is overwritten afterwards, and pass anyway:
   ```bash
   KIT_RUN_ID=review-$ARGUMENTS python3 scripts/review_context.py record-subject --pr <pr_number> --issue $ARGUMENTS
   ```
   It writes the byte count, head oid, range and verified dimensions into `<worktree>/docs/review_notes/$ARGUMENTS.md` — **copied from the receipt the passing echo gate in step 3.1(c) wrote, not recomputed here.** That is the point: a block the command computes for itself is byte-identical whether the echo gate passed, was rejected, or never ran. An existing block is replaced in place, so a second review cycle (step 6 commits and pushes these notes, which moves the head) does not wedge. A non-zero exit means:
   - `reason=verification-missing` / `reason=verification-unconfigured` — no passing delegation to attest to. Either no dimension delegated (then skip this step), or the echo gate was never run / was rejected / had no run id.
   - `reason=review-notes-missing` — run the synthesizer first.
   - `reason=subject-duplicate-block` / `reason=subject-unparseable` — the notes carry two blocks or an unreadable one; delete the stale block and re-run.
   - `reason=subject-incomplete` — the block could not be read back. Usually an **unterminated code fence** earlier in the notes (a finding whose multi-line `evidence` puts a ``` at column 0) hiding the heading from the detector; the message names which cause it found. Nothing was written, so fix the cause and re-run — retries do not accumulate blocks.

   Fix the cause before shipping, so "reviewed nothing" can never render identically to "reviewed and found nothing". Skip only when no dimension delegated.

5.5) **Learning Extraction → native memory** (kit-distinctive, not duplicated by runtime). Identify findings in `docs/review_notes/$ARGUMENTS.md` that could have been prevented earlier (at kickoff or implementation time), and record each preventable pattern as a **review lesson in Claude Code's native persistent memory** so it auto-recalls into future sessions — replacing the retired `docs/review_lessons.md` registry (ISSUE-033).
   - Persist to the project memory topic file `review-lessons.md` (in the native auto-memory directory — `${autoMemoryDirectory}` if set, else `~/.claude/projects/<project>/memory/`; use your memory capability rather than a hard-coded path). Add a one-line pointer under a `## Review Lessons` heading in `MEMORY.md` so the index surfaces it at session start.
   - Each lesson is one entry: a short title, the classification (Code Quality / Security / Testing / Architecture / Over-Engineering), **Why** it matters, and **How to apply** (the prevention step). Include the observed PR/issue.
   - **Dedup, don't version-count**: before writing, check the `MEMORY.md` index and `review-lessons.md`; if the pattern already exists, update that entry (append the new observed issue) instead of creating a duplicate. No numeric lesson IDs, no Frequency counter — the native convention is one fact per entry, updated in place.
   - **Do not record a lesson that teaches a better document guard.** A lesson whose "How to apply" amounts to *keep this doc in sync with the code* — regenerate a copied number, tighten a phrasing blacklist, assert a constant is documented — institutionalizes the `[record]` class: it widens what future reviews check, and each new drift becomes triage work. Record the lesson one level up instead: *don't state the derived fact, or generate it from its source*. Same test as the triage gate — if the pattern never recurring would break nothing for a user, it is not a lesson.
   - Do **not** write `docs/review_lessons.md` or use `registry_edit.sh` for lessons; native memory is the store now.
5.7) **Update test plan** (if `docs/test_plan.md` exists):
   - Ask qa-designer subagent to review and update `docs/test_plan.md` based on the PR changes.
   - Pass: PR diff summary, list of changed files, and current `docs/test_plan.md` content.
   - qa-designer evaluates: new flows requiring test coverage, risk level changes, E2E gap updates.
   - Update via `bash scripts/registry_edit.sh docs/test_plan.md -- bash -c '<update command>'` for safe concurrent modification.
   - If no updates needed: skip silently.

> **CHECKPOINT — MANDATORY — NEVER SKIP**
> Run: `bash scripts/checkpoint.sh --skill review --phase review --issue $ARGUMENTS`
> If exit code ≠ 0: STOP immediately and report the failure. Do NOT proceed.

6) Commit + push from `$WT/`.

> **CHECKPOINT — ADVISORY (report & continue)**
> Run: `bash scripts/checkpoint.sh --skill review --phase push --issue $ARGUMENTS`
> Advisory: exits 0 even on failure, printing an `ADVISORY:` line — report the gap, self-correct, then continue.

7) If PR is draft and ready: `gh pr ready`.

## Shared Registry Files
**IMPORTANT**: Never commit `issues.md`, `STATUS.md`, or `CHANGELOG.md` to the feature branch.
These are registry files managed only on main. Always use `bash scripts/registry_edit.sh <file> -- bash -c '<update command>'` — the wrapper resolves the main repo root internally.

## Error Handling
- If PR not found (issues.md has no PR field and `gh pr status` returns nothing): stop and report; suggest running `/implement` first.
- If reviewer subagent fails: retry once; if still failing, skip automated review and log a warning in docs/review_notes/$ARGUMENTS.md.
- If applied fixes break tests:
  1. Revert the fix commits: `git checkout -- <files>` for unstaged or `git revert HEAD` for committed changes (inside `$WT/`).
  2. Re-run tests to confirm the branch is back to a passing state.
  3. Log the failed fix attempt in docs/review_notes/$ARGUMENTS.md as a follow-up item.
- If `gh pr ready` fails: report the error but do not block — the PR can be manually marked ready.

## Rollback
- Review changes are commits on the existing PR branch.
- If review fixes must be fully undone: `git revert` the review commits (do not force-push).
- docs/review_notes/$ARGUMENTS.md is append-only; no rollback needed for notes.
- Clean up worktree when done: `bash scripts/wt_cleanup.sh "$BRANCH"`.

Files in this skill

  • SKILL.md19.4 KB
  • SKILL.md.tmpl17 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.