improve-codebase-architecture

Analyzes codebases to find module-deepening refactoring opportunities and creates GitHub RFC issues.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/lfuuu/claude-rules --skill improve-codebase-architecture-lfuuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/lfuuu/claude-rules/tree/main/global-skills/improve-codebase-architecture
Command: npx skills add https://github.com/lfuuu/claude-rules --skill improve-codebase-architecture-lfuuu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Shallow, tightly-coupled modules make codebases hard to test, navigate, and maintain. This Skill explores a codebase the way an AI experiences it, detects architectural friction, and proposes deep-module refactorings grounded in John Ousterhout's "A Philosophy of Software Design". ## Core Features & Use Cases - Friction-Based Exploration: Uses an Explore subagent to find shallow modules, tight coupling, and untestable integration seams without rigid heuristics. - Parallel Interface Design: Launches 3+ subagents that each propose radically different interfaces (minimal, flexible, caller-optimized, ports & adapters), then compares them and gives an opinionated recommendation. - Dependency Classification: Categorizes dependencies as in-process, locally-substitutable, ports & adapters, or external mocks to define the right testing strategy. - GitHub RFC Output: Creates a structured refactoring issue via gh issue create covering the problem, proposed interface, dependency strategy, and test migration plan. - Use Case: A team has dozens of small service modules whose bugs hide in the seams between them. Run this Skill to identify consolidation candidates, pick a deepened interface design, and file an actionable refactoring RFC. ## Quick Start Ask the assistant to explore this codebase and find opportunities to improve its architecture by deepening shallow modules.

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 large codebase?

Run this Skill to explore the codebase with an Explore subagent that notes where understanding one concept requires jumping between many small files. It presents a numbered list of module-deepening candidates with coupling rationale and test impact for you to choose from.

What is a deep module in software design?

A deep module, from John Ousterhout's "A Philosophy of Software Design", has a small interface hiding a large implementation. Deep modules are easier to test at their boundary, simpler for AI to navigate, and reduce integration risk between tightly-coupled shallow modules.

How does the Skill handle external service dependencies during refactoring?

It classifies dependencies into four categories: in-process, locally-substitutable, ports & adapters, and true external services. External services are mocked at the boundary, while owned network services get a port interface with production and in-memory test adapters.

Does this Skill modify my code directly?

No. It produces analysis and a GitHub RFC issue via `gh issue create` describing the problem, proposed interface, dependency strategy, and test migration plan. Actual implementation happens separately after the team reviews the issue.

What happens to existing unit tests after deepening modules?

The strategy is replace, not layer. Old unit tests on shallow modules become redundant once boundary tests exist on the deepened module's interface, so the RFC lists which old tests to delete and which new boundary tests to write.