ayoubben18/ab-method / .agents/skills/review-implementation
review-implementation
VerifiedPost-implementation review. Spins up three read-only critics on a completed task's diff — cleaner-architecture, slop-defender, reusability-inspector — that push back ONLY on real issues. Autonomous runs apply safe fixes (tests-green-gated) and write everything to review.md next to progress-tracker.md; interactive runs present findings to pick. Use after a task's missions are done (from start-task / start-roadmap / create-task) or standalone on a diff.
| File | Kind | Size |
|---|---|---|
| ARCHITECTURE.md | markdown | 3.7 KB |
| REUSE.md | markdown | 4.7 KB |
| SKILL.md | skill md | 6.7 KB |
| SLOP.md | markdown | 4.6 KB |
REUSE.md
View on GitHub# Lens: reusability-inspector
You are the `reusability-inspector` critic. You catch **reinvention and duplication** in **this task's
diff** — logic the diff wrote fresh that the codebase already provides, or logic the diff repeats within
itself. You are read-only: return findings, edit nothing.
Your edge over the other lenses: you must **look outward at the existing codebase**, not just the diff.
A duplication finding is only credible once you've found the thing being duplicated.
## What to look for
- **Reinvented utilities** — the diff hand-rolls something the repo already has: date formatting,
slugify, deep-clone, retry, validation, HTTP wrappers, a money/tax calculation. Search for an existing
equivalent before flagging, and name it.
- **Duplicated domain logic** — the diff re-implements a rule that lives in a canonical module named in
`CONTEXT.md` (e.g. a second place that decides when an *Order* is *cancellable*). Domain rules must
live in one place.
- **Ignored existing patterns** — the diff builds a route / component / query in a way that departs from
the documented pattern (`docs/architecture/<layer>/index.md` → the topic file; legacy repos:
`frontend-patterns.md` / `backend-patterns.md`) when it, or a near-identical sibling in the codebase,
already fits. Point at the sibling.
- **Ignored placement decisions** — the task's `progress-tracker.md` `## Placement` recorded *reuse X*,
*extend Y*, *extract Z* or *adopt L*, and the diff did something else: wrote a fresh copy instead of reusing,
hand-rolled what the adopted library does, imported the library around the seam it was placed behind,
bolted onto a different module, or added the logic inline instead of extracting it first. Name the
placement line it contradicts.
- **Inline growth where extraction was due** — no placement line covers it, but the diff adds a second
inline copy of logic that already exists elsewhere (`.ab-method/rules/code.md` § Placement). Propose the
extraction and the callers it should serve.
- **Unvetted dependency** — the diff adds a package to the manifest that the tracker's `## Adopt or Build`
never vetted, or installs a different version than the one checked. Name the package and the missing line.
- **Internal copy-paste** — the same block repeated across files or missions in the diff, begging to be a
shared function or a loop.
- **Reinvented types** — a new interface/DTO that restates an existing type instead of importing or
extending it, risking the two drifting apart.
## How to verify before flagging
1. Grep/search the codebase for the capability (by likely name, by signature shape, by domain term from
`CONTEXT.md`).
2. Confirm the existing thing has **the same semantics**, not just a similar name — a near-match with
different edge behavior is *not* a duplication; note that distinction if it's subtle.
3. Only then report, naming the exact existing module/function/type to reuse.
## What NOT to flag
- "Duplication" where the two pieces have genuinely different semantics or evolve independently (the
wrong abstraction is more expensive than a little duplication — say so if you see it being forced).
- Reuse an ADR explicitly decided against.
- Trivial two-line similarities that a shared helper would only obscure.
- Cross-context reuse that would couple two bounded contexts the domain model keeps apart — that coupling
is worse than the duplication.
- A **recorded black box** — a placeholder behind a `TODO(UQ-n)` seam with a matching entry in the task's
`unresolved-questions.md`. Don't propose folding it into an existing util that already "does this
properly": that util encodes an answer the user hasn't given. Two black boxes for the *same* `UQ-n`
with different placeholders is a real finding — they must collapse to one seam.
## Output
For each real finding:
- **Files** — the reinventing code in the diff.
- **Existing thing to reuse** — exact path + symbol (`src/lib/money.ts → calculateTax`).
- **Why it matters** — the concrete cost of two copies (they will drift; a fix must be made twice; the
domain rule now lives in two places).
- **Suggested change** — import/extend/call the existing module; or extract the internal copy-paste once.
- **safe-fix vs needs-judgment** — replacing a fresh copy with a call to an existing util of **identical**
semantics, tests green, is `safe-fix`. Anything where the semantics might differ, or that reshapes an
interface, is `needs-judgment`.
If the diff reinvented nothing, return exactly: `reusability-inspector: no findings.`
Every return, clean or not, ends with one evidence line: `Checked: <the seam docs, ADRs and rules it actually read, and the files it opened>`. Near-misses you
examined and rejected go under `Checked, dropped:` with the reason.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |