codebase-design

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

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/gmackie/agent-skills --skill codebase-design-gmackie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/gmackie/agent-skills/tree/main/skills/codebase-design
Command: npx skills add https://github.com/gmackie/agent-skills --skill codebase-design-gmackie

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 design principles for creating 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 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 merge them into one deep module, define a port at the seam, and rewrite tests against 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 behaviour behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside. Ask whether deleting the module would remove complexity or just push it back onto callers.

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 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 production plus test. A single-adapter seam is just indirection. Use ports for remote-but-owned services and true external dependencies like Stripe.

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. Tests should assert observable outcomes through the interface and survive internal refactors.

What is the Design It Twice technique?▼

Design It Twice spawns three or more parallel sub-agents, each producing a radically different interface under different constraints such as minimal surface or maximum flexibility. The designs are then compared on depth, locality, and seam placement.

When should old unit tests be deleted after deepening modules?▼

Delete old unit tests on shallow modules once tests exist at the deepened module's interface. The interface becomes the test surface, and tests targeting internals become waste that breaks on every refactor.