codebase-design

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

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/kashman001/ai-workspace-template --skill codebase-design-kashman001
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/kashman001/ai-workspace-template/tree/main/skills/codebase-design
Command: npx skills add https://github.com/kashman001/ai-workspace-template --skill codebase-design-kashman001

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 decision framework for designing 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, per DEEPENING.md. - Parallel interface exploration: DESIGN-IT-TWICE.md orchestrates multiple sub-agents to propose radically different interfaces, 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, merge the modules behind one small interface, and rewrite tests against that interface instead of internals. ## Quick Start Ask the agent to review a module in your codebase and suggest how to deepen its 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 capability 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 and where behavior can be altered without editing that 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. 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?▼

Write tests at the deepened module's interface and delete old unit tests on the shallow modules it absorbed. Tests should assert observable outcomes through the interface and survive internal refactors, since the interface is the test surface.

How do I handle third-party dependencies when deepening modules?▼

Treat true external services like Stripe or Twilio as injected ports, with tests providing a mock adapter. For remote services you own, define a port with an HTTP adapter for production and an in-memory adapter for tests.

When should I not deepen a module?▼

Avoid deepening when it only creates pass-through indirection. Apply the deletion test: if deleting the module makes complexity vanish rather than reappear across callers, it was not earning its keep.