improve-codebase-architecture

Scan a codebase for module deepening opportunities and present them as a visual HTML report.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/Fatih0234/mattpocock-skills-pi --skill improve-codebase-architecture-fatih0234
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/Fatih0234/mattpocock-skills-pi/tree/main/skills/engineering/improve-codebase-architecture
Command: npx skills add https://github.com/Fatih0234/mattpocock-skills-pi --skill improve-codebase-architecture-fatih0234

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, making them hard to test and navigate. This Skill surfaces that architectural friction and proposes concrete deepening refactors, so you can decide what to fix based on evidence rather than gut feel. ## Core Features & Use Cases - Hot-spot-driven scanning: Uses git history to find frequently changed areas, then delegates exploration to a context-isolated scout agent that applies the deletion test to detect shallow modules, leaky seams, and poor locality. - Visual HTML report: Renders each candidate refactor as a self-contained HTML file (Tailwind and Mermaid via CDN) with before/after diagrams, problem/solution summaries, and a recommendation strength badge, written to the OS temp directory. - Guided decision loop: After you pick a candidate, it walks constraints, dependencies, and interface shape through a grilling workflow, updating CONTEXT.md and offering ADRs when decisions carry lasting weight. - Use Case: Run it on a service where order handling logic is scattered across six thin wrappers; get a report showing how to collapse them into one deep module with a single testable interface. ## Quick Start Ask the agent to scan this repository for architecture improvements and show me the deepening candidates as an HTML report.

Frequently Asked Questions about improve-codebase-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find shallow modules in my codebase?▼

Run the scan, which walks recent git history to find hot spots, then delegates exploration to a scout agent. It applies the deletion test: if deleting a module would concentrate complexity rather than move it, that module is a deepening candidate.

What is a deep module versus a shallow module?▼

A shallow module has an interface nearly as complex as its implementation, offering little leverage. A deep module hides substantial implementation behind a small interface, so tests target one interface and bugs concentrate in one place.

Does the architecture report write files into my repository?▼

No. The HTML report is written to the OS temp directory ($TMPDIR, /tmp, or %TEMP%) and opened in your browser. Only the scout agent's exploration artifact lands in .scratch, and any unexpected repo change stops the run.

Can I use this with existing ADRs and architecture decision records?▼

Yes. The scan reads ADRs in docs/adr/ first and avoids re-litigating settled decisions. If a candidate contradicts an ADR, it is only surfaced with a clear warning callout when the friction justifies reopening the decision.

What happens after I pick a refactoring candidate?▼

A grilling loop walks the decision tree with you: constraints, dependencies, the deepened module's shape, and what sits behind the seam. New domain terms are added to CONTEXT.md, and load-bearing rejections can be recorded as ADRs.