improve-codebase-architecture

Identifies module-deepening refactoring opportunities in codebases and drafts RFC GitHub issues.

14|1|Updated Jun 14, 2026
One-click install
npx skills add https://github.com/allemaar/open-skills --skill improve-codebase-architecture-allemaar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/allemaar/open-skills/tree/main/skills/improve-codebase-architecture
Command: npx skills add https://github.com/allemaar/open-skills --skill improve-codebase-architecture-allemaar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow, tightly-coupled modules that are hard to test, hard to navigate, and create integration risk at every seam. This Skill applies John Ousterhout's deep-module philosophy to find genuine refactoring opportunities and turn them into actionable RFCs. ## Core Features & Use Cases - Friction-Based Exploration: Navigates the codebase organically, treating navigation friction (scattered concepts, shallow modules, brittle tests) as the signal for coupling problems. - Dependency Classification: Categorizes each candidate's dependencies as in-process, local-substitutable, remote-but-owned, or true external, which determines the entire testing strategy. - Multi-Design Interface Generation: Produces 3-4 radically different interface designs (minimal, flexible, caller-optimized, ports & adapters), optionally via parallel sub-agents, with an opinionated recommendation. - RFC Issue Creation: Drafts a structured GitHub issue covering problem, proposed interface, dependency strategy, testing strategy, and implementation principles, then creates it with gh after confirmation. - Use Case: A team complains that changing one feature breaks three others and tests are brittle. Run this Skill to find the coupled module cluster, design a deepened interface, and file an RFC proposing the merge with boundary tests replacing the old unit tests. ## Quick Start Ask the agent to explore this repository, find modules that should be deepened or consolidated, and draft an RFC for the strongest refactoring candidate.

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?

Explore the codebase and note where understanding one concept requires bouncing between many small files, or where interfaces are nearly as complex as their implementations. Apply the deepening test: merging modules must produce a smaller combined interface, otherwise it is just reorganization.

What is a deep module in software design?

A deep module has a small interface hiding a large implementation, a concept from John Ousterhout's A Philosophy of Software Design. Deep modules are more testable and navigable because callers interact with a minimal boundary instead of internal complexity.

How do I make tightly coupled modules more testable?

Classify the dependencies first: in-process code merges directly, local-substitutable dependencies use stand-ins like PGLite or memfs, owned remote services get ports and adapters, and true external services get mocked at the boundary. Then write new tests at the deepened module's interface and delete the old shallow unit tests.

When should I not merge or consolidate modules?

Do not merge when the combined interface would not be smaller than the separate interfaces, since that is reorganization rather than deepening. A thin adapter over a stable external API is also correct design and should be left alone.

Does this refactoring workflow create a GitHub issue automatically?

It drafts a complete RFC covering problem, proposed interface, dependency strategy, and testing strategy, then asks for explicit confirmation before running gh issue create. If the gh CLI is unavailable, it prints the final draft for manual pasting.