improve-codebase-architecture

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

Updated May 9, 2024
One-click install
npx skills add https://github.com/AceCodePt/dotfiles --skill improve-codebase-architecture-acecodept
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/AceCodePt/dotfiles/tree/main/.config/opencode/flows/improve-codebase-architecture
Command: npx skills add https://github.com/AceCodePt/dotfiles --skill improve-codebase-architecture-acecodept

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 those architectural friction points and presents concrete deepening refactors as a visual report, then walks you through the trade-offs of whichever one you pick. ## Core Features & Use Cases - Hot-spot-driven exploration: Scopes the scan using recent commit history (git log) or a user-named direction, then spawns a sub-agent to find shallow modules, seam leakage, and poor locality. - Visual HTML report: Writes a self-contained Tailwind + Mermaid HTML file to the OS temp directory with before/after diagrams, recommendation-strength badges, and ADR conflict callouts for each candidate. - Guided decision loop: After you pick a candidate, runs a grilling workflow to explore constraints and dependencies, updating CONTEXT.md and offering ADRs as decisions crystallize. - Use Case: Point it at a subsystem where bugs keep recurring; it identifies that the Order intake module is shallow, shows a before/after diagram collapsing six wrappers into one deep module, and grills you on the new interface shape. ## Quick Start Ask the assistant to run the improve-codebase-architecture flow on the part of the codebase that has changed most recently and open the resulting 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 flow to scan recent commit history for hot spots, then a sub-agent explores for modules whose interfaces nearly match their implementations. It applies the deletion test: if deleting a module would concentrate complexity rather than move it, that module is a deepening candidate.

What does the architecture review report look like?▼

The report is a single self-contained HTML file written to the OS temp directory, styled with Tailwind via CDN and diagrammed with Mermaid plus hand-built SVG. Each candidate card shows files, problem, solution, benefits, a before/after diagram, and a recommendation-strength badge.

Does the architecture review write files into my repository?▼

No, the HTML report is written to the OS temp directory resolved from $TMPDIR or /tmp, so nothing lands in the repo. The only repo changes happen later if you accept updates to CONTEXT.md or choose to record an ADR during the grilling loop.

How does the review handle existing ADRs that conflict with a suggestion?▼

Candidates that contradict an existing ADR are only surfaced when the friction is real enough to warrant revisiting the decision. The card is marked with a warning callout explaining why the ADR should be reopened, rather than listing every refactor an ADR forbids.

What happens after I pick a candidate from the report?▼

The flow runs a grilling loop that walks the decision tree with you: constraints, dependencies, the shape of the deepened module, and what tests survive. New domain terms are added to CONTEXT.md inline, and load-bearing rejections can be recorded as ADRs.