codebase-design

Designs deep modules with small interfaces, clean seams, and testable adapters.

1|Updated Mar 2, 2025
One-click install
npx skills add https://github.com/marjorg/setup --skill codebase-design-marjorg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/marjorg/setup/tree/main/home/.agents/skills/archive/0-matt/codebase-design
Command: npx skills add https://github.com/marjorg/setup --skill codebase-design-marjorg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, making code hard to test, navigate, and change. This Skill provides a shared vocabulary and decision framework for designing deep modules that hide complexity behind small interfaces. ## Core Features & Use Cases - Deep-module vocabulary: Precise definitions of module, interface, seam, adapter, depth, leverage, and locality so teams and AI agents name things consistently. - Dependency-aware deepening: Classifies dependencies (in-process, local-substitutable, remote-owned, true external) and prescribes ports-and-adapters strategies for each, per DEEPENING.md. - Parallel interface exploration: DESIGN-IT-TWICE.md spawns multiple sub-agents to propose radically different interfaces, then compares them on depth, locality, and seam placement. - Use Case: When refactoring a cluster of shallow service classes, use this Skill to identify the right seam, define a port with production and in-memory test adapters, and rewrite tests against the new deep interface. ## Quick Start Ask the AI to review a module in your codebase and suggest how to deepen its interface using the codebase-design vocabulary.

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 behaviour behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside the implementation so callers get more leverage per unit of interface they must learn.

What is the difference between a seam and an interface?

An interface is everything a caller must know to use a module, including invariants, ordering, and error modes. A seam is the location where that interface lives, a place where behaviour can be altered without editing in place.

When should I introduce a port and adapter?

Introduce a port only when at least two adapters are justified, typically a production adapter and an in-memory test adapter. A single-adapter seam is just indirection and should be avoided.

How do I test a deepened module with external dependencies?

Inject the external dependency as a port and provide a mock adapter in tests. Write tests at the deepened module's interface, assert on observable outcomes, and delete old unit tests on the shallow modules it replaced.

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 public interface just because tests use them.