improve-codebase-architecture

Analyze codebases to surface shallow modules and propose deepening refactors with HTML reports.

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/afonsoft/gamehub --skill improve-codebase-architecture-afonsoft
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/afonsoft/gamehub/tree/main/.claude/skills/improve-codebase-architecture
Command: npx skills add https://github.com/afonsoft/gamehub --skill improve-codebase-architecture-afonsoft

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

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 identifies that architectural friction and proposes deepening refactors that consolidate tightly-coupled modules behind smaller interfaces. ## Core Features & Use Cases - Architecture exploration: Spawns a read-only exploration pass over the codebase, applying the deletion test to find shallow modules, leaked seams, and untestable areas. - Visual HTML report: Generates a self-contained HTML report (Tailwind and Mermaid via CDN) in the OS temp directory with before/after diagrams, recommendation-strength badges, and a top recommendation. - Guided design conversation: Runs a grilling loop on the chosen candidate, with optional parallel sub-agents producing radically different interface designs (Design It Twice), and records decisions in .claude/CONTEXT.md or SPEC files. - Use Case: A maintainer suspects the order intake pipeline is over-fragmented. Run the Skill to get a visual report of deepening candidates, pick one, and explore alternative interfaces before committing to a refactor. ## Quick Start Ask the assistant to run improve-codebase-architecture on this repository and open the generated architecture review 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 Skill's exploration pass, which walks the codebase and applies the deletion test: imagine deleting a module and check whether complexity vanishes (pass-through) or reappears across callers (earning its keep). Candidates are presented in an HTML report with before/after diagrams.

What is a deep module versus a shallow module?▼

Depth is leverage at the interface: a deep module hides a large amount of behaviour behind a small interface, while a shallow module's interface is nearly as complex as its implementation. The Skill uses this vocabulary consistently across all suggestions.

Does the architecture review modify my repository files?▼

The HTML report is written to the OS temp directory, not the repo. The only repo writes happen during the grilling conversation: new domain terms may be added to .claude/CONTEXT.md, and rejected candidates can optionally be recorded as SPEC files under .specs/.

How does the Skill handle external dependencies when deepening modules?▼

Dependencies are classified into four categories: in-process, local-substitutable, remote but owned (ports and adapters), and true external (mock). The category determines the testing strategy, and a seam is only introduced when at least two adapters justify it.

When should I not introduce a new interface or seam?▼

Avoid a seam when only one adapter exists, since a single-adapter seam is just indirection. The Skill's rule is that one adapter means a hypothetical seam while two adapters (typically production plus test) make it real.