[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C2YCW388Z0G2F1A0VT1218":3,"skill-same:01M7C2YCW388Z0G2F1A0VT1218":58},{"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":15,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":13,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7C2YCW388Z0G2F1A0VT1218","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.","PhmnPh\u002Fclaude-config","PhmnPh","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F206572176?v=4","01M7C2Y3QW8QEWQYD46EM0WMSV","01M7C2Y3RG0T6ZRNN1QWMMVMXQ",0,"MIT","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fclaude\u002Fskills\u002Fcodebase-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fclaude\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. Apply these principles when an interface or ownership decision needs design work. The aim is leverage for callers, locality for maintainers, and testability for everyone.\n\n## Glossary\n\nUse the project’s established terminology. The definitions below help reason about design; explain unfamiliar terms and do not rename existing concepts merely to match this glossary.\n\n**Module**: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice.\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.\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.\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 test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.\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## Relationships\n\n- A **Module** has exactly one **Interface** (the surface it presents to callers and tests).\n- **Depth** is a property of a **Module**, measured against its **Interface**.\n- A **Seam** is where a **Module**'s **Interface** lives.\n- An **Adapter** sits at a **Seam** and satisfies the **Interface**.\n- **Depth** produces **Leverage** for callers and **Locality** for maintainers.\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- **\"Interface\" as the TypeScript `interface` keyword or a class's public methods**: too narrow: interface here includes every fact a caller must know.\n- **Ambiguous boundaries**: clarify whether you mean a domain boundary, API contract, or test seam when the distinction matters.\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. Apply these principles when an interface or ownership decision needs design work. The aim is leverage for callers, locality for maintainers, and testability for everyone.\n\n## Glossary\n\nUse the project’s established terminology. The definitions below help reason about design; explain unfamiliar terms and do not rename existing concepts merely to match this glossary.\n\n**Module**: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package, or tier-spanning slice.\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.\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.\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 test surface.** Callers and tests cross the same seam. If you want to test *past* the interface, the module is probably the wrong shape.\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## Relationships\n\n- A **Module** has exactly one **Interface** (the surface it presents to callers and tests).\n- **Depth** is a property of a **Module**, measured against its **Interface**.\n- A **Seam** is where a **Module**'s **Interface** lives.\n- An **Adapter** sits at a **Seam** and satisfies the **Interface**.\n- **Depth** produces **Leverage** for callers and **Locality** for maintainers.\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- **\"Interface\" as the TypeScript `interface` keyword or a class's public methods**: too narrow: interface here includes every fact a caller must know.\n- **Ambiguous boundaries**: clarify whether you mean a domain boundary, API contract, or test seam when the distinction matters.\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","2e487cdaeb989b9f77052c38e05a9a32a21d9f12","claude\u002Fskills\u002Fcodebase-design","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config","https:\u002F\u002Fgithub.com\u002FPhmnPh","2026-09-16 22:26:04",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add PhmnPh\u002Fclaude-config --skill codebase-design",{"tool":36,"command":37},"bunx","bunx skills add PhmnPh\u002Fclaude-config --skill codebase-design",{"tool":39,"command":40},"pnpm","pnpm dlx skills add PhmnPh\u002Fclaude-config --skill codebase-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fclaude\u002Fskills\u002Fcodebase-design\u002FSKILL.md",true,[44,50,54],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"DEEPENING.md","REFERENCE","参考文档",2553,"https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fclaude\u002Fskills\u002Fcodebase-design\u002FDEEPENING.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"DESIGN-IT-TWICE.md",2850,"https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fclaude\u002Fskills\u002Fcodebase-design\u002FDESIGN-IT-TWICE.md",{"path":55,"resourceType":55,"resourceTypeDesc":56,"sizeBytes":57,"sourceHtmlUrl":15},"LICENSE","许可证",1068,[59,67,75,83,91,99],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":63,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7C33F4HEPNCDR2RNG62YZX4","wayfinder","Map unresolved decisions for a large initiative and work through their dependencies until a plan is actionable.","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fwayfinder\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fwayfinder\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":71,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7C338XN7376BKCGTKFBQ583","to-tickets","Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker (edges as text in one file per ticket locally, or native blocking links on a real tracker).","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fto-tickets\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fto-tickets\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":79,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7C336B4KYZGGMKPNKEFPV00","to-spec","Turn an agreed feature or plan into a proportionate, testable specification at the requested destination.","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fto-spec\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fto-spec\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7C32Y5F6M2SQ675YK6679E9","tdd","Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Ftdd\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":95,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M7C32TNN391FBBA7NQHDX3MQ","setup-matt-pocock-skills","Configure missing tracker and domain-document conventions for the Matt Pocock workflows in a repository.","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fsetup-matt-pocock-skills\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fsetup-matt-pocock-skills\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":103,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7C32R800TF424Y0SHWGR9BB","research","Investigate a specific technical question using primary sources and save a cited research note.","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fresearch\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FPhmnPh\u002Fclaude-config\u002Fblob\u002Fmain\u002Fcodex\u002Fskills\u002Fresearch\u002FSKILL.md",[],[]]