Improve Codebase Architecture looks for shallow modules whose refactor into deep ones would improve testability and navigation for agents. It weights recently changed code using git history, spawns a sub-agent with a fresh context to walk the codebase, and applies the deletion test to suspect modules.
Results go into a self-contained HTML report with a before and after visual for each candidate and a Top recommendation section.
What You Get
- An HTML report in the temp directory, built with Tailwind and Mermaid loaded from CDNs
- A card per candidate with files, problem, solution, benefits, a before and after diagram and a Strong, Worth exploring or Speculative badge
- ADR conflicts flagged on the card when the friction justifies reopening a decision
- A grilling session on your chosen candidate with glossary updates and optional ADRs
Common Use Cases
- Running a periodic architecture survey every few days
- Pointing the survey at one module or pain point you already suspect
- Choosing the first refactor to tackle from a ranked set of candidates
What Makes It Unique
It ties the survey to hot spots in git history, speaks the codebase-design vocabulary and the project’s own glossary, and draws a visual before and after for every candidate. It offers an ADR only when a rejection reason would stop future reviews from suggesting the same refactor again.
Under The Hood
The model runs git log, reads files, and writes one HTML file to the temp directory, then opens it with xdg-open, open or start depending on the OS. The page loads Tailwind from cdn.tailwindcss.com and Mermaid from cdn.jsdelivr.net in your browser. A sub-agent walks the code. After you choose a candidate, the skill calls grilling, domain-modeling and optionally codebase-design, which may edit GLOSSARY.md and ADRs.