[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6BV22BAF3SV9Z1TKCAAZ3P5":3,"skill-same:01M6BV22BAF3SV9Z1TKCAAZ3P5":65},{"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":25,"linkOnly":26,"markdownContent":27,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":35,"ownerDescription":6,"updatedAt":36,"install":37,"resources":50},"01M6BV22BAF3SV9Z1TKCAAZ3P5","tdd",null,"Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.","pkking\u002Fdotfiles","pkking","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2853724?v=4","01M6BTYGKF2NYA1TM9G1XSAE7N","li chaoran","01M6BTYGQW6GANXWW15H8SPDQ2",0,"MIT","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ftdd\u002FSKILL.md",[],[5,19,20,21,22,23,24],"test","integration tests","development","integration","refactor","first","2026-11-10 10:12:30",false,"---\nname: tdd\ndescription: Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions \"red-green-refactor\", or wants integration tests.\n---\n\n# Test-Driven Development\n\nTDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after.\n\nWhen exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.\n\n## What a good test is\n\nTests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification: \"user can checkout with valid cart\" tells you exactly what capability exists, and it survives refactors because it doesn't care about internal structure.\n\nSee [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.\n\n## Seams: where tests go\n\nA **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.\n\n**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything, so agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.\n\nAsk: \"What's the public interface, and which seams should we test?\"\n\nWhen the shape of that interface is itself in question (how deep the module is, where the seam belongs, what the interface should expose), call the Skill tool with \"codebase-design\" for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.\n\n## Anti-patterns\n\n- **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.\n- **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec.\n- **Horizontal slicing**: writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead: one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.\n\n## Rules of the loop\n\n- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.\n- **One slice at a time.** One seam, one test, one minimal implementation per cycle.\n- **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.\n","# Test-Driven Development\n\nTDD is the red → green loop. This skill is the reference that makes that loop produce tests worth keeping: what a good test is, where tests go, the anti-patterns, and the rules of the loop. Every section applies on every cycle: consult them before and during the loop, not after.\n\nWhen exploring the codebase, read `CONTEXT.md` (if it exists) so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.\n\n## What a good test is\n\nTests verify behavior through public interfaces, not implementation details. Code can change entirely; tests shouldn't. A good test reads like a specification: \"user can checkout with valid cart\" tells you exactly what capability exists, and it survives refactors because it doesn't care about internal structure.\n\nSee [tests.md](tests.md) for examples and [mocking.md](mocking.md) for mocking guidelines.\n\n## Seams: where tests go\n\nA **seam** is the public boundary you test at: the interface where you observe behavior without reaching inside. Tests live at seams, never against internals.\n\n**Test only at pre-agreed seams.** Before writing any test, write down the seams under test and confirm them with the user. No test is written at an unconfirmed seam. You can't test everything, so agreeing the seams up front is how testing effort lands on the critical paths and complex logic instead of every edge case.\n\nAsk: \"What's the public interface, and which seams should we test?\"\n\nWhen the shape of that interface is itself in question (how deep the module is, where the seam belongs, what the interface should expose), call the Skill tool with \"codebase-design\" for the vocabulary. It is the shared source of the module, interface, depth, seam, adapter, leverage and locality terms, and it is a reference to consult, not a session to run.\n\n## Anti-patterns\n\n- **Implementation-coupled**: mocks internal collaborators, tests private methods, or verifies through a side channel (querying the database instead of using the interface). The tell: the test breaks when you refactor but behavior hasn't changed.\n- **Tautological**: the assertion recomputes the expected value the way the code does (`expect(add(a, b)).toBe(a + b)`, a snapshot derived by hand the same way, a constant asserted equal to itself), so it passes by construction and can never disagree with the code. Expected values must come from an independent source of truth: a known-good literal, a worked example, the spec.\n- **Horizontal slicing**: writing all tests first, then all implementation. Bulk tests verify _imagined_ behavior: you test the _shape_ of things rather than user-facing behavior, the tests go insensitive to real changes, and you commit to test structure before understanding the implementation. Work in **vertical slices** instead: one test → one implementation → repeat, each test a **tracer bullet** that responds to what the last cycle taught you.\n\n## Rules of the loop\n\n- **Red before green.** Write the failing test first, then only enough code to pass it. Don't anticipate future tests or add speculative features.\n- **One slice at a time.** One seam, one test, one minimal implementation per cycle.\n- **Refactoring is not part of the loop.** It belongs to the review stage (see the `code-review` skill), not the red → green implementation cycle.\n",{"name":5,"description":7},"master","0952986a94cbbf338098cd44c77bb9282287019d","dotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ftdd","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles","https:\u002F\u002Fgithub.com\u002Fpkking","https:\u002F\u002Ffosstodon.org\u002F@pkking","2026-11-14 21:58:55",{"source":8,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add pkking\u002Fdotfiles --skill tdd",{"tool":43,"command":44},"bunx","bunx skills add pkking\u002Fdotfiles --skill tdd",{"tool":46,"command":47},"pnpm","pnpm dlx skills add pkking\u002Fdotfiles --skill tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ftdd\u002FSKILL.md",true,[51,57,61],{"path":52,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":55,"sourceHtmlUrl":56},"agents\u002Fopenai.yaml","REFERENCE","参考文档",87,"https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ftdd\u002Fagents\u002Fopenai.yaml",{"path":58,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":59,"sourceHtmlUrl":60},"mocking.md",1481,"https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ftdd\u002Fmocking.md",{"path":62,"resourceType":53,"resourceTypeDesc":54,"sizeBytes":63,"sourceHtmlUrl":64},"tests.md",2214,"https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ftdd\u002Ftests.md",[66,93,113,128,138,149],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":70,"licenseFileUrl":71,"sourceHtmlUrl":72,"categories":73,"keywords":87,"publishedAt":92},"01M6BTZYNBAF3ZW1F26AYFNP7C","frontend-design","Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ffrontend-design\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Ffrontend-design\u002FSKILL.md",[74,79,82],{"categoryNo":75,"categoryName":76,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":80,"categoryName":81,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":83,"categoryName":84,"taxonomyType":85,"taxonomyTypeDesc":86},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[88,89,90,91],"frontend","design","frontend design","ui","2026-11-12 13:55:43",{"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":97,"sourceHtmlUrl":98,"categories":99,"keywords":106,"publishedAt":92},"01M6BTYMZJTANQTXN0PXP0FZPE","aihot","查询 AIHOT 的中文 AI 资讯、精选、当前热点和日报。用户询问今天或最近的 AI 新闻、AI 圈动态、大模型或产品发布、OpenAI／Anthropic／Google 最新消息、AI 论文、AI 日报、AIHOT 精选、当前最热事件，或需要同步当前全部精选时使用。必须通过 aihot.news 的匿名只读 API 获取当前数据，不凭训练记忆回答新闻；不需要 API Key 或 MCP server。","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Faihot\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Faihot\u002FSKILL.md",[100,103],{"categoryNo":101,"categoryName":102,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":104,"categoryName":105,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000023","Skill与智能体开发",[95,107,108,109,110,111,112],"MCP","api","server","openai","mcp server","google",{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":125,"publishedAt":25},"01M6BV2S7QC2D65HBV50KRXP9P","writing-shape","Writing, exploit: shape raw material into an article, paragraph by paragraph.","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-shape\u002FSKILL.md",[119,122],{"categoryNo":120,"categoryName":121,"taxonomyType":77,"taxonomyTypeDesc":78},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":123,"categoryName":124,"taxonomyType":85,"taxonomyTypeDesc":86},"01JBSEEDCAT000000000000036","内容创作者",[126,127],"writing shape","writing",{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":136,"publishedAt":25},"01M6BV2QMHAVE24QQS5YRB91AN","writing-great-skills","Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-great-skills\u002FSKILL.md",[134,135],{"categoryNo":120,"categoryName":121,"taxonomyType":77,"taxonomyTypeDesc":78},{"categoryNo":123,"categoryName":124,"taxonomyType":85,"taxonomyTypeDesc":86},[137,127],"writing great skills",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":146,"publishedAt":25},"01M6BV2NJCTKZ7FJX22977QKJ9","writing-fragments","Writing, explore: mine raw fragments, no structure yet.","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-fragments\u002FSKILL.md",[144,145],{"categoryNo":120,"categoryName":121,"taxonomyType":77,"taxonomyTypeDesc":78},{"categoryNo":123,"categoryName":124,"taxonomyType":85,"taxonomyTypeDesc":86},[147,127,148],"writing fragments","explore",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":157,"publishedAt":25},"01M6BV2KQFWWPY0C168DF0F8G6","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fpkking\u002Fdotfiles\u002Fblob\u002Fmaster\u002Fdotfiles\u002Fdot_config\u002Fskillshare\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[155,156],{"categoryNo":120,"categoryName":121,"taxonomyType":77,"taxonomyTypeDesc":78},{"categoryNo":123,"categoryName":124,"taxonomyType":85,"taxonomyTypeDesc":86},[127,158,159],"writing for agents","documents"]