codebase-design
Skill2 starsChanged 2 months agoMITView on GitHub
Use when designing module interfaces, evaluating abstraction depth, identifying code seams, or turning shallow pass-through wrappers into deep modules. Don't use for syntax styling, single-line bug fixes, or minor formatting changes.
139 other projects use a version of this.
Adopted by
Most recently taken up by
- mattpocock/skillstheir own version, first seen Oct 8, 2026
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- hmjBill/skillstheir own version, first seen Oct 5, 2026
- AlexisBalayre/claude-code-configtheir own version, first seen Oct 5, 2026
- KroxiDev/engineering-skillstheir own version, first seen Oct 5, 2026
- gordon1210/reposcouttheir own version, first seen Oct 4, 2026
Used with
Projects with it also use writing-beats, writing-shape 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.
RoentekSkillwriting-beats
Writing, exploit — assemble raw material into a journey of beats, grounding each term before a beat leans on it.
Also in 23 projects that use this
RoentekSkillwriting-shape
Writing, exploit — shape raw material into an article, paragraph by paragraph.
Also in 23 projects that use this
loulanyueSkillsetup-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 16 projects that use this
risadamsSkillwhich-skill
Router over this pack's skills and flows. Ask it "which skill fits X" when you don't remember what's available.
Also in 5 projects that use this
pahwarangerSkillsetup-skills
Sets up an `## Agent skills` block in AGENTS.md/CLAUDE.md and `docs/agents/` so the engineering skills know this repo's ticket tracker (GitHub or local markdown), triage label vocabulary, and domain doc layout. Run before first use of `to-tickets`, `to-prd`, `triage`, `diagnose`, `tdd`, `improve-codebase-architecture`, or `zoom-out` — or if those skills appear to be missing context about the ticket tracker, triage labels, or domain docs.
Also in 7 projects that use this
qhuang20Skillmigrate-to-shoehorn
Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
Also in 24 projects that use this
- +2 more from Roentek
Other versions139 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 139
- mattpocock/skills★ 335ksame name
- LibreChat-AI/LibreChat★ 45ksame name
- vinvcn/mattpocock-skills-zh-CN★ 4.6ksame name
- stevesolun/ctx★ 588same name
- nodetool-ai/nodetool★ 551same name
- mxyhi/ok-skills★ 492same name
- aws/graph-explorer★ 484same name
- devcxl/mattpocock-skills-zh★ 426same name
- Tiberriver256/mcp-server-azure-devops★ 393same name
- bighadj22/codflow★ 338same name
129 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 repository24 other files it gives its agents.
- brainstormingSkill
- code-reviewSkill
- conventional-commitSkill
- copy-web-designSkill
- executing-plansSkill
- frontend-designSkill
- i18nSkill
- laravelSkill
- prototypeSkill
- reactSkill
- s13nSkill
- security-auditSkill
- summarizeSkill
- systematic-debuggingSkill
- technical-writingSkill
- testing-patternsSkill
- ui-motionSkill
- ui-ux-reviewSkill
- unslopSkill
- upsert-codebase-docsSkill
- verification-before-completionSkill
- workspace-onboardingSkill
- writing-for-agentsSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 128 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Follow these five steps in sequence.
- Distinctive: line 16
Read the project context and verify actual data schemas before modifying or creating modules.
- Very specific: line 35
If the user accepts, consult references/design-it-twice.md and dispatch sub-agents using invoke_subagent.
- Distinctive: line 36
If the user declines, proceed directly to Step 3.
- Distinctive: line 63
Wait for explicit user approval.
- Distinctive: line 75
Use these architectural terms consistently:
- Distinctive: line 90
Run this check before finishing the skill execution:
“Common” is measured: kept by at least 6 in 10 of the 128 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 modules with substantial behavior behind small interfaces, placed at clean seams, and testable directly through those interfaces.
Workflow
Follow these five steps in sequence.
Step 1. Domain context and schema ingestion
Read the project context and verify actual data schemas before modifying or creating modules.
- Inspect
AGENTS.md,CODEBASE.md, orCLAUDE.mdin the project root if present. Use the domain nouns, bounded contexts, and naming conventions defined there. - Audit database schemas and migration files:
- For projects with existing databases, inspect migration directories (such as
database/migrations/,prisma/schema.prisma, orsrc/db/). - Ground all entity attributes, foreign keys, and relations in verified schema files on disk. Never invent columns or assume database fields based on general model training.
- For greenfield repositories without existing migrations, mark the status as greenfield initialization and draft the initial schema explicitly without unverified assumptions.
- For projects with existing databases, inspect migration directories (such as
- Infer domain boundaries and seams directly from verified migrations, route declarations, and existing data models.
Completion criterion. The agent names modules, methods, and attributes using verified project domain terms and disk-backed database schemas.
Step 2. Design It Twice offer
Offer the user an exploratory multi-agent design pass before committing to a single interface.
Ask the user:
"Do you want to run a Design It Twice pass with parallel sub-agents to explore 2 to 3 contrasting interface designs, or proceed directly with a single design?"
- If the user accepts, consult
references/design-it-twice.mdand dispatch sub-agents usinginvoke_subagent. - If the user declines, proceed directly to Step 3.
Completion criterion. User preference recorded and the matching design branch initiated.
Step 3. Deep module and seam formulation
Formulate the interface and identify module boundaries using deep module principles.
- Apply the deletion test. Imagine deleting the module. If complexity vanishes, the module is a shallow pass-through wrapper and should be merged or deleted. If complexity reappears across multiple callers, the module earns its keep. Consult
references/codebase-health-and-hotspots.mdfor git churn hotspot detection, deletion test execution, and architecture diagrams. - Minimize interface surface. Reduce public methods, simplify parameters, and hide implementation details internally.
- Classify dependencies across seams. Consult
references/deepening.mdto classify external touchpoints into in-process, local-substitutable, remote owned, or true external. - Enforce seam discipline. Follow the rule that one adapter represents a hypothetical seam, while two adapters represent a real seam. Do not introduce interface ports unless at least two concrete adapters exist.
- Simplicity first and YAGNI discipline. Never introduce abstractions, generics, or configurability layers for single-use code. Build the minimum interface that solves the confirmed problem. If an interface introduces more boilerplate than the implementation logic it wraps, inline or simplify it.
- Align interface with test surface. Ensure callers and automated tests cross the same external seam. Do not leak internal test hooks into the public interface.
Completion criterion. A written interface specification defining inputs, outputs, error states, and concrete seam placement.
Step 4. User review gate
Present the proposed interface design to the user before writing implementation code.
Cover these technical details:
- Module responsibility and what implementation logic sits behind it.
- Public interface signature and parameter types.
- Seam placement and adapter classifications.
- Automated testing strategy through the public interface.
Wait for explicit user approval. If the user requests adjustments, update the interface and repeat the review.
Completion criterion. Explicit user confirmation approving the interface design.
Step 5. Transition to implementation planning
Invoke the writing-plans skill to generate a phased implementation plan.
Completion criterion. The writing-plans skill is invoked with the approved interface design.
Core vocabulary
Use these architectural terms consistently:
| Term | Definition | Avoid substituting |
| Module | A discrete unit with an interface and an implementation | Component, service, unit |
| Interface | Everything a caller must know to use the module correctly, including types, invariants, and errors | API, signature |
| Implementation | Internal code body hidden behind the interface | Adapter |
| Depth | Abstraction power at the interface, maximizing behavior while minimizing surface area | Lines of code ratio |
| Seam | The location where behavior can be altered without editing the caller | Boundary |
| Adapter | A concrete implementation that satisfies an interface at a seam | Infrastructure, driver |
| Multiplier | Total capability gained by callers per unit of interface learned | Abstraction power |
| Locality | Concentration of change, knowledge, and bugs in one place | Cohesion |
Quick audit checklist
Run this check before finishing the skill execution:
| Check | Passing condition |
| Depth check | Module hides internal complexity behind a minimal parameter surface |
| Deletion test | Deleting module causes complexity to reappear across callers |
| Seam discipline | No interface port created for single-adapter dependencies |
| Test surface | Tests exercise the module through the same seam used by callers |
| Progressive disclosure | Deepening and multi-agent rules loaded from references/ |
| Pipeline handoff | Transition offered to writing-plans upon design approval |
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.

