codebase-design

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

3|1|Updated Jul 12, 2026
One-click install
npx skills add https://github.com/DuckKota/my-opencode-setup --skill codebase-design-duckkota
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/DuckKota/my-opencode-setup/tree/main/src/skills/codebase-design
Command: npx skills add https://github.com/DuckKota/my-opencode-setup --skill codebase-design-duckkota

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 change. 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 design 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, 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 consolidate logic into one deep module tested through its interface. ## Quick Start Ask the AI 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 so callers get more leverage per unit of interface they 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 behavior can be altered without editing in place. 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; a single-adapter seam is just indirection without real variation.

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

Classify the dependency first: use local stand-ins like PGLite for substitutable dependencies, in-memory adapters for owned remote services, and mock adapters for third-party services. Write tests at the module's interface and delete old shallow-module unit tests.

What are the limitations of the deep module approach?▼

Depth is a property of the interface, not implementation size, so padding an implementation does not create depth. The approach also rejects measuring depth as a ratio of implementation lines to interface lines, which rewards bloated code.