improve-codebase-architecture

Locate shallow modules and propose deepened interfaces for codebase architecture.

Updated Jul 2, 2025
One-click install
npx skills add https://github.com/janpeterd/dotfiles --skill improve-codebase-architecture-janpeterd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: improve-codebase-architecture
Source: https://github.com/janpeterd/dotfiles/tree/main/dot_agents/skills/improve-codebase-architecture
Command: npx skills add https://github.com/janpeterd/dotfiles --skill improve-codebase-architecture-janpeterd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Improve a codebase’s architecture by finding “shallow” modules whose interfaces don’t carry enough behavior for tests and callers, causing friction across seams and spreading complexity.

Core Features & Use Cases

  • Deepening opportunities: identify places where consolidating tightly coupled modules and moving behavior behind a smaller interface increases depth, locality, and leverage.
  • Seam-driven architecture: classify dependencies and choose seam placement using ports/adapters (including mockable and in-memory test seams) so testing matches the interface.
  • Iteration and interface design: run an explore-and-grill workflow that can propose deepened module shapes, and (when requested) generate alternative interface options using a “design it twice” pattern.

Quick Start

Use the improve-codebase-architecture skill to analyze your repository and propose the best deepening candidates by focusing on where the deletion test indicates complexity would concentrate.

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 in a codebase for refactoring?

Shallow modules are located by applying the deletion test to find interfaces failing to capture behavior for tests and callers. The skill analyzes your codebase to find these deepening opportunities where complexity concentrates across tightly coupled module seams.

What is the best way to improve codebase testability using seams and adapters?

Improve testability by classifying dependencies and choosing seam placement using ports and adapters, including mockable and in-memory test seams. This ensures testing matches the interface and moves behavior behind a smaller, deeper module boundary.

How do I make my codebase architecture more AI-navigable for exploration?

Make a codebase AI-navigable by deepening shallow modules so their interfaces capture behavior for tests and callers. Consolidating tightly coupled modules increases depth and locality, allowing AI to explore system behavior more effectively behind clear boundaries.

How does the deletion test work in software architecture refactoring?

The deletion test works by locating shallow modules whose interfaces fail to capture behavior for testing and callers. It indicates where complexity would concentrate if the module were removed, producing candidates for deepening and alternative interface design.

Can I generate alternative interface designs during codebase analysis?

Yes, alternative interface designs can be generated by requesting the optional design it twice pattern during the interactive grilling loop. The skill proposes deepened module shapes and alternative interface options after exploring codebase candidates through the deletion test.

When should I not use module deepening for architecture improvement?

Module deepening is not suitable when shallow interfaces already capture sufficient behavior for tests and callers without friction. If dependencies cannot be cleanly categorized into ports and adapters, deepening may spread complexity rather than consolidating tightly coupled modules.