codebase-design

Design deep modules with shared vocabulary for interfaces, seams, and adapters.

2|Updated Jun 21, 2026
One-click install
npx skills add https://github.com/IsKenKenYa/skills --skill codebase-design-iskenkenya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/IsKenKenYa/skills/tree/main/skills/engineering/codebase-design
Command: npx skills add https://github.com/IsKenKenYa/skills --skill codebase-design-iskenkenya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams often design modules with shallow interfaces that leak complexity to every caller, making code hard to test, refactor, and navigate. This Skill provides a precise shared vocabulary (module, interface, seam, adapter, depth, leverage, locality) and design principles so engineers and AI agents can consistently design deep modules that hide complexity behind small interfaces. ## Core Features & Use Cases - Deep-module vocabulary: Defines exact terms (module, interface, implementation, seam, adapter, depth, leverage, locality) with rejected framings, so architecture discussions stay consistent across people and AI agents. - Dependency-aware deepening: DEEPENING.md classifies dependencies (in-process, local-substitutable, remote-but-owned, true external) and prescribes ports-and-adapters strategies plus replace-don't-layer testing for each category. - Design It Twice workflow: DESIGN-IT-TWICE.md orchestrates parallel sub-agents that each produce a radically different interface for a candidate module, then compares them on depth, locality, and seam placement with an opinionated recommendation. - Use Case: When refactoring a cluster of shallow service classes, use this Skill to decide where the seam belongs, define a port with production and in-memory test adapters, and write tests at the new deep interface. ## Quick Start Ask the agent to review the payment module's interface using the codebase-design vocabulary and propose a deeper design with a seam and test adapters.

Frequently Asked Questions about codebase-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is a deep module in software design?

A deep module hides a large amount of behavior behind a small interface, giving callers high leverage per unit of interface they must learn. Depth is measured at the interface, not by implementation size, and produces locality so changes concentrate in one place.

How do I decide where to put a seam when refactoring?

Classify the module's dependencies first: in-process code needs no adapter, local-substitutable dependencies use test stand-ins, remote owned services get ports with HTTP and in-memory adapters, and third-party services get mock adapters. Only introduce a seam when at least two adapters justify it.

When should I use ports and adapters architecture?

Use ports and adapters when a module's logic crosses a network boundary to services you own, or depends on third-party APIs. The deep module owns the logic, the transport is injected as an adapter, and tests use an in-memory adapter.

Should I keep old unit tests after deepening a module?

No. Once tests exist at the deepened module's interface, old unit tests on the shallow modules become waste and should be deleted. New tests assert observable outcomes through the interface so they survive internal refactors.

How does the Design It Twice process work?

It spawns three or more parallel sub-agents, each given a different design constraint such as minimizing the interface or maximizing flexibility. Each produces a complete interface proposal, which are then compared on depth, locality, and seam placement with an opinionated recommendation.