[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AJ9QYVKKFRC154Y9BQA2GV":3,"skill-same:01M7AJ9QYVKKFRC154Y9BQA2GV":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":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7AJ9QYVKKFRC154Y9BQA2GV","codebase-design",null,"用于设计深模块的共享词汇。适用于用户想设计或改进模块接口、寻找深化机会、决定 seam 放在哪里、让代码更容易测试或更适合 AI 导航，或其他技能需要深模块词汇时。","limbo947\u002Fdsh-recall-plugin","limbo947","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F267408385?v=4","01M7AJ97PM2MZC4BZ3VEFK5KPZ","01M7AJ97QB6S04S49C2M9X80SX",55,"MIT","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcodebase-design\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: codebase-design\ndescription: 用于设计深模块的共享词汇。适用于用户想设计或改进模块接口、寻找深化机会、决定 seam 放在哪里、让代码更容易测试或更适合 AI 导航，或其他技能需要深模块词汇时。\n---\n\n# 代码库设计\n\n设计 **deep modules**：把大量行为放在小 interface 之后，把 interface 放在清晰 seam 上，并通过该 interface 测试。凡是在设计或重构代码时，都使用这套语言和原则。目标是给 callers 带来 leverage，给 maintainers 带来 locality，并让每个人都更容易测试。\n\n## 术语表\n\n准确使用这些术语，不要替换成 \"component\"、\"service\"、\"API\" 或 \"boundary\"。一致语言就是重点。\n\n**Module** - 任何拥有 interface 和 implementation 的东西。它故意不限定尺度：function、class、package，或跨层 slice 都可以。_Avoid_: unit, component, service.\n\n**Interface** - caller 为了正确使用 module 必须知道的一切：type signature，以及 invariants、ordering constraints、error modes、required configuration 和 performance characteristics。_Avoid_: API, signature（太窄，只指 type-level surface）。\n\n**Implementation** - module 内部的代码体。它不同于 **Adapter**：一个东西可以是小 adapter 但有大 implementation（Postgres repo），也可以是大 adapter 但 implementation 很小（in-memory fake）。讨论 seam 时说 adapter；其他时候说 implementation。\n\n**Depth** - interface 上的 leverage：caller（或 test）每学习一单位 interface，就能触达多少行为。大量行为藏在小 interface 后面时，module 是 **deep**；interface 几乎和 implementation 一样复杂时，module 是 **shallow**。\n\n**Seam**（Michael Feathers）- 你可以在不编辑当前位置的情况下改变行为的地方；也就是 module 的 interface 所在的 *location*。seam 放在哪里是独立设计决策，不同于 seam 后面放什么。_Avoid_: boundary（它和 DDD bounded context 过载）。\n\n**Adapter** - 在 seam 上满足某个 interface 的具体东西。描述的是 *role*（填哪个槽位），不是 substance（内部是什么）。\n\n**Leverage** - callers 从 depth 获得的收益：每学习一单位 interface，就得到更多能力。一个 implementation 会在 N 个 call sites 和 M 个 tests 中回本。\n\n**Locality** - maintainers 从 depth 获得的收益：change、bugs、knowledge 和 verification 集中在一个地方，而不是散到 callers 里。修一次，到处都修好。\n\n## Deep 与 shallow\n\n**Deep module** = small interface + lots of implementation:\n\n```text\n+------------------+\n| Small Interface  | -> few methods, simple params\n+------------------+\n|                  |\n| Deep             | -> complex logic hidden\n| Implementation   |\n|                  |\n+------------------+\n```\n\n**Shallow module** = large interface + little implementation（避免）：\n\n```text\n+-------------------------------+\n| Large Interface               | -> many methods, complex params\n+-------------------------------+\n| Thin Implementation           | -> mostly pass-through\n+-------------------------------+\n```\n\n设计 interface 时问：\n\n- 我能减少 methods 数量吗？\n- 我能简化 parameters 吗？\n- 我能把更多复杂度藏到内部吗？\n\n## 原则\n\n- **Depth 是 interface 的属性，不是 implementation 的属性。** Deep module 内部可以由小的、mockable、swappable parts 组成，只是它们不属于 interface。一个 module 可以同时拥有 **internal seams**（implementation 私有，供自身 tests 使用）和位于 interface 的 **external seam**。\n- **Deletion test。** 想象删除这个 module。如果复杂度消失了，它只是 pass-through。如果复杂度重新散落到 N 个 callers 里，它就在发挥价值。\n- **Interface is the test surface。** Callers 和 tests 穿过同一个 seam。若你想测试 interface 之后的内部细节，这个 module 形状可能不对。\n- **One adapter means a hypothetical seam. Two adapters means a real one.** 除非确实有东西会跨 seam 变化，否则不要引入 seam。\n\n## 为可测试性而设计\n\n好的 interfaces 让测试自然发生：\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.** 更少 methods = 需要更少 tests。更少 params = 更简单的 test setup。\n\n## 关系\n\n- 一个 **Module** 恰好有一个 **Interface**（它呈现给 callers 和 tests 的 surface）。\n- **Depth** 是 **Module** 的属性，并以其 **Interface** 衡量。\n- **Seam** 是 **Module** 的 **Interface** 所在的位置。\n- **Adapter** 位于 **Seam** 上，并满足 **Interface**。\n- **Depth** 为 callers 产生 **Leverage**，为 maintainers 产生 **Locality**。\n\n## 不采用的表述\n\n- **把 depth 当作 implementation-lines 与 interface-lines 的比例**（Ousterhout）：这会奖励 padding implementation。这里使用 depth-as-leverage。\n- **把 \"Interface\" 理解为 TypeScript `interface` keyword 或 class public methods**：太窄；这里的 interface 包括 caller 必须知道的所有事实。\n- **\"Boundary\"**：与 DDD bounded context 过载。说 **seam** 或 **interface**。\n\n## 进一步深化\n\n- **Deepening a cluster given its dependencies** - 见 [DEEPENING.md](DEEPENING.md)：Dependency 分类、Seam 纪律和「替换，而不是叠加」的测试策略。\n- **Exploring alternative interfaces** - 见 [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md)：启动并行 sub-agents，用几种截然不同的方式设计 interface，再按 depth、locality 和 seam placement 比较。\n","# 代码库设计\n\n设计 **deep modules**：把大量行为放在小 interface 之后，把 interface 放在清晰 seam 上，并通过该 interface 测试。凡是在设计或重构代码时，都使用这套语言和原则。目标是给 callers 带来 leverage，给 maintainers 带来 locality，并让每个人都更容易测试。\n\n## 术语表\n\n准确使用这些术语，不要替换成 \"component\"、\"service\"、\"API\" 或 \"boundary\"。一致语言就是重点。\n\n**Module** - 任何拥有 interface 和 implementation 的东西。它故意不限定尺度：function、class、package，或跨层 slice 都可以。_Avoid_: unit, component, service.\n\n**Interface** - caller 为了正确使用 module 必须知道的一切：type signature，以及 invariants、ordering constraints、error modes、required configuration 和 performance characteristics。_Avoid_: API, signature（太窄，只指 type-level surface）。\n\n**Implementation** - module 内部的代码体。它不同于 **Adapter**：一个东西可以是小 adapter 但有大 implementation（Postgres repo），也可以是大 adapter 但 implementation 很小（in-memory fake）。讨论 seam 时说 adapter；其他时候说 implementation。\n\n**Depth** - interface 上的 leverage：caller（或 test）每学习一单位 interface，就能触达多少行为。大量行为藏在小 interface 后面时，module 是 **deep**；interface 几乎和 implementation 一样复杂时，module 是 **shallow**。\n\n**Seam**（Michael Feathers）- 你可以在不编辑当前位置的情况下改变行为的地方；也就是 module 的 interface 所在的 *location*。seam 放在哪里是独立设计决策，不同于 seam 后面放什么。_Avoid_: boundary（它和 DDD bounded context 过载）。\n\n**Adapter** - 在 seam 上满足某个 interface 的具体东西。描述的是 *role*（填哪个槽位），不是 substance（内部是什么）。\n\n**Leverage** - callers 从 depth 获得的收益：每学习一单位 interface，就得到更多能力。一个 implementation 会在 N 个 call sites 和 M 个 tests 中回本。\n\n**Locality** - maintainers 从 depth 获得的收益：change、bugs、knowledge 和 verification 集中在一个地方，而不是散到 callers 里。修一次，到处都修好。\n\n## Deep 与 shallow\n\n**Deep module** = small interface + lots of implementation:\n\n```text\n+------------------+\n| Small Interface  | -> few methods, simple params\n+------------------+\n|                  |\n| Deep             | -> complex logic hidden\n| Implementation   |\n|                  |\n+------------------+\n```\n\n**Shallow module** = large interface + little implementation（避免）：\n\n```text\n+-------------------------------+\n| Large Interface               | -> many methods, complex params\n+-------------------------------+\n| Thin Implementation           | -> mostly pass-through\n+-------------------------------+\n```\n\n设计 interface 时问：\n\n- 我能减少 methods 数量吗？\n- 我能简化 parameters 吗？\n- 我能把更多复杂度藏到内部吗？\n\n## 原则\n\n- **Depth 是 interface 的属性，不是 implementation 的属性。** Deep module 内部可以由小的、mockable、swappable parts 组成，只是它们不属于 interface。一个 module 可以同时拥有 **internal seams**（implementation 私有，供自身 tests 使用）和位于 interface 的 **external seam**。\n- **Deletion test。** 想象删除这个 module。如果复杂度消失了，它只是 pass-through。如果复杂度重新散落到 N 个 callers 里，它就在发挥价值。\n- **Interface is the test surface。** Callers 和 tests 穿过同一个 seam。若你想测试 interface 之后的内部细节，这个 module 形状可能不对。\n- **One adapter means a hypothetical seam. Two adapters means a real one.** 除非确实有东西会跨 seam 变化，否则不要引入 seam。\n\n## 为可测试性而设计\n\n好的 interfaces 让测试自然发生：\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.** 更少 methods = 需要更少 tests。更少 params = 更简单的 test setup。\n\n## 关系\n\n- 一个 **Module** 恰好有一个 **Interface**（它呈现给 callers 和 tests 的 surface）。\n- **Depth** 是 **Module** 的属性，并以其 **Interface** 衡量。\n- **Seam** 是 **Module** 的 **Interface** 所在的位置。\n- **Adapter** 位于 **Seam** 上，并满足 **Interface**。\n- **Depth** 为 callers 产生 **Leverage**，为 maintainers 产生 **Locality**。\n\n## 不采用的表述\n\n- **把 depth 当作 implementation-lines 与 interface-lines 的比例**（Ousterhout）：这会奖励 padding implementation。这里使用 depth-as-leverage。\n- **把 \"Interface\" 理解为 TypeScript `interface` keyword 或 class public methods**：太窄；这里的 interface 包括 caller 必须知道的所有事实。\n- **\"Boundary\"**：与 DDD bounded context 过载。说 **seam** 或 **interface**。\n\n## 进一步深化\n\n- **Deepening a cluster given its dependencies** - 见 [DEEPENING.md](DEEPENING.md)：Dependency 分类、Seam 纪律和「替换，而不是叠加」的测试策略。\n- **Exploring alternative interfaces** - 见 [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md)：启动并行 sub-agents，用几种截然不同的方式设计 interface，再按 depth、locality 和 seam placement 比较。\n",{"name":5,"description":7},"main","df80442fbb1b598026c75b6b699f7d0ecdc2ced7",".agents\u002Fskills\u002Fcodebase-design",7,"https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin","https:\u002F\u002Fgithub.com\u002Flimbo947","2026-11-06 01:16:56",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add limbo947\u002Fdsh-recall-plugin --skill codebase-design",{"tool":36,"command":37},"bunx","bunx skills add limbo947\u002Fdsh-recall-plugin --skill codebase-design",{"tool":39,"command":40},"pnpm","pnpm dlx skills add limbo947\u002Fdsh-recall-plugin --skill codebase-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcodebase-design\u002FSKILL.md",true,[44,50,54],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"agents\u002Fopenai.yaml","REFERENCE","参考文档",103,"https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcodebase-design\u002Fagents\u002Fopenai.yaml",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"DEEPENING.md",2521,"https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcodebase-design\u002FDEEPENING.md",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"DESIGN-IT-TWICE.md",2619,"https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcodebase-design\u002FDESIGN-IT-TWICE.md",[59,66,73,80,87,94],{"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":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M7AJAH5ZM0CATVKNJESYF19S","trim-cot-leakage","审计或修复「读起来像泄漏推理转录」的散文时使用——死设计会话引用（(decision 7)、审计项代码、未提交草稿的 §N）、变更叙述（「以前」「不再」「本版」）、栈\u002F审阅视角（「本栈的后一个 PR」「评审中被拒」）、对审查者说理的辩护、控制流叙述与注释、JSDoc、文档、计划记录里的规划残留；用户说「清理 CoT 泄漏」「审计文档措辞」时适用。","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftrim-cot-leakage\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M7AJAEXKNNK38D7EAPQC1HTJ","tdd","测试驱动开发。适用于用户想用先写测试的方式构建功能或修复缺陷、提到 “red-green-refactor”，或需要集成测试时。","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M7AJACGA7J9R71JESX32HDPD","speed-up-perf","调查或优化本插件性能时使用——每条用户消息的快照开销（win32 上 spawn pwsh\u002Fgit 尤其贵）、串行队列吞吐、启动预热、gc 节拍、大工作区 diff\u002Frollback、client 快照树渲染；用户说「让它更快」「这里好慢」时适用，把抱怨变成可复现的测量与小步、保行为的修复。","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fspeed-up-perf\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M7AJAA4C6HMC3GN35HSFX389","research","对照高可信一手来源调研问题，并把发现保存为仓库中的 Markdown 文件。适用于用户想调研主题、收集文档或 API 事实，或把阅读工作委托给后台代理时。","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fresearch\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M7AJA6WDD84YJKY4NN8CVXKE","prose-standard","撰写、审查、精简或审计本仓库的文字时使用——Markdown 文档与 README、注释与 JSDoc、配置说明、诊断文案、client UI 字符串；用户说「润色文档」「审查 README」「这段文案行不行」时适用。拥有文档结构、行文规则与文档质量判据。","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fprose-standard\u002FSKILL.md",[],[],{"skillNo":95,"name":96,"nameZh":6,"description":97,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":18},"01M7AJA3WBPXAE84EZE01JRF8W","pre-push-checks","git push、打 tag、发 npm 包或声称「检查通过」之前使用——按外发 diff 的改动面选最小检查集而非条件反射跑全量；test:probe 与 verify:host 不进 CI，发布前必须在本地跑过。","https:\u002F\u002Fgithub.com\u002Flimbo947\u002Fdsh-recall-plugin\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fpre-push-checks\u002FSKILL.md",[],[]]