deep-modules
Skill0 starsChanged 37 days agoMITView on GitHub
The vocabulary and the moves for designing deep modules: a lot of behaviour behind a small interface at a clean seam, testable through that interface. Module, interface, implementation, depth, seam, adapter, payback, locality, used exactly. Deepening a cluster given its dependency category, and exploring alternative interfaces with parallel agents only after the decider agrees to the fan-out. Triggers on: "design the interface", "where should the seam go", "deepen this", "module boundary", "make this testable", "too many small modules", "ports and adapters", "design it twice", "which abstraction".
5 other projects use a version of this.
Adopted by
Most recently taken up by
- AdityaZxxx/skillstheir own version, first seen Oct 20, 2026
- sammasak/skillstheir own version, first seen Oct 17, 2026
- sammasak/claude-code-skillstheir own version, first seen Oct 13, 2026
- codybrom/clairvoyancetheir own version, first seen Jul 1, 2026
- preetamnath/agent-skillstheir own version, first seen Apr 24, 2026
Other versions5 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 5
- codybrom/clairvoyance★ 12same name
- preetamnath/agent-skills★ 4same name
- AdityaZxxx/skills★ 1same name
- sammasak/claude-code-skills★ 1same name
- sammasak/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cut-ticketsSkill
- decision-recordsSkill
- evidenceSkill
- grill-planSkill
- plain-voiceSkill
- plan-projectSkill
- review-changeSkill
- setup-conventionsSkill
- test-firstSkill
- thin-slicesSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
Use these words exactly in module design.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Deep modules
Design deep modules: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. The aim is payback for callers, locality for maintainers, and testability for everyone.
Vocabulary
Use these words exactly in module design; do not substitute "component", "service" or "API" for module and interface, or "boundary" for seam. "Boundary" keeps its other senses: a bounded context, and the system boundary where test-first puts its mocks.
| Term | Is | Avoid |
| Module | Anything with an interface and an implementation: a function, a class, a package, a tier-spanning slice. | unit, component, service |
| Interface | Everything a caller must know to use the module correctly: types, invariants, ordering, error modes, required configuration, performance characteristics. | API, signature |
| Implementation | What is inside the module. | |
| Depth | Behaviour a caller or a test can exercise per unit of interface learned. Deep: a lot behind a little. Shallow: the interface is nearly as complex as the implementation. | |
| Seam | Michael Feathers' term: a place where behaviour can be altered without editing in that place; where a module's interface lives. Where the seam goes is its own decision. | boundary |
| Adapter | A concrete thing that satisfies an interface at a seam. A role, not a substance. | |
| Payback | What callers get from depth: one implementation pays back across N call sites and M tests. | leverage (Ousterhout's and the upstream's word; kept out of this set because VOICE-6 bans it as a verb) <!-- voice-lint: skip --> |
| Locality | What maintainers get from depth: change, bugs and knowledge concentrate in one place. |
The rules
| Id | Rule | In practice |
| DESIGN-1 | Deep modules | Fewer methods, simpler parameters, more hidden. The deletion test: delete the module; if complexity vanishes it was a pass-through, if it reappears across N callers it was earning its keep. |
| DESIGN-2 | The interface is the test surface | Callers and tests cross the same seam. Wanting to test past the interface means the module is the wrong shape. A module can have internal seams for its own tests without exposing them. |
| DESIGN-3 | Two adapters make a seam | One adapter is a hypothetical seam: indirection with no variation. Production plus test counts as two. |
| DESIGN-4 | Replace tests after deepening | Old tests at the shallow modules become waste once tests at the deepened interface exist; delete them. New tests assert observable outcomes through the interface and survive internal refactors. |
| DESIGN-5 | Design it twice, with consent | Ask before a fan-out. With consent, three or more agents each produce a radically different interface; compare on depth, locality and seam placement; recommend one, or a hybrid. Without consent, one design at a time. |
Designing for testability
Accept dependencies, do not create them. Return results, do not produce side effects. Keep the surface small: fewer methods mean fewer tests, fewer parameters mean simpler setup.
Rejected framings
Depth as a ratio of implementation lines to interface lines rewards padding; depth is payback. "Interface" as the language keyword or a class's public methods is too narrow. "Boundary" is overloaded with bounded contexts; say seam or interface.
Going deeper
- Deepening a cluster given its dependencies:
references/deepening.md. - Exploring alternative interfaces in parallel:
references/design-it-twice.md.
Companion skills
| Need | Skill |
| Agreeing the seams before tests (TEST-1) | invoke test-first after this skill |
| Recording a seam placement that is hard to reverse | decision-records |
| The questions that settle the design | grill-plan |
Sources
John Ousterhout, A Philosophy of Software Design (deep modules, design it twice). Michael Feathers, Working Effectively with Legacy Code (seams). codebase-design (mattpocock/skills, MIT).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

