一键导入
run-tdd
Write failing unit tests (RED), implement minimal code (GREEN), refactor with quality validation for Stages F-H of the VibeFlow docs-first workflow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write failing unit tests (RED), implement minimal code (GREEN), refactor with quality validation for Stages F-H of the VibeFlow docs-first workflow
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Register work items, create feature branches, track and advance stages, close work items in the VibeFlow docs-first development workflow
Codebase discovery and analysis for Stage B of the VibeFlow docs-first workflow
Create Feature Specs for Stage E of the VibeFlow docs-first workflow
Create PRDs with success metrics for Stage A of the VibeFlow docs-first workflow
Create tech specs with architecture for Stage C of the VibeFlow docs-first workflow
Release preparation for Stages I-L of the VibeFlow docs-first workflow
| name | run-tdd |
| description | Write failing unit tests (RED), implement minimal code (GREEN), refactor with quality validation for Stages F-H of the VibeFlow docs-first workflow |
| metadata | {"triggers":["implement feature","start TDD","write tests","Stage F","Stage G","Stage H","RED phase","GREEN phase","REFACTOR phase"]} |
TDD implementation cycle for Stages F-H of the VibeFlow docs-first workflow.
This skill guides the TDD cycle:
Stage F: RED
│
├── Create stubs from Feature Spec API Design
├── Write failing unit tests
├── Tests fail with NotImplementedError
└── Checkpoint #3: Tests Complete
│
▼
Stage G: GREEN
│
├── Implement minimal code to pass tests
├── If contracts change → Stage G.1
└── All unit tests pass
│
▼
Stage H: REFACTOR
│
├── Write integration tests for I/O
├── Pass integration tests
├── Refactor with tests green
├── Complete H.4 quality validation
└── Checkpoint #4: Implementation Complete
/run-tdd start
Guides through the full TDD cycle starting with Stage F.
/run-tdd red
/run-tdd green
/run-tdd refactor
/run-tdd validate
Runs test quality validation (Stage H.4 checklist).
/run-tdd g1
Guides through Stage G.1 protocol when implementation reveals contract changes.
If implementation reveals contract changes, STOP IMMEDIATELY and follow these steps:
Contract changes that trigger G.1:
Changes that DON'T trigger G.1:
All tests must have categorization tags:
Speed/Scope (required):
unit / fast — All dependencies mocked, runs in msintegration / medium — Uses test DB, mocked external APIse2e / slow — Full workflow, multiple componentsreal_api — Makes real external API callsModule (required):
accounts, generation, api)Before completing Stage H, validate:
Organization:
test_<what>_<condition>_<expected>Usefulness:
Code Quality:
Categorization:
Reliability:
Quality Gate:
scripts/validate_red.py — Validate Stage F (tests failing correctly)scripts/validate_green.py — Validate Stage G (tests passing)scripts/validate_refactor.py — Validate Stage H (integration + quality)scripts/check_coverage.py — Report test coverageSee references/:
tdd-policy.md — TDD policy and requirementstdd-guide.md — TDD workflow guidancestage-g1-protocol.md — Design change handling protocolAfter completing each stage, update docs/workflow-state.yaml:
Stage F (RED):
stage: FCheckpoint #3 (after Stage F):
checkpoint: 3 after passing validationStage G (GREEN):
stage: GStage H (REFACTOR):
stage: HCheckpoint #4 (after Stage H):
checkpoint: 4 after passing validationAfter completing each stage, ask the user for permission before committing:
Stage F (RED):
git add <test-files> <stub-files> docs/workflow-state.yaml
git commit -m "feat(<module>): add failing tests and stubs (#ft-<ID>)"
Stage G (GREEN):
git add <source-files> docs/workflow-state.yaml
git commit -m "feat(<module>): implement to pass tests (#ft-<ID>)"
Stage H (REFACTOR):
git add <source-files> <test-files> docs/workflow-state.yaml
git commit -m "feat(<module>): add integration tests and refactor (#ft-<ID>)"
Replace <module> with the actual module name, <ID> with the work item ID, and file placeholders with actual paths.
After each sub-stage commit, directly run /manage-work advance <ID>: