codebase-design

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

Updated Apr 16, 2025
One-click install
npx skills add https://github.com/damoke012/eks_code --skill codebase-design-damoke012
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/damoke012/eks_code/tree/main/.claude-env/skills/codebase-design
Command: npx skills add https://github.com/damoke012/eks_code --skill codebase-design-damoke012

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: a lot of behaviour behind a small interface, placed at a clean seam. ## 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. - Deepening guidance: Classifies dependencies (in-process, local-substitutable, remote-owned, true external) and prescribes ports-and-adapters strategies plus replace-don't-layer testing 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 ports and adapters, and how to restructure tests around 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 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 behaviour can be altered without editing in place.

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. One adapter means a hypothetical seam; a single-adapter seam is just indirection.

How do I test a deepened module?▼

Write tests at the deepened module's interface, since the interface is the test surface. Delete old unit tests on the shallow modules, and assert on observable outcomes so tests survive internal refactors.

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

Treat true external services like Stripe or Twilio as injected ports. The deepened module owns the logic, production uses the real client as an adapter, and tests provide a mock adapter.

When should I not deepen a module?▼

Avoid deepening when it only adds indirection, such as introducing a seam with a single adapter. Use the deletion test: if deleting the module makes complexity vanish rather than reappear across callers, it was a pass-through.