codebase-design

Designs deep modules with small interfaces placed at clean, testable seams.

3|Updated Oct 28, 2020
One-click install
npx skills add https://github.com/k0d3x8its/dotfiles --skill codebase-design-k0d3x8its
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/k0d3x8its/dotfiles/tree/main/claude/.claude/skills/codebase-design
Command: npx skills add https://github.com/k0d3x8its/dotfiles --skill codebase-design-k0d3x8its

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, spreading logic across callers and making testing painful. This Skill provides a shared vocabulary and principles for designing deep modules that hide complexity behind small interfaces. ## Core Features & Use Cases - Deep-module vocabulary: Defines module, interface, depth, seam, adapter, leverage, and locality so teams discuss design decisions with consistent language. - Deepening guidance: Classifies dependencies (in-process, local-substitutable, remote-owned, true external) and prescribes ports-and-adapters or mock strategies for each, with replace-don't-layer testing discipline. - Design It Twice workflow: Spawns parallel sub-agents to produce radically different interface proposals, then compares them on depth, locality, and seam placement. - Use Case: When refactoring a cluster of shallow service functions, use this Skill to identify the right seam, merge the modules into one deep module, and rewrite tests against the new interface. ## Quick Start Ask the AI to review a module's interface using the codebase-design vocabulary and suggest deepening opportunities with a seam and adapter strategy.

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 puts a large amount of behavior behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside the implementation. The interface includes invariants, ordering constraints, and error modes, not just type signatures.

What is the difference between a seam and an interface?▼

A seam is the location where a module's interface lives, a place where behavior can be altered without editing that spot. The interface is everything a caller must know to use the module. Seam placement is a design decision distinct from what goes behind it.

When should I introduce a port and adapter?▼

Introduce a port only when at least two adapters are justified, typically a production adapter and a test adapter. One adapter means a hypothetical seam that is just indirection. Use ports for remote-owned or true external dependencies.

How do I test a deepened module?▼

Write tests at the deepened module's interface, which is the test surface, and delete old unit tests on the shallow modules it replaced. Tests should assert observable outcomes and survive internal refactors without changing.

What are the limitations of the deep module approach?▼

Depth measured as implementation-lines to interface-lines is rejected because it rewards padding. The approach also warns against exposing internal seams through the interface just because tests use them, and against seams with only one adapter.