[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CP2BH7KSPPS535F93EH7EC":3,"skill-same:01M7CP2BH7KSPPS535F93EH7EC":72},{"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":16,"sourceHtmlUrl":17,"categories":18,"keywords":19,"publishedAt":20,"linkOnly":21,"markdownContent":22,"markdownBody":23,"frontMatter":24,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":14,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7CP2BH7KSPPS535F93EH7EC","tdd",null,"Test-driven development. Use for test-first features, red-green-refactor, or regression tests.","syanga\u002Fastack","syanga","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42523849?v=4","01M7CNYD2SW40HXC8R8CTVJPGE","Alan Yang","01M7CNYD3D0B0EYPA4AGXC1VC8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FLICENSE-pstack","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tdd\ndescription: Test-driven development. Use for test-first features, red-green-refactor, or regression 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, if the project has a domain glossary (located per [GLOSSARY-FORMAT.md](..\u002Fdomain-modeling\u002FGLOSSARY-FORMAT.md)), read it so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.\n\nFor bug fixes, follow [BUG-FIX.md](BUG-FIX.md) for the focused regression workflow and its practical fallback. The test-quality references below apply to both features and fixes.\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\nRead [Test Behavior, Not Implementation](..\u002Fprinciples\u002Ftest-behavior-not-implementation.md) before writing or changing tests. See [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**Reuse agreed seams.** Use the testing boundaries already established in the spec or conversation. Otherwise name the existing public interface that reaches the behavior and state your choice. Give each proposed seam a one-line note on what it catches and what it misses. Confirm with the user only when unresolved requirements or a new boundary would change the design. Testing effort belongs on the critical paths and complex logic.\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), read [Deep Modules](..\u002Fprinciples\u002Fdeep-modules.md) 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- **Refactor after green.** When the passing code reveals a concrete simplification, keep behavior fixed and rerun the affected checks. Broader review belongs to [review-pr](..\u002Freview-pr\u002FSKILL.md).\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, if the project has a domain glossary (located per [GLOSSARY-FORMAT.md](..\u002Fdomain-modeling\u002FGLOSSARY-FORMAT.md)), read it so test names and interface vocabulary match the project's domain language, and respect ADRs in the area you're touching.\n\nFor bug fixes, follow [BUG-FIX.md](BUG-FIX.md) for the focused regression workflow and its practical fallback. The test-quality references below apply to both features and fixes.\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\nRead [Test Behavior, Not Implementation](..\u002Fprinciples\u002Ftest-behavior-not-implementation.md) before writing or changing tests. See [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**Reuse agreed seams.** Use the testing boundaries already established in the spec or conversation. Otherwise name the existing public interface that reaches the behavior and state your choice. Give each proposed seam a one-line note on what it catches and what it misses. Confirm with the user only when unresolved requirements or a new boundary would change the design. Testing effort belongs on the critical paths and complex logic.\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), read [Deep Modules](..\u002Fprinciples\u002Fdeep-modules.md) 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- **Refactor after green.** When the passing code reveals a concrete simplification, keep behavior fixed and rerun the affected checks. Broader review belongs to [review-pr](..\u002Freview-pr\u002FSKILL.md).\n",{"name":5,"description":7},"main","ec1ea5dc71f382a2a09360a736d31b7294e5ecc2","skills\u002Ftdd","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack","https:\u002F\u002Fgithub.com\u002Fsyanga","2026-11-14 17:01:29",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add syanga\u002Fastack --skill tdd",{"tool":37,"command":38},"bunx","bunx skills add syanga\u002Fastack --skill tdd",{"tool":40,"command":41},"pnpm","pnpm dlx skills add syanga\u002Fastack --skill tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FSKILL.md",true,[45,51,55,61,64,68],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",87,"https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"BUG-FIX.md",3118,"https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FBUG-FIX.md",{"path":56,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":59,"sourceHtmlUrl":60},"LICENSE-mattpocock","LICENSE","许可证",1068,"https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002FLICENSE-mattpocock",{"path":62,"resourceType":57,"resourceTypeDesc":58,"sizeBytes":63,"sourceHtmlUrl":16},"LICENSE-pstack",1067,{"path":65,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":66,"sourceHtmlUrl":67},"mocking.md",1341,"https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002Fmocking.md",{"path":69,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":70,"sourceHtmlUrl":71},"tests.md",1946,"https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Ftdd\u002Ftests.md",[73,80,88,96,104,112],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":20},"01M7CP39S6D7662SFCC9K286T7","replace-with-skill-name","Replace with when this skill should be reached.","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Ftemplates\u002Fskill\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":84,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":20},"01M7CP37YN62Z7VR6P2J7918ZA","writing-for-agents","Writing documents for agents. Use when creating or editing skills, or modifying AGENTS.md or CLAUDE.md.","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-for-agents\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":20},"01M7CP353RP2S1M1ZMHFZ0F610","worktree-cleanup","Worktree cleanup. Use for cleanup, resource audits, close this lane, or close out.","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fworktree-cleanup\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fworktree-cleanup\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":20},"01M7CP32DSVPRTBAFHF1P6NZ1X","wizard","Generate an interactive Bash wizard that walks a human through steps only they can perform. Use when provisioning, credential setup, or a one-off migration needs such steps.","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwizard\u002FLICENSE-mattpocock","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwizard\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":20},"01M7CP2YE3WABQE9MNY8RQD6MX","why","Use for 'why does X work this way', 'why we picked Y', design rationale, regressions, postmortems, or data-backed thresholds. Returns a cited read on decisions and tradeoffs.","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwhy\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":20},"01M7CP2VP8JA1HYDE8TJX2Y494","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\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwayfinder\u002FLICENSE-mattpocock","https:\u002F\u002Fgithub.com\u002Fsyanga\u002Fastack\u002Fblob\u002Fmain\u002Fskills\u002Fwayfinder\u002FSKILL.md",[],[]]