codebase-design
Skill2 starsChanged 51 days 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 or minor formatting changes (use s13n), or single-line bug fixes (use systematic-debugging).
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 9 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 repository35 other files it gives its agents.
- agent-planningSkill
- brainstormingSkill
- code-reviewSkill
- conventional-commitSkill
- copy-web-designSkill
- executing-plansSkill
- frontend-designSkill
- i18nSkill
- laravelSkill
- prototypeSkill
- pull-requestSkill
- reactSkill
- recursive-researchSkill
- reflect-to-skillSkill
- review-a-skillSkill
- s13nSkill
- schema-migrationSkill
- security-auditSkill
- skill-testingSkill
- summarizeSkill
- systematic-debuggingSkill
- t3-operational-guardrailSkill
- technical-writingSkill
- testing-patternsSkill
- ui-motionSkill
- ui-ux-reviewSkill
- unslopSkill
- upsert-codebase-docsSkill
- verification-before-completionSkill
- vibe-wiseSkill
- web-advisor-promptSkill
- wizardSkill
- workspace-onboardingSkill
- writing-for-agentsSkill
- writing-plansSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 7 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 181 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Write-Target Boundary. Do not create, modify, or delete files under src/, app/, packages/, database/, tests/, or any production source tree.
- Distinctive: line 22
Follow these five steps in sequence.
- Distinctive: line 26
Read the project context and verify actual data schemas before modifying or creating modules.
- Distinctive: line 41
Ask the user directly.
- Very specific: line 45
If the user accepts, consult references/design-it-twice.md and dispatch sub-agents using invoke_subagent.
- Distinctive: line 46
If the user declines, proceed directly to Step 3.
- Distinctive: line 76
Wait for explicit user approval.
- Distinctive: line 96
Use these architectural terms consistently:
- Distinctive: line 115
Run this check before finishing the skill execution:
“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 modules with substantial behavior behind small interfaces, placed at clean seams, and testable directly through those interfaces.
<HARD-GATE>
Write-Target Boundary. Do not create, modify, or delete files under `src/`, `app/`, `packages/`, `database/`, `tests/`, or any production source tree. Emit design artifacts only to `.agents/state/codebase-design/` and reference files. Any production write requires a separate `executing-plans` invocation with a user-approved plan.
</HARD-GATE>Modes
Select the design mode before Step 1:
- Greenfield mode. Draft schemas, bounded contexts, and initial interface contracts from scratch.
- Refactor mode. Audit existing database schemas, migration files, and routes to encapsulate existing complexity behind deep modules.
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 directly.
"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. Record user preference in .agents/state/codebase-design/decision.md with explicit line design_it_twice: accepted or design_it_twice: declined.
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, keep the module. Consult
references/codebase-health-and-hotspots.mdfor git churn hotspot detection, deletion test execution, and architecture diagrams. - Minimize interface surface and reject line count metrics. Measure depth by power gained per unit of interface learned, never by lines of code ratio. Reduce public methods, simplify parameters, and design functions to return pure values instead of mutating state.
- 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 reuse hierarchy. Take the first option that fully works. Prioritize an existing codebase helper or pattern first, the standard library or platform feature second, an installed dependency third, and minimum new code last. Never add a dependency for a few lines. Never introduce abstractions, generics, or configurability layers for single-use code.
- Shortcut discipline and essential boundaries. When taking an intentional implementation shortcut, mark it in code using
shortcut: <the limit>, <when to upgrade>. Never cut trust boundary validation, data loss error handling, security invariants, or accessibility in the name of minimalism. - 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.
- Subtract before you add. When evolving or refactoring a system, remove complexity first, then build. Sequence removal before construction. Delete dead code, redundant validation checks, and unused stub references before adding new capabilities. Leave the design simpler and more capable behind the same or smaller surface than you found it.
- Migrate callers then delete legacy APIs. When introducing a new internal module interface, migrate all in-tree callers and purge the deprecated API in the same wave. Avoid long-lived compatibility shims, forwarding aliases, or wrapper layers for internal code. Update tests to assert the new contract, and delete tests that only protect pre-refactor implementation details.
Completion criterion. Interface specification file .agents/state/codebase-design/interface-spec.md exists on disk with headings ## Inputs, ## Outputs, ## Error states, and ## 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.
Pass the following envelope:
source_skill: codebase-design
source_spec_path: .agents/state/codebase-design/interface-spec.md
mode: AuthorCompletion criterion. The writing-plans invocation returns a plan path, and .agents/state/codebase-design/handoff.json exists on disk with plan_path matching the returned path and spec_path matching source_spec_path.
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, ordering constraints, error modes, configuration, and performance traits | API, signature |
| Implementation | Internal code body hidden behind the interface | Adapter |
| Depth | Abstraction power at the interface that provides substantial behavior behind minimal 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 |
Boundary isolation
Design module interfaces and contracts only. Do not write functional implementation code, run database migrations, or alter production runtime files during design specification.
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 |
| Subtraction first | Dead code, redundant guards, and stubs removed before adding new features |
| In-tree caller migration | Deprecated internal APIs and shims purged in the same wave with callers updated |
| Progressive disclosure | Deepening and multi-agent rules loaded from references/ |
| Reuse hierarchy | Prioritizes existing helpers and platform features before new dependencies |
| 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.

