wikis / Matt Pocock Skills / wiki / entities / improve-codebase-architecture.md view as markdown report a mistake
improve-codebase-architecture
Overview
improve-codebase-architecture scans a codebase for "deepening opportunities" — refactors that turn shallow modules into deep ones — presents them as a visual HTML report, then runs a grilling loop through whichever candidate the user picks. It is codebase upkeep, not feature work: the survey that finds candidates for /codebase-design to design and /grill-with-docs to sharpen into an idea.
Characteristics
User-invoked — frontmatter carries disable-model-invocation: true. Uses the /codebase-design vocabulary (module, interface, depth, seam, adapter, leverage, locality) for every suggestion, and GLOSSARY.md/ADRs for domain naming and prior decisions. Since v1.3.2 it walks the codebase with a sub-agent started in a fresh context window, not a fork of the conversation. Writes a self-contained HTML report (Tailwind CDN + Mermaid CDN) to the OS temp directory as <tmpdir>/architecture-review-<timestamp>.html — never into the repo — and opens it via xdg-open/open/start.
How to Use
Process: (1) Explore — scope by user direction or by walking git log --oneline for hot spots, read GLOSSARY.md/ADRs, then have that fresh-context sub-agent note friction (concept understanding scattered across modules, shallow interfaces, extracted-for-testability functions with no locality, leaky seams, untested/hard-to-test areas), applying the deletion test to anything suspected shallow; (2) present candidates as HTML cards — Files, Problem, Solution, Benefits, a before/after diagram, and a Recommendation strength badge (Strong / Worth exploring / Speculative) — ending with a Top recommendation, then ask "Which of these would you like to explore?"; (3) grilling loop — run /grilling on the chosen candidate, updating GLOSSARY.md inline and offering an ADR when the user rejects a candidate for a load-bearing reason. Picking a candidate generates an idea to take into the main flow at /grill-with-docs.
Related Entities
- codebase design — the vocabulary this skill's report and grilling loop use throughout.
- domain modeling — kept current inline as decisions crystallize during the grilling loop.
- diagnosing bugs — a bug that exposes a missing seam is a reason to run this skill (the automatic hand-off was removed in v1.3.0).
- grill with docs — where a chosen candidate feeds back into the main flow.
- ask matt — names this as the codebase-health loop.
- promoted catalog — full inventory.
