Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Scans a codebase for deepening opportunities, presents them as a visual HTML report, then grills through the chosen one. Use when the user wants to improve codebase architecture or find refactoring opportunities.
.claude/skills/fradser-improve-codebase-architecture/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-10 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-12 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-19 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 13% | 0% |
Surface architectural friction and propose deepening opportunities — refactors that turn shallow modules into deep ones. The aim is testability and AI-navigability.
This command is _informed_ by the project's domain model and built on a shared design vocabulary:
/mattpocock:codebase-design skill for the architecture vocabulary (module, interface, depth, seam, adapter, leverage, locality) and its principles (the deletion test, "the interface is the test surface", "one adapter = hypothetical seam, two = real"). Use these terms exactly in every suggestion — don't drift into "component," "service," "API," or "boundary."CONTEXT.md gives names to good seams; ADRs in docs/adr/ record decisions this command should not re-litigate.Scope before you scan — YAGNI. Deepening a module pays off by making future changes to it easier, so put extra weight on the parts of the codebase that have recently changed. Decide where to look before you look:
git log --oneline) to find the codebase's hot spots — the files and areas that keep coming up — and let those paths pull your attention first. If the changes are scattered with no clear hot spot, widen the net.Read the project's domain glossary (CONTEXT.md) and any ADRs in the area you're touching first.
Then spawn a sub-agent to walk the codebase. Don't follow rigid heuristics — explore organically and note where you experience friction:
Apply the deletion test to anything you suspect is shallow: would deleting it concentrate complexity, or just move it? A "yes, concentrates" is the signal you want.
Write a self-contained HTML file to the OS temp directory so nothing lands in the repo. Resolve the temp dir from $TMPDIR, falling back to /tmp (or %TEMP% on Windows), and write to <tmpdir>/architecture-review-<timestamp>.html so each run gets a fresh file. Open it for the user — xdg-open <path> on Linux, open <path> on macOS, start <path> on Windows — and tell them the absolute path.
The report uses Tailwind via CDN for layout and styling, and Mermaid via CDN for diagrams where a graph/flow/sequence reliably communicates the structure. Mix Mermaid with hand-crafted CSS/SVG visuals — use Mermaid when relationships are graph-shaped (call graphs, dependencies, sequences), and hand-built divs/SVG when you want something more editorial (mass diagrams, cross-sections, collapse animations). Each candidate gets a before/after visualisation. Be visual.
For each candidate, render a card with:
Strong, Worth exploring, Speculative, rendered as a badgeEnd the report with a Top recommendation section: which candidate you'd tackle first and why.
Use CONTEXT.md vocabulary for the domain, and the /mattpocock:codebase-design vocabulary for the architecture. If CONTEXT.md defines "Order," talk about "the Order intake module" — not "the FooBarHandler," and not "the Order service."
ADR conflicts: if a candidate contradicts an existing ADR, only surface it when the friction is real enough to warrant revisiting the ADR. Mark it clearly in the card (e.g. a warning callout: _"contradicts ADR-0007 — but worth reopening because…"_). Don't list every theoretical refactor an ADR forbids.
See HTML-REPORT.md for the full HTML scaffold, diagram patterns, and styling guidance.
Do NOT propose interfaces yet. After the file is written, use the AskUserQuestion tool to ask which candidate to explore, the candidates as options with your recommended one marked "(Recommended)".
Decide where to look before looking: follow the user's direction, or walk the commit history for hot spots — YAGNI. The report surfaces candidates only: do NOT propose interfaces yet — present the report and use the AskUserQuestion tool to ask which candidate to explore before any design work.
Once the user picks a candidate, run the /mattpocock:grilling skill to walk the decision tree with them — constraints, dependencies, the shape of the deepened module, what sits behind the seam, what tests survive.
Side effects happen inline as decisions crystallize — run the /mattpocock:domain-modeling skill to keep the domain model current as you go:
CONTEXT.md? Add the term to CONTEXT.md. Create the file lazily if it doesn't exist.CONTEXT.md right there./mattpocock:codebase-design skill and use its design-it-twice parallel sub-agent pattern.| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 9,350 | 15,705 | +68% | 1 | 1 | 0% | 498 | 2,038 | +309% | 0 | 0 | — |
case-02 | fail→fail | 11,938 | 6,530 | -45% | 1 | 1 | 0% | 326 | 1,836 | +463% | 0 | 0 | — |
case-03 | fail→fail | 4,694 | 7,771 | +66% | 1 | 1 | 0% | 292 | 2,040 | +599% | 0 | 0 | — |
case-04 | fail→fail | 5,315 | 6,809 | +28% | 1 | 1 | 0% | 237 | 1,891 | +698% | 0 | 0 | — |
case-05 | pass→fail | 8,980 | 9,081 | +1% | 1 | 1 | 0% | 1,787 | 2,096 | +17% | 0 | 0 | — |
case-06 | pass→fail | 10,899 | 4,933 | -55% | 1 | 1 | 0% | 1,734 | 1,826 | +5% | 0 | 0 | — |
case-07 | pass→fail | 14,695 | 5,650 | -62% | 1 | 1 | 0% | 2,256 | 1,802 | -20% | 0 | 0 | — |
case-08 | pass→pass | 11,704 | 7,325 | -37% | 1 | 1 | 0% | 1,806 | 2,467 | +37% | 0 | 0 | — |
case-09 | fail→fail | 15,548 | 8,189 | -47% | 1 | 1 | 0% | 2,413 | 1,883 | -22% | 0 | 0 | — |
case-10 | fail→pass | 9,616 | 2,992 | -69% | 1 | 1 | 0% | 1,446 | 1,904 | +32% | 0 | 0 | — |
case-11 | pass→pass | 21,273 | 9,634 | -55% | 1 | 1 | 0% | 4,001 | 2,995 | -25% | 0 | 0 | — |
case-12 | fail→pass | 15,046 | 4,606 | -69% | 1 | 1 | 0% | 2,274 | 2,184 | -4% | 0 | 0 | — |
case-13 | pass→pass | 10,791 | 4,982 | -54% | 1 | 1 | 0% | 1,534 | 2,141 | +40% | 0 | 0 | — |
case-14 | fail→fail | 13,635 | 3,998 | -71% | 1 | 1 | 0% | 2,256 | 2,113 | -6% | 0 | 0 | — |
case-15 | fail→fail | 12,108 | 2,056 | -83% | 1 | 1 | 0% | 1,739 | 1,776 | +2% | 0 | 0 | — |
case-16 | pass→pass | 12,514 | 6,911 | -45% | 1 | 1 | 0% | 1,948 | 2,503 | +28% | 0 | 0 | — |
case-17 | fail→pass | 7,882 | 6,541 | -17% | 1 | 1 | 0% | 1,374 | 2,512 | +83% | 0 | 0 | — |
case-18 | pass→pass | 10,329 | 4,588 | -56% | 1 | 1 | 0% | 1,811 | 2,244 | +24% | 0 | 0 | — |
case-19 | fail→pass | 16,307 | 9,735 | -40% | 1 | 1 | 0% | 2,345 | 2,588 | +10% | 0 | 0 | — |
case-20 | fail→pass | 11,519 | 4,828 | -58% | 1 | 1 | 0% | 2,080 | 2,357 | +13% | 0 | 0 | — |
case-21 | fail→fail | 12,969 | 3,658 | -72% | 1 | 1 | 0% | 1,765 | 2,021 | +15% | 0 | 0 | — |
case-22 | pass→pass | 4,258 | 3,165 | -26% | 1 | 1 | 0% | 598 | 1,996 | +234% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 14 counted toward the lift figure. The other 8 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +9 percentage points is the difference between those two pass rates over the 14 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.