codebase-design
Skill626 starsChanged 4 months agoMITView on GitHub
Shared vocabulary for designing deep modules and for naming factory concepts consistently. Load before writing a spec, decomposing issues, freezing checks, or reviewing a diff - anywhere "module," "interface," "issue," or "frozen check" need to mean the same thing to every skill, builder, and reviewer. Also covers dependency categories for deepening and the parallel design-it-twice pattern for exploring interfaces before committing to one.
194 other projects use a version of this, 160 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 · 160
- mattpocock/skills★ 309k24% same
- danny-avila/LibreChat★ 47k24% same
- LibreChat-AI/LibreChat★ 47k24% same
- QuivrHQ/quivr★ 40k24% same
- The-Vibe-Company/quivr★ 40k24% same
- windmill-labs/windmill★ 18k23% same
- MODSetter/SurfSense★ 17k24% same
- GreyDGL/PentestGPT★ 16k24% same
- formbricks/formbricks★ 13k24% same
- humanlayer/humanlayer★ 13k24% same
150 more not listed
Wrote their own version · 34
- vinvcn/mattpocock-skills-zh-CN★ 5.5ksame name
- stevesolun/ctx★ 583same name
- devcxl/mattpocock-skills-zh★ 522same name
- OyadotAI/oya-browser★ 348same name
- ahonn/dotfiles★ 62same name
- WenWuZhiDao/mattpocock-skills-zh★ 27same name
- sgaabdu4/building-flutter-apps★ 25same name
- rafaelob/pragmatic-agent-skills★ 24same name
- kriscard/Skills★ 15same name
- eralmansouri/skills★ 9same name
24 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.
- adversarial-reviewSkill
- architect-fastSkill
- architect-researchSkill
- architectSkill
- final-reviewSkill
- frozen-checksSkill
- integrateSkill
- tddSkill
- to-issuesSkill
- to-specSkill
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 24
Use these terms exactly — don't substitute component, service, boundary, or API when you mean module or interface.
- Distinctive: line 78
Don't introduce a seam unless 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
<!-- Adapted from mattpocock/skills (MIT). -->Codebase Design
Design deep modules: a lot of behavior behind a small interface, placed at a clean seam, testable through that interface. Use this language wherever code or a factory issue is being designed. The aim is leverage for callers, locality for maintainers, and testability for everyone.
Glossary
Use these terms exactly — don't substitute component, service, boundary, or API when you mean module or interface; don't say task or ticket for issue, or test file for frozen check. Consistent language is the whole point.
Design (Pocock, adapted):
- Module - anything with an interface and an implementation, at any scale: a function, a package, or a whole vertical slice.
- Interface - everything a caller must know to use a module correctly: types, invariants, ordering, error modes, config, performance - not just a signature.
- Implementation - the body of code behind the interface; distinct from adapter, which names role at a seam, not substance.
- Depth - leverage at the interface: behavior reached per unit of interface learned. Deep means a small interface over a big implementation; shallow is the opposite, and to avoid.
- Seam (Feathers) - the place a module's interface lives; where behavior can change without editing there.
- Adapter - a concrete thing satisfying an interface at a seam. One adapter is a hypothetical seam; two make it real.
- Leverage - what callers get from depth: one implementation pays off across many call sites and tests.
- Locality - what maintainers get from depth: change and bugs concentrate in one place instead of spreading.
Factory (one line each; matches docs/spec/skill-library.md Target flow):
- Run - one factory build from intake to the closing PR, on its own factory branch.
- Tracking issue - the run's parent issue: dashboard, digest, preflight record.
- Issue - one vertical-slice unit of work: one builder job, one disjoint file set, one change-skeleton.
- Slice - the vertical cut an issue implements; slice names the cut, issue names its tracker record - same unit, two angles.
- Frozen check - the committed, read-only acceptance check a builder's work is graded against.
- Check-runner - the deterministic script that grades a frozen check's RUN items and exits typed (0/2/5).
- Strategist - the fresh high-judgment subagent that drafts specs, cuts issues, stress-tests plans, and runs full-lane reviews.
- Builder - the fresh, worktree-isolated agent that implements one issue and never commits.
- Orchestrator - the one session that grounds, dispatches strategist and builder work, freezes, and integrates; never writes implementation code; in the fast lane (/architect-fast) it also runs the closing test pass whose output feeds the builder review - a recorded relaxation.
- Factory branch - the run's integration branch (
factory/<run>) that job branches merge into. - Worktree - the isolated git checkout a builder or reviewer works in, verified against the freeze commit.
- Job report - a builder's raw-evidence artifact, ending in one STATUS line.
- Verdict - the grading record posted on an issue at close: checkrun summary plus typed exit, postflight result, slice call, decisive reason; the closing review's run-level verdict goes on the tracking issue.
- Ruling - an orchestrator decision recorded post-freeze: a PHASE-0 execution conflict, boundary amendment, or respawn answer.
- Digest - the shipped-issues, diffstat, rulings, and domain-language summary handed to the integrate subagent's docs pass.
- Hard stop - an irreversible or destructive action the loop refuses without a human ruling.
Deep vs. shallow
A deep module hides a lot of implementation behind a small interface: few methods, simple params, most of the complexity out of sight. A shallow module is the opposite - an interface almost as complex as what it wraps, often a near-passthrough. When shaping an interface, ask whether the method count and params can shrink, and whether more logic can move inside.
Principles
- Depth is a property of the interface, not the implementation - a deep module can be built from small internal seams its own tests use, without exposing them at the external interface.
- The deletion test: imagine deleting the module. If complexity vanishes, it was a pass-through; if it reappears across N callers, it was earning its keep.
- The interface is the test surface - callers and tests cross the same seam. If you want to test past the interface, the module is probably the wrong shape.
- One adapter means a hypothetical seam; two adapters means a real one. Don't introduce a seam unless something actually varies across it.
Designing for testability
- Accept dependencies, don't create them - a function that takes its
gateway is testable; one that builds a
StripeGateway()internally is not. - Return results, don't produce side effects - a function that returns a computed discount is testable; one that mutates a cart in place is not.
- Small surface area: fewer methods = fewer tests needed; fewer params = simpler test setup.
Going deeper
- Deepening a cluster given its dependencies - see
DEEPENING.md: dependency categories, seam discipline, and replace-don't-layer testing. - Exploring alternative interfaces - see
DESIGN-IT-TWICE.md: dispatch parallel subagents to design the interface several radically different ways, then compare on depth, locality, and seam placement.
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.

