[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AAJAM4RYAW1VEH6FZ563GY":3,"skill-same:01M7AAJAM4RYAW1VEH6FZ563GY":54},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7AAJAM4RYAW1VEH6FZ563GY","codebase-design",null,"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.","joeloverbeck\u002Fskill-evidence","joeloverbeck","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F120873?v=4","01M758KCBJ0GWAPGN74C9NJF8T","01M7AAJ49JAQNVPTMQSWVB57TY",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codebase-design\ndescription: 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.\n---\n\n# Codebase Design\n\nDesign **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.\n\n## Glossary\n\nUse these terms exactly when naming architectural roles — don't substitute \"component,\" \"service,\" \"API,\" or \"boundary\" as synonyms. Authoritative project and domain vocabulary keeps its defined meaning. When a domain term collides with this glossary, qualify the architectural term — for example, **module interface** or **architectural seam** — rather than renaming the domain concept. Consistent language is the point; overwriting the project's ubiquitous language is not.\n\n**Module** — anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.\n\n**Interface** — everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow — they refer only to the type-level surface).\n\n**Implementation** — what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for \"adapter\" when the seam is the topic; \"implementation\" otherwise.\n\n**Depth** — leverage at the interface: the amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.\n\n**Seam** _(Michael Feathers)_ — a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).\n\n**Adapter** — a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).\n\n**Leverage** — what callers get from depth: more capability per unit of interface they learn. One implementation pays back across N call sites and M tests.\n\n**Locality** — what maintainers get from depth: change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.\n\n## Deep vs shallow\n\n**Deep module** = small interface + lots of implementation:\n\n```\n┌─────────────────────┐\n│   Small Interface   │  ← Few methods, simple params\n├─────────────────────┤\n│                     │\n│  Deep Implementation│  ← Complex logic hidden\n│                     │\n└─────────────────────┘\n```\n\n**Shallow module** = large interface + little implementation (avoid):\n\n```\n┌─────────────────────────────────┐\n│       Large Interface           │  ← Many methods, complex params\n├─────────────────────────────────┤\n│  Thin Implementation            │  ← Just passes through\n└─────────────────────────────────┘\n```\n\nWhen designing an interface, ask:\n\n- Can I reduce the number of methods?\n- Can I simplify the parameters?\n- Can I hide more complexity inside?\n\n## Principles\n\n- **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.\n- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.\n- **The interface is the behavioural test surface.** Callers and acceptance tests cross the same seam. Do not reach past it merely to observe implementation detail. A module may still test private invariants through internal seams; if caller-facing behavioural tests must do that, the module is probably the wrong shape.\n- **Warrant is part of the interface when an output asks to be trusted.** For an evaluator, scoring, ranking, or measurement module, expose the provenance, uncertainty, validity or calibration diagnostics, explanations, and authority limits a caller needs to judge fitness for purpose. Semantic correctness and fitness for purpose are separate obligations. Test warrant with independent oracles, fixtures, and metamorphic checks through diagnostic surfaces; use internal seams for implementation invariants, never as a substitute for caller-visible evidence.\n- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.\n\n## Designing for testability\n\nGood interfaces make testing natural:\n\n1. **Accept dependencies, don't create them.**\n\n   ```typescript\n   \u002F\u002F Testable\n   function processOrder(order, paymentGateway) {}\n\n   \u002F\u002F Hard to test\n   function processOrder(order) {\n     const gateway = new StripeGateway();\n   }\n   ```\n\n2. **Return results, don't produce side effects.**\n\n   ```typescript\n   \u002F\u002F Testable\n   function calculateDiscount(cart): Discount {}\n\n   \u002F\u002F Hard to test\n   function applyDiscount(cart): void {\n     cart.total -= discount;\n   }\n   ```\n\n3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.\n\n## Rejected framings\n\n- **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.\n\n## Going deeper\n\n- **Deepening a cluster given its dependencies** — see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.\n- **Exploring alternative interfaces** — see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.\n","# Codebase Design\n\nDesign **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.\n\n## Glossary\n\nUse these terms exactly when naming architectural roles — don't substitute \"component,\" \"service,\" \"API,\" or \"boundary\" as synonyms. Authoritative project and domain vocabulary keeps its defined meaning. When a domain term collides with this glossary, qualify the architectural term — for example, **module interface** or **architectural seam** — rather than renaming the domain concept. Consistent language is the point; overwriting the project's ubiquitous language is not.\n\n**Module** — anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice. _Avoid_: unit, component, service.\n\n**Interface** — everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration, and performance characteristics. _Avoid_: API, signature (too narrow — they refer only to the type-level surface).\n\n**Implementation** — what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repo) or a large adapter with a small implementation (an in-memory fake). Reach for \"adapter\" when the seam is the topic; \"implementation\" otherwise.\n\n**Depth** — leverage at the interface: the amount of behaviour a caller (or test) can exercise per unit of interface they have to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.\n\n**Seam** _(Michael Feathers)_ — a place where you can alter behaviour without editing in that place; the *location* at which a module's interface lives. Where to put the seam is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).\n\n**Adapter** — a concrete thing that satisfies an interface at a seam. Describes *role* (what slot it fills), not substance (what's inside).\n\n**Leverage** — what callers get from depth: more capability per unit of interface they learn. One implementation pays back across N call sites and M tests.\n\n**Locality** — what maintainers get from depth: change, bugs, knowledge, and verification concentrate in one place rather than spreading across callers. Fix once, fixed everywhere.\n\n## Deep vs shallow\n\n**Deep module** = small interface + lots of implementation:\n\n```\n┌─────────────────────┐\n│   Small Interface   │  ← Few methods, simple params\n├─────────────────────┤\n│                     │\n│  Deep Implementation│  ← Complex logic hidden\n│                     │\n└─────────────────────┘\n```\n\n**Shallow module** = large interface + little implementation (avoid):\n\n```\n┌─────────────────────────────────┐\n│       Large Interface           │  ← Many methods, complex params\n├─────────────────────────────────┤\n│  Thin Implementation            │  ← Just passes through\n└─────────────────────────────────┘\n```\n\nWhen designing an interface, ask:\n\n- Can I reduce the number of methods?\n- Can I simplify the parameters?\n- Can I hide more complexity inside?\n\n## Principles\n\n- **Depth is a property of the interface, not the implementation.** A deep module can be internally composed of small, mockable, swappable parts — they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.\n- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.\n- **The interface is the behavioural test surface.** Callers and acceptance tests cross the same seam. Do not reach past it merely to observe implementation detail. A module may still test private invariants through internal seams; if caller-facing behavioural tests must do that, the module is probably the wrong shape.\n- **Warrant is part of the interface when an output asks to be trusted.** For an evaluator, scoring, ranking, or measurement module, expose the provenance, uncertainty, validity or calibration diagnostics, explanations, and authority limits a caller needs to judge fitness for purpose. Semantic correctness and fitness for purpose are separate obligations. Test warrant with independent oracles, fixtures, and metamorphic checks through diagnostic surfaces; use internal seams for implementation invariants, never as a substitute for caller-visible evidence.\n- **One adapter means a hypothetical seam. Two adapters means a real one.** Don't introduce a seam unless something actually varies across it.\n\n## Designing for testability\n\nGood interfaces make testing natural:\n\n1. **Accept dependencies, don't create them.**\n\n   ```typescript\n   \u002F\u002F Testable\n   function processOrder(order, paymentGateway) {}\n\n   \u002F\u002F Hard to test\n   function processOrder(order) {\n     const gateway = new StripeGateway();\n   }\n   ```\n\n2. **Return results, don't produce side effects.**\n\n   ```typescript\n   \u002F\u002F Testable\n   function calculateDiscount(cart): Discount {}\n\n   \u002F\u002F Hard to test\n   function applyDiscount(cart): void {\n     cart.total -= discount;\n   }\n   ```\n\n3. **Small surface area.** Fewer methods = fewer tests needed. Fewer params = simpler test setup.\n\n## Rejected framings\n\n- **Depth as ratio of implementation-lines to interface-lines** (Ousterhout): rewards padding the implementation. We use depth-as-leverage instead.\n\n## Going deeper\n\n- **Deepening a cluster given its dependencies** — see [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, and replace-don't-layer testing.\n- **Exploring alternative interfaces** — see [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): spin up parallel sub-agents to design the interface several radically different ways, then compare on depth, locality, and seam placement.\n",{"name":5,"description":7},"main","9b13db1df193bd0709752040255bd64b682d3242",".claude\u002Fskills\u002Fcodebase-design","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence","https:\u002F\u002Fdocs.rs\u002Fskill-evidence","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck","2026-08-23 17:23:53",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add joeloverbeck\u002Fskill-evidence --skill codebase-design",{"tool":36,"command":37},"bunx","bunx skills add joeloverbeck\u002Fskill-evidence --skill codebase-design",{"tool":39,"command":40},"pnpm","pnpm dlx skills add joeloverbeck\u002Fskill-evidence --skill codebase-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FSKILL.md",true,[44,50],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"DEEPENING.md","REFERENCE","参考文档",2571,"https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FDEEPENING.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"DESIGN-IT-TWICE.md",2924,"https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FDESIGN-IT-TWICE.md",[55,62,67,74,79,84],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7AAQDXB1QQET7VSTF1FCEET","triage","Move issues and external PRs through a state machine of triage roles — categorise, verify, grill if needed, and write agent-ready briefs.","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftriage\u002Freviews\u002Ffce6031a-a8f1-44b9-93cc-5c27488a51d3\u002Fcandidate\u002FSKILL.md",[],[],{"skillNo":63,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":18},"01M7AAQBCSHN0ZH9MHQZNEHCGR","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftriage\u002Freviews\u002F48b04150-c9c8-42a7-982a-324aceb6d21e\u002Fheld\u002Fember\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":18},"01M7AAQ8BDCGNPBVJVGQ1KWSN7","tdd","Test-driven development. Use when the user wants a red-green development loop or integration tests.","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftdd\u002Freviews\u002Frev_c25c6d82-756b-49e4-85ed-bd164820f2f2\u002Fpre-land-backup\u002FSKILL.md",[],[],{"skillNo":75,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7AAQ6DRHY95HPCDGG7TBP93","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftdd\u002Freviews\u002Frev_c25c6d82-756b-49e4-85ed-bd164820f2f2\u002Fcandidate\u002FSKILL.md",[],[],{"skillNo":80,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":18},"01M7AAQ3XN1HSP13RC35NFTKT0","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftdd\u002Freviews\u002Frev_3e39da1f-a737-4029-bd88-f710519fe3de\u002Fpre-land-backup\u002FSKILL.md",[],[],{"skillNo":85,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7AAQ1NGVGK62GB5Z6JSNJ76","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fskill-evidence\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftdd\u002Freviews\u002Frev_3e39da1f-a737-4029-bd88-f710519fe3de\u002Fcandidate\u002FSKILL.md",[],[]]