codebase-design
Skill0 starsChanged 22 days agoMITView on GitHub
Use when deciding where a seam goes, how deep a module's interface should be, or how to make code more testable and AI-navigable. For naming and shared vocabulary, use domain-modeling.
194 other projects use a version of this, 145 of them edited.
Adopted by
Most recently taken up by
- chrysogonus/power-agentsedited, first seen Nov 8, 2026
- wowyuarm/dsh-agent-teamedited, first seen Nov 8, 2026
- Contexera/dsh-agent-teamedited, first seen Nov 8, 2026
- sgaabdu4/appwrite-backendtheir own version, first seen Nov 8, 2026
- The-Vibe-Company/quivredited, first seen Nov 8, 2026
- dhruvsaxena1998/skillsedited, 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 · 145
- mattpocock/skills★ 309k11% same
- danny-avila/LibreChat★ 47k11% same
- LibreChat-AI/LibreChat★ 47k11% same
- QuivrHQ/quivr★ 40k11% same
- The-Vibe-Company/quivr★ 40k11% same
- windmill-labs/windmill★ 18k11% same
- MODSetter/SurfSense★ 17k11% same
- GreyDGL/PentestGPT★ 16k11% same
- formbricks/formbricks★ 13k11% same
- humanlayer/humanlayer★ 13k11% same
135 more not listed
Wrote their own version · 49
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- DanMcInerney/architect-loop★ 626same name
- stevesolun/ctx★ 583same name
- devcxl/mattpocock-skills-zh★ 522same name
- OyadotAI/oya-browser★ 348same name
- ayoubben18/ab-method★ 192same name
- PaulRBerg/agent-skills★ 104same name
- ahonn/dotfiles★ 62same name
- WenWuZhiDao/mattpocock-skills-zh★ 27same name
- sgaabdu4/building-flutter-apps★ 25same name
39 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 repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- brainstorming-designSkill
- branch-lifecycleSkill
- bug-feedback-loopSkill
- code-review-disciplineSkill
- domain-modelingSkill
- failure-classesSkill
- git-safetySkill
- grillingSkill
- handoffSkill
- ops-safetySkill
- prototypeSkill
- quality-floorSkill
- researchSkill
- subagent-driven-devSkill
- systematic-debuggingSkill
- terse-modeSkill
- test-driven-developmentSkill
- ui-designSkill
- using-skillsSkill
- verification-before-completionSkill
- vetting-third-partySkill
- writing-plansSkill
- writing-skillsSkill
- zoom-outSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
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
- Distinctive: line 25
One adapter = hypothetical seam. Two adapters = real seam: Don't introduce a seam unless something actually varies across it.
- Distinctive: line 39
When designing an interface ask: fewer methods?
“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
Design deep modules: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Goal: leverage for callers, locality for maintainers.
Vocabulary (use these terms exactly)
- Module — anything with an interface and an implementation; scale-agnostic (function, class, package). Avoid: unit, component, service.
- Interface — everything a caller must know: signature + invariants, ordering, error modes, config, performance. Avoid: API (too narrow).
- Depth — leverage at the interface: behaviour exercised per unit of interface learned. Deep = small interface, lots behind it. Shallow = interface nearly as complex as the implementation.
- Seam (Feathers) — where you can alter behaviour without editing in that place; where the interface lives. Avoid: boundary.
- Adapter — a concrete thing satisfying an interface at a seam (role, not substance).
- Leverage — callers' payoff: one implementation pays back across N call sites and M tests.
- Locality — maintainers' payoff: change, bugs, and verification concentrate in one place.
Principles
- Depth is a property of the interface, not the implementation. Internals may be small, swappable parts with internal seams — they're just not part of the interface.
- The deletion test: imagine deleting the module. Complexity vanishes → it was a pass-through. Complexity reappears across N callers → it earned its keep.
- The interface is the test surface. Wanting to test past the interface means the module is the wrong shape.
- One adapter = hypothetical seam. Two adapters = real seam. Don't introduce a seam unless something actually varies across it.
Simplicity ladder — stop at the first rung that holds
- Does this need to exist at all? 2. Already in this codebase? 3. Standard library does it? 4. Native platform feature covers it? 5. An already-installed dependency solves it? 6. Can it be one line? 7. Only then: the minimum code that works. Two stdlib options of the same size → take the one correct on edge cases. Bug fix = root cause, not symptom: grep every caller before editing; one guard in the shared function beats a guard in every caller.
Mark deliberate shortcuts with a ceiling. A simplification that cuts a real corner (global lock, O(n²) scan, naive heuristic) gets a ceiling: comment naming the ceiling and the upgrade trigger. A ceiling comment with no trigger is the kind that rots; grep -rn "ceiling:" is the debt ledger. (Ladder and marker distilled from DietrichGebert/ponytail, MIT.)
Designing for testability
- Accept dependencies, don't create them (inject the gateway; don't
new StripeGateway()inside). - Return results, don't produce side effects.
- Small surface area: fewer methods = fewer tests; fewer params = simpler setup.
When designing an interface ask: fewer methods? simpler params? more complexity hidden inside?
Periodic architecture review
Scope before you scan — YAGNI. Deepening pays off by making future changes easier, so weight the parts of the codebase that change often. If the user named a direction (module, subsystem, pain point), take it. Otherwise walk back the commit history (git log --oneline) for hot spots — files that keep coming up — and let those pull your attention first; scattered changes with no hot spot → widen the net.
Then scan the scoped area for deepening opportunities: shallow modules, concept-understanding that bounces across many files, pure functions extracted "for testability" while bugs hide in how they're called, untestable-through-interface areas. Apply the deletion test to suspects. Present candidates (files, problem, solution, benefits in locality/leverage terms, recommendation strength), let the user pick one, then run grilling on the chosen design. Record rejections with load-bearing reasons as ADRs so future reviews don't re-suggest them.
Distilled from mattpocock/skills (MIT © Matt Pocock), snapshot 9603c1c (2026-07-20). Based on Ousterhout, "A Philosophy of Software Design".
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.

