codebase-design

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

Updated May 31, 2026
One-click install
npx skills add https://github.com/AlexanderNarbaev/agi --skill codebase-design-alexandernarbaev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/AlexanderNarbaev/agi/tree/main/.opencode/skills/matt-pocock/codebase-design
Command: npx skills add https://github.com/AlexanderNarbaev/agi --skill codebase-design-alexandernarbaev

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 refactor. This Skill provides a shared vocabulary and decision framework for designing deep modules so interfaces stay small while behaviour concentrates behind clean seams. ## Core Features & Use Cases - Deep-module vocabulary: Precise definitions of module, interface, seam, adapter, depth, leverage, and locality, with rejected framings explicitly called out to keep language consistent across a team. - 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 category. - Design It Twice workflow: Spawns 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 goes, define a port with production and in-memory test adapters, and rewrite tests against the new deep interface. ## Quick Start Ask the assistant to review a module's interface using the codebase-design vocabulary and propose a deeper design with a clear seam and test strategy.

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 amount of behaviour behind a small interface. Reduce the number of methods, simplify parameters, and hide complexity inside. Ask whether deleting the module would make complexity vanish (pass-through) or reappear across callers (earning its keep).

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 be altered without editing that code. The interface is everything a caller must know to use the module: signatures, invariants, ordering, error modes, and performance characteristics.

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. Use ports for remote-but-owned services and true external dependencies like third-party APIs.

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 it replaced, and assert on observable outcomes rather than internal state so tests survive internal refactors.

What is the Design It Twice approach for interfaces?

Design It Twice spawns multiple parallel sub-agents, each producing a radically different interface under distinct constraints such as minimal surface, maximum flexibility, or common-caller optimization. The designs are then compared on depth, locality, and seam placement with an opinionated recommendation.