codebase-design
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- codebase-design
- description
- Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
- disable-model-invocation
- true
02 资源文件 2
- 参考文档DEEPENING.md1.1 KB
- 参考文档DESIGN-IT-TWICE.md1.4 KB
03 SKILL.md 正文
<!-- vendored: mattpocock/skills@c0d6901 skills/engineering/codebase-design (MIT). -->
Codebase design
Design deep modules: a lot of behavior behind a small interface, placed at a clean seam and tested through that interface.
Terms
Use these terms exactly, and do not swap in the words each entry rules out.
- Module: anything with an interface and an implementation, at any scale: a function, a class, a package. Do not say component, service, or unit.
- Interface: everything a caller must know to use the module correctly. That includes types, invariants, ordering, error modes, required configuration, and performance. Do not say API or signature, which cover only the types.
- Implementation: the code inside the module.
- Depth: how much behavior a caller gets for each thing they must learn about the interface. A deep module puts a lot of behavior behind a small interface. A shallow module's interface is nearly as complex as its implementation.
- Seam: the place where a module's interface sits, and where behavior can change without editing callers. Do not say boundary.
- Adapter: a concrete thing that satisfies an interface at a seam.
- Leverage: what callers gain from depth. One implementation serves many call sites and tests.
- Locality: what maintainers gain from depth. Changes, bugs, knowledge, and tests concentrate in one place.
Principles
- When designing an interface, try to reduce the methods, simplify the parameters, and hide more complexity inside.
- Depth is a property of the interface. A deep module can be built from small swappable parts, as long as those parts and their internal seams stay private.
- The deletion test: imagine deleting the module. If the complexity disappears, the module only passed calls through. If it reappears in every caller, keep the module.
- Callers and tests cross the same interface. Tests assert on outcomes seen through it and never on internals. A test that needs to reach past the interface means the module has the wrong shape.
- One adapter makes a seam hypothetical, and two make it real. Add a seam only when something varies across it.
- Accept dependencies as arguments instead of creating them inside.
- Return results instead of producing side effects.
To deepen a group of modules given its dependencies, read DEEPENING.md. To compare alternative interfaces, read DESIGN-IT-TWICE.md.
04 同仓库更多 Skills
human-voice
Humanize prose by choosing a surgical voice edit or a structural rewrite. Use for AI-sounding drafts, anti-slop passes, editorial reviews, and requests to preserve an author's voice.
install-anti-slop
Install and configure the anti-slop Oxlint plugin in a local TypeScript or JavaScript repository. Use whenever a user asks to add anti-slop lint rules, copy the anti-slop plugin, configure opinionated Oxlint rules, or migrate an existing local anti-slop setup.
improve-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
eli5
Explain a topic like I'm a 5 year old. Use when the user types /eli5 <topic> or asks for a dead-simple picture explainer of how something works.
audit-codebase
Read-only whole-codebase audit for simplifications in data structures, state representation, control flow, algorithms, and ownership. Inventories every subsystem as a coverage contract, reviews each one in a bounded subagent, verifies each finding against the repo, then audits its own coverage. Never edits, runs tests, commits, or pushes. Use for "audit this codebase", "find simplifications", or a pre-refactor survey.
crawl
Crawl a site with Screaming Frog and turn the output into findings a repo can act on. Use for SEO crawls and site audits, redirect or structured-data checks, rich-result eligibility questions, or any request that starts from crawl output.