[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CHX2Z44CQFYKXEYFPF3Q8S":3,"skill-same:01M6CHX2Z44CQFYKXEYFPF3Q8S":94},{"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":25,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":66,"commitSha":67,"skillDirectory":68,"forksCount":69,"repositoryHtmlUrl":70,"repositoryHomepageUrl":71,"ownerHtmlUrl":72,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":73,"install":74,"resources":87},"01M6CHX2Z44CQFYKXEYFPF3Q8S","tdd-cycle",null,"[ADD v0.11.0] Execute complete TDD cycle — RED → GREEN → REFACTOR → VERIFY against a spec","MountainUnicorn\u002Fadd","MountainUnicorn","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F199411549?v=4","01M6CHRAWFWD275ANP1S2A0HXC","01M6CHRB0QE1678D913B438SAR",11,"MIT","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Fplugins\u002Fadd\u002Fskills\u002Ftdd-cycle\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000007","代码审查","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"tdd","tdd cycle","cycle","Rules","spec","test","task","discipline","v0","edit","write","read","telemetry","parallel","model","learning","Bash","verify","refactor","cache","2026-11-10 10:12:30",false,"---\ndescription: \"[ADD v0.11.0] Execute complete TDD cycle — RED → GREEN → REFACTOR → VERIFY against a spec\"\nargument-hint: \"specs\u002F{feature}.md [--ac AC-001,AC-002] [--parallel] [--allow-test-rewrite]\"\nallowed-tools: [Read, Write, Edit, Glob, Grep, Bash, Task, TodoWrite]\nreferences: [\"learning-reference.md\", \"skill-epilogue.md\", \"rules\u002Fcache-discipline.md\", \"rules\u002Ftelemetry.md\", \"rules\u002Fmodel-roles.md\"]\n---\n\n# ADD TDD Cycle Skill v0.11.0\n\nExecute a complete Test-Driven Development cycle for a feature from the specification through production-quality code.\n\n## Overview\n\nThe TDD Cycle is the primary \"do the work\" skill in Agent Driven Development. It orchestrates the full lifecycle:\n\n1. **RED** — Write failing tests from spec acceptance criteria\n2. **GREEN** — Implement minimal code to pass those tests\n3. **REFACTOR** — Improve code quality while keeping tests green\n4. **VERIFY** — Run all quality gates to ensure production readiness\n\nThis skill coordinates sub-agents (test-writer, implementer, reviewer, verify) and maintains traceability between specs, tests, and implementation.\n\n## Sub-Agent Dispatch Prompt Template\n\nEvery Task-tool dispatch from this skill (test-writer, implementer, reviewer,\nverify) MUST emit a prompt body laid out per `rules\u002Fcache-discipline.md`.\nConstruct the prompt as follows — the STABLE block is byte-identical across\nevery dispatch in a session; only the VOLATILE block changes per role.\n\n\u003C!-- CACHE: STABLE -->\n- Active autoload:true rule bodies, in stable order\n- Tier-1 knowledge active view (`knowledge\u002Fglobal.md`)\n- Tier-2 active view (`~\u002F.claude\u002Fadd\u002Flibrary-active.md`) if present\n- Project identity summary from `.add\u002Fconfig.json`\n- Active learnings view (`.add\u002Flearnings-active.md`)\n- Full body of the current spec under work\n\u003C!-- CACHE: VOLATILE -->\n- Role (test-writer | implementer | reviewer | verify)\n- MODEL: capability tier per role — test-writer: editor, implementer: editor,\n  reviewer: architect, verify: editor (tiers per `rules\u002Fmodel-roles.md`, never\n  hardcoded model names)\n- BUDGET: max tokens for this dispatch — per the maturity Resource Budgets\n  table in `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fswarm-protocol.md` (overridable\n  via `.add\u002Fconfig.json` → `swarm.budgets`)\n- Per-call TASK \u002F SCOPE \u002F SPEC REFERENCE \u002F SUCCESS CRITERIA \u002F RESTRICTIONS\n- AC subset for this dispatch\n- Per-call hints — recent edits, tool outputs, working-set diffs\n\nValidate compliance with `python3 scripts\u002Fvalidate-cache-discipline.py`.\n\n## Pre-Flight Checks\n\nBefore beginning, validate:\n1. Spec file exists at path provided in argument\n2. Read the spec frontmatter to extract:\n   - Feature name\n   - Acceptance criteria (ACs)\n   - User test cases (UTs)\n   - Status and version\n3. Load .add\u002Fconfig.json to determine:\n   - Test framework and conventions\n   - Code style rules\n   - Quality gate thresholds\n   - Parallelization preference\n4. Verify plan exists at docs\u002Fplans\u002F{feature}-plan.md\n   - If not, generate one using \u002Fadd:plan skill before proceeding\n5. Identify target implementation paths from the spec\n6. **Check for session handoff** — per the Session-Handoff Preflight in `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fskill-epilogue.md`\n\n## Execution Phases\n\n### Phase 1: RED — Test Writing\n\nInvoke the \u002Fadd:test-writer skill with the spec reference:\n- Pass argument: `specs\u002F{feature}.md [--ac AC-001,AC-002]`\n- This generates failing tests covering all acceptance criteria\n- Tests must be named using convention: `test_AC_NNN_description` for traceability\n- Each test maps to one or more ACs from the spec\n- Allow parallel test generation if --parallel flag is set\n\nVerify tests actually fail:\n- Run the test command: `npm test` or `python -m pytest` depending on config\n- Confirm exit code is non-zero (tests fail)\n- Log any compilation\u002Fimport errors — halt if tests can't run\n\n**RED-end snapshot (test-deletion guardrail — required since v0.9.0):**\n\nAfter test-writer signals RED complete, capture the test surface snapshot:\n\n```bash\npython3 ${CLAUDE_PLUGIN_ROOT}\u002F..\u002F..\u002Fscripts\u002Fcheck-test-count.py snapshot \\\n  --phase red \\\n  --cycle-id {N} \\\n  --spec-slug {slug} \\\n  --base-sha {cycle-base-sha} \\\n  --fail-on-empty\n```\n\nThis writes `.add\u002Fcycles\u002Fcycle-{N}\u002Ftdd-{slug}-red.json`. The `--fail-on-empty` flag\nenforces AC-006: a RED phase that produced zero new tests is itself a TDD violation\nand halts the cycle. Commit the snapshot with:\n\n```\ngit add .add\u002Fcycles\u002Fcycle-{N}\u002Ftdd-{slug}-red.json\ngit commit -m \"test(red): snapshot {total_functions} tests for {slug}\"\n```\n\nSee `core\u002Frules\u002Ftdd-enforcement.md` \"Test-Deletion Invariant\" for the full rationale.\n\n### Phase 2: GREEN — Implementation\n\n**Pre-GREEN: files-likely-affected hint.**\n\nBefore invoking the implementer, generate the impact hint so the implementer enters\nGREEN with a focused set of candidate files:\n\n```bash\nbash ${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fimpact-hint.sh {cycle-base-sha} specs\u002F{feature}.md .\n```\n\nThe helper emits a two-section block: *Files likely to need changes* (from diff +\nimport resolution + spec path scan) and *Files to be careful around* (paths mentioned\nin anti-pattern learnings). Pass this block to the implementer verbatim as part of its\ncontext — see `core\u002Fskills\u002Fimplementer\u002FSKILL.md` §Pre-Flight.\n\nOnce RED phase is complete, invoke the \u002Fadd:implementer skill:\n- Pass argument: `specs\u002F{feature}.md [--ac AC-001,AC-002]`\n- Provide the impact hint as additional context\n- Implementer writes minimal code to pass each test\n- Target: Every test should pass with as little code as possible\n- No over-engineering; defer non-essential features\n\nAfter implementation:\n- Run tests again: `npm test` or equivalent\n- Verify all tests pass (exit code 0)\n- Capture test output showing pass counts\n- If any tests still fail, return to implementer with failure details\n\n**GREEN-end snapshot (test-deletion guardrail — required since v0.9.0):**\n\n```bash\npython3 ${CLAUDE_PLUGIN_ROOT}\u002F..\u002F..\u002Fscripts\u002Fcheck-test-count.py snapshot \\\n  --phase green \\\n  --cycle-id {N} \\\n  --spec-slug {slug} \\\n  --base-sha {cycle-base-sha}\n```\n\nThis writes `.add\u002Fcycles\u002Fcycle-{N}\u002Ftdd-{slug}-green.json`. Gate 3.5 in \u002Fadd:verify\ncompares RED vs GREEN and fails if tests were removed without a recorded override.\n\n### Phase 3: REFACTOR — Code Quality\n\nWith all tests green, refactor for quality:\n1. Run the \u002Fadd:reviewer skill to identify issues:\n   - Pass argument: `specs\u002F{feature}.md --scope full`\n   - Reviewer produces READ-ONLY report on code quality and spec compliance\n2. Address reviewer findings:\n   - Use \u002Fedit to improve variable names, reduce duplication, improve structure\n   - Maintain test-green status after each refactoring change\n   - Run tests after every significant refactor: `npm test`\n3. Focus areas:\n   - DRY principle (Don't Repeat Yourself)\n   - Clear, descriptive names for functions and variables\n   - Proper error handling and edge case coverage\n   - Comment complex logic\n   - Consistent formatting per .add\u002Fconfig.json\n\n### Phase 4: VERIFY — Quality Gates\n\nRun the full verification suite using \u002Fadd:verify skill:\n- Pass argument: `--level deploy` (all gates for production readiness)\n- Verify produces a structured report:\n  - Gate 1: Lint and formatting (must pass)\n  - Gate 2: Type checking (must pass)\n  - Gate 3: Unit test coverage >= configured threshold (default 80%)\n  - **Gate 3.5: Test Surface Integrity** — reads the RED\u002FGREEN snapshots from\n    `.add\u002Fcycles\u002Fcycle-{N}\u002F` and fails if tests were removed without an override.\n    If `--allow-test-rewrite` was passed to this cycle and the user approved via the\n    prompt, the approval is recorded in `.add\u002Fcycles\u002Fcycle-{N}\u002Foverrides.json` and\n    the gate reads it.\n  - Gate 4: Spec compliance (every AC has a passing test)\n  - Gate 5: Integration tests if applicable\n\nIf any gate fails:\n- Review the failure details\n- Return to appropriate phase (GREEN for test failures, REFACTOR for style)\n- Re-run verification\n\n## Output Format\n\nUpon successful completion, output:\n\n```\n# TDD Cycle Complete ✓\n\n## Feature\n{feature-name} v{spec-version}\n\n## Summary\n- Tests Written: {count}\n- Tests Passing: {count}\n- Code Coverage: {percentage}%\n- Refactoring Issues Fixed: {count}\n- Quality Gates: {pass\u002Ftotal}\n\n## Acceptance Criteria Status\n- AC-001: ✓ Passing\n- AC-002: ✓ Passing\n... (all ACs listed with status)\n\n## Next Steps\n1. Review code in {implementation-path}\n2. Merge to main branch\n3. Deploy to staging environment\n\n## Artifacts\n- Tests: {test-file-paths}\n- Implementation: {code-file-paths}\n- Plan: docs\u002Fplans\u002F{feature}-plan.md\n```\n\n## Progress Tracking\n\n**Tasks to create** (mechanics per `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fskill-epilogue.md`):\n\n| Phase | Subject | activeForm |\n|-------|---------|------------|\n| Pre-flight | Loading spec and config | Loading spec and config... |\n| RED | Writing failing tests | Writing failing tests... |\n| GREEN | Implementing code | Implementing code to pass tests... |\n| REFACTOR | Refactoring for quality | Refactoring for code quality... |\n| VERIFY | Running verification gates | Running verification gates... |\n\n## Error Handling\n\n**Tests won't compile\u002Frun**\n- Check syntax errors in test-writer output\n- Verify test framework is installed per config\n- Check imports and paths are correct\n- Run: `npm install` or equivalent dependency installation\n\n**Tests still failing after GREEN phase**\n- Implementer may have missed test requirements\n- Run `\u002Fadd:implementer` again with specific AC range\n- Check test output for assertion details\n\n**Quality gate failures**\n- Lint errors: Run with `--fix` flag on \u002Fadd:verify\n- Coverage below threshold: Write additional tests or increase coverage in refactor phase\n- Spec compliance: Verify every AC has a mapped test; update test mapping if needed\n\n**Performance issues detected**\n- Dispatch \u002Fadd:optimize skill to identify bottlenecks\n- Apply optimizations and re-run verify\n\n## Integration with Other Skills\n\n- **test-writer**: Invoked during RED phase; generates test files\n- **implementer**: Invoked during GREEN phase; generates implementation\n- **reviewer**: Invoked during REFACTOR phase; produces quality report (read-only)\n- **verify**: Invoked during VERIFY phase; produces gate report and pass\u002Ffail\n- **plan**: Called pre-cycle if plan doesn't exist; provides task breakdown\n\n## `--allow-test-rewrite` flag (v0.9.0+)\n\nBy default, if the GREEN snapshot shows any test removed OR any same-name test with a\nchanged body, Gate 3.5 fails the cycle. If the user knows a test was legitimately wrong\n(asserted incorrect behavior), pass `--allow-test-rewrite`:\n\n1. GREEN comparison detects the replacement\n2. Human approval prompt is shown with the RED body and the GREEN body side by side\n3. If the human confirms, an override is recorded in\n   `.add\u002Fcycles\u002Fcycle-{N}\u002Foverrides.json`:\n\n   ```json\n   {\n     \"kind\": \"test-rewrite\",\n     \"approved_by\": \"human\",\n     \"timestamp\": \"2026-04-22T14:32:00Z\",\n     \"affected_tests\": [\"tests\u002Ftest_auth.py::test_validation\"]\n   }\n   ```\n\n4. Gate 3.5 reads the override and passes\n5. Telemetry records `override_used: true` for retro review\n\nWithout `--allow-test-rewrite`, or without explicit human confirmation, Gate 3.5 fails\nand the cycle does not advance.\n\n## Parallelization\n\nIf --parallel flag is set:\n- Test writing (RED) can be parallelized by AC groups\n- Implementation (GREEN) proceeds after all RED tests complete (serial dependency)\n- Refactoring (REFACTOR) is typically serial (one logical flow)\n- Verification (VERIFY) runs all gates in order (serial)\n\n## Configuration\n\nThe skill respects these .add\u002Fconfig.json settings:\n- `test.framework`: The test framework (jest, pytest, vitest, etc.)\n- `test.minCoverage`: Minimum code coverage percentage\n- `test.convention`: Test file naming convention\n- `code.style`: Code style rules and linters\n- `ci.gates`: Which gates to run and in what order\n\nEnd-of-skill epilogue: follow `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fskill-epilogue.md` (observation + learning checkpoint + progress tracking). Learning checkpoint trigger: \"After TDD Cycle Completes\".\n","# ADD TDD Cycle Skill v0.11.0\n\nExecute a complete Test-Driven Development cycle for a feature from the specification through production-quality code.\n\n## Overview\n\nThe TDD Cycle is the primary \"do the work\" skill in Agent Driven Development. It orchestrates the full lifecycle:\n\n1. **RED** — Write failing tests from spec acceptance criteria\n2. **GREEN** — Implement minimal code to pass those tests\n3. **REFACTOR** — Improve code quality while keeping tests green\n4. **VERIFY** — Run all quality gates to ensure production readiness\n\nThis skill coordinates sub-agents (test-writer, implementer, reviewer, verify) and maintains traceability between specs, tests, and implementation.\n\n## Sub-Agent Dispatch Prompt Template\n\nEvery Task-tool dispatch from this skill (test-writer, implementer, reviewer,\nverify) MUST emit a prompt body laid out per `rules\u002Fcache-discipline.md`.\nConstruct the prompt as follows — the STABLE block is byte-identical across\nevery dispatch in a session; only the VOLATILE block changes per role.\n\n\u003C!-- CACHE: STABLE -->\n- Active autoload:true rule bodies, in stable order\n- Tier-1 knowledge active view (`knowledge\u002Fglobal.md`)\n- Tier-2 active view (`~\u002F.claude\u002Fadd\u002Flibrary-active.md`) if present\n- Project identity summary from `.add\u002Fconfig.json`\n- Active learnings view (`.add\u002Flearnings-active.md`)\n- Full body of the current spec under work\n\u003C!-- CACHE: VOLATILE -->\n- Role (test-writer | implementer | reviewer | verify)\n- MODEL: capability tier per role — test-writer: editor, implementer: editor,\n  reviewer: architect, verify: editor (tiers per `rules\u002Fmodel-roles.md`, never\n  hardcoded model names)\n- BUDGET: max tokens for this dispatch — per the maturity Resource Budgets\n  table in `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fswarm-protocol.md` (overridable\n  via `.add\u002Fconfig.json` → `swarm.budgets`)\n- Per-call TASK \u002F SCOPE \u002F SPEC REFERENCE \u002F SUCCESS CRITERIA \u002F RESTRICTIONS\n- AC subset for this dispatch\n- Per-call hints — recent edits, tool outputs, working-set diffs\n\nValidate compliance with `python3 scripts\u002Fvalidate-cache-discipline.py`.\n\n## Pre-Flight Checks\n\nBefore beginning, validate:\n1. Spec file exists at path provided in argument\n2. Read the spec frontmatter to extract:\n   - Feature name\n   - Acceptance criteria (ACs)\n   - User test cases (UTs)\n   - Status and version\n3. Load .add\u002Fconfig.json to determine:\n   - Test framework and conventions\n   - Code style rules\n   - Quality gate thresholds\n   - Parallelization preference\n4. Verify plan exists at docs\u002Fplans\u002F{feature}-plan.md\n   - If not, generate one using \u002Fadd:plan skill before proceeding\n5. Identify target implementation paths from the spec\n6. **Check for session handoff** — per the Session-Handoff Preflight in `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fskill-epilogue.md`\n\n## Execution Phases\n\n### Phase 1: RED — Test Writing\n\nInvoke the \u002Fadd:test-writer skill with the spec reference:\n- Pass argument: `specs\u002F{feature}.md [--ac AC-001,AC-002]`\n- This generates failing tests covering all acceptance criteria\n- Tests must be named using convention: `test_AC_NNN_description` for traceability\n- Each test maps to one or more ACs from the spec\n- Allow parallel test generation if --parallel flag is set\n\nVerify tests actually fail:\n- Run the test command: `npm test` or `python -m pytest` depending on config\n- Confirm exit code is non-zero (tests fail)\n- Log any compilation\u002Fimport errors — halt if tests can't run\n\n**RED-end snapshot (test-deletion guardrail — required since v0.9.0):**\n\nAfter test-writer signals RED complete, capture the test surface snapshot:\n\n```bash\npython3 ${CLAUDE_PLUGIN_ROOT}\u002F..\u002F..\u002Fscripts\u002Fcheck-test-count.py snapshot \\\n  --phase red \\\n  --cycle-id {N} \\\n  --spec-slug {slug} \\\n  --base-sha {cycle-base-sha} \\\n  --fail-on-empty\n```\n\nThis writes `.add\u002Fcycles\u002Fcycle-{N}\u002Ftdd-{slug}-red.json`. The `--fail-on-empty` flag\nenforces AC-006: a RED phase that produced zero new tests is itself a TDD violation\nand halts the cycle. Commit the snapshot with:\n\n```\ngit add .add\u002Fcycles\u002Fcycle-{N}\u002Ftdd-{slug}-red.json\ngit commit -m \"test(red): snapshot {total_functions} tests for {slug}\"\n```\n\nSee `core\u002Frules\u002Ftdd-enforcement.md` \"Test-Deletion Invariant\" for the full rationale.\n\n### Phase 2: GREEN — Implementation\n\n**Pre-GREEN: files-likely-affected hint.**\n\nBefore invoking the implementer, generate the impact hint so the implementer enters\nGREEN with a focused set of candidate files:\n\n```bash\nbash ${CLAUDE_PLUGIN_ROOT}\u002Flib\u002Fimpact-hint.sh {cycle-base-sha} specs\u002F{feature}.md .\n```\n\nThe helper emits a two-section block: *Files likely to need changes* (from diff +\nimport resolution + spec path scan) and *Files to be careful around* (paths mentioned\nin anti-pattern learnings). Pass this block to the implementer verbatim as part of its\ncontext — see `core\u002Fskills\u002Fimplementer\u002FSKILL.md` §Pre-Flight.\n\nOnce RED phase is complete, invoke the \u002Fadd:implementer skill:\n- Pass argument: `specs\u002F{feature}.md [--ac AC-001,AC-002]`\n- Provide the impact hint as additional context\n- Implementer writes minimal code to pass each test\n- Target: Every test should pass with as little code as possible\n- No over-engineering; defer non-essential features\n\nAfter implementation:\n- Run tests again: `npm test` or equivalent\n- Verify all tests pass (exit code 0)\n- Capture test output showing pass counts\n- If any tests still fail, return to implementer with failure details\n\n**GREEN-end snapshot (test-deletion guardrail — required since v0.9.0):**\n\n```bash\npython3 ${CLAUDE_PLUGIN_ROOT}\u002F..\u002F..\u002Fscripts\u002Fcheck-test-count.py snapshot \\\n  --phase green \\\n  --cycle-id {N} \\\n  --spec-slug {slug} \\\n  --base-sha {cycle-base-sha}\n```\n\nThis writes `.add\u002Fcycles\u002Fcycle-{N}\u002Ftdd-{slug}-green.json`. Gate 3.5 in \u002Fadd:verify\ncompares RED vs GREEN and fails if tests were removed without a recorded override.\n\n### Phase 3: REFACTOR — Code Quality\n\nWith all tests green, refactor for quality:\n1. Run the \u002Fadd:reviewer skill to identify issues:\n   - Pass argument: `specs\u002F{feature}.md --scope full`\n   - Reviewer produces READ-ONLY report on code quality and spec compliance\n2. Address reviewer findings:\n   - Use \u002Fedit to improve variable names, reduce duplication, improve structure\n   - Maintain test-green status after each refactoring change\n   - Run tests after every significant refactor: `npm test`\n3. Focus areas:\n   - DRY principle (Don't Repeat Yourself)\n   - Clear, descriptive names for functions and variables\n   - Proper error handling and edge case coverage\n   - Comment complex logic\n   - Consistent formatting per .add\u002Fconfig.json\n\n### Phase 4: VERIFY — Quality Gates\n\nRun the full verification suite using \u002Fadd:verify skill:\n- Pass argument: `--level deploy` (all gates for production readiness)\n- Verify produces a structured report:\n  - Gate 1: Lint and formatting (must pass)\n  - Gate 2: Type checking (must pass)\n  - Gate 3: Unit test coverage >= configured threshold (default 80%)\n  - **Gate 3.5: Test Surface Integrity** — reads the RED\u002FGREEN snapshots from\n    `.add\u002Fcycles\u002Fcycle-{N}\u002F` and fails if tests were removed without an override.\n    If `--allow-test-rewrite` was passed to this cycle and the user approved via the\n    prompt, the approval is recorded in `.add\u002Fcycles\u002Fcycle-{N}\u002Foverrides.json` and\n    the gate reads it.\n  - Gate 4: Spec compliance (every AC has a passing test)\n  - Gate 5: Integration tests if applicable\n\nIf any gate fails:\n- Review the failure details\n- Return to appropriate phase (GREEN for test failures, REFACTOR for style)\n- Re-run verification\n\n## Output Format\n\nUpon successful completion, output:\n\n```\n# TDD Cycle Complete ✓\n\n## Feature\n{feature-name} v{spec-version}\n\n## Summary\n- Tests Written: {count}\n- Tests Passing: {count}\n- Code Coverage: {percentage}%\n- Refactoring Issues Fixed: {count}\n- Quality Gates: {pass\u002Ftotal}\n\n## Acceptance Criteria Status\n- AC-001: ✓ Passing\n- AC-002: ✓ Passing\n... (all ACs listed with status)\n\n## Next Steps\n1. Review code in {implementation-path}\n2. Merge to main branch\n3. Deploy to staging environment\n\n## Artifacts\n- Tests: {test-file-paths}\n- Implementation: {code-file-paths}\n- Plan: docs\u002Fplans\u002F{feature}-plan.md\n```\n\n## Progress Tracking\n\n**Tasks to create** (mechanics per `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fskill-epilogue.md`):\n\n| Phase | Subject | activeForm |\n|-------|---------|------------|\n| Pre-flight | Loading spec and config | Loading spec and config... |\n| RED | Writing failing tests | Writing failing tests... |\n| GREEN | Implementing code | Implementing code to pass tests... |\n| REFACTOR | Refactoring for quality | Refactoring for code quality... |\n| VERIFY | Running verification gates | Running verification gates... |\n\n## Error Handling\n\n**Tests won't compile\u002Frun**\n- Check syntax errors in test-writer output\n- Verify test framework is installed per config\n- Check imports and paths are correct\n- Run: `npm install` or equivalent dependency installation\n\n**Tests still failing after GREEN phase**\n- Implementer may have missed test requirements\n- Run `\u002Fadd:implementer` again with specific AC range\n- Check test output for assertion details\n\n**Quality gate failures**\n- Lint errors: Run with `--fix` flag on \u002Fadd:verify\n- Coverage below threshold: Write additional tests or increase coverage in refactor phase\n- Spec compliance: Verify every AC has a mapped test; update test mapping if needed\n\n**Performance issues detected**\n- Dispatch \u002Fadd:optimize skill to identify bottlenecks\n- Apply optimizations and re-run verify\n\n## Integration with Other Skills\n\n- **test-writer**: Invoked during RED phase; generates test files\n- **implementer**: Invoked during GREEN phase; generates implementation\n- **reviewer**: Invoked during REFACTOR phase; produces quality report (read-only)\n- **verify**: Invoked during VERIFY phase; produces gate report and pass\u002Ffail\n- **plan**: Called pre-cycle if plan doesn't exist; provides task breakdown\n\n## `--allow-test-rewrite` flag (v0.9.0+)\n\nBy default, if the GREEN snapshot shows any test removed OR any same-name test with a\nchanged body, Gate 3.5 fails the cycle. If the user knows a test was legitimately wrong\n(asserted incorrect behavior), pass `--allow-test-rewrite`:\n\n1. GREEN comparison detects the replacement\n2. Human approval prompt is shown with the RED body and the GREEN body side by side\n3. If the human confirms, an override is recorded in\n   `.add\u002Fcycles\u002Fcycle-{N}\u002Foverrides.json`:\n\n   ```json\n   {\n     \"kind\": \"test-rewrite\",\n     \"approved_by\": \"human\",\n     \"timestamp\": \"2026-04-22T14:32:00Z\",\n     \"affected_tests\": [\"tests\u002Ftest_auth.py::test_validation\"]\n   }\n   ```\n\n4. Gate 3.5 reads the override and passes\n5. Telemetry records `override_used: true` for retro review\n\nWithout `--allow-test-rewrite`, or without explicit human confirmation, Gate 3.5 fails\nand the cycle does not advance.\n\n## Parallelization\n\nIf --parallel flag is set:\n- Test writing (RED) can be parallelized by AC groups\n- Implementation (GREEN) proceeds after all RED tests complete (serial dependency)\n- Refactoring (REFACTOR) is typically serial (one logical flow)\n- Verification (VERIFY) runs all gates in order (serial)\n\n## Configuration\n\nThe skill respects these .add\u002Fconfig.json settings:\n- `test.framework`: The test framework (jest, pytest, vitest, etc.)\n- `test.minCoverage`: Minimum code coverage percentage\n- `test.convention`: Test file naming convention\n- `code.style`: Code style rules and linters\n- `ci.gates`: Which gates to run and in what order\n\nEnd-of-skill epilogue: follow `${CLAUDE_PLUGIN_ROOT}\u002Freferences\u002Fskill-epilogue.md` (observation + learning checkpoint + progress tracking). Learning checkpoint trigger: \"After TDD Cycle Completes\".\n",{"references":51,"description":7,"allowed-tools":57,"argument-hint":65},[52,53,54,55,56],"learning-reference.md","skill-epilogue.md","rules\u002Fcache-discipline.md","rules\u002Ftelemetry.md","rules\u002Fmodel-roles.md",[58,59,60,61,62,42,63,64],"Read","Write","Edit","Glob","Grep","Task","TodoWrite","specs\u002F{feature}.md [--ac AC-001,AC-002] [--parallel] [--allow-test-rewrite]","main","e335248c85d50f73919320bc138766eb413c5ee3","plugins\u002Fadd\u002Fskills\u002Ftdd-cycle",6,"https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd","https:\u002F\u002Fgetadd.dev","https:\u002F\u002Fgithub.com\u002FMountainUnicorn","2026-10-31 22:03:50",{"source":8,"skillName":5,"commands":75,"prompt":85,"zipAvailable":86},[76,79,82],{"tool":77,"command":78},"npx","npx skills add MountainUnicorn\u002Fadd --skill tdd-cycle",{"tool":80,"command":81},"bunx","bunx skills add MountainUnicorn\u002Fadd --skill tdd-cycle",{"tool":83,"command":84},"pnpm","pnpm dlx skills add MountainUnicorn\u002Fadd --skill tdd-cycle","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Fplugins\u002Fadd\u002Fskills\u002Ftdd-cycle\u002FSKILL.md",true,[88],{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Flineage.md","REFERENCE","参考文档",7804,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002FHDeibler\u002Funiversal-design-principles\u002Fplugins\u002Fperception-and-hierarchy-principles\u002Fskills\u002Freadability\u002Freferences\u002Flineage.md",[95,102,107,112,123,149],{"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":46},"01M6CHXN68ZCGNXE9Q0K2T2RKX","add-verify","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Ftests\u002Fhooks\u002Ffixtures\u002Fdoctor\u002Fmanifest-modified\u002Fskills\u002Fadd-verify\u002FSKILL.md",[],[101,43],"add verify",{"skillNo":103,"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":104,"categories":105,"keywords":106,"publishedAt":46},"01M6CHXJY4ZXKTNP0235A9KTNH","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Ftests\u002Fhooks\u002Ffixtures\u002Fdoctor\u002Fmanifest-missing\u002Fskills\u002Fadd-verify\u002FSKILL.md",[],[101,43],{"skillNo":108,"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":109,"categories":110,"keywords":111,"publishedAt":46},"01M6CHXG6NV1DBMWT2N6XE5555","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Ftests\u002Fhooks\u002Ffixtures\u002Fdoctor\u002Fhealthy\u002Fskills\u002Fadd-verify\u002FSKILL.md",[],[101,43],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":46},"01M6CHXDZFPEFBZ79GHP48S1BB","version","[ADD v0.11.0] Show installed version, project version, and upgrade status","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Fplugins\u002Fadd\u002Fskills\u002Fversion\u002FSKILL.md",[],[114,119,120,38,42,29,121,37,34,122],"grep","status","check","show",{"skillNo":124,"name":43,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":137,"publishedAt":46},"01M6CHXB5XG415PP88E0GACHP8","[ADD v0.11.0] Run quality gates — lint, types, tests, coverage, spec compliance","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Fplugins\u002Fadd\u002Fskills\u002Fverify\u002FSKILL.md",[128,131,132],{"categoryNo":129,"categoryName":130,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":133,"categoryName":134,"taxonomyType":135,"taxonomyTypeDesc":136},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[43,119,37,138,139,34,140,141,29,38,30,142,143,144,145,146,147,42,41,148],"coverage","fix","smoke","gate","quality gates","run","lint","ci","compliance","secrets","quality",{"skillNo":150,"name":151,"nameZh":6,"description":152,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":153,"categories":154,"keywords":162,"publishedAt":46},"01M6CHX8JF3M3J8BKTBW604D37","ux","[ADD v0.11.0] Iterate on UI\u002FUX design before implementation — wireframes, flow validation, and design sign-off","https:\u002F\u002Fgithub.com\u002FMountainUnicorn\u002Fadd\u002Fblob\u002Fmain\u002Fplugins\u002Fadd\u002Fskills\u002Fux\u002FSKILL.md",[155,158,159],{"categoryNo":156,"categoryName":157,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000015","视觉设计",{"categoryNo":23,"categoryName":24,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":160,"categoryName":161,"taxonomyType":135,"taxonomyTypeDesc":136},"01JBSEEDCAT000000000000032","设计师",[151,163,164,165,166,38,30,42,167,29,119,37,36,35,34,168,169,170,171],"ui","file","figma","validation","system","design-system","implementation","flow","design"]