codebase-design

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

7|1|Updated Jul 17, 2026
One-click install
npx skills add https://github.com/J0Jng/MathModelingAgents --skill codebase-design-j0jng
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/J0Jng/MathModelingAgents/tree/main/.claude/skills/engineering/codebase-design
Command: npx skills add https://github.com/J0Jng/MathModelingAgents --skill codebase-design-j0jng

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 so interfaces stay small while behaviour concentrates behind clean seams. ## Core Features & Use Cases - Deep-module vocabulary: Precise definitions of module, interface, depth, seam, adapter, leverage, and locality, with rejected framings explicitly called out so teams use consistent language. - Dependency-aware deepening: Classifies dependencies as in-process, local-substitutable, remote-but-owned, or true external, and prescribes ports-and-adapters or mock strategies per category. - Parallel interface exploration: A Design-It-Twice workflow that 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 decide where the seam belongs, define a port with production and in-memory test adapters, and rewrite tests against the new interface. ## Quick Start Ask the assistant to review a module's interface using the codebase-design vocabulary and suggest how to deepen it.

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 a large amount of behaviour behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside. Measure depth as leverage: how much behaviour callers exercise per unit of interface they must learn.

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

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

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. One adapter means a hypothetical seam, which is just indirection without payoff.

How do I test a deepened module with external dependencies?▼

Classify the dependency first. In-process code needs no adapter, local-substitutable dependencies use stand-ins like in-memory databases, owned remote services get ports with injected adapters, and true third-party services get mock adapters in tests.

Should I keep old unit tests after deepening modules?▼

No. Old unit tests on shallow modules become waste once tests exist at the deepened module's interface. Write new tests at the interface, assert on observable outcomes, and delete the old ones so tests survive internal refactors.