[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M754SGEHP6QBJS72KKKF6C2N":3,"skill-same:01M754SGEHP6QBJS72KKKF6C2N":52},{"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":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M754SGEHP6QBJS72KKKF6C2N","codex-test-driven-development",null,"Use before feature, bugfix, or refactor implementation when behavior can be tested; enforces Red-Green-Refactor discipline.","Bang-isme\u002FAgencyCLI","Bang-isme","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F179383529?v=4","01M754NDM8K05SAX2V31R63WEE","01M754NDMV48ECFT4HY6X2CKQ0",2,"MIT","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills\u002Fcodex-test-driven-development\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: codex-test-driven-development\ndescription: Use before feature, bugfix, or refactor implementation when behavior can be tested; enforces Red-Green-Refactor discipline.\nload_priority: on-demand\n---\n\n## TL;DR\nWrite test first → watch it fail → write minimal code to pass → watch it pass → refactor. Delete code written before tests. No exceptions. Integrate with `$gate` for automated verification. Use `$tdd` or `$red-green` to activate.\n\n# Test-Driven Development (TDD)\n\n## Activation\n\n1. Activate on `$codex-test-driven-development`, `$tdd`, or `$red-green`.\n2. Activate when implementing any feature or bugfix, before writing implementation code.\n3. Activate when `codex-workflow-autopilot` routes to `build` or `fix` workflow.\n4. Activate when `codex-intent-context-analyzer` detects implementation intent.\n5. Always active as a behavioral constraint during implementation phases.\n\n## The Iron Law\n\n```\nNO PRODUCTION CODE WITHOUT A FAILING TEST FIRST\n```\n\nWrite code before the test? **Delete it. Start over.**\n\n**No exceptions:**\n- Don't keep it as \"reference\"\n- Don't \"adapt\" it while writing tests\n- Don't look at it\n- Delete means delete\n\nImplement fresh from tests. Period.\n\n**Violating the letter of the rules is violating the spirit of the rules.**\n\n## When to Use\n\n**Always:**\n- New features\n- Bug fixes\n- Refactoring\n- Behavior changes\n\n**Exceptions (ask the human):**\n- Throwaway prototypes\n- Generated code\n- Configuration files\n\nThinking \"skip TDD just this once\"? Stop. That's rationalization.\n\n## Red-Green-Refactor Cycle\n\n```\nTask type → Implementation needed?\n    |- Yes → Write failing test (RED)\n    |   |- Verify it fails correctly\n    |   |- Write minimal code (GREEN)\n    |   |- Verify it passes + all tests pass\n    |   |- Refactor (keep green)\n    |   `- Next test → repeat\n    |\n    `- No → skip TDD\n```\n\n### RED — Write Failing Test\n\nWrite one minimal test showing what should happen.\n\n**Good — Python:**\n```python\ndef test_retries_failed_operations_three_times():\n    attempts = 0\n\n    def operation():\n        nonlocal attempts\n        attempts += 1\n        if attempts \u003C 3:\n            raise RuntimeError(\"fail\")\n        return \"success\"\n\n    result = retry_operation(operation)\n\n    assert result == \"success\"\n    assert attempts == 3\n```\nClear name, tests real behavior, one thing.\n\n**Good — TypeScript:**\n```typescript\ntest('retries failed operations 3 times', async () => {\n  let attempts = 0;\n  const operation = () => {\n    attempts++;\n    if (attempts \u003C 3) throw new Error('fail');\n    return 'success';\n  };\n\n  const result = await retryOperation(operation);\n\n  expect(result).toBe('success');\n  expect(attempts).toBe(3);\n});\n```\n\n**Bad:**\n```typescript\ntest('retry works', async () => {\n  const mock = jest.fn()\n    .mockRejectedValueOnce(new Error())\n    .mockResolvedValueOnce('success');\n  await retryOperation(mock);\n  expect(mock).toHaveBeenCalledTimes(2);\n});\n```\nVague name, tests mock not code.\n\n**Requirements:**\n- One behavior per test\n- Clear descriptive name\n- Real code (no mocks unless unavoidable)\n\n### Verify RED — Watch It Fail\n\n**MANDATORY. Never skip.**\n\n```bash\n# Python\npython -m pytest tests\u002Fpath\u002Ftest_module.py::test_name -v\n\n# JavaScript\u002FTypeScript\nnpm test -- --grep \"test name\"\n\n# Go\ngo test -run TestName -v .\u002F...\n```\n\nConfirm:\n- Test fails (not errors)\n- Failure message is expected\n- Fails because feature missing (not typos)\n\n**Test passes immediately?** You're testing existing behavior. Fix test.\n\n**Test errors?** Fix error, re-run until it fails correctly.\n\n### GREEN — Minimal Code\n\nWrite simplest code to pass the test.\n\n**Good:**\n```python\nasync def retry_operation(fn, max_retries=3):\n    for i in range(max_retries):\n        try:\n            return fn()\n        except Exception:\n            if i == max_retries - 1:\n                raise\n```\nJust enough to pass.\n\n**Bad:**\n```python\nasync def retry_operation(\n    fn,\n    max_retries=3,\n    backoff=\"exponential\",\n    on_retry=None,\n    timeout=30,\n    jitter=True,\n):\n    # YAGNI — over-engineered\n```\n\nDon't add features, refactor other code, or \"improve\" beyond the test.\n\n### Verify GREEN — Watch It Pass\n\n**MANDATORY.**\n\n```bash\n# Run specific test\npython -m pytest tests\u002Fpath\u002Ftest_module.py::test_name -v\n\n# Run ALL tests to check for regressions\npython -m pytest tests\u002F -q\n```\n\nConfirm:\n- Test passes\n- Other tests still pass\n- Output pristine (no errors, warnings)\n\n**Test fails?** Fix code, not test.\n\n**Other tests fail?** Fix now.\n\n### REFACTOR — Clean Up\n\nAfter green only:\n- Remove duplication\n- Improve names\n- Extract helpers\n\nKeep tests green. Don't add behavior.\n\n### Repeat\n\nNext failing test for next feature.\n\n## Good Tests\n\n| Quality | Good | Bad |\n|---------|------|-----|\n| **Minimal** | One thing. \"and\" in name? Split it. | `test_validates_email_and_domain_and_whitespace` |\n| **Clear** | Name describes behavior | `test_1`, `test_it_works` |\n| **Shows intent** | Demonstrates desired API | Obscures what code should do |\n| **Real code** | Tests actual implementation | Tests mock behavior |\n\n## Why Order Matters\n\n**\"I'll write tests after to verify it works\"**\n\nTests written after code pass immediately. Passing immediately proves nothing:\n- Might test wrong thing\n- Might test implementation, not behavior\n- Might miss edge cases you forgot\n- You never saw it catch the bug\n\nTest-first forces you to see the test fail, proving it actually tests something.\n\n**\"I already manually tested all the edge cases\"**\n\nManual testing is ad-hoc. You think you tested everything but:\n- No record of what you tested\n- Can't re-run when code changes\n- Easy to forget cases under pressure\n- \"It worked when I tried it\" ≠ comprehensive\n\nAutomated tests are systematic. They run the same way every time.\n\n**\"Deleting X hours of work is wasteful\"**\n\nSunk cost fallacy. The time is already gone. Your choice now:\n- Delete and rewrite with TDD (X more hours, high confidence)\n- Keep it and add tests after (30 min, low confidence, likely bugs)\n\nThe \"waste\" is keeping code you can't trust.\n\n**\"TDD is dogmatic, being pragmatic means adapting\"**\n\nTDD IS pragmatic:\n- Finds bugs before commit (faster than debugging after)\n- Prevents regressions (tests catch breaks immediately)\n- Documents behavior (tests show how to use code)\n- Enables refactoring (change freely, tests catch breaks)\n\n\"Pragmatic\" shortcuts = debugging in production = slower.\n\n## Common Rationalizations\n\n| Excuse | Reality |\n|--------|---------|\n| \"Too simple to test\" | Simple code breaks. Test takes 30 seconds. |\n| \"I'll test after\" | Tests passing immediately prove nothing. |\n| \"Tests after achieve same goals\" | Tests-after = \"what does this do?\" Tests-first = \"what should this do?\" |\n| \"Already manually tested\" | Ad-hoc ≠ systematic. No record, can't re-run. |\n| \"Deleting X hours is wasteful\" | Sunk cost fallacy. Keeping unverified code is technical debt. |\n| \"Keep as reference, write tests first\" | You'll adapt it. That's testing after. Delete means delete. |\n| \"Need to explore first\" | Fine. Throw away exploration, start with TDD. |\n| \"Test hard = design unclear\" | Listen to test. Hard to test = hard to use. |\n| \"TDD will slow me down\" | TDD faster than debugging. Pragmatic = test-first. |\n| \"Manual test faster\" | Manual doesn't prove edge cases. You'll re-test every change. |\n| \"Existing code has no tests\" | You're improving it. Add tests for existing code. |\n| \"This is different because...\" | It's not. Start with TDD. |\n\n## Red Flags — STOP and Start Over\n\n- Code before test\n- Test after implementation\n- Test passes immediately on first run\n- Can't explain why test failed\n- Tests added \"later\"\n- Rationalizing \"just this once\"\n- \"I already manually tested it\"\n- \"Tests after achieve the same purpose\"\n- \"It's about spirit not ritual\"\n- \"Keep as reference\" or \"adapt existing code\"\n- \"Already spent X hours, deleting is wasteful\"\n- \"TDD is dogmatic, I'm being pragmatic\"\n\n**All of these mean: Delete code. Start over with TDD.**\n\n## Example: Bug Fix\n\n**Bug:** Empty email accepted\n\n**RED**\n```python\ndef test_rejects_empty_email():\n    result = submit_form({\"email\": \"\"})\n    assert result[\"error\"] == \"Email required\"\n```\n\n**Verify RED**\n```bash\n$ python -m pytest tests\u002Ftest_form.py::test_rejects_empty_email -v\nFAIL: AssertionError: expected 'Email required', got None\n```\n\n**GREEN**\n```python\ndef submit_form(data):\n    if not data.get(\"email\", \"\").strip():\n        return {\"error\": \"Email required\"}\n    # ...\n```\n\n**Verify GREEN**\n```bash\n$ python -m pytest tests\u002Ftest_form.py -v\nPASS (all tests)\n```\n\n**REFACTOR**\nExtract validation for multiple fields if needed.\n\n## Verification Checklist\n\nBefore marking work complete:\n\n- [ ] Every new function\u002Fmethod has a test\n- [ ] Watched each test fail before implementing\n- [ ] Each test failed for expected reason (feature missing, not typo)\n- [ ] Wrote minimal code to pass each test\n- [ ] All tests pass\n- [ ] Output pristine (no errors, warnings)\n- [ ] Tests use real code (mocks only if unavoidable)\n- [ ] Edge cases and errors covered\n\nCan't check all boxes? You skipped TDD. Start over.\n\n## When Stuck\n\n| Problem | Solution |\n|---------|----------|\n| Don't know how to test | Write wished-for API. Write assertion first. Ask the human. |\n| Test too complicated | Design too complicated. Simplify interface. |\n| Must mock everything | Code too coupled. Use dependency injection. |\n| Test setup huge | Extract helpers. Still complex? Simplify design. |\n\n## Debugging Integration\n\nBug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.\n\nNever fix bugs without a test.\n\n## CodexAI Integration\n\n### Gate Integration\n\nAfter TDD cycle, run quality gate:\n\n```bash\n# Quick check\npython codex-execution-quality-gate\u002Fscripts\u002Fauto_gate.py --mode quick --project-root \u003Crepo>\n\n# Smart test selection for changed files\npython codex-execution-quality-gate\u002Fscripts\u002Fsmart_test_selector.py --project-root \u003Crepo>\n```\n\n### Workflow Integration\n\n| Workflow Phase | TDD Requirement |\n|----------------|-----------------|\n| `$plan` task breakdown | Each task must include test-first steps |\n| `$create` implementation | RED-GREEN-REFACTOR per feature unit |\n| `$debug` bug fix | Failing reproduction test BEFORE fix attempt |\n| `$review` code review | Verify TDD compliance in changeset |\n\n## Testing Anti-Patterns\n\nWhen adding mocks or test utilities, see `references\u002Ftesting-anti-patterns.md` to avoid common pitfalls.\n\n## Reference Files\n\n- `references\u002Ftesting-anti-patterns.md`: common testing mistakes and how to avoid them.\n\n## Final Rule\n\n```\nProduction code → test exists and failed first\nOtherwise → not TDD\n```\n\nNo exceptions without the human's explicit permission.\n","## TL;DR\nWrite test first → watch it fail → write minimal code to pass → watch it pass → refactor. Delete code written before tests. No exceptions. Integrate with `$gate` for automated verification. Use `$tdd` or `$red-green` to activate.\n\n# Test-Driven Development (TDD)\n\n## Activation\n\n1. Activate on `$codex-test-driven-development`, `$tdd`, or `$red-green`.\n2. Activate when implementing any feature or bugfix, before writing implementation code.\n3. Activate when `codex-workflow-autopilot` routes to `build` or `fix` workflow.\n4. Activate when `codex-intent-context-analyzer` detects implementation intent.\n5. Always active as a behavioral constraint during implementation phases.\n\n## The Iron Law\n\n```\nNO PRODUCTION CODE WITHOUT A FAILING TEST FIRST\n```\n\nWrite code before the test? **Delete it. Start over.**\n\n**No exceptions:**\n- Don't keep it as \"reference\"\n- Don't \"adapt\" it while writing tests\n- Don't look at it\n- Delete means delete\n\nImplement fresh from tests. Period.\n\n**Violating the letter of the rules is violating the spirit of the rules.**\n\n## When to Use\n\n**Always:**\n- New features\n- Bug fixes\n- Refactoring\n- Behavior changes\n\n**Exceptions (ask the human):**\n- Throwaway prototypes\n- Generated code\n- Configuration files\n\nThinking \"skip TDD just this once\"? Stop. That's rationalization.\n\n## Red-Green-Refactor Cycle\n\n```\nTask type → Implementation needed?\n    |- Yes → Write failing test (RED)\n    |   |- Verify it fails correctly\n    |   |- Write minimal code (GREEN)\n    |   |- Verify it passes + all tests pass\n    |   |- Refactor (keep green)\n    |   `- Next test → repeat\n    |\n    `- No → skip TDD\n```\n\n### RED — Write Failing Test\n\nWrite one minimal test showing what should happen.\n\n**Good — Python:**\n```python\ndef test_retries_failed_operations_three_times():\n    attempts = 0\n\n    def operation():\n        nonlocal attempts\n        attempts += 1\n        if attempts \u003C 3:\n            raise RuntimeError(\"fail\")\n        return \"success\"\n\n    result = retry_operation(operation)\n\n    assert result == \"success\"\n    assert attempts == 3\n```\nClear name, tests real behavior, one thing.\n\n**Good — TypeScript:**\n```typescript\ntest('retries failed operations 3 times', async () => {\n  let attempts = 0;\n  const operation = () => {\n    attempts++;\n    if (attempts \u003C 3) throw new Error('fail');\n    return 'success';\n  };\n\n  const result = await retryOperation(operation);\n\n  expect(result).toBe('success');\n  expect(attempts).toBe(3);\n});\n```\n\n**Bad:**\n```typescript\ntest('retry works', async () => {\n  const mock = jest.fn()\n    .mockRejectedValueOnce(new Error())\n    .mockResolvedValueOnce('success');\n  await retryOperation(mock);\n  expect(mock).toHaveBeenCalledTimes(2);\n});\n```\nVague name, tests mock not code.\n\n**Requirements:**\n- One behavior per test\n- Clear descriptive name\n- Real code (no mocks unless unavoidable)\n\n### Verify RED — Watch It Fail\n\n**MANDATORY. Never skip.**\n\n```bash\n# Python\npython -m pytest tests\u002Fpath\u002Ftest_module.py::test_name -v\n\n# JavaScript\u002FTypeScript\nnpm test -- --grep \"test name\"\n\n# Go\ngo test -run TestName -v .\u002F...\n```\n\nConfirm:\n- Test fails (not errors)\n- Failure message is expected\n- Fails because feature missing (not typos)\n\n**Test passes immediately?** You're testing existing behavior. Fix test.\n\n**Test errors?** Fix error, re-run until it fails correctly.\n\n### GREEN — Minimal Code\n\nWrite simplest code to pass the test.\n\n**Good:**\n```python\nasync def retry_operation(fn, max_retries=3):\n    for i in range(max_retries):\n        try:\n            return fn()\n        except Exception:\n            if i == max_retries - 1:\n                raise\n```\nJust enough to pass.\n\n**Bad:**\n```python\nasync def retry_operation(\n    fn,\n    max_retries=3,\n    backoff=\"exponential\",\n    on_retry=None,\n    timeout=30,\n    jitter=True,\n):\n    # YAGNI — over-engineered\n```\n\nDon't add features, refactor other code, or \"improve\" beyond the test.\n\n### Verify GREEN — Watch It Pass\n\n**MANDATORY.**\n\n```bash\n# Run specific test\npython -m pytest tests\u002Fpath\u002Ftest_module.py::test_name -v\n\n# Run ALL tests to check for regressions\npython -m pytest tests\u002F -q\n```\n\nConfirm:\n- Test passes\n- Other tests still pass\n- Output pristine (no errors, warnings)\n\n**Test fails?** Fix code, not test.\n\n**Other tests fail?** Fix now.\n\n### REFACTOR — Clean Up\n\nAfter green only:\n- Remove duplication\n- Improve names\n- Extract helpers\n\nKeep tests green. Don't add behavior.\n\n### Repeat\n\nNext failing test for next feature.\n\n## Good Tests\n\n| Quality | Good | Bad |\n|---------|------|-----|\n| **Minimal** | One thing. \"and\" in name? Split it. | `test_validates_email_and_domain_and_whitespace` |\n| **Clear** | Name describes behavior | `test_1`, `test_it_works` |\n| **Shows intent** | Demonstrates desired API | Obscures what code should do |\n| **Real code** | Tests actual implementation | Tests mock behavior |\n\n## Why Order Matters\n\n**\"I'll write tests after to verify it works\"**\n\nTests written after code pass immediately. Passing immediately proves nothing:\n- Might test wrong thing\n- Might test implementation, not behavior\n- Might miss edge cases you forgot\n- You never saw it catch the bug\n\nTest-first forces you to see the test fail, proving it actually tests something.\n\n**\"I already manually tested all the edge cases\"**\n\nManual testing is ad-hoc. You think you tested everything but:\n- No record of what you tested\n- Can't re-run when code changes\n- Easy to forget cases under pressure\n- \"It worked when I tried it\" ≠ comprehensive\n\nAutomated tests are systematic. They run the same way every time.\n\n**\"Deleting X hours of work is wasteful\"**\n\nSunk cost fallacy. The time is already gone. Your choice now:\n- Delete and rewrite with TDD (X more hours, high confidence)\n- Keep it and add tests after (30 min, low confidence, likely bugs)\n\nThe \"waste\" is keeping code you can't trust.\n\n**\"TDD is dogmatic, being pragmatic means adapting\"**\n\nTDD IS pragmatic:\n- Finds bugs before commit (faster than debugging after)\n- Prevents regressions (tests catch breaks immediately)\n- Documents behavior (tests show how to use code)\n- Enables refactoring (change freely, tests catch breaks)\n\n\"Pragmatic\" shortcuts = debugging in production = slower.\n\n## Common Rationalizations\n\n| Excuse | Reality |\n|--------|---------|\n| \"Too simple to test\" | Simple code breaks. Test takes 30 seconds. |\n| \"I'll test after\" | Tests passing immediately prove nothing. |\n| \"Tests after achieve same goals\" | Tests-after = \"what does this do?\" Tests-first = \"what should this do?\" |\n| \"Already manually tested\" | Ad-hoc ≠ systematic. No record, can't re-run. |\n| \"Deleting X hours is wasteful\" | Sunk cost fallacy. Keeping unverified code is technical debt. |\n| \"Keep as reference, write tests first\" | You'll adapt it. That's testing after. Delete means delete. |\n| \"Need to explore first\" | Fine. Throw away exploration, start with TDD. |\n| \"Test hard = design unclear\" | Listen to test. Hard to test = hard to use. |\n| \"TDD will slow me down\" | TDD faster than debugging. Pragmatic = test-first. |\n| \"Manual test faster\" | Manual doesn't prove edge cases. You'll re-test every change. |\n| \"Existing code has no tests\" | You're improving it. Add tests for existing code. |\n| \"This is different because...\" | It's not. Start with TDD. |\n\n## Red Flags — STOP and Start Over\n\n- Code before test\n- Test after implementation\n- Test passes immediately on first run\n- Can't explain why test failed\n- Tests added \"later\"\n- Rationalizing \"just this once\"\n- \"I already manually tested it\"\n- \"Tests after achieve the same purpose\"\n- \"It's about spirit not ritual\"\n- \"Keep as reference\" or \"adapt existing code\"\n- \"Already spent X hours, deleting is wasteful\"\n- \"TDD is dogmatic, I'm being pragmatic\"\n\n**All of these mean: Delete code. Start over with TDD.**\n\n## Example: Bug Fix\n\n**Bug:** Empty email accepted\n\n**RED**\n```python\ndef test_rejects_empty_email():\n    result = submit_form({\"email\": \"\"})\n    assert result[\"error\"] == \"Email required\"\n```\n\n**Verify RED**\n```bash\n$ python -m pytest tests\u002Ftest_form.py::test_rejects_empty_email -v\nFAIL: AssertionError: expected 'Email required', got None\n```\n\n**GREEN**\n```python\ndef submit_form(data):\n    if not data.get(\"email\", \"\").strip():\n        return {\"error\": \"Email required\"}\n    # ...\n```\n\n**Verify GREEN**\n```bash\n$ python -m pytest tests\u002Ftest_form.py -v\nPASS (all tests)\n```\n\n**REFACTOR**\nExtract validation for multiple fields if needed.\n\n## Verification Checklist\n\nBefore marking work complete:\n\n- [ ] Every new function\u002Fmethod has a test\n- [ ] Watched each test fail before implementing\n- [ ] Each test failed for expected reason (feature missing, not typo)\n- [ ] Wrote minimal code to pass each test\n- [ ] All tests pass\n- [ ] Output pristine (no errors, warnings)\n- [ ] Tests use real code (mocks only if unavoidable)\n- [ ] Edge cases and errors covered\n\nCan't check all boxes? You skipped TDD. Start over.\n\n## When Stuck\n\n| Problem | Solution |\n|---------|----------|\n| Don't know how to test | Write wished-for API. Write assertion first. Ask the human. |\n| Test too complicated | Design too complicated. Simplify interface. |\n| Must mock everything | Code too coupled. Use dependency injection. |\n| Test setup huge | Extract helpers. Still complex? Simplify design. |\n\n## Debugging Integration\n\nBug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.\n\nNever fix bugs without a test.\n\n## CodexAI Integration\n\n### Gate Integration\n\nAfter TDD cycle, run quality gate:\n\n```bash\n# Quick check\npython codex-execution-quality-gate\u002Fscripts\u002Fauto_gate.py --mode quick --project-root \u003Crepo>\n\n# Smart test selection for changed files\npython codex-execution-quality-gate\u002Fscripts\u002Fsmart_test_selector.py --project-root \u003Crepo>\n```\n\n### Workflow Integration\n\n| Workflow Phase | TDD Requirement |\n|----------------|-----------------|\n| `$plan` task breakdown | Each task must include test-first steps |\n| `$create` implementation | RED-GREEN-REFACTOR per feature unit |\n| `$debug` bug fix | Failing reproduction test BEFORE fix attempt |\n| `$review` code review | Verify TDD compliance in changeset |\n\n## Testing Anti-Patterns\n\nWhen adding mocks or test utilities, see `references\u002Ftesting-anti-patterns.md` to avoid common pitfalls.\n\n## Reference Files\n\n- `references\u002Ftesting-anti-patterns.md`: common testing mistakes and how to avoid them.\n\n## Final Rule\n\n```\nProduction code → test exists and failed first\nOtherwise → not TDD\n```\n\nNo exceptions without the human's explicit permission.\n",{"name":5,"description":7,"load_priority":23},"on-demand","main","19b976c6b4f182f06d2d2e6b030549f2f8a69cc0","packages\u002Fcli\u002Fskills\u002Fcodex-test-driven-development",0,"https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI","https:\u002F\u002Fgithub.com\u002FBang-isme","Hi my name is jeff","2026-07-15 19:58:17",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Bang-isme\u002FAgencyCLI --skill codex-test-driven-development",{"tool":38,"command":39},"bunx","bunx skills add Bang-isme\u002FAgencyCLI --skill codex-test-driven-development",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Bang-isme\u002FAgencyCLI --skill codex-test-driven-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills\u002Fcodex-test-driven-development\u002FSKILL.md",true,[46],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Ftesting-anti-patterns.md","REFERENCE","参考文档",6060,"https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Fpackages\u002Fcli\u002Fskills\u002Fcodex-test-driven-development\u002Freferences\u002Ftesting-anti-patterns.md",[53,59,66,73,80,87],{"skillNo":54,"name":5,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":18},"01M754T5CB6WCXB2AV8N0M50AC","Fixture stub for TDD skill.","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-skills\u002Fcodex-test-driven-development\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":18},"01M754T41J59TG0MJYC52TES58","codex-subagent-execution","Fixture stub for subagent execution skill.","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-skills\u002Fcodex-subagent-execution\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":18},"01M754T2JDSPA3YF83FK6BMNV6","codex-runtime-hook","Fixture stub for runtime hook skill.","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-skills\u002Fcodex-runtime-hook\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":18},"01M754T1HG4JRTJVZC2PBFTXDT","codex-plan-writer","Fixture stub for plan writer skill.","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-skills\u002Fcodex-plan-writer\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":18},"01M754SZJVZKGQR5PSA6YFFY09","codex-execution-quality-gate","Fixture stub for quality gate skill.","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-skills\u002Fcodex-execution-quality-gate\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":18},"01M754SXBJ1DE0JR6TK0XJ4SAK","codex-demo","Minimal fixture skill for Agency CLI skill-md parser tests.","https:\u002F\u002Fgithub.com\u002FBang-isme\u002FAgencyCLI\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fmock-skills\u002Fcodex-demo\u002FSKILL.md",[],[]]