[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MDC4YYYBBVM5PTSAPSF1CY":3,"skill-same:01M6MDC4YYYBBVM5PTSAPSF1CY":77},{"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":26,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":56,"repositoryHtmlUrl":57,"repositoryHomepageUrl":58,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6MDC4YYYBBVM5PTSAPSF1CY","test-driven-development",null,"Enforce RED-GREEN-REFACTOR discipline for every implementation task. Use for all new features, bug fixes, and refactors. The core rule — if you didn't watch the test fail, you don't know if it tests the right thing.","hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FRBraga01\u002Fa-team\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"test driven development","development","test","driven","new","features","fixes","for","you","watch","tests","green","enforce","task","implementation","bug","red-green-refactor","discipline","use","refactor","core","2026-11-10 10:12:30",false,"---\nname: test-driven-development\ndescription: Enforce RED-GREEN-REFACTOR discipline for every implementation task. Use for all new features, bug fixes, and refactors. The core rule — if you didn't watch the test fail, you don't know if it tests the right thing.\n---\n\n# Test-Driven Development\n\n## The Core Rule\n\n```\nIF YOU DIDN'T WATCH THE TEST FAIL, YOU DON'T KNOW IF IT TESTS THE RIGHT THING.\n```\n\nA green test you've never seen red is not a test — it's a decoration.\n\n## The Three Phases (Non-Negotiable)\n\n### Phase RED — Write a Failing Test\n\nWrite the test FIRST. Not after. Not \"I'll add it later.\" **First.**\n\nThe test must:\n- Describe the behavior you want, not the implementation\n- Be specific enough to fail for the right reason\n- Cover the exact scenario you're about to implement\n\n```typescript\n\u002F\u002F RED: Write this BEFORE writing the function\ntest('returns empty array when no users match the filter', () => {\n  const result = filterActiveUsers([])\n  expect(result).toEqual([])\n})\n```\n\n**Run it. Watch it fail.**\n\n```bash\nnpm test -- --testPathPattern=\"user-filter\"\n# Expected: FAIL (function doesn't exist yet)\n```\n\nIf the test passes before you write the implementation: the test is wrong. Rewrite it.\n\n### Phase GREEN — Write Minimal Implementation\n\nWrite the **smallest possible code** that makes the test pass. Nothing more.\n\n- No extra features \"while I'm here\"\n- No optimization\n- No handling of edge cases not yet covered by tests\n- Ugly code that passes is better than beautiful code that doesn't exist yet\n\n```typescript\n\u002F\u002F GREEN: Minimal implementation that passes the test\nfunction filterActiveUsers(users: User[]): User[] {\n  return users.filter(u => u.active)\n}\n```\n\n**Run it. Watch it pass.**\n\n```bash\nnpm test -- --testPathPattern=\"user-filter\"\n# Expected: PASS\n```\n\nIf it still fails: read the error message carefully. Fix only what the message tells you.\n\n### Phase REFACTOR — Improve Without Breaking\n\nNow clean up. Rename, extract, simplify — **while keeping tests green**.\n\n```bash\n# Run tests continuously during refactor\nnpm test -- --watch --testPathPattern=\"user-filter\"\n```\n\nRules during refactor:\n- Tests must stay green at every step\n- No new behavior — only structural improvement\n- If tests go red: undo the last change, understand why\n\n## Adding More Tests (Expand-Contract Pattern)\n\nAfter GREEN for the first case, expand coverage:\n\n```\nRED  → watch new test fail\nGREEN → minimal code to pass\nRED  → add next edge case test\nGREEN → handle the edge case\n...\nREFACTOR → clean up all at once when coverage is complete\n```\n\nCover in order:\n1. Happy path (basic success case)\n2. Empty \u002F null inputs\n3. Boundary values (min, max, exactly-at-limit)\n4. Error paths (invalid input, dependency failure)\n5. Concurrent \u002F race conditions if applicable\n\n## What to Test vs. What NOT to Test\n\n**Test:**\n- Public API surface (exported functions, class methods, HTTP endpoints)\n- Business logic decisions\n- Data transformations\n- Error handling\n\n**Do NOT test:**\n- Implementation details (private functions, internal state)\n- Third-party library behavior\n- Framework internals\n\n## Mocking External Dependencies\n\nExternal dependencies (database, APIs, file system) must be mocked in unit tests:\n\n```typescript\n\u002F\u002F Mock the DB before testing the service\njest.mock('..\u002Fdb\u002Fusers')\nconst mockFindUser = db.findUser as jest.MockedFunction\u003Ctypeof db.findUser>\nmockFindUser.mockResolvedValue({ id: '1', name: 'Alice', active: true })\n```\n\nIntegration tests should hit real dependencies — but unit tests must be fast and isolated.\n\n## Coverage Gate\n\nAfter each feature or bug fix, verify coverage meets the project minimum:\n\n```bash\nnpm run test:coverage\n# Required: ≥ 80% branches, functions, lines, statements\n```\n\nIf coverage drops below threshold: add tests before moving on.\n\n## TDD Red Flags — You're Doing It Wrong\n\n- Writing the implementation before writing the test\n- Running the test only after implementation (never seeing it red)\n- Writing tests that test the implementation, not the behavior\n- Skipping the refactor phase (\"it works, ship it\")\n- Writing multiple failing tests before making any pass\n- Adding edge cases without first making them fail\n\nIf you catch yourself rationalizing any of these: stop, revert to the last green state, and start the RED phase properly.\n\n## Integration with A Team Workflow\n\nTDD fits into the full workflow:\n1. `brainstorming` → spec approved\n2. `writing-plans` → plan with test strategy included\n3. **`test-driven-development`** ← you are here, per task\n4. `subagent-driven-development` → each subagent runs TDD internally\n5. `verification-before-completion` → final proof before claiming done\n6. `finishing-a-development-branch` → branch wrap-up\n","# Test-Driven Development\n\n## The Core Rule\n\n```\nIF YOU DIDN'T WATCH THE TEST FAIL, YOU DON'T KNOW IF IT TESTS THE RIGHT THING.\n```\n\nA green test you've never seen red is not a test — it's a decoration.\n\n## The Three Phases (Non-Negotiable)\n\n### Phase RED — Write a Failing Test\n\nWrite the test FIRST. Not after. Not \"I'll add it later.\" **First.**\n\nThe test must:\n- Describe the behavior you want, not the implementation\n- Be specific enough to fail for the right reason\n- Cover the exact scenario you're about to implement\n\n```typescript\n\u002F\u002F RED: Write this BEFORE writing the function\ntest('returns empty array when no users match the filter', () => {\n  const result = filterActiveUsers([])\n  expect(result).toEqual([])\n})\n```\n\n**Run it. Watch it fail.**\n\n```bash\nnpm test -- --testPathPattern=\"user-filter\"\n# Expected: FAIL (function doesn't exist yet)\n```\n\nIf the test passes before you write the implementation: the test is wrong. Rewrite it.\n\n### Phase GREEN — Write Minimal Implementation\n\nWrite the **smallest possible code** that makes the test pass. Nothing more.\n\n- No extra features \"while I'm here\"\n- No optimization\n- No handling of edge cases not yet covered by tests\n- Ugly code that passes is better than beautiful code that doesn't exist yet\n\n```typescript\n\u002F\u002F GREEN: Minimal implementation that passes the test\nfunction filterActiveUsers(users: User[]): User[] {\n  return users.filter(u => u.active)\n}\n```\n\n**Run it. Watch it pass.**\n\n```bash\nnpm test -- --testPathPattern=\"user-filter\"\n# Expected: PASS\n```\n\nIf it still fails: read the error message carefully. Fix only what the message tells you.\n\n### Phase REFACTOR — Improve Without Breaking\n\nNow clean up. Rename, extract, simplify — **while keeping tests green**.\n\n```bash\n# Run tests continuously during refactor\nnpm test -- --watch --testPathPattern=\"user-filter\"\n```\n\nRules during refactor:\n- Tests must stay green at every step\n- No new behavior — only structural improvement\n- If tests go red: undo the last change, understand why\n\n## Adding More Tests (Expand-Contract Pattern)\n\nAfter GREEN for the first case, expand coverage:\n\n```\nRED  → watch new test fail\nGREEN → minimal code to pass\nRED  → add next edge case test\nGREEN → handle the edge case\n...\nREFACTOR → clean up all at once when coverage is complete\n```\n\nCover in order:\n1. Happy path (basic success case)\n2. Empty \u002F null inputs\n3. Boundary values (min, max, exactly-at-limit)\n4. Error paths (invalid input, dependency failure)\n5. Concurrent \u002F race conditions if applicable\n\n## What to Test vs. What NOT to Test\n\n**Test:**\n- Public API surface (exported functions, class methods, HTTP endpoints)\n- Business logic decisions\n- Data transformations\n- Error handling\n\n**Do NOT test:**\n- Implementation details (private functions, internal state)\n- Third-party library behavior\n- Framework internals\n\n## Mocking External Dependencies\n\nExternal dependencies (database, APIs, file system) must be mocked in unit tests:\n\n```typescript\n\u002F\u002F Mock the DB before testing the service\njest.mock('..\u002Fdb\u002Fusers')\nconst mockFindUser = db.findUser as jest.MockedFunction\u003Ctypeof db.findUser>\nmockFindUser.mockResolvedValue({ id: '1', name: 'Alice', active: true })\n```\n\nIntegration tests should hit real dependencies — but unit tests must be fast and isolated.\n\n## Coverage Gate\n\nAfter each feature or bug fix, verify coverage meets the project minimum:\n\n```bash\nnpm run test:coverage\n# Required: ≥ 80% branches, functions, lines, statements\n```\n\nIf coverage drops below threshold: add tests before moving on.\n\n## TDD Red Flags — You're Doing It Wrong\n\n- Writing the implementation before writing the test\n- Running the test only after implementation (never seeing it red)\n- Writing tests that test the implementation, not the behavior\n- Skipping the refactor phase (\"it works, ship it\")\n- Writing multiple failing tests before making any pass\n- Adding edge cases without first making them fail\n\nIf you catch yourself rationalizing any of these: stop, revert to the last green state, and start the RED phase properly.\n\n## Integration with A Team Workflow\n\nTDD fits into the full workflow:\n1. `brainstorming` → spec approved\n2. `writing-plans` → plan with test strategy included\n3. **`test-driven-development`** ← you are here, per task\n4. `subagent-driven-development` → each subagent runs TDD internally\n5. `verification-before-completion` → final proof before claiming done\n6. `finishing-a-development-branch` → branch wrap-up\n",{"name":5,"description":7},"main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002FRBraga01\u002Fa-team\u002Fskills\u002Ftest-driven-development",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill test-driven-development",{"tool":69,"command":70},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill test-driven-development",{"tool":72,"command":73},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill test-driven-development","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FRBraga01\u002Fa-team\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",true,[],[78,88,96,104,112,120],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":87},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":87},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":87},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":87},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":87},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":87},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]