[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ERE1JTCK5NGPD2NHCGY0FH":3,"skill-same:01M7ERE1JTCK5NGPD2NHCGY0FH":64},{"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":26,"commitSha":27,"skillDirectory":28,"forksCount":29,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7ERE1JTCK5NGPD2NHCGY0FH","tdd",null,"Fix a bug test-first, with a focused regression test that fails before the fix and passes after. Use for a bug with a clear, cheap test path; skip it when the test would be slow or integration-heavy.","JoshuaHayesWasHere\u002Fjstack","JoshuaHayesWasHere","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78288453?v=4","01M7EQPZP0GDYN3SYY9SZZHFJE","Joshua Hayes","01M7EQPZPQKJDZR99NG512A8X2",1,"MIT","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Ftdd\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: tdd\ndescription: \"Fix a bug test-first, with a focused regression test that fails before the fix and passes after. Use for a bug with a clear, cheap test path; skip it when the test would be slow or integration-heavy.\"\ntip: fixes a bug test-first, with a regression test that fails before the fix | fix this bug | fix the bug | regression test | failing test first | test first\ncard: \"Distrust the change | 3 | Fixes a bug test-first: a focused regression test that fails before the fix and passes after it. | Reach for it when a bug has a clear, cheap test path. | op: the operator\"\n---\n\n# TDD Bug Fix\n\nSource: pstack, `pstack\u002Fskills\u002Ftdd\u002FSKILL.md`\n\nWhen fixing a bug with a clear, cheap test path, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.\n\nRun this first:\n\n```sh\nif R=$(realpath ~\u002F.claude\u002Fskills\u002Ftdd\u002F..\u002F.. 2> \u002Fdev\u002Fnull) && [ -f \"$R\u002Fplaybooks\u002Fbug-fix.md\" ]; then\n    echo \"$R\"\nelse\n    echo \"no root: ~\u002F.claude\u002Fskills\u002Ftdd is not a link into the repo this skill lives in\"\nfi\n```\n\nIt prints the root of the repo this skill lives in. Every path below that starts with `playbooks\u002F`, `principles\u002F` or `skills\u002F` is from that root, and a path that starts with `references\u002F` is beside this file. On `no root` the skill was loaded from somewhere else: the root is two directories above the real place of this file, not of a link to it.\n\n## Workflow\n\nThe workflow is written once, in `playbooks\u002Fbug-fix.md`: the repro, the failing test seen to fail for the intended reason, the fix at the root cause, the proof, and the commit of the failing test before the fix. Read it and run its steps 1 to 6 in this thread, in order, as written. Its step 7 opens a pull request the way a crewmate does: run it in a crewmate's thread. In any other thread run the repo's check command in its place, and stop.\n\nThat playbook is written for a crewmate. In a thread with no brief, its \"Result\" is your reply to the user, and the brief's **Where** in its step 4 is the files the user's request names. Its step 6 commits, and such a thread commits only when the user asked for commits, and never on the default branch: otherwise leave the test and the fix uncommitted and say so.\n\nThe rest of this file is what the source says and the playbook does not.\n\n## When no test is written\n\nThe playbook names three reasons to write no test: a broad harness, brittle mocks, slow infrastructure. Three more count: the bug needs production-only state, its reproduction steps are vague, or the test would churn large unrelated fixtures. Browser automation and a snapshot comparison are checks that can stand in, beside the ones the playbook lists.\n\nA bad test is one that mostly tests mocks, encodes current implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.\n\n## Guardrails\n\n- Keep the regression test focused on the bug. Avoid broad fixture churn or unrelated coverage expansion.\n- If the bug is flaky, make the test deterministic where possible and document the signal being locked down.\n\n## Final Response\n\nReport the evidence, not just the outcome, as the playbook's \"Hand over\" has it: the failing-before check and the failure it produced, the passing-after run, and any nearby validation performed.\n","# TDD Bug Fix\n\nSource: pstack, `pstack\u002Fskills\u002Ftdd\u002FSKILL.md`\n\nWhen fixing a bug with a clear, cheap test path, make the broken behavior executable before changing production code. The goal is a focused regression test that fails before the fix and passes after it.\n\nRun this first:\n\n```sh\nif R=$(realpath ~\u002F.claude\u002Fskills\u002Ftdd\u002F..\u002F.. 2> \u002Fdev\u002Fnull) && [ -f \"$R\u002Fplaybooks\u002Fbug-fix.md\" ]; then\n    echo \"$R\"\nelse\n    echo \"no root: ~\u002F.claude\u002Fskills\u002Ftdd is not a link into the repo this skill lives in\"\nfi\n```\n\nIt prints the root of the repo this skill lives in. Every path below that starts with `playbooks\u002F`, `principles\u002F` or `skills\u002F` is from that root, and a path that starts with `references\u002F` is beside this file. On `no root` the skill was loaded from somewhere else: the root is two directories above the real place of this file, not of a link to it.\n\n## Workflow\n\nThe workflow is written once, in `playbooks\u002Fbug-fix.md`: the repro, the failing test seen to fail for the intended reason, the fix at the root cause, the proof, and the commit of the failing test before the fix. Read it and run its steps 1 to 6 in this thread, in order, as written. Its step 7 opens a pull request the way a crewmate does: run it in a crewmate's thread. In any other thread run the repo's check command in its place, and stop.\n\nThat playbook is written for a crewmate. In a thread with no brief, its \"Result\" is your reply to the user, and the brief's **Where** in its step 4 is the files the user's request names. Its step 6 commits, and such a thread commits only when the user asked for commits, and never on the default branch: otherwise leave the test and the fix uncommitted and say so.\n\nThe rest of this file is what the source says and the playbook does not.\n\n## When no test is written\n\nThe playbook names three reasons to write no test: a broad harness, brittle mocks, slow infrastructure. Three more count: the bug needs production-only state, its reproduction steps are vague, or the test would churn large unrelated fixtures. Browser automation and a snapshot comparison are checks that can stand in, beside the ones the playbook lists.\n\nA bad test is one that mostly tests mocks, encodes current implementation details, depends on timing or unrelated global state, needs expensive infrastructure for a small fix, or would be deleted immediately after proving the fix.\n\n## Guardrails\n\n- Keep the regression test focused on the bug. Avoid broad fixture churn or unrelated coverage expansion.\n- If the bug is flaky, make the test deterministic where possible and document the signal being locked down.\n\n## Final Response\n\nReport the evidence, not just the outcome, as the playbook's \"Hand over\" has it: the failing-before check and the failure it produced, the passing-after run, and any nearby validation performed.\n",{"tip":24,"card":25,"name":5,"description":7},"fixes a bug test-first, with a regression test that fails before the fix | fix this bug | fix the bug | regression test | failing test first | test first","Distrust the change | 3 | Fixes a bug test-first: a focused regression test that fails before the fix and passes after it. | Reach for it when a bug has a clear, cheap test path. | op: the operator","main","daff051d2674b46e2eb8a333bbd3f3e40f8d1cea","features\u002Ftdd",0,"https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere","Software Engineer @ Markel\r\n","2026-11-15 11:25:06",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add JoshuaHayesWasHere\u002Fjstack --skill tdd",{"tool":40,"command":41},"bunx","bunx skills add JoshuaHayesWasHere\u002Fjstack --skill tdd",{"tool":43,"command":44},"pnpm","pnpm dlx skills add JoshuaHayesWasHere\u002Fjstack --skill tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Ftdd\u002FSKILL.md",true,[48,54,60],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"feature.json","REFERENCE","参考文档",164,"https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Ftdd\u002Ffeature.json",{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"tests\u002Ftest_tdd_skill.py","SCRIPT","脚本",637,"https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Ftdd\u002Ftests\u002Ftest_tdd_skill.py",{"path":61,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":62,"sourceHtmlUrl":63},"verify.md",539,"https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Ftdd\u002Fverify.md",[65,72,79,86,93,100],{"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},"01M7ERF9GXMY62V7QTVAR6G8DG","no-key","A skill its skills.json lists as hidden that a model may still call by itself, kept broken so the lint is seen to catch it.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ftesting\u002Ftests\u002Ffixtures\u002Fskills\u002Fno-key\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},"01M7ERF83ZG3XKJ2SB8MJHCZ8H","fake-skill","A FAKE skill in a FAKE tree, named for its folder until the test renames the folder.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ftesting\u002Ftests\u002Ffixtures\u002Fskills\u002Fnamed-tree\u002Fskills\u002Ffake-skill\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},"01M7ERF698RV4VF8QCDF8H8DA4","extra-key","A skill its skills.json does not list as hidden that a model still cannot call, kept broken so the lint is seen to catch it.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ftesting\u002Ftests\u002Ffixtures\u002Fskills\u002Fextra-key\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},"01M7ERF2V8N73X9T0Y9PJ4SFV6","unslop","Cut AI tells from writing. Use when the user says text reads like AI, asks to unslop it, or before prose ships to people.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fwriting\u002Fskills\u002Funslop\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},"01M7EREWM67WX934XKABM4XCSZ","technical-writing","Write or review docs, READMEs, RFCs, PR descriptions and commit messages to a layered standard: Diataxis structure, Google developer style, STE rules and Global English.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fwriting\u002Fskills\u002Ftechnical-writing\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7EREMHJS9JY10AM5EKVX3GP","why","Find why code is the way it is, from its history and every evidence source this session can query, with citations. Use for 'why does X work this way', 'why did we pick Y', regressions and postmortems. Use how for runtime behavior.","https:\u002F\u002Fgithub.com\u002FJoshuaHayesWasHere\u002Fjstack\u002Fblob\u002Fmain\u002Ffeatures\u002Fwhy\u002FSKILL.md",[],[]]