codebase-design

Designs deep modules with small interfaces placed at clean seams.

Updated Jul 22, 2026
One-click install
npx skills add https://github.com/Chau165/local_skill --skill codebase-design-chau165
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/Chau165/local_skill/tree/main/codex/skills/codebase-design
Command: npx skills add https://github.com/Chau165/local_skill --skill codebase-design-chau165

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 decide where the seam belongs, define one deep interface, and write tests at that interface instead of layering mocks. ## Quick Start Ask the AI 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 implementation behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside. Accept dependencies as parameters and return results rather than producing side effects so the interface stays testable.

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 change without editing that spot. The interface is everything a caller must know to use the module, including invariants, ordering, and error modes.

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, which is just indirection without payoff.

How do I test a deepened module?

Write tests at the deepened module's interface, asserting observable outcomes rather than internal state. Delete old unit tests on the shallow modules once interface-level tests exist, since tests should survive internal refactors.

What are the limitations of the deep-module approach?

Depth measured as implementation-lines to interface-lines rewards padding, so this Skill uses depth-as-leverage instead. Over-merging can also hide legitimate variation, so seams should only exist where behavior actually varies across adapters.