[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758KV6VVQFQSBNET05R2WT9":3,"skill-same:01M758KV6VVQFQSBNET05R2WT9":53},{"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":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M758KV6VVQFQSBNET05R2WT9","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\u002Fcontinuity-loom","joeloverbeck","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F120873?v=4","01M758KCBJ0GWAPGN74C9NJF8T","01M758KCCNQ8F0YS327T45F7C0",0,"GPL-3.0","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FSKILL.md",[],[],"2026-11-12 13:55:43",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## Repo authorities\n\nWhen using this vocabulary inside a repo, honor that repo's design authorities before recommending a seam or interface:\n\n- If `docs\u002Fagents\u002Fdomain.md` exists, follow it to find the relevant domain glossary. Otherwise, read `CONTEXT-MAP.md` when present and then the relevant mapped `CONTEXT.md` files; fall back to root `CONTEXT.md` when there is no map.\n- Read `docs\u002Fprinciples\u002FREADME.md` if it exists, then any principle files and ADRs relevant to the module being designed.\n- If a proposed interface or seam contradicts a principle or ADR, surface the contradiction explicitly and explain why it may be worth reopening.\n- If an authority already *endorses or anticipates* the proposed seam, surface that too — it shows the authorities were honored and the change is pre-ratified, which strengthens the recommendation.\n\n## Glossary\n\nUse these terms exactly — don't substitute \"component,\" \"service,\" \"API,\" or \"boundary.\" Consistent language is the whole point.\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 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. Runtime adapters are the common signal; historical\u002Fversioned contracts can also justify a seam when current behavior must not rewrite old behavior.\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## Dependency categories\n\nEvery deepening candidate has dependencies; classify them, because the category decides how the deepened module is tested across its seam (and, in a report, the tag it carries). Full detail — including the \"replace, don't layer\" testing move — is in [DEEPENING.md](DEEPENING.md).\n\n- **In-process** — pure computation, in-memory state, no I\u002FO. Merge and test through the new interface directly; no adapter needed. An embedded database (SQLite \u002F `better-sqlite3`) is *not* in-process — it does file I\u002FO; see local-substitutable.\n- **Local-substitutable** — a dependency with a local test stand-in (PGLite for Postgres, an embedded SQLite database on a temp file or `:memory:`, an in-memory filesystem). The stand-in runs in the test suite; the seam is internal, no port at the external interface.\n- **Ports & adapters** — your own service across a network\u002Fprocess boundary (an HTTP API, a localhost server). Define a port at the seam; inject an HTTP adapter in production and an in-memory adapter in tests.\n- **Mock** — a true external you don't control (Stripe, Twilio). Inject a port; tests provide a mock adapter.\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- **\"Boundary\"**: overloaded with DDD's bounded context. Say **seam** or **interface**.\n\n## Going deeper\n\n- **Deepening a cluster given its dependencies** — see [DEEPENING.md](DEEPENING.md): the dependency categories above expanded with per-category testing strategy, plus 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## Repo authorities\n\nWhen using this vocabulary inside a repo, honor that repo's design authorities before recommending a seam or interface:\n\n- If `docs\u002Fagents\u002Fdomain.md` exists, follow it to find the relevant domain glossary. Otherwise, read `CONTEXT-MAP.md` when present and then the relevant mapped `CONTEXT.md` files; fall back to root `CONTEXT.md` when there is no map.\n- Read `docs\u002Fprinciples\u002FREADME.md` if it exists, then any principle files and ADRs relevant to the module being designed.\n- If a proposed interface or seam contradicts a principle or ADR, surface the contradiction explicitly and explain why it may be worth reopening.\n- If an authority already *endorses or anticipates* the proposed seam, surface that too — it shows the authorities were honored and the change is pre-ratified, which strengthens the recommendation.\n\n## Glossary\n\nUse these terms exactly — don't substitute \"component,\" \"service,\" \"API,\" or \"boundary.\" Consistent language is the whole point.\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 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. Runtime adapters are the common signal; historical\u002Fversioned contracts can also justify a seam when current behavior must not rewrite old behavior.\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## Dependency categories\n\nEvery deepening candidate has dependencies; classify them, because the category decides how the deepened module is tested across its seam (and, in a report, the tag it carries). Full detail — including the \"replace, don't layer\" testing move — is in [DEEPENING.md](DEEPENING.md).\n\n- **In-process** — pure computation, in-memory state, no I\u002FO. Merge and test through the new interface directly; no adapter needed. An embedded database (SQLite \u002F `better-sqlite3`) is *not* in-process — it does file I\u002FO; see local-substitutable.\n- **Local-substitutable** — a dependency with a local test stand-in (PGLite for Postgres, an embedded SQLite database on a temp file or `:memory:`, an in-memory filesystem). The stand-in runs in the test suite; the seam is internal, no port at the external interface.\n- **Ports & adapters** — your own service across a network\u002Fprocess boundary (an HTTP API, a localhost server). Define a port at the seam; inject an HTTP adapter in production and an in-memory adapter in tests.\n- **Mock** — a true external you don't control (Stripe, Twilio). Inject a port; tests provide a mock adapter.\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- **\"Boundary\"**: overloaded with DDD's bounded context. Say **seam** or **interface**.\n\n## Going deeper\n\n- **Deepening a cluster given its dependencies** — see [DEEPENING.md](DEEPENING.md): the dependency categories above expanded with per-category testing strategy, plus 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","bb13c72ec4134361fec0b0584913aee821330c02",".claude\u002Fskills\u002Fcodebase-design","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck","2026-11-10 23:00:02",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add joeloverbeck\u002Fcontinuity-loom --skill codebase-design",{"tool":35,"command":36},"bunx","bunx skills add joeloverbeck\u002Fcontinuity-loom --skill codebase-design",{"tool":38,"command":39},"pnpm","pnpm dlx skills add joeloverbeck\u002Fcontinuity-loom --skill codebase-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FSKILL.md",true,[43,49],{"path":44,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":47,"sourceHtmlUrl":48},"DEEPENING.md","REFERENCE","参考文档",4152,"https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FDEEPENING.md",{"path":50,"resourceType":45,"resourceTypeDesc":46,"sizeBytes":51,"sourceHtmlUrl":52},"DESIGN-IT-TWICE.md",3147,"https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Fcodebase-design\u002FDESIGN-IT-TWICE.md",[54,61,66,71,78,83],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M758XG3F9AESCQBKYQX0GPSD","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\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftriage\u002Freviews\u002Frev_a4ce832d-b023-4fa0-8d5d-382e558791d8\u002Fcandidate\u002FSKILL.md",[],[],{"skillNo":62,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M758XDY39PNPRY8FSXVE8SZN","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftriage\u002Fdecontamination\u002Fdec_2d4305f8-ee96-4376-a267-061413c4fdd6\u002Fcandidate\u002FSKILL.md",[],[],{"skillNo":67,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M758XB4XZ6N5XP8XZXWVMVQ0","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Ftriage\u002Fdecontamination\u002Fdec_2d4305f8-ee96-4376-a267-061413c4fdd6\u002Fbaseline\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M758X7WRCGV9BM5RNEGH4MSX","to-prd","Turn the current conversation into a PRD and publish it to the project issue tracker — no requirements interview, just synthesis of what you've already discussed; the seam confirmation is the sole checkpoint.","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Fto-prd\u002Fdecontamination\u002Fdec_581ad8e4-4f9d-4aad-a6ee-59eeec05c8a4\u002Fpre-land-backup\u002FSKILL.md",[],[],{"skillNo":79,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M758X55QJQTVHH1MWHJF2BBZ","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Fto-prd\u002Fdecontamination\u002Fdec_581ad8e4-4f9d-4aad-a6ee-59eeec05c8a4\u002Fcandidate\u002FSKILL.md",[],[],{"skillNo":84,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":18},"01M758X1Z0F2YRRHNTR3ZCY02C","https:\u002F\u002Fgithub.com\u002Fjoeloverbeck\u002Fcontinuity-loom\u002Fblob\u002Fmain\u002Freports\u002Fskill-evidence\u002Fto-prd\u002Fdecontamination\u002Fdec_581ad8e4-4f9d-4aad-a6ee-59eeec05c8a4\u002Fbaseline\u002FSKILL.md",[],[]]