reuse-firstlisted
Install: claude install-skill CodeWithJuber/forgekit
# Reuse-first engineering
Default to reusing and following what exists. New code is a liability; the best
change is the smallest one that fits the codebase.
## 1. Reuse before building
- **Ask the proof-carrying cache first**: `forge reuse query "<what you're about to
build>"`. A hit is code this team already generated AND verified — its test/accept
evidence travels with it (`forge ledger blame <id>` shows why to trust it):
- **EXACT / NEAR hit** → use that artifact; do not regenerate.
- **ADAPT hit** → read it, start from it, generate only the delta.
- **miss** → build it, then `forge reuse mint "<spec>" --file <path> --ref <test-run>`
so the next teammate (or session) gets the hit.
- Search the repo next (`grep`/`glob`/serena LSP): is there an existing util,
component, hook, service, or pattern that already does this? Extend it.
- If not in-repo, is there a maintained library? Vet it with `tech-selector`
(current best from Context7 + web + GitHub health) before adding a dependency.
- Only write from scratch when reuse genuinely doesn't fit — and say why.
## 2. Follow the codebase's patterns
- Match the existing architecture and idioms over any personal preference or
textbook pattern. Consistency beats cleverness.
- Apply a design pattern only when it removes real duplication or coupling — not
for its own sake. Prefer composition over inheritance; keep modules cohesive and
loosely coupled; push side effects to the edges.
## 3. Design for reuse + t