codebase-design

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

9|Updated Jul 17, 2026
One-click install
npx skills add https://github.com/Yassimba/loom --skill codebase-design-yassimba
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/Yassimba/loom/tree/main/skills/codebase-design
Command: npx skills add https://github.com/Yassimba/loom --skill codebase-design-yassimba

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: Defines precise terms (module, interface, seam, adapter, depth, leverage, locality) so teams and AI agents discuss architecture consistently. - Dependency-Aware Deepening: Classifies dependencies into four categories (in-process, local-substitutable, remote-owned, true external) and prescribes the right seam and adapter strategy for each via DEEPENING.md. - Parallel Interface Exploration: Uses a Design-It-Twice pattern that spawns multiple sub-agents to propose radically different interfaces, then compares them on depth, locality, and seam placement. - Use Case: When refactoring a tangled cluster of shallow classes, use this Skill to identify the right seam, define a port with production and in-memory test adapters, and rewrite tests against the new deep interface. ## Quick Start Use the codebase-design skill to review this module cluster and propose a deepened interface with the right seam and adapters.

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 hides a large implementation behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside. Accept dependencies as parameters rather than creating them, and return results instead of producing side effects.

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 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 an in-memory test adapter. A single-adapter seam is just indirection and should be avoided.

How do I test a deepened module?

Write tests at the deepened module's interface, treating the interface as 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, with tests providing mock adapters. For remote services you own, define a port with an HTTP adapter for production and an in-memory adapter for tests.