codebase-design

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

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

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, seam, adapter, depth, leverage, and locality so teams and AI agents name things consistently. - Dependency-aware deepening: Classifies dependencies as in-process, local-substitutable, remote-but-owned, or true external, and prescribes the right seam and adapter strategy 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, whether a port-and-adapter pair is justified, and how to write tests at the new interface. ## 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 puts a large amount of behavior behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside the implementation. Measure depth as leverage: how much behavior callers get per unit of interface they must learn.

What is the difference between a seam and an interface?

An interface is everything a caller must know to use a module, including invariants, error modes, and ordering constraints. A seam is the location where that interface lives, a place where behavior can be altered without editing in place.

When should I use ports and adapters in module design?

Use ports and adapters when a dependency crosses a network boundary you own, such as internal microservices. Only introduce a seam when at least two adapters are justified, typically a production adapter and an in-memory test adapter.

How do I make code more testable through its interface?

Accept dependencies as parameters instead of constructing them, return results instead of producing side effects, and keep the surface area small. Write tests at the module's interface and delete old unit tests on shallow modules once interface-level tests exist.

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. A single-adapter seam is just indirection, and exposing internal seams through the interface breaks the module's shape.