[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AVG8CE5BTR2CRFPHHVJCJZ":3,"skill-same:01M7AVG8CE5BTR2CRFPHHVJCJZ":44},{"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":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7AVG8CE5BTR2CRFPHHVJCJZ","test-driven-development",null,"Use when implementing a feature, bugfix, or behavior-changing refactor — require a failing behavior test before production code, then make the smallest change that passes.","MinhDuyDEV\u002Fmd-pikit","MinhDuyDEV","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F94704296?v=4","01M7AVDRJB5JM5VG5B6K49X0EZ","Nguyễn Viết Minh Duy","01M7AVDRKDB3JPGHFE4HGK1Z5M",0,"MIT","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: test-driven-development\ndescription: Use when implementing a feature, bugfix, or behavior-changing refactor — require a failing behavior test before production code, then make the smallest change that passes.\n---\n\n# Test-Driven Development\n\n## Iron Law\n\n\u003CHARD-GATE>\n**NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.** The test must fail because the required behavior is missing. If it passes immediately or fails to compile, it is not RED.\n\u003C\u002FHARD-GATE>\n\nUse for features, bugfixes, and behavior-changing refactors. Skip documentation, pure configuration, and explicitly throwaway prototypes.\n\n## Loop\n\n1. **RED** — write the smallest test of observable behavior; run it and inspect the expected failure.\n2. **GREEN** — write minimum production code; do not add adjacent improvements.\n3. **REFACTOR** — improve names and structure without new behavior.\n4. **VERIFY** — run the full relevant test file, then required type\u002Flint checks.\n\nA behavior test checks input\u002Foutput, state change, side effect, or error contract. It must survive internal refactoring.\n\nWork in the smallest vertical slice: one behavior through the relevant layers. Name the next observable check in one sentence; if you cannot, split it smaller. Finish RED\u002FGREEN verification before starting another slice.\n\n## Test Design Rules\n\n- **Test behavior, not mocks.** A mock-call assertion alone proves wiring, not the promised outcome.\n- **Mock at the seam.** Replace an external interface, not private internals.\n- **No test-only methods in production.** Inject the dependency or expose a real domain operation instead.\n- **One intent per test.** Multiple assertions are fine when they prove one outcome.\n- **Keep tests order-independent.** No shared mutable fixtures or reliance on another test running first.\n- **Use a contract test before mocking an unfamiliar dependency.** Know what the real dependency does.\n\n### Tautology Check\n\nAsk: **Would this test fail if I deleted or broke the production body?** If not, it is a tautology. A test that merely repeats the implementation, snapshots without intent, or checks `toHaveBeenCalled` can pass while behavior is wrong.\n\n## Common Rationalizations\n\n| Rationalization | Counter |\n| --- | --- |\n| “It is obvious.” | Then RED is cheap. Run it. |\n| “Tests after.” | A passing-after test does not prove it detects the defect. |\n| “Manual testing passed.” | It is not reproducible or regression-safe. |\n| “Mocking is faster.” | Mock only a known seam; assert the resulting behavior. |\n| “Existing tests cover it.” | Run them and cite the result. |\n\n## Stop Conditions\n\nStop if RED fails for the wrong reason, the test requires private access, or GREEN needs unrelated behavior. Repair the test or design before continuing.\n\n## Completion Evidence\n\nReport the observed RED failure, the GREEN command\u002Foutput, and the final relevant verification. No evidence means no completion claim.\n","# Test-Driven Development\n\n## Iron Law\n\n\u003CHARD-GATE>\n**NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.** The test must fail because the required behavior is missing. If it passes immediately or fails to compile, it is not RED.\n\u003C\u002FHARD-GATE>\n\nUse for features, bugfixes, and behavior-changing refactors. Skip documentation, pure configuration, and explicitly throwaway prototypes.\n\n## Loop\n\n1. **RED** — write the smallest test of observable behavior; run it and inspect the expected failure.\n2. **GREEN** — write minimum production code; do not add adjacent improvements.\n3. **REFACTOR** — improve names and structure without new behavior.\n4. **VERIFY** — run the full relevant test file, then required type\u002Flint checks.\n\nA behavior test checks input\u002Foutput, state change, side effect, or error contract. It must survive internal refactoring.\n\nWork in the smallest vertical slice: one behavior through the relevant layers. Name the next observable check in one sentence; if you cannot, split it smaller. Finish RED\u002FGREEN verification before starting another slice.\n\n## Test Design Rules\n\n- **Test behavior, not mocks.** A mock-call assertion alone proves wiring, not the promised outcome.\n- **Mock at the seam.** Replace an external interface, not private internals.\n- **No test-only methods in production.** Inject the dependency or expose a real domain operation instead.\n- **One intent per test.** Multiple assertions are fine when they prove one outcome.\n- **Keep tests order-independent.** No shared mutable fixtures or reliance on another test running first.\n- **Use a contract test before mocking an unfamiliar dependency.** Know what the real dependency does.\n\n### Tautology Check\n\nAsk: **Would this test fail if I deleted or broke the production body?** If not, it is a tautology. A test that merely repeats the implementation, snapshots without intent, or checks `toHaveBeenCalled` can pass while behavior is wrong.\n\n## Common Rationalizations\n\n| Rationalization | Counter |\n| --- | --- |\n| “It is obvious.” | Then RED is cheap. Run it. |\n| “Tests after.” | A passing-after test does not prove it detects the defect. |\n| “Manual testing passed.” | It is not reproducible or regression-safe. |\n| “Mocking is faster.” | Mock only a known seam; assert the resulting behavior. |\n| “Existing tests cover it.” | Run them and cite the result. |\n\n## Stop Conditions\n\nStop if RED fails for the wrong reason, the test requires private access, or GREEN needs unrelated behavior. Repair the test or design before continuing.\n\n## Completion Evidence\n\nReport the observed RED failure, the GREEN command\u002Foutput, and the final relevant verification. No evidence means no completion claim.\n",{"name":5,"description":7},"main","01207a96514af9f9c4d7d6cb594b936c6a9ddb10",".pi\u002Fskills\u002Ftest-driven-development","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV","2026-08-20 02:00:33",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MinhDuyDEV\u002Fmd-pikit --skill test-driven-development",{"tool":36,"command":37},"bunx","bunx skills add MinhDuyDEV\u002Fmd-pikit --skill test-driven-development",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MinhDuyDEV\u002Fmd-pikit --skill test-driven-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M7AVGJR1RSRVA3VJT8ZW4Y27","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment - applies TDD to process documentation by testing with subagents before writing, iterating until bulletproof against rationalization. Includes complete pressure testing methodology.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7AVGE076BNB3J7JDBGAKD2T","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7AVGAYJ6APXRB9QWBG7482S","typescript-coding-standards","Use when writing, refactoring, or reviewing TypeScript code that needs strong domain modeling, typed errors, schema parsing, safe adapters, test seams, or maintainable module boundaries.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Ftypescript-coding-standards\u002FSKILL.md",[],[],{"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":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7AVG5FJH3WTG9XR2G0608ND","source-driven-development","Use when unfamiliar libraries, dependency internals, external APIs, framework behavior, migrations, or current ecosystem guidance require official documentation, version-matched source, read the tests, and cited evidence.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fsource-driven-development\u002FSKILL.md",[],[],{"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":19},"01M7AVG37PZ77CF35KAR6E93ZJ","security-and-hardening","Use when auditing security, implementing authentication or authorization, handling secrets, or validating data across external trust boundaries.","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fsecurity-and-hardening\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":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7AVG0HSKDA2Q23AEWDT8TNS","prototype","Use when the user wants to prototype, sanity-check a data model or state machine, mock up a UI, explore design options, or says \"prototype this\", \"let me play with it\", \"try a few designs\".","https:\u002F\u002Fgithub.com\u002FMinhDuyDEV\u002Fmd-pikit\u002Fblob\u002Fmain\u002F.pi\u002Fskills\u002Fprototype\u002FSKILL.md",[],[]]