/flagrare:implementation-reviewfrom Flagrare
Pre-commit quality gate running seven parallel checks: plan gaps, use-case coverage, missing tests, Testing Trophy violations, SOLID, Clean Code, and security. Invoke before every commit.
Ships in Flagrare. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Run this before every commit, after /flagrare:staleness-audit. The goal: what was planned is implemented, what is implemented is tested, and what is tested is correct.
Each of the seven checks is run by a dedicated subagent. Spawn all seven in parallel, collect their reports, then synthesise into the output format below.
REQUIRED BACKGROUND for Checks 2-4: the test-related checks apply /flagrare:testing-philosophy (behavior over implementation, the Testing Trophy, the e2e necessity floor). Pass that skill's content into the Check 2, 3, and 4 subagent briefs so they judge against the same definition of "good test" the planning side uses.
REQUIRED BACKGROUND for Check 7: the security check applies /flagrare:security-audit (threat taxonomy, three-phase methodology, confidence gate, false-positive precedents, generic dependency audit). Pass that skill's content into the Check 7 subagent brief so it judges against the same security discipline a standalone /flagrare:security-audit run uses.
Before spawning subagents, collect in the main agent:
git diff --staged, full diff (the primary input for all subagents)git diff --staged --name-only, file list/flagrare:atdd-plan run earlier in this conversation? Use that output.~/.claude/plans/*.md, the most recently modified file, if the directory exists.docs/decisions/, docs/adr/, RFCs, or equivalent), the foundational decision is always the mission/scope anchor.If no plan is findable, say so explicitly and skip Checks 1-2 in the subagent briefs.
Spawn all seven subagents simultaneously using model: "sonnet". Each subagent receives the relevant slice of inputs (described in each brief below) and returns findings in the format Check N · [name]: ✓ clean | ⚠ [finding] | ✗ [blocking finding].
Do not run checks sequentially in the main agent. Spawn → collect → synthesise.
Rules every brief below inherits. Paste these into each subagent's prompt ahead of its brief. They are adapted from the review prompts in alibaba/open-code-review; the teardown is at docs/research/2026-09-14-open-code-review-teardown.md.
Inputs: full git diff --staged, the active plan document.
Compare what the active plan said would be built against what the staged diff actually implements.
For each item in the plan's "Implementation Phases" or task list:
Ask: would a reader of the plan consider this commit "phase complete"? If the plan defined a gate ("Phase N is done when ATs #1-4 pass"), does the commit satisfy it?
Flag every gap. A deferred item is not a gap, but it must be explicitly deferred, not silently absent.
Inputs: full git diff --staged, the project's foundational scope document (ADR-0001, RFC-001, mission doc, or equivalent, whichever anchors what this project is for), README feature description.
For every user-facing capability in scope for this commit:
/flagrare:testing-philosophy, a user-facing feature with unit + integration coverage but no e2e/full-stack proof that the layers connect is a gap. E2e generalizes by surface: a browser journey for a UI, running-service-over-HTTP-against-a-real-DB for a backend, a subprocess invocation for a CLI, public-API-as-a-consumer for a library. One or two critical paths suffice, but zero is a finding.This is different from Check 1, use cases can be implicit in the product scope even if the plan did not spell them out. Ask: "what would a consumer of this code reasonably expect to be able to do?"
Flag any use case that has an implementation but no test, a test but no implementation, or a user-facing happy path with no end-to-end coverage.
Inputs: full git diff --staged, full content of changed test files.
For every behavior introduced or changed in the staged diff, work through this scenario checklist:
| Scenario type | Question to ask |
|---|---|
| Happy path | Is the basic success case tested? |
| Empty / nil / zero | What happens when the input is empty, null, zero, or absent? |
| Boundary | First item, last item, exactly one item, max capacity? |
| Invalid input | Malformed, out-of-range, wrong type, is the rejection tested? |
| Error path | For every success path, is the corresponding failure path tested? |
| Idempotency | If the operation can be called twice, is that safe? Is it tested? |
| Order sensitivity | Does the result depend on call order? Is that documented and tested? |
| Concurrent access | If the code will be called from multiple threads/tasks, is that safe? Is it tested? (Only if relevant.) |
Flag missing scenarios. Not every category applies to every change, exercise judgment, but don't skip a category without a reason.
Inputs: full content of changed test files only (do not check non-test files here).
For each test in the staged diff, check against the following rules. A violation is a finding. Apply the two acid tests from /flagrare:testing-philosophy to every test: (1) would it break under a behavior-preserving refactor (internal rename / restructure with the public contract unchanged)? (2) does it assert what a real user observes, or how the result was produced? A "yes" to (1) or a "no" to (2) is an implementation-detail test.
Behavior over implementation
Public API only
_inner objects, unexported functions, or internal state? → violationReal collaborators where cheap
Refactor-proof
Testing Trophy shape: check both directions (most reviews only catch overuse):
Test names
it("works"), it("test 1"), it("should work correctly"), it("handles the case") → violationit("rejects a negative index with StoryChoiceRangeError carrying attempted=−1") → ✓Inputs: non-test source files from the staged diff only (do not check test files here).
Scan for these patterns:
Single Responsibility
Open/Closed
switch or if/else if chain on a type tag in the caller is often the smell.Liskov
Interface Segregation
Dependency Inversion
new a concrete dependency inside a class rather than receiving it?new ConcreteType() inside class bodies where an abstraction or injection would be natural.Inputs: full git diff --staged (both test and non-test files).
Scan for:
| Issue | What to look for |
|---|---|
| Magic values | Bare literals with semantic meaning: if (index >= 99), setTimeout(fn, 3000), "choice:made" repeated in multiple files. Every meaningful literal must be a named constant. |
| Function does more than one thing | If "and" is required to describe what it does, it should be split. |
| Unqualified generic names | data, info, result, value, temp, manager, handler, helper without qualification. |
| Comments | Flag every comment in the diff that is not a trap-preventer: one where deleting or moving the code it sits on would look like a safe cleanup and break something the reader cannot see. What-comments, provenance ("on purpose", "the design says"), file headers, citations to tickets or docs, and test narration all fail that test, even when they read as a why. /flagrare:wrap-up Step 3 does the deleting; this check only reports. |
| Half-finished surfaces | Any exported symbol with TODO, a stub body { return null; }, or "implement later". |
| Long parameter lists | More than 3-4 positional parameters, group into an options object. |
Inputs: full git diff --staged, file list, the lockfile diff if a lockfile changed.
Pull in the full content of /flagrare:security-audit and apply it to the staged diff. That skill carries the threat taxonomy, the three-phase methodology (understand the repo's security model, compare the change against it, trace data flow from source to sink), the confidence gate, the false-positive precedents, and the generic dependency audit.
The one rule: only report a finding with a concrete exploit path, and only when over 80% confident it is actually exploitable. A security check that flags theoretical issues gets ignored; keep it to what a security engineer would confidently raise. Review what the change newly introduces, not pre-existing issues the diff sits near.
When a lockfile changed, run the repo's native dependency auditor (scoped to the changed packages so the gate stays fast) and degrade gracefully to an advisory flag if the auditor is not installed.
Return findings in the house line format. HIGH and MEDIUM severity block; LOW is advisory.
After all seven subagents return, merge their findings into this format:
Implementation review, [commit subject or staged file summary]
Coverage: N staged files. Per check: 3 N/N · 4 N/N · 5 N/N · 6 N/N · 7 N/N; Check 1 N/N plan items; Check 2 N/N use cases. Skipped: <item> (<check>, <reason>). Omit the skipped clause if none.
Check 1 · Plan gaps
✓ All phase items present | ✗ Gap: [item], [present/partial/absent]
Check 2 · Use-case coverage
✓ All use cases covered | ✗ [use case], no test / no implementation
Check 3 · Missing test scenarios
✓ Scenarios complete | ⚠ [behavior]: missing [scenario type]
Check 4 · Test philosophy
✓ Tests pass philosophy check | ✗ [test name]: [violation]
Check 5 · SOLID
✓ No violations | ✗ [file:line]: [principle], [finding]
Check 6 · Clean Code
✓ No violations | ✗ [file:line]: [issue]
Check 7 · Security
✓ No vulnerabilities in the diff | ✗ [file:line]: [category] ([severity]), [exploit in a phrase] + fix | ⚠ [lockfile moved / auditor unavailable]
Summary: [N findings, fix before committing / Clean, proceed]
If any check skipped an item without a reason, the Summary line says so and cannot read "Clean, proceed". Unexplained partial coverage is not a clean review.
If a finding is blocking (plan gap, philosophy violation on a public API test, SOLID violation that breaks extensibility, a HIGH or MEDIUM security vulnerability), fix it before committing unless the user explicitly overrides.
If a finding is advisory (a test name that could be clearer, a slightly long function), surface it but do not block.
[code changes complete]
↓
/flagrare:staleness-audit ← docs drift, TSDoc, export sync, stale markers
↓
/flagrare:implementation-review ← THIS SKILL (7 parallel subagents)
↓
git commit
↓
/flagrare:release-check ← is a release due?
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
43 skills in this plugin
/atdd-planProduce an ATDD-first implementation plan in Claude Code's native plan mode, with named design patterns called out where they earn their keep. The skill enters plan mode automatically (via the EnterPlanMode tool), runs /flagrare:codebase-explore to ground the plan in the actual codebase, then produces a plan-mode plan that MUST include both: (1) 3-5 acceptance tests in plain English defining 'done' before any implementation, written behavior-first against the public API only; and (2) any non-trivial structural decisions named as design patterns with a one-line rationale. Plan mode's native approve/edit/reject button UI is the close, ExitPlanMode is how the skill ends. Use whenever the user wants to plan a feature, fix, or refactor, 'how should we implement X', 'plan this', 'let's design X', 'where do we start on Y'. Tests follow Kent Dodds Testing Trophy: behavior over implementation, integration-heavy, public-API-only, refactor-proof. The skill stops at the plan; it does not write implementation code./brag-docGenerate a comprehensive, impact-framed brag-doc entry for a chosen time window (day, week, biweek, month, or custom). Pulls authored PRs, reviews given, commits, deploys, and linked tickets across GitHub, local git, and configured MCPs, then synthesises a themed narrative, leading with outcomes, quantifying impact, owning the work in first-person past tense, separating IC contributions from amplification, and naming the judgment exercised. Output is designed to drop straight into a developer journal, a personal bragging sheet, or a performance-review packet. Accepts a mode argument, `/flagrare:brag-doc resumancer` renders the output as ready-to-paste Resumancer CLI commands (`resumancer impact "..." --branch ...`) instead of markdown. Use whenever the user says "brag doc", "brag sheet", "what did I do this week", "weekly recap", "monthly recap", "performance review prep", "what should I tell my manager", "summarise my impact", "career log entry", "give me my wins", "biweekly recap", or any variant about looking back over a longer window than a single day's standup. Also trigger near review season ("self-review", "perf packet", "evaluation prep"), and on phrases like "log my wins to resumancer" or "make resumancer entries for this week" (which should pass the `resumancer` mode). For windows longer than about a month, a tenure retrospective, a departure record, or "everything I did at this company", hand off to `/flagrare:impact-timeline` instead; this skill's window tops out at a month.npx claudepluginhub flagrare/agent-skills --plugin flagrareOther plugins' skills for the same job