improve-codebase-architecture

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

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

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 grounded in a shared design vocabulary. ## Core Features & Use Cases - Hot-spot-driven exploration: Scopes the scan using commit history (git log) to focus on recently changed areas, then spawns a sub-agent to find shallow modules, seam leakage, and poor locality. - Visual HTML report: Renders candidates as 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. - Grilling loop: After the user picks a candidate, runs a structured decision-tree conversation and keeps CONTEXT.md and ADRs current as decisions crystallize. - Use Case: Point it at a subsystem where tests keep breaking across many small wrappers; it identifies the shallow modules, shows a before/after diagram of collapsing them into one deep module, and walks you through the refactor decision. ## Quick Start Ask the agent to review this codebase's architecture and show me deepening opportunities 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 scan the codebase for modules whose interface is nearly as complex as their implementation. It applies the deletion test—asking whether deleting a module would concentrate complexity—and presents each finding with a before/after diagram.

What is a deepening refactor in software architecture?▼

A deepening refactor turns a shallow module into a deep one: a small interface hiding a large implementation. The Skill uses this vocabulary from the codebase-design skill and proposes candidates ranked Strong, Worth exploring, or Speculative.

Does the architecture report write files into my repository?▼

No. The HTML report is written to the OS temp directory (resolved from $TMPDIR, falling back to /tmp or %TEMP%) with a timestamped filename, then opened in your browser. Nothing lands in the repo.

How does the skill handle existing ADRs?▼

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

What happens after I pick a refactoring candidate?▼

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