improve-codebase-architecture

Scan a codebase for shallow modules and present deepening refactors as a visual HTML report.

7|1|Updated Jul 17, 2026
One-click install
npx skills add https://github.com/J0Jng/MathModelingAgents --skill improve-codebase-architecture-j0jng
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/J0Jng/MathModelingAgents/tree/main/.claude/skills/improve-codebase-architecture
Command: npx skills add https://github.com/J0Jng/MathModelingAgents --skill improve-codebase-architecture-j0jng

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 hard for AI agents to navigate. This Skill surfaces that architectural friction and proposes concrete deepening refactors instead of vague cleanup advice. ## Core Features & Use Cases - Hot-spot-driven exploration: Scopes the review using git history and user direction, then explores the codebase for shallow modules, seam leakage, and poor locality. - Visual HTML report: Renders each refactor candidate as a self-contained HTML file with Tailwind and Mermaid before/after diagrams, recommendation-strength badges, and ADR conflict callouts, written to the OS temp directory. - Guided decision loop: After the user picks a candidate, runs a grilling workflow to walk constraints and dependencies, updating CONTEXT.md and offering ADRs as decisions crystallize. - Use Case: A team notices their order intake flow bounces across six tiny wrappers. Run this Skill to get a visual report showing the shallowness, pick the top candidate, and grill through the design of one deep module with a single testable interface. ## Quick Start Ask the assistant to review this repository's architecture for deepening opportunities and show the 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 this Skill to explore the codebase starting from git history hot spots, looking for modules whose interface is nearly as complex as their implementation. It applies the deletion test to confirm whether collapsing a module would concentrate complexity rather than just move it.

What is a deep module versus a shallow module?▼

A deep module has a small interface hiding a substantial implementation, while a shallow module's interface costs nearly as much as its implementation delivers. The Skill uses this vocabulary from the companion codebase-design skill to frame every refactor candidate.

What output does the architecture review produce?▼

It writes a self-contained HTML report to the OS temp directory and opens it in the browser. Each candidate gets a card with files, problem, solution, benefits, a before/after diagram using Mermaid or hand-built SVG, and a recommendation-strength badge.

Does the architecture review respect existing ADRs?▼

Yes, it reads ADRs in docs/adr/ before proposing candidates and avoids re-litigating recorded decisions. A candidate that contradicts an ADR is only surfaced with a clear warning callout when the friction justifies reopening the decision.

When should I not use this architecture review approach?▼

Skip it for greenfield code with no history to scope the review, or when you already know the exact refactor you want and just need implementation. The Skill targets discovering and deciding between deepening opportunities, not executing a predetermined refactor.