[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6PEP40F2BSQC847C17P2RF3":3,"skill-same:01M6PEP40F2BSQC847C17P2RF3":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":42,"linkOnly":43,"markdownContent":44,"markdownBody":45,"frontMatter":46,"refName":49,"commitSha":50,"skillDirectory":51,"forksCount":52,"repositoryHtmlUrl":53,"repositoryHomepageUrl":6,"ownerHtmlUrl":54,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":55,"install":56,"resources":69},"01M6PEP40F2BSQC847C17P2RF3","tdd",null,"Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.","r3dlex\u002Foh-my-githubcopilot","r3dlex","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F291373160?v=4","01M6PEFNGGBVB7SHAPWXFFX933","01M6PEFNMNKPP8K3C881MDS722",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftdd\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",[5,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41],"test-driven","implement","mode","with","red","feature","tests","full","green","activate","enforcement","red-green-refactor","implement with tdd","write","first","refactor","development","write tests","test","2026-11-10 10:12:30",false,"---\nname: tdd\ndescription: >\n  Test-Driven Development enforcement skill. Activates full TDD mode.\n  Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.\nargument-hint: \"[feature or function to implement with TDD]\"\n---\n\n# TDD — Test-Driven Development\n\n**THE IRON LAW: Write the failing test FIRST. Always.**\n\n## The Red-Green-Refactor Cycle\n\n```\nRED   → Write a failing test for the NEXT behavior\nGREEN → Write ONLY enough code to make it pass (no extras)\nREFACTOR → Clean up code quality (tests must stay green after every change)\nREPEAT\n```\n\n## Step-by-Step Protocol\n\n### 1. RED Phase\n1. Identify the smallest next behavior to implement\n2. Write a test that describes that behavior as a named `it()` \u002F `test()` \u002F `def test_`\n3. **Run the test** — it MUST FAIL. If it passes, the test is wrong.\n4. Confirm the failure message is the RIGHT failure (not a syntax error)\n\n```typescript\n\u002F\u002F Example: RED — test fails because function doesn't exist yet\nit('returns an empty array for an empty input', () => {\n  const result = parseItems([]);\n  expect(result).toEqual([]);  \u002F\u002F FAILS: parseItems is not defined\n});\n```\n\n### 2. GREEN Phase\n1. Write the MINIMUM code to make the test pass\n2. Do not add extra logic, default parameters, or \"nice-to-haves\"\n3. Run ALL tests — the new test must pass; existing tests must not break\n\n```typescript\n\u002F\u002F Example: GREEN — just enough to pass\nfunction parseItems(input: string[]): string[] {\n  return [];  \u002F\u002F only enough for the current test\n}\n```\n\n### 3. REFACTOR Phase\n1. Look at the code — can it be cleaner without changing behavior?\n2. Apply simplification patterns (see `\u002Fai-slop-cleaner` and `\u002Fcoding-standards`)\n3. **Run tests after EVERY change.** If tests break, undo immediately.\n\n## TDD Gate — When to Stop\n\n| Situation | Action |\n|-----------|--------|\n| Code written before test | STOP. Delete production code. Write test first. |\n| Test passes on first run (no prior code) | The test is wrong — fix it to fail first. |\n| Multiple behaviors in one test | STOP. One test, one behavior. |\n| Skipping refactor to go faster | Go back. Clean up before next feature. |\n\n## Naming Tests as Specifications\n\nTests are executable documentation. Name them as complete sentences:\n\n```typescript\n\u002F\u002F BAD\nit('test1', ...)\nit('works with empty', ...)\n\n\u002F\u002F GOOD\nit('returns empty array when input is empty', ...)\nit('throws ValidationError when email is missing @', ...)\nit('sends exactly one email when user registers', ...)\n```\n\n## Framework Quick Reference\n\n| Framework | Failing assertion | Run single test |\n|-----------|-------------------|-----------------|\n| Vitest | `expect(x).toBe(y)` | `npx vitest run -t \"test name\"` |\n| Jest | `expect(x).toBe(y)` | `npx jest -t \"test name\"` |\n| pytest | `assert x == y` | `pytest -k \"test_name\"` |\n| cargo test | `assert_eq!(x, y)` | `cargo test test_name` |\n| go test | `t.Errorf(...)` | `go test -run TestName` |\n\n## Common TDD Pitfalls\n\n| Pitfall | Fix |\n|---------|-----|\n| Testing implementation details | Test behavior (outputs), not internals (private methods) |\n| One test for 10 behaviors | Split into atomic test cases |\n| Mock everything (over-mocking) | Mock at system boundaries only (DB, HTTP, filesystem) |\n| No triangulation | Write 2-3 tests that force the correct implementation to emerge |\n| Untriangulated constants | `return 42` passes one test — add a second test to force real logic |\n\n## See Also\n\n- `@test-engineer` — test strategy, framework detection, coverage gap analysis\n- `\u002Fultraqa` — QA cycling: test, verify, fix, repeat\n- `\u002Fverify` — evidence-based completion verification\n","# TDD — Test-Driven Development\n\n**THE IRON LAW: Write the failing test FIRST. Always.**\n\n## The Red-Green-Refactor Cycle\n\n```\nRED   → Write a failing test for the NEXT behavior\nGREEN → Write ONLY enough code to make it pass (no extras)\nREFACTOR → Clean up code quality (tests must stay green after every change)\nREPEAT\n```\n\n## Step-by-Step Protocol\n\n### 1. RED Phase\n1. Identify the smallest next behavior to implement\n2. Write a test that describes that behavior as a named `it()` \u002F `test()` \u002F `def test_`\n3. **Run the test** — it MUST FAIL. If it passes, the test is wrong.\n4. Confirm the failure message is the RIGHT failure (not a syntax error)\n\n```typescript\n\u002F\u002F Example: RED — test fails because function doesn't exist yet\nit('returns an empty array for an empty input', () => {\n  const result = parseItems([]);\n  expect(result).toEqual([]);  \u002F\u002F FAILS: parseItems is not defined\n});\n```\n\n### 2. GREEN Phase\n1. Write the MINIMUM code to make the test pass\n2. Do not add extra logic, default parameters, or \"nice-to-haves\"\n3. Run ALL tests — the new test must pass; existing tests must not break\n\n```typescript\n\u002F\u002F Example: GREEN — just enough to pass\nfunction parseItems(input: string[]): string[] {\n  return [];  \u002F\u002F only enough for the current test\n}\n```\n\n### 3. REFACTOR Phase\n1. Look at the code — can it be cleaner without changing behavior?\n2. Apply simplification patterns (see `\u002Fai-slop-cleaner` and `\u002Fcoding-standards`)\n3. **Run tests after EVERY change.** If tests break, undo immediately.\n\n## TDD Gate — When to Stop\n\n| Situation | Action |\n|-----------|--------|\n| Code written before test | STOP. Delete production code. Write test first. |\n| Test passes on first run (no prior code) | The test is wrong — fix it to fail first. |\n| Multiple behaviors in one test | STOP. One test, one behavior. |\n| Skipping refactor to go faster | Go back. Clean up before next feature. |\n\n## Naming Tests as Specifications\n\nTests are executable documentation. Name them as complete sentences:\n\n```typescript\n\u002F\u002F BAD\nit('test1', ...)\nit('works with empty', ...)\n\n\u002F\u002F GOOD\nit('returns empty array when input is empty', ...)\nit('throws ValidationError when email is missing @', ...)\nit('sends exactly one email when user registers', ...)\n```\n\n## Framework Quick Reference\n\n| Framework | Failing assertion | Run single test |\n|-----------|-------------------|-----------------|\n| Vitest | `expect(x).toBe(y)` | `npx vitest run -t \"test name\"` |\n| Jest | `expect(x).toBe(y)` | `npx jest -t \"test name\"` |\n| pytest | `assert x == y` | `pytest -k \"test_name\"` |\n| cargo test | `assert_eq!(x, y)` | `cargo test test_name` |\n| go test | `t.Errorf(...)` | `go test -run TestName` |\n\n## Common TDD Pitfalls\n\n| Pitfall | Fix |\n|---------|-----|\n| Testing implementation details | Test behavior (outputs), not internals (private methods) |\n| One test for 10 behaviors | Split into atomic test cases |\n| Mock everything (over-mocking) | Mock at system boundaries only (DB, HTTP, filesystem) |\n| No triangulation | Write 2-3 tests that force the correct implementation to emerge |\n| Untriangulated constants | `return 42` passes one test — add a second test to force real logic |\n\n## See Also\n\n- `@test-engineer` — test strategy, framework detection, coverage gap analysis\n- `\u002Fultraqa` — QA cycling: test, verify, fix, repeat\n- `\u002Fverify` — evidence-based completion verification\n",{"name":5,"description":47,"argument-hint":48},"Test-Driven Development enforcement skill. Activates full TDD mode. Activate when: TDD, test-driven, test first, red-green-refactor, write tests first.\n","[feature or function to implement with TDD]","main","55294682936bc69473eba70e93ffa88ede018e81",".github\u002Fskills\u002Ftdd",0,"https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot","https:\u002F\u002Fgithub.com\u002Fr3dlex","2026-10-31 18:57:35",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add r3dlex\u002Foh-my-githubcopilot --skill tdd",{"tool":62,"command":63},"bunx","bunx skills add r3dlex\u002Foh-my-githubcopilot --skill tdd",{"tool":65,"command":66},"pnpm","pnpm dlx skills add r3dlex\u002Foh-my-githubcopilot --skill tdd","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002F.github\u002Fskills\u002Ftdd\u002FSKILL.md",true,[],[71,77,83,89,95,103],{"skillNo":72,"name":73,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":42},"01M6PF2CTFS0AEXQXF2NFYT8J2","wiki","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002Fvscode-omp\u002Fresources\u002Ftemplates\u002F.copilot\u002Fskills\u002Fwiki\u002FSKILL.md",[],[73],{"skillNo":78,"name":79,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":42},"01M6PF2BFXJ97M6NKH7N42XZVZ","ultrawork","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002Fvscode-omp\u002Fresources\u002Ftemplates\u002F.copilot\u002Fskills\u002Fultrawork\u002FSKILL.md",[],[79],{"skillNo":84,"name":85,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":42},"01M6PF2A38Y1CE5BVJ5HMTMBP6","trace","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002Fvscode-omp\u002Fresources\u002Ftemplates\u002F.copilot\u002Fskills\u002Ftrace\u002FSKILL.md",[],[85],{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":42},"01M6PF28P7S19AK5XJA41WS9V8","team","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002Fvscode-omp\u002Fresources\u002Ftemplates\u002F.copilot\u002Fskills\u002Fteam\u002FSKILL.md",[],[91],{"skillNo":96,"name":97,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":98,"categories":99,"keywords":100,"publishedAt":42},"01M6PF278EADT8W3EWDYA3C2H0","swe-bench","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002Fvscode-omp\u002Fresources\u002Ftemplates\u002F.copilot\u002Fskills\u002Fswe-bench\u002FSKILL.md",[],[101,102],"SWE","swe bench",{"skillNo":104,"name":105,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":42},"01M6PF25XW1TMP5Z1N89ZVJQDY","swarm","https:\u002F\u002Fgithub.com\u002Fr3dlex\u002Foh-my-githubcopilot\u002Fblob\u002Fmain\u002Fvscode-omp\u002Fresources\u002Ftemplates\u002F.copilot\u002Fskills\u002Fswarm\u002FSKILL.md",[],[105]]