improve-codebase-architecture

Identify shallow modules and architectural friction to improve codebase locality and leverage.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/mpsuesser/workspace --skill improve-codebase-architecture-mpsuesser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/mpsuesser/workspace/tree/main/dotconfig/pi/agent/skills/.deprecated/improve-codebase-architecture
Command: npx skills add https://github.com/mpsuesser/workspace --skill improve-codebase-architecture-mpsuesser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Shallow, tightly-coupled modules make it hard to understand behavior, test changes confidently, and evolve architecture without breaking callers.

Core Features & Use Cases

  • Exploration-driven deepening: identifies where deleting or consolidating modules would concentrate complexity and improve Locality and Leverage.
  • Architecture opportunity framing: produces a clear list of deepening candidates with modules/files involved, the friction caused today, and the refactoring direction.
  • Architecture grilling loop: iteratively refines the deepened module shape by focusing on Module, Interface, Seam, Adapter, dependencies, and test strategy.

Quick Start

Use the skill to explore your repository’s architecture and propose deepening candidates for improving testability and AI-navigability.

Frequently Asked Questions about improve-codebase-architecture

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify shallow modules and improve codebase architecture for testability?

You identify shallow modules causing architectural friction, then consolidate tightly-coupled code to concentrate complexity and increase module depth. This process enhances locality and leverage while making behavior testable through defined interfaces.

What is the ports and adapters pattern and when do I need seams for refactoring?

Seams for ports and adapters are interface boundaries separating dependency categories during refactoring. You need them when making behavior testable through interfaces, allowing you to isolate external dependencies and define clear adapter implementations for your architecture.

How do I explore a codebase to find refactoring opportunities and tightly-coupled code?

You explore a codebase to find refactoring opportunities by scanning for shallow modules and architectural friction that reduces locality. The exploration produces prioritized deepening candidates with module-level evidence, detailing files involved and friction caused today.

What is the best way to make tightly-coupled code testable through interfaces?

The best way to make tightly-coupled code testable is defining seams for ports and adapters, then using an iterative grilling loop to refine the deepened module shape. This preserves the interface-as-test-surface and deletion-test principles while clarifying dependencies and test strategy.

Does this architecture refactoring approach work for any dependency category?

Yes, this architecture refactoring approach applies across dependency categories by defining seams for ports and adapters tailored to each type. It supports consolidating tightly-coupled code regardless of the specific external dependency boundaries in your codebase.

Why does deleting or consolidating modules improve codebase testability and AI-navigability?

Deleting or consolidating shallow modules improves testability and AI-navigability by concentrating complexity into deeper modules with higher leverage. This reduces architectural friction, increases locality of behavior, and establishes clear interfaces as test surfaces for confident changes.