[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75B4RRN7EE7Z1GZHF9NSAKT":3,"skill-same:01M75B4RRN7EE7Z1GZHF9NSAKT":55},{"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":31,"ownerHtmlUrl":32,"ownerBlogUrl":6,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M75B4RRN7EE7Z1GZHF9NSAKT","test-driven-development",null,"Writes a failing test before the code that makes it pass, for a feature or bug fix whose expected behavior is known and testable through the production code.","AidALL\u002Fghost-alice","AidALL","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F130629202?v=4","01M75B3KHHA5AD250W0XNC7DGX","AidALL Inc.","01M75B3KJAYXRRNBW5F9B8C2RW",15,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fcoding-convention\u002Ftest-driven-development\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: test-driven-development\ndescription: Writes a failing test before the code that makes it pass, for a feature or bug fix whose expected behavior is known and testable through the production code.\ncompatibility:\n  - \"Python 3.11+ standard library\"\n---\n\n# Test-Driven Development\n\nThe response model establishes a meaningful failing test for accepted behavior, implements that behavior, and observes the resulting pass. The test's expected result comes from the human user's requirement and source contract.\n\n## Applicability\n\nApply RED-first when the required behavior is known, its expected result can be stated independently of the proposed implementation, and an automated test can exercise the relevant production path.\n\nIf the premise, data flow, target or behavior is unknown, use bounded discovery or an implementation proof first. When that work establishes a testable production contract, apply RED-first to the subsequent implementation. Configuration, generated output and instruction changes without a meaningful behavioral test use their accepted source or runtime validation instead. Follow an explicit instruction that the human user enters in the conversation about implementation and verification order, under the common contract's instruction precedence rule.\n\nBefore starting, the response model identifies the expected failure, the production path and the independent basis for the assertion. Unknown answers require discovery under systematic-debugging or the accepted design workflow; they do not justify inventing a test.\n\n## RED: establish the intended failure\n\nWrite a focused test with a descriptive name and an assertion about required behavior. Prefer the real production path; use a mock only for a dependency whose contract is understood. Load [testing-anti-patterns.md](references\u002Ftesting-anti-patterns.md) when choosing mocks or test utilities.\n\nInvoke the project's actual runner with the exact test target. Retain the original command, output, status and evidence locator. Judge whether the failure demonstrates the missing behavior rather than an invalid fixture, syntax error or unavailable dependency.\n\nIf the test passes, determine whether the behavior already exists or the test misses the intended condition. If the test errors, correct the fixture or prerequisite and observe the affected result. Follow systematic-debugging to count failed repair rounds.\n\nFor applicable work, observe this intended failure before writing production code. If the response model prematurely wrote production code, remove only its own authorized premature change before rebuilding from the test. Preserve local changes already present in the checkout that this work did not make and retained original failure evidence; git does not record who made the change.\n\n## GREEN: satisfy the behavior\n\nImplement the accepted behavior to the depth required by the observed cause. A structural defect may need a structural correction; passing one assertion does not settle other required acceptance criteria. Exclude unrelated features and refactors.\n\nRun the same relevant target and inspect its result. If it fails, compare the failure with the acceptance criterion: correct production behavior when it violates that acceptance criterion, or correct an assertion or fixture that misstates it. A passing implementation must not depend on weakening a valid requirement.\n\nUse verification-before-completion's [Evidence selection and stop gate](..\u002Fverification-before-completion\u002FSKILL.md#evidence-selection-and-stop-gate) for affected additional checks and [verify-or-reuse](..\u002Fverification-before-completion\u002Freferences\u002Fverify-or-reuse.md) for retained results. Report unrelated failures without claiming they were caused or resolved by this change.\n\n## REFACTOR\n\nOnce required behavior passes, simplify duplication, names or interfaces only within the task being implemented. Preserve behavior and check the affected paths under the same evidence-selection procedure. Begin another RED step only for another required behavior.\n\n## Worked example\n\nThe accepted operation makes at most three attempts and returns the successful result. This illustrative test exercises the operation through a controllable dependency:\n\n```typescript\ntest('returns success on the third allowed attempt', async () => {\n  let attempts = 0;\n  const operation = async () => {\n    attempts++;\n    if (attempts \u003C 3) throw new Error('temporary failure');\n    return 'success';\n  };\n  expect(await retryOperation(operation)).toBe('success');\n  expect(attempts).toBe(3);\n});\n```\n\nThe response model first observes the intended failure in the actual project, then implements the accepted attempt limit:\n\n```typescript\nasync function retryOperation\u003CT>(operation: () => Promise\u003CT>): Promise\u003CT> {\n  for (let attempt = 0; attempt \u003C 3; attempt++) {\n    try {\n      return await operation();\n    } catch (error) {\n      if (attempt === 2) throw error;\n    }\n  }\n  throw new Error('unreachable');\n}\n```\n\nThe example covers success on the third attempt. If the contract also requires propagating the final failure, that distinct behavior needs its own evidence. Neither sample code nor its presence in this skill proves that a test ran.\n\n## Failure modes and result\n\nDo not replace an unknown requirement with an implementation-shaped assertion, count mock configuration as production behavior, or treat RED-first order alone as proof of coverage. When setup is difficult, inspect the actual dependencies before prescribing interface changes or asking the user for an implementation detail.\n\nReturn the behavior covered, original RED and GREEN observations, changed production target and any unresolved requirement. Verification-before-completion defines the completion judgment, including how this evidence supports the whole result that the human user requested.\n","# Test-Driven Development\n\nThe response model establishes a meaningful failing test for accepted behavior, implements that behavior, and observes the resulting pass. The test's expected result comes from the human user's requirement and source contract.\n\n## Applicability\n\nApply RED-first when the required behavior is known, its expected result can be stated independently of the proposed implementation, and an automated test can exercise the relevant production path.\n\nIf the premise, data flow, target or behavior is unknown, use bounded discovery or an implementation proof first. When that work establishes a testable production contract, apply RED-first to the subsequent implementation. Configuration, generated output and instruction changes without a meaningful behavioral test use their accepted source or runtime validation instead. Follow an explicit instruction that the human user enters in the conversation about implementation and verification order, under the common contract's instruction precedence rule.\n\nBefore starting, the response model identifies the expected failure, the production path and the independent basis for the assertion. Unknown answers require discovery under systematic-debugging or the accepted design workflow; they do not justify inventing a test.\n\n## RED: establish the intended failure\n\nWrite a focused test with a descriptive name and an assertion about required behavior. Prefer the real production path; use a mock only for a dependency whose contract is understood. Load [testing-anti-patterns.md](references\u002Ftesting-anti-patterns.md) when choosing mocks or test utilities.\n\nInvoke the project's actual runner with the exact test target. Retain the original command, output, status and evidence locator. Judge whether the failure demonstrates the missing behavior rather than an invalid fixture, syntax error or unavailable dependency.\n\nIf the test passes, determine whether the behavior already exists or the test misses the intended condition. If the test errors, correct the fixture or prerequisite and observe the affected result. Follow systematic-debugging to count failed repair rounds.\n\nFor applicable work, observe this intended failure before writing production code. If the response model prematurely wrote production code, remove only its own authorized premature change before rebuilding from the test. Preserve local changes already present in the checkout that this work did not make and retained original failure evidence; git does not record who made the change.\n\n## GREEN: satisfy the behavior\n\nImplement the accepted behavior to the depth required by the observed cause. A structural defect may need a structural correction; passing one assertion does not settle other required acceptance criteria. Exclude unrelated features and refactors.\n\nRun the same relevant target and inspect its result. If it fails, compare the failure with the acceptance criterion: correct production behavior when it violates that acceptance criterion, or correct an assertion or fixture that misstates it. A passing implementation must not depend on weakening a valid requirement.\n\nUse verification-before-completion's [Evidence selection and stop gate](..\u002Fverification-before-completion\u002FSKILL.md#evidence-selection-and-stop-gate) for affected additional checks and [verify-or-reuse](..\u002Fverification-before-completion\u002Freferences\u002Fverify-or-reuse.md) for retained results. Report unrelated failures without claiming they were caused or resolved by this change.\n\n## REFACTOR\n\nOnce required behavior passes, simplify duplication, names or interfaces only within the task being implemented. Preserve behavior and check the affected paths under the same evidence-selection procedure. Begin another RED step only for another required behavior.\n\n## Worked example\n\nThe accepted operation makes at most three attempts and returns the successful result. This illustrative test exercises the operation through a controllable dependency:\n\n```typescript\ntest('returns success on the third allowed attempt', async () => {\n  let attempts = 0;\n  const operation = async () => {\n    attempts++;\n    if (attempts \u003C 3) throw new Error('temporary failure');\n    return 'success';\n  };\n  expect(await retryOperation(operation)).toBe('success');\n  expect(attempts).toBe(3);\n});\n```\n\nThe response model first observes the intended failure in the actual project, then implements the accepted attempt limit:\n\n```typescript\nasync function retryOperation\u003CT>(operation: () => Promise\u003CT>): Promise\u003CT> {\n  for (let attempt = 0; attempt \u003C 3; attempt++) {\n    try {\n      return await operation();\n    } catch (error) {\n      if (attempt === 2) throw error;\n    }\n  }\n  throw new Error('unreachable');\n}\n```\n\nThe example covers success on the third attempt. If the contract also requires propagating the final failure, that distinct behavior needs its own evidence. Neither sample code nor its presence in this skill proves that a test ran.\n\n## Failure modes and result\n\nDo not replace an unknown requirement with an implementation-shaped assertion, count mock configuration as production behavior, or treat RED-first order alone as proof of coverage. When setup is difficult, inspect the actual dependencies before prescribing interface changes or asking the user for an implementation detail.\n\nReturn the behavior covered, original RED and GREEN observations, changed production target and any unresolved requirement. Verification-before-completion defines the completion judgment, including how this evidence supports the whole result that the human user requested.\n",{"name":5,"description":7,"compatibility":24},[25],"Python 3.11+ standard library","main","d8f3b95a64ce7042d26b5b14282d54821538b79e","coding-convention\u002Ftest-driven-development",4,"https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice","https:\u002F\u002Faidall.github.io\u002Fghost-alice\u002F","https:\u002F\u002Fgithub.com\u002FAidALL","AI for everyone, AidALL","2026-11-15 02:33:23",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add AidALL\u002Fghost-alice --skill test-driven-development",{"tool":41,"command":42},"bunx","bunx skills add AidALL\u002Fghost-alice --skill test-driven-development",{"tool":44,"command":45},"pnpm","pnpm dlx skills add AidALL\u002Fghost-alice --skill test-driven-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fcoding-convention\u002Ftest-driven-development\u002FSKILL.md",true,[49],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Ftesting-anti-patterns.md","REFERENCE","参考文档",3796,"https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fcoding-convention\u002Ftest-driven-development\u002Freferences\u002Ftesting-anti-patterns.md",[56,63,70,77,84,91],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M75B5QP9T3Z24VG1PZ8BFRXS","skill-evolution","Recommends skill changes from recorded tool-call patterns and conduct corrections asserted by the human user or observed by the response model, when the human user asks for such recommendations or their pending backlog, or authorizes that analysis.","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fskill-evolution\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M75B5M1QFQRR9AW2PSV9GMNX","session-intent-analyzer","Records the response model's new or changed interpretation of the input the response model is answering as its `interpreted-as` record before the first tool call of work, and reads that record when it can change the objective, constraints, work choice or whether earlier work continues.","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fsession-intent-analyzer\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M75B5FW8XJ7WGK3R683PG1RW","necessity-gate","Judges whether proposed work is justified, needs a narrower scope or is unjustified, when the response model proposes new work or the human user asks whether to do it.","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fnecessity-gate\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M75B5CKFWYKXMAN9SWPDGT0S","merge-companion","Reviews the installer's backups of external changes to installed skills and merges each into the new skill version, discards or defers it as the human user chooses, before a task changes or reinstalls an installed skill, or when the human user asks for that review.","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fmerge-companion\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M75B59BWNYVAK4W2V577W2TA","compact-handoff","Writes a handoff of the task's objective, scope, evidence and next action when a long conversation, compaction or handover to another session or agent could lose them, and resumes the task from it afterwards.","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fcompact-handoff\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M75B57FN00BYY5Y50DZ980Q4","writing-skills","Writes a new skill or changes an existing one in its folder (SKILL.md, references and scripts) and tests it.","https:\u002F\u002Fgithub.com\u002FAidALL\u002Fghost-alice\u002Fblob\u002Fmain\u002Fcoding-convention\u002Fwriting-skills\u002FSKILL.md",[],[]]