principle-small-door-big-room
Skill1 starsChanged 40 days agoMITView on GitHub
Apply when designing or restructuring a module, choosing where a seam goes, or when code is shallow, pass-through heavy, hard to test, or hard to navigate. Build deep modules: a lot of behavior behind a small interface, tested through that interface.
In this repository58 other files it gives its agents.
- architectSkill
- arenaSkill
- automate-meSkill
- benchmark-checklistSkill
- blast-radiusSkill
- browser-useSkill
- control-cliSkill
- control-uiSkill
- correctSkill
- create-verification-skillSkill
- cua-driverSkill
- deslopSkill
- figure-it-outSkill
- howSkill
- interrogateSkill
- maintain-verification-skillSkill
- no-commentsSkill
- poteto-modeSkill
- principle-attack-the-premiseSkill
- principle-boundary-disciplineSkill
- principle-build-the-leverSkill
- principle-encode-lessons-in-structureSkill
- principle-exhaust-the-design-spaceSkill
- principle-experience-firstSkill
- principle-explain-the-numberSkill
- principle-fix-root-causesSkill
- principle-foundational-thinkingSkill
- principle-guard-the-context-windowSkill
- principle-laziness-protocolSkill
- principle-make-operations-idempotentSkill
- principle-migrate-callers-then-delete-legacy-apisSkill
- principle-minimize-reader-loadSkill
- principle-model-the-domainSkill
- principle-never-block-on-the-humanSkill
- principle-outcome-oriented-executionSkill
- principle-prove-it-worksSkill
- principle-redesign-from-first-principlesSkill
- principle-separate-before-serializing-shared-stateSkill
- principle-sequence-verifiable-unitsSkill
- principle-subtract-before-you-addSkill
- principle-test-behavior-not-implementationSkill
- principle-tests-pay-rentSkill
- principle-type-system-disciplineSkill
- recallSkill
- reflectSkill
- setup-pstackSkill
- show-me-your-workSkill
- stacked-prsSkill
- swarmSkill
- tddSkill
- teachSkill
- technical-writingSkill
- thermo-nuclear-code-quality-reviewSkill
- thermo-nuclear-reviewSkill
- thermosSkill
- typescript-best-practicesSkill
- unslopSkill
- whySkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
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 13
Vocabulary: Use these words exactly. Consistent language is the point.
- Distinctive: line 28
One adapter is a hypothetical seam, two is a real one: Add a seam only where something actually varies across it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Small Door, Big Room
Design deep modules: a lot of behavior behind a small interface, placed at a clean seam, tested through that interface. The door is small, the room behind it is big. Callers gain leverage, maintainers gain locality.
Why: A shallow module makes the reader learn an interface about as large as its body, so it buys nothing. Callers each re-derive the same knowledge, bugs scatter, and tests pin internals. Depth concentrates all three costs in one place.
Vocabulary. Use these words exactly. Consistent language is the point.
- Module: anything with an interface and an implementation, at any scale: function, class, package, slice. Avoid unit, component, service.
- Interface: everything a caller must know to use the module correctly: signature, invariants, ordering, error modes, required config, performance traits. Avoid API and signature, which name only the type-level surface.
- Implementation: the code inside. Say adapter when the seam is the topic, implementation otherwise.
- Depth: leverage at the interface, the behavior a caller or test exercises per unit of interface learned. Deep: much behavior, small interface. Shallow: interface nearly as complex as the body.
- Seam: a place where behavior can change without editing in that place, and where a module's interface lives. Where it goes is its own decision, separate from what sits behind it. Avoid boundary.
- Adapter: a concrete thing that satisfies the interface at a seam. It names a role, not a size.
- Leverage: what callers get. One implementation pays back across N call sites and M tests.
- Locality: what maintainers get. Change, bugs, and knowledge concentrate in one place. Fix once, fixed everywhere.
Rules.
- Deletion test. Imagine deleting the module. If the complexity vanishes, it was a pass-through. If it reappears across N callers, the module earned its keep.
- The interface is the test surface. Callers and tests cross the same seam. Wanting to test past the interface means the module has the wrong shape.
- One adapter is a hypothetical seam, two is a real one. Add a seam only where something actually varies across it. Production plus a test fake counts as two.
- Depth belongs to the interface, not the implementation. A deep module may be built from small swappable parts. Those are internal seams: private, exercised only through the interface, never exposed. A seam that exists only so a test can reach it follows question 4 of Tests Pay Rent: move the test to the real boundary.
Shape it for tests. Accept dependencies instead of creating them (processOrder(order, gateway), not new StripeGateway() inside). Return results instead of mutating (calculateDiscount(cart): Discount). Keep the surface small: fewer methods mean fewer tests, fewer parameters mean simpler setup.
Rejected framings.
- Depth as implementation lines over interface lines. It rewards padding. Measure leverage.
- Interface as the
interfacekeyword or a class's public methods. It covers every fact a caller needs. - Boundary as a design term. It collides with bounded context. Say seam or interface.
Neighbors.
- Model the Domain picks the structure that goes behind the door. This principle sizes the door.
- Minimize Reader Load counts layers. Depth is the test for which layers to keep: a layer that fails the deletion test goes.
- Laziness Protocol: a flat call tree and a rich interface agree. Hide work behind one call, not behind five.
- Boundary Discipline: guards sit at the system edge, so the inside of a deep module can trust its types.
- Tests Pay Rent: tests cross the same seam as callers, so one owner suite per interface is enough.
Red flags: a wrapper with one caller, a port with one adapter, a getter or reset export that exists for tests, callers that must know call order the module could enforce, a change that touches five files for one decision.
To deepen a cluster of shallow modules, read references/deepening.md. When the right interface is unclear, read references/design-it-twice.md.
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.

