codebase-design
Skill8 starsChanged 2 months agoMITView on GitHub
Shared vocabulary and patterns for designing deep modules with narrow interfaces and clean seams. Use when designing module interfaces, finding deepening opportunities, deciding where seams go, or making code more testable and AI-navigable — even if the user says \"improve this module\". Do NOT use for whole-codebase architectural surveys.
We split this skill into the rules it gives an agent
3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 181 edited versions we read keep these.
3
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 16
The Deletion Test: If deleting a module causes complexity to vanish, it was an unnecessary pass-through.
- Distinctive: line 46
Key Point: Check the ratio of interface cognitive overhead to internal capabilities.
- Distinctive: line 63
Action: When designing complex or foundational modules, draft 2–3 radically different interface designs before coding.
“Common” is measured: kept by at least 6 in 10 of the 181 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
Codebase Design
Design deep, high-leverage modules that encapsulate complex domain behavior behind minimal interfaces placed at clear architectural seams.
Core Invariants
- Depth Over Surface Area: Maximize internal implementation leverage while minimizing interface surface area (few methods, simple primitive parameters).
- Interface as Test Surface: External callers and unit tests cross the exact same seam; never pierce the interface to test internal private plumbing.
- The Deletion Test: If deleting a module causes complexity to vanish, it was an unnecessary pass-through; if complexity scatters across $N$ callers, it was earning its keep.
- Real vs. Hypothetical Seams: One adapter indicates a hypothetical seam; introduce an interface seam only when at least two concrete adapters vary across it.
- Exact Design Vocabulary: Strictly use canonical terminology (module, interface, depth, seam, adapter, leverage, locality); avoid vague synonyms (service, component, boundary).
Architecture & Map of Content (MOC)
┌───────────────────────────────────────┐
│ Narrow Public Interface │ ◄── Small surface (few methods, simple inputs)
├───────────────────────────────────────┤
│ │
│ Deep Implementation │ ◄── High leverage, hidden state, rich logic
│ │
└───────────────────────────────────────┘| Component | Responsibility | Reference |
| Module Deepening | Refactor shallow pass-throughs into deep modules | skills/codebase-design/DEEPENING.md |
| Design It Twice | Explore multi-model interface variations | skills/codebase-design/DESIGN-IT-TWICE.md |
| Testability Rules | Accept dependencies, return pure values | Public seam tests |
Step-by-Step Procedure (TWI)
Step 1: Evaluate Current Interface Depth & Seams
- Action: Inspect the module's public methods, parameter signatures, and call sites.
- Key Point: Check the ratio of interface cognitive overhead to internal capabilities.
- Why: Shallow modules force callers to understand internal mechanics, destroying locality.
Step 2: Apply the Deletion Test & Simplify Signatures
- Action: Consolidate fine-grained procedural methods into unified, intent-revealing operations.
- Key Point: Hide internal state transformations and dependency instantiations behind the seam.
- Inline Checklist:
- Methods reduced to minimal essential operations
- Dependencies passed in rather than created internally
- Functions return values rather than mutating global side effects
Step 3: Align Seam with Unit Test Harness
- Action: Structure test suites to exercise the module strictly through its public interface.
- Key Point: Eliminate internal mocking and testing of private helper functions.
- Why: Testing through the interface ensures tests survive internal refactors without breakage.
Step 4: Explore Alternatives (Design It Twice)
- Action: When designing complex or foundational modules, draft 2–3 radically different interface designs before coding.
- Key Point: Compare candidates on depth, locality, and caller ergonomics.
- Why: The first interface that comes to mind is rarely the deepest or most maintainable.
Anti-Rationalization Guardrails
| Tempting Rationalization | Binding Rule | Engineering Rationale |
| "Expose private helper functions so we can write unit tests for them." | Forbidden. Test exclusively through the public interface. | Testing private helpers couples tests to implementation details and prevents refactoring. |
| "Create an interface and adapter for a single implementation." | Wait for 2 adapters before extracting a generic seam. | Speculative generalization creates shallow, unnecessary abstraction layers. |
| "Break this 100-line cohesive function into 5 single-use files." | Maintain locality inside deep modules. | Excessive fragmentation increases cognitive load and scatters related logic. |
Other versions194 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 194
- mattpocock/skills★ 309ksame name
- danny-avila/LibreChat★ 47ksame name
- LibreChat-AI/LibreChat★ 47ksame name
- QuivrHQ/quivr★ 40ksame name
- windmill-labs/windmill★ 18ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
- formbricks/formbricks★ 13ksame name
- humanlayer/humanlayer★ 13ksame name
- openstatusHQ/openstatus★ 9.2ksame name
184 more not listed
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.
Used alongsideProjects with it also use decision-mapping, loop-me and 2 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
FabienDehopreSkilldecision-mapping
Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.
Also in 8 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 50 projects that use this
ryotaroh180105Skillclaude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.
Also in 37 projects that use this
AnasX7Skillnarrow-react-prop-types
narrow React component prop types to match live code paths
Also in 3 projects that use this
In this repository42 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-data-remediationSkill
- ai-engineeringSkill
- code-reviewSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- engineering-workflow-guideSkill
- git-safety-guardrailsSkill
- goalSkill
- grillingSkill
- grill-meSkill
- grill-with-docsSkill
- handoffSkill
- implementSkill
- implement-specSkill
- improve-codebase-architectureSkill
- j-spaceSkill
- migrate-to-shoehornSkill
- ml-best-practicesSkill
- prototypeSkill
- researchSkill
- resolving-merge-conflictsSkill
- retroSkill
- scaffold-exercisesSkill
- setup-engineering-workflowsSkill
- setup-pre-commitSkill
- setup-ts-deep-modulesSkill
- skill-conductorSkill
- tddSkill
- teachSkill
- to-questionnaireSkill
- to-specSkill
- to-ticketsSkill
- triageSkill
- wait-whatSkill
- wayfinderSkill
- wizardSkill
- workflow-designerSkill
- writing-beatsSkill
- writing-for-agentsSkill
- writing-fragmentsSkill
- writing-shapeSkill
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.

