[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ARHWN2C2CVAV3YQ6TNNBCS":3,"skill-same:01M7ARHWN2C2CVAV3YQ6TNNBCS":57},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M7ARHWN2C2CVAV3YQ6TNNBCS","tdd",null,"测试驱动开发。适用于用户想以测试先行方式开发功能或修复缺陷、提到「红-绿-重构」，或者想要集成测试的场合。","FeatherHunter\u002Fdsh-mattpocock-skills-deck","FeatherHunter","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12967785?v=4","01M71JFD7JMNT8HWC3Y9JKMWGG","王辰浩","01M7ARGR9XSH26AXVRCDJYP6T5",363,"MIT","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills-zh\u002Ftdd\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tdd\ndescription: 测试驱动开发。适用于用户想以测试先行方式开发功能或修复缺陷、提到「红-绿-重构」，或者想要集成测试的场合。\n---\n\n# 测试驱动开发\n\nTDD 就是红 → 绿这个循环。本技能是一份参考，让这个循环产出的测试值得保留：什么算好测试、测试放在哪里、有哪些反模式，以及循环的规则。每一节在每一轮循环里都适用：在循环开始之前和进行当中都要查阅，而不是等循环结束之后再查。\n\n探索代码库时，先读 `GLOSSARY.md`（如果存在），让测试名称和接口词汇与项目的领域语言对得上；同时尊重你正在触及的那片区域里的 ADR。\n\n## 什么样的测试是好测试\n\n测试通过公开接口验证行为，不验证实现细节。代码可以整个换掉，测试不该跟着换。一份好测试读起来像规格说明：「用户可以用有效购物车结账」明确告诉你存在什么能力；它也能扛住重构，因为它不关心内部结构。\n\n示例见 [tests.md](tests.md)，模拟相关的准则见 [mocking.md](mocking.md)。\n\n## 接缝：测试放在哪里\n\n**接缝**是你能做测试的那道公开接口：你在这里观察行为，不必伸手到内部。测试只落在接缝上，绝不针对内部实现。\n\n**只在事先约定好的接缝上测试。** 写任何测试之前，先把准备测的接缝写下来，并跟用户确认。没有确认过的接缝上，一个测试都不写。你不可能什么都测，所以事先把接缝谈定，才能让测试精力落在关键路径和复杂逻辑上，而不是落在每个边缘情况上。\n\n问一句：「公开接口是什么，我们应该测哪些接缝？」再给每个提出的接缝写一行说明：它能抓住什么、漏掉什么。\n\n当这个接口本身的形状还有疑问时（模块该有多深、接缝该放在哪里、接口该暴露什么），调用 Skill 工具并传入 \"codebase-design\" 来拿词汇。它是模块、接口、深度、接缝、适配器、杠杆和局部性这些术语的共同出处；它是一份随时可查的参考资料，不是要跑起来的一次会话。\n\n## 反模式\n\n- **与实现耦合**：模拟内部协作者、测试私有方法，或者通过旁路来验证（不去用接口，而是去查数据库）。识别信号：你重构了，但行为没有变，测试却挂了。\n- **同义反复**：断言用跟代码一样的方式把期望值重算一遍（`expect(add(a, b)).toBe(a + b)`、手工按同样方式推导出来的快照、把一个常量断言成它自己），于是它靠构造本身就成立，永远不可能与代码不一致。期望值必须来自独立的事实来源：一个已知正确的字面量、一个算好的例子，或者规格说明。\n- **水平切片**：先把所有测试写完，再写所有实现。批量写出来的测试验证的是_想象中_的行为：你测的是东西的_形状_，而不是面向用户的行为；测试对真实发生的变化不再敏感；而且你在还没理解实现之前就把测试结构定死了。改用**垂直切片**：一个测试 → 一份实现 → 重复，每个测试都是一发**曳光弹**，根据上一轮循环学到的东西来调整。\n\n## 循环的规则\n\n- **先红后绿。** 先写失败的测试，然后只写刚好能让它通过的那点代码。不要提前考虑将来的测试，也不要加投机性的功能。\n- **一次一个切片。** 每一轮循环一条接缝、一个测试、一份最小实现。\n- **重构不属于这个循环。** 它属于评审阶段（见 `code-review` 技能），不属于红 → 绿的实现循环。\n","# 测试驱动开发\n\nTDD 就是红 → 绿这个循环。本技能是一份参考，让这个循环产出的测试值得保留：什么算好测试、测试放在哪里、有哪些反模式，以及循环的规则。每一节在每一轮循环里都适用：在循环开始之前和进行当中都要查阅，而不是等循环结束之后再查。\n\n探索代码库时，先读 `GLOSSARY.md`（如果存在），让测试名称和接口词汇与项目的领域语言对得上；同时尊重你正在触及的那片区域里的 ADR。\n\n## 什么样的测试是好测试\n\n测试通过公开接口验证行为，不验证实现细节。代码可以整个换掉，测试不该跟着换。一份好测试读起来像规格说明：「用户可以用有效购物车结账」明确告诉你存在什么能力；它也能扛住重构，因为它不关心内部结构。\n\n示例见 [tests.md](tests.md)，模拟相关的准则见 [mocking.md](mocking.md)。\n\n## 接缝：测试放在哪里\n\n**接缝**是你能做测试的那道公开接口：你在这里观察行为，不必伸手到内部。测试只落在接缝上，绝不针对内部实现。\n\n**只在事先约定好的接缝上测试。** 写任何测试之前，先把准备测的接缝写下来，并跟用户确认。没有确认过的接缝上，一个测试都不写。你不可能什么都测，所以事先把接缝谈定，才能让测试精力落在关键路径和复杂逻辑上，而不是落在每个边缘情况上。\n\n问一句：「公开接口是什么，我们应该测哪些接缝？」再给每个提出的接缝写一行说明：它能抓住什么、漏掉什么。\n\n当这个接口本身的形状还有疑问时（模块该有多深、接缝该放在哪里、接口该暴露什么），调用 Skill 工具并传入 \"codebase-design\" 来拿词汇。它是模块、接口、深度、接缝、适配器、杠杆和局部性这些术语的共同出处；它是一份随时可查的参考资料，不是要跑起来的一次会话。\n\n## 反模式\n\n- **与实现耦合**：模拟内部协作者、测试私有方法，或者通过旁路来验证（不去用接口，而是去查数据库）。识别信号：你重构了，但行为没有变，测试却挂了。\n- **同义反复**：断言用跟代码一样的方式把期望值重算一遍（`expect(add(a, b)).toBe(a + b)`、手工按同样方式推导出来的快照、把一个常量断言成它自己），于是它靠构造本身就成立，永远不可能与代码不一致。期望值必须来自独立的事实来源：一个已知正确的字面量、一个算好的例子，或者规格说明。\n- **水平切片**：先把所有测试写完，再写所有实现。批量写出来的测试验证的是_想象中_的行为：你测的是东西的_形状_，而不是面向用户的行为；测试对真实发生的变化不再敏感；而且你在还没理解实现之前就把测试结构定死了。改用**垂直切片**：一个测试 → 一份实现 → 重复，每个测试都是一发**曳光弹**，根据上一轮循环学到的东西来调整。\n\n## 循环的规则\n\n- **先红后绿。** 先写失败的测试，然后只写刚好能让它通过的那点代码。不要提前考虑将来的测试，也不要加投机性的功能。\n- **一次一个切片。** 每一轮循环一条接缝、一个测试、一份最小实现。\n- **重构不属于这个循环。** 它属于评审阶段（见 `code-review` 技能），不属于红 → 绿的实现循环。\n",{"name":5,"description":7},"main","5b4d78f3b2f70a7de1743ddf59b1999330daa1d1","package\u002Fbundled-skills-zh\u002Ftdd",33,"https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck","https:\u002F\u002Ffeatherhunter.github.io\u002Fdsh-mattpocock-skills-deck\u002Farchitecture\u002FMattSkills-architecture.html","https:\u002F\u002Fgithub.com\u002FFeatherHunter","The Boy, The Man, The Human.","2026-11-14 17:21:39",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add FeatherHunter\u002Fdsh-mattpocock-skills-deck --skill tdd",{"tool":39,"command":40},"bunx","bunx skills add FeatherHunter\u002Fdsh-mattpocock-skills-deck --skill tdd",{"tool":42,"command":43},"pnpm","pnpm dlx skills add FeatherHunter\u002Fdsh-mattpocock-skills-deck --skill tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills-zh\u002Ftdd\u002FSKILL.md",true,[47,53],{"path":48,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":51,"sourceHtmlUrl":52},"mocking.md","REFERENCE","参考文档",1549,"https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills-zh\u002Ftdd\u002Fmocking.md",{"path":54,"resourceType":49,"resourceTypeDesc":50,"sizeBytes":55,"sourceHtmlUrl":56},"tests.md",2266,"https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills-zh\u002Ftdd\u002Ftests.md",[58,65,72,79,86,93],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7ARN2HT5PJ948V8V1X6AE2P","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7ARMY0H53GWTKKDWEFW38H7","wizard","Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7ARMTZHMWQCM1VN87EFKHYF","wayfinder","Plan a huge chunk of work (more than one agent session can hold) as a shared map of decision tickets on your issue tracker, and resolve them one at a time until the way to the destination is clear.","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills\u002Fwayfinder\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7ARMS9JVG5BJSAGBZCYFEJV","wait-what","Stop. That last message did not land: re-pitch it.","https:\u002F\u002Fgithub.com\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills\u002Fwait-what\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7ARMPH1T621Q493BRNJA4M9","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\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills\u002Ftriage\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7ARMJ9YHKAQQ9Z2WSQ5Y9VK","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\u002FFeatherHunter\u002Fdsh-mattpocock-skills-deck\u002Fblob\u002Fmain\u002Fpackage\u002Fbundled-skills\u002Fto-tickets\u002FSKILL.md",[],[]]