codebase-design
Skill1 starsChanged 3 months agoMITView on GitHub
Shared vocabulary for designing deep modules with small interfaces and clean seams. Use when designing a class or module interface, evaluating whether a module is deep or shallow, reviewing code structure, or deciding where to place a seam.
194 other projects use a version of this.
Adopted by
Most recently taken up by
- chrysogonus/power-agentstheir own version, first seen Nov 8, 2026
- wowyuarm/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- Contexera/dsh-agent-teamtheir own version, first seen Nov 8, 2026
- sgaabdu4/appwrite-backendtheir own version, first seen Nov 8, 2026
- The-Vibe-Company/quivrtheir own version, first seen Nov 8, 2026
- dhruvsaxena1998/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use setup-ts-deep-modules, decision-mapping and 10 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.
liufeng1976Skillsetup-ts-deep-modules
Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.
Also in 43 projects that use this
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 55 projects that use this
LesaniSkillwriting-beats
Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
Also in 58 projects that use this
AWSSkillto-questionnaire
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
Also in 90 projects that use this
LesaniSkillwriting-shape
Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.
Also in 58 projects that use this
- +1 more from Lesani
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
- The-Vibe-Company/quivr★ 40ksame name
- windmill-labs/windmill★ 18ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
- formbricks/formbricks★ 13ksame name
- humanlayer/humanlayer★ 13ksame 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.
In this repository10 other files it gives its agents.
- blueprintSkill
- diagnoseSkill
- grill-with-docsSkill
- improve-codebase-architectureSkill
- integrateSkill
- quickSkill
- setup-runtimeSkill
- setupSkill
- setup-styleSkill
- tddSkill
The file
We split this skill into the rules it gives an agent
3 rules. 1 is common, 2 are distinctive, and 0 are very specific to this project.
1
Common
Most of the 181 edited versions we read keep these.
2
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
- Common: line 26
When designing an interface, ask:
- Distinctive: line 33
Use these exact terms. Do not drift into "component," "service," "API," or "boundary."
- Distinctive: line 59
Don't cut a seam until something actually varies across it.
“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
Deep Modules
A deep module has a small interface and a lot of implementation. A shallow module has a large interface and little implementation — it passes through without adding leverage.
DEEP (good): SHALLOW (avoid):
┌──────────────────────┐ ┌──────────────────────────┐
│ Small Interface │ │ Large Interface │
│ Few methods, │ │ Many methods, │
│ simple params │ │ complex params │
├──────────────────────┤ ├──────────────────────────┤
│ │ │ │
│ Deep Implementation │ │ Thin Implementation │
│ Complex logic │ │ Just passes through │
│ hidden inside │ │ │
└──────────────────────┘ └──────────────────────────┘When designing an interface, ask:
- Can I reduce the number of methods?
- Can I simplify the parameters?
- Can I hide more complexity inside?
Vocabulary
Use these exact terms. Do not drift into "component," "service," "API," or "boundary."
| Term | Definition |
| Module | Anything with an interface and an implementation — a class, a package, a library. Scale-independent. |
| Interface | Everything a caller must know: types, invariants, error modes, ordering, configuration, performance characteristics. NOT just a Java interface keyword — the full contract. |
| Implementation | The code inside the module. Callers don't see it. |
| Depth | Leverage at the interface — how much behavior the caller gets per unit of interface they must learn. Not lines-of-code ratio. |
| Seam | A place where behavior can change without editing in place (from Michael Feathers). One adapter = a hypothetical seam. Two adapters = a real one. |
| Adapter | A concrete thing satisfying an interface at a seam. Describes the role, not the substance. |
| Leverage | What callers gain from depth. |
| Locality | What maintainers gain: changes, bugs, and knowledge concentrate in one place. |
The Deletion Test
Imagine deleting the module. If the complexity vanishes — it was a pass-through (shallow, eliminate it). If the complexity reappears across N callers — it earned its keep (deep).
Interface Design
- Accept dependencies, don't create them. Inject what you need; don't instantiate internally.
- Return results, don't produce side effects. Functions that return values are easier to test than void methods that mutate state.
- Small surface area. Fewer methods = fewer tests. Simpler params = simpler test setup.
- Tests at the seam. Tests exercise the same interface callers use. If you need to mock internals to test, the interface is wrong.
Seam Discipline
- Don't cut a seam until something actually varies across it.
- One concrete implementation = no seam yet. Only introduce abstraction when a second implementation exists or is imminent.
- Adapters describe the role they fill, not what's inside them (e.g.
MariaDbTransactionLogDao, notRealTransactionLogDao).
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.

