codebase-design

Designs deep modules with small interfaces placed at clean, testable seams.

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/yamcodes/the-hat --skill codebase-design-yamcodes
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/yamcodes/the-hat/tree/main/skills/codebase-design
Command: npx skills add https://github.com/yamcodes/the-hat --skill codebase-design-yamcodes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate shallow modules whose interfaces are nearly as complex as their implementations, spreading change across callers and making testing painful. This Skill provides a shared vocabulary and principles for designing deep modules so interfaces stay small, behavior stays hidden, and tests cross the same seam as callers. ## Core Features & Use Cases - Deep-module vocabulary: Defines module, interface, implementation, depth, seam, adapter, leverage, and locality with explicit rejected framings 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 ports-and-adapters or mock strategies per category. - Design It Twice workflow: Spawns parallel sub-agents that each produce a radically different interface for a candidate module, then compares them on depth, locality, and seam placement. - Use Case: When refactoring a cluster of shallow repository classes, use this Skill to merge them into one deep module, define a port at the seam, and write tests only at the new interface. ## Quick Start Ask the AI to review a module's interface using the codebase-design vocabulary and suggest deepening opportunities with a seam and adapter 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 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 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, ordering, and error modes. A seam is the location where that interface lives, a place where behavior can be altered without editing in that place.

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; two adapters mean a real seam where something actually varies.

How do I make code more testable through interfaces?▼

Accept dependencies as parameters instead of constructing them, return results instead of producing side effects, and keep the surface area small. Tests should assert observable outcomes through the interface and survive internal refactors.

Should I keep old unit tests after deepening modules?▼

No. Once tests exist at the deepened module's interface, old unit tests on the shallow modules become waste and should be deleted. The interface is the test surface, so replace tests rather than layering new ones on top.