codebase-design

Guides deep module design with shared vocabulary for interfaces, seams, and adapters.

Updated Sep 14, 2026
One-click install
npx skills add https://github.com/Suge8/skills --skill codebase-design-suge8
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/Suge8/skills/tree/main/development/codebase-design
Command: npx skills add https://github.com/Suge8/skills --skill codebase-design-suge8

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases often accumulate shallow modules with large interfaces and thin pass-through implementations, making code hard to test, refactor, and navigate. This Skill provides a rigorous shared vocabulary and design principles for building deep modules that hide substantial behavior behind small interfaces. ## Core Features & Use Cases - Deep Module Vocabulary: Enforces consistent terms—module, interface, implementation, depth, seam, adapter, leverage, locality—so teams and AI agents discuss architecture without ambiguity. - Dependency-Based Deepening: Classifies dependencies (in-process, locally substitutable, remote-but-owned, truly external) and prescribes port-and-adapter strategies for each, per DEEPENING.md. - Parallel Interface Exploration: Uses a Design-It-Twice pattern that launches multiple subagents to produce contrasting interface designs, then compares them on depth, locality, and seam placement. - Use Case: When refactoring a tangled service layer, use this Skill to identify deepening candidates, decide where seams belong, and design a small testable interface with injected adapters. ## Quick Start Ask the agent to review a module in your codebase and propose a deeper interface using the codebase-design vocabulary and seam discipline.

Frequently Asked Questions about codebase-design

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

FAQPage Schema
How do I design a deep module interface?▼

A deep module hides substantial behavior behind a small interface. Reduce method count, simplify parameters, and move complexity behind the interface. Judge depth by leverage: how much behavior callers gain per unit of interface they must learn.

What is a seam in software design?▼

A seam, from Michael Feathers, is a location where behavior can change without editing that code—where a module's interface sits. Introduce a seam only when at least two adapters justify it, such as a production adapter plus a test adapter.

When should I use ports and adapters for dependencies?▼

Use ports and adapters for remote-but-owned services and truly external third-party dependencies. Define a port at the seam, inject an HTTP or queue adapter in production, and use in-memory or mock adapters in tests.

How does interface design affect testability?▼

Testable interfaces receive dependencies rather than creating them, return results rather than producing side effects, and keep the surface small. The interface is the test surface—tests assert observable behavior through it, not internal state.

What is the Design It Twice approach?▼

Design It Twice launches three or more parallel subagents, each producing a contrasting interface under different constraints such as minimal surface or maximum flexibility. Designs are then compared on depth, locality, and seam placement before recommending one.

When should old unit tests be deleted during refactoring?▼

Delete old unit tests on shallow modules once the deepened module's interface has its own tests. Tests should target the interface and survive internal refactoring; keeping redundant tests on internals creates maintenance burden.