codebase-design

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

6|2|Updated May 6, 2026
One-click install
npx skills add https://github.com/sek788432/Stock-Back-Test-System --skill codebase-design-sek788432
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/sek788432/Stock-Back-Test-System/tree/main/.agents/skills/codebase-design
Command: npx skills add https://github.com/sek788432/Stock-Back-Test-System --skill codebase-design-sek788432

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 refactor. 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, implementation, depth, seam, adapter, leverage, and locality, with rejected framings explicitly called out. - Dependency-aware deepening: Classifies dependencies as in-process, local-substitutable, remote-but-owned, or true external, and prescribes ports-and-adapters or mock strategies for each. - 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 decide where the seam goes, which dependencies need adapters, and how to write tests at the new interface while deleting obsolete unit tests. ## Quick Start Ask the AI to review a module's interface using the codebase-design skill and propose a deeper design with a clean seam and test strategy.

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?▼

A seam is the location where a module's interface lives — a place where behaviour can be altered without editing that code. 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. A single-adapter seam is just indirection; one adapter means a hypothetical seam, two adapters mean a real one.

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 in-memory test adapters, and third-party services get mock adapters.

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 replaced tests so tests survive internal refactors.