improve-codebase-architecture

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

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/mikalv/pi-extensions --skill improve-codebase-architecture-mikalv
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/mikalv/pi-extensions/tree/main/packages/pi-atelier/.agents/skills/improve-codebase-architecture
Command: npx skills add https://github.com/mikalv/pi-extensions --skill improve-codebase-architecture-mikalv

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, presented visually rather than as a wall of prose. ## Core Features & Use Cases - Hot-spot-driven exploration: Scopes the scan using git history and user direction, then explores the codebase for shallow modules, seam leakage, and poor locality. - Visual HTML report: Generates a self-contained HTML file in the OS temp directory using Tailwind and Mermaid via CDN, with before/after diagrams, recommendation-strength badges, and ADR conflict callouts for each candidate. - Guided decision loop: After the user picks a candidate, runs a grilling workflow to refine the design, updates CONTEXT.md with new domain terms, and offers ADRs for load-bearing rejections. - Use Case: A team notices their order intake logic is scattered across six thin wrappers. Run this Skill to get a visual report of deepening candidates, pick one, and walk through the refactor decision tree. ## Quick Start Ask the agent to run the improve-codebase-architecture skill on the current 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 this Skill to explore the codebase for modules whose interface is nearly as complex as their implementation. It applies the deletion test to candidates and presents each finding with a before/after diagram in an HTML report.

How to generate a visual architecture review report?▼

The Skill writes a self-contained HTML file to the OS temp directory using Tailwind and Mermaid from CDNs, then opens it in your browser. Each candidate gets a card with files, problem, solution, benefits, and a side-by-side before/after diagram.

Does the architecture review respect existing ADRs?▼

Yes, it reads ADRs in docs/adr/ before scanning and avoids re-litigating recorded decisions. Candidates that contradict an ADR are only surfaced when the friction justifies reopening it, and are marked with a warning callout.

What vocabulary does the architecture report use?▼

The report uses a fixed glossary from the codebase-design skill: module, interface, implementation, depth, seam, adapter, leverage, and locality. It avoids substitute terms like component, service, API, or boundary to keep recommendations precise.

What happens after I pick a refactoring candidate?▼

The Skill runs a grilling loop that walks the decision tree covering constraints, dependencies, and the deepened module's shape. It updates CONTEXT.md with new domain terms inline and offers to record load-bearing rejections as ADRs.