codebase-design

Designs deep modules with small interfaces placed at clean seams.

2|Updated Jul 11, 2026
One-click install
npx skills add https://github.com/MoofonLi/dev-ready --skill codebase-design-moofonli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/MoofonLi/dev-ready/tree/main/.agents/skills/codebase-design
Command: npx skills add https://github.com/MoofonLi/dev-ready --skill codebase-design-moofonli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases often accumulate shallow modules whose interfaces are nearly as complex as their implementations, making code hard to test, navigate, and maintain. This Skill provides a shared vocabulary and design principles for creating deep modules that hide complexity behind small interfaces. ## Core Features & Use Cases - Deep-module vocabulary: Defines precise terms (module, interface, seam, adapter, depth, leverage, locality) so teams and AI agents discuss architecture consistently. - Dependency-aware deepening: Classifies dependencies (in-process, local-substitutable, remote-owned, true external) and prescribes ports-and-adapters strategies for each, with replace-don't-layer testing guidance. - Design It Twice workflow: Spawns parallel sub-agents to produce radically different interface designs for a candidate module, then compares them on depth, locality, and seam placement. - Use Case: When refactoring a tangled cluster of shallow service classes, use this Skill to identify the right seam, design a minimal interface, and restructure tests to target the interface rather than internals. ## Quick Start Ask the agent to review a module in your codebase and propose a deeper 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 behavior behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside the implementation. The interface includes everything a caller must know: types, invariants, ordering, error modes, and performance characteristics.

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 code. The interface is the surface callers use. Seam placement is its own 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 production plus test. One adapter means a hypothetical seam and is just indirection. Use ports for remote-owned or true external dependencies like third-party services.

How do I test a deepened module after refactoring?

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

What is the Design It Twice process?

Design It Twice spawns three or more parallel sub-agents, each producing a radically different interface under different constraints such as minimal surface, maximum flexibility, or common-case optimization. The designs are then compared on depth, locality, and seam placement.