codebase-design

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

Updated Jul 16, 2026
One-click install
npx skills add https://github.com/The-Focus-AI/walking-thoughts --skill codebase-design-the-focus-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-design
Source: https://github.com/The-Focus-AI/walking-thoughts/tree/main/.agents/skills/codebase-design
Command: npx skills add https://github.com/The-Focus-AI/walking-thoughts --skill codebase-design-the-focus-ai

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 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 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 per 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. - 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 or package in your repository and propose a deeper 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?

Start by reducing the number of methods and simplifying parameters so more behaviour hides behind less surface. Accept dependencies rather than creating them, return results instead of producing side effects, and verify depth with the deletion test: if deleting the module spreads complexity across callers, it earns 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 spot. The interface is everything a caller must know to use the module: types, 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; 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, treating the interface as the test surface, and delete old unit tests on the shallow modules it replaced. Tests assert observable outcomes through the interface so they survive internal refactors.

How does the Design It Twice process work?

It frames the problem space and constraints, then spawns three or more parallel sub-agents that each design a radically different interface under distinct constraints such as minimal surface or maximum flexibility. The designs are compared on depth, locality, and seam placement, followed by an opinionated recommendation.

When is deepening a module not appropriate?

Avoid deepening when a dependency has no local test stand-in and no justified second adapter, or when the module is a genuine pass-through where merging adds no leverage. Forcing a seam without variation across it only adds indirection.