Agent Skills
› kinncj/Heimdall
› tdd-workflow
tdd-workflow
GitHub驱动TDD开发流程,遵循红-绿-重构循环。QA编写失败测试,专家实现最小代码并通过测试,随后重构优化。支持ATDD模式及集成测试容器生命周期管理,确保测试先于实现且质量可靠。
Trigger Scenarios
需要实现新功能
执行测试驱动开发任务
Install
npx skills add kinncj/Heimdall --skill tdd-workflow -g -y
SKILL.md
Frontmatter
{
"name": "tdd-workflow",
"description": "Drive development with a red-green-refactor TDD cycle, ensuring tests are written before implementation. Use when implementing any new functionality."
}
SKILL: TDD Workflow
The RED → GREEN → REFACTOR Cycle
RED Phase (QA Agent)
- Read the acceptance criterion or task description.
- Write a test that will fail because the implementation doesn't exist.
- Run the test. It MUST fail with a meaningful error (not a syntax error).
- If the test passes immediately → the test is wrong. Rewrite it.
- Report: file path, test name, failure message.
GREEN Phase (Specialist Agent)
- Read the failing test file at the provided path.
- Implement the MINIMUM code to make ONLY that test pass.
- Do not implement anything not required by the test.
- Run the test. It must pass.
- Run the full unit suite to verify no regressions.
- If the test fails after 3 attempts → escalate to Orchestrator.
REFACTOR Phase (Specialist Agent)
- Look for: duplication, poor naming, long functions, complex conditionals.
- Clean up without changing behavior.
- Run the test again. It must still pass.
- Commit:
git commit -m "refactor: {what was cleaned up}"
ATDD Pattern (Acceptance Test-Driven Development)
- Write the E2E/acceptance test from the acceptance criterion (Given/When/Then).
- Watch it fail (RED).
- Drive out unit tests and implementation to make it pass (GREEN).
- Acceptance test goes green last.
Integration Test Container Lifecycle
# Before integration tests
docker compose -f docker-compose.test.yml up -d --wait
# Run integration tests
make test-integration
# After tests
docker compose -f docker-compose.test.yml down -v
Rules
- Test file is created BEFORE implementation file.
- Test name format: "should {expected outcome} when {condition}".
- Never weaken an assertion to make a test pass.
- Never mock what you can test with a real dependency (use containers).
- Implementation agent receives FILE PATH, not requirement text.
- Gate: test must fail before implementation, pass after.
Version History
- f4ea31f Current 2026-07-05 10:43


