improve-codebase-architecture

Identifies shallow modules and proposes deepening refactors rendered as an HTML architecture report.

Updated May 23, 2026
One-click install
npx skills add https://github.com/kveperedo/website --skill improve-codebase-architecture-kveperedo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/kveperedo/website/tree/main/.agents/skills/improve-codebase-architecture
Command: npx skills add https://github.com/kveperedo/website --skill improve-codebase-architecture-kveperedo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, scattering logic across tightly-coupled files and making testing and navigation difficult. This Skill surfaces that architectural friction and proposes concrete deepening refactors grounded in the project's own domain language and recorded ADR decisions. ## Core Features & Use Cases - Architecture exploration: Walks the codebase with an Explore sub-agent to find shallow modules, leaking seams, and pass-through abstractions, applying the deletion test to each candidate. - HTML review report: Renders candidates as a self-contained HTML file with Tailwind and Mermaid before/after diagrams, recommendation-strength badges, and a top recommendation section. - Guided design conversation: Runs a grilling loop on the chosen candidate, updates CONTEXT.md with new domain terms, offers ADRs for rejected candidates, and spawns parallel sub-agents to design alternative interfaces. - Use Case: A team inherits a service where order processing logic is split across six thin wrappers. Run this Skill to get a visual report showing how to collapse them into one deep module with a single testable interface. ## Quick Start Ask the assistant to review this repository's architecture and propose deepening opportunities using the improve-codebase-architecture skill.

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 refactoring opportunities in a legacy codebase?▼

Run an architecture review that explores the codebase for shallow modules whose interfaces match their implementation complexity. Each candidate is presented with a before/after diagram, problem statement, and recommendation strength so you can pick what to refactor first.

What is a deep module versus a shallow module?▼

A deep module hides a large amount of behaviour behind a small interface, giving callers leverage and maintainers locality. A shallow module has an interface nearly as complex as its implementation, adding indirection without hiding complexity.

How does the architecture review handle existing ADRs?▼

The review reads ADRs before suggesting changes and avoids re-litigating recorded decisions. A candidate that contradicts an ADR is only surfaced when the friction justifies reopening it, and it is marked with a warning callout in the report.

What output does the architecture review produce?▼

It writes a single self-contained HTML file to the OS temp directory, styled with Tailwind and using Mermaid for dependency and sequence diagrams. Each candidate card shows files involved, the problem, the solution, benefits, and a before/after visualization.

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

Avoid a seam when only one adapter would ever satisfy it, since a single-adapter seam is just indirection. Introduce a port only when at least two adapters are justified, typically a production adapter and an in-memory test adapter.