Agent skill
tdd
Enforces Test-Driven Development (Red-Green-Refactor) for rigorous code quality.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/tdd-hoangnguyen0403-agent-skills-standar
SKILL.md
Test-Driven Development (TDD)
Priority: P1 (OPERATIONAL)
The Iron Law
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST. If you wrote code before the test: Delete it. Start over. No "adapting" or keeping as reference.
The TDD Cycle
- RED: Write a minimal failing test. Verify failure (Expected error, not typo).
- GREEN: Write the simplest code to pass. Verify pass (Pristine output).
- REFACTOR: Clean up code while staying green.
Core Principles
- Watch it Fail: If you didn't see it fail, you didn't prove the test works.
- Minimalism: Don't add features/options beyond the current test (YAGNI).
- Real Over Mock: Prefer real dependencies unless they are slow/flaky. Avoid Anti-Patterns.
Verification Checklist
- Every new function/method has a failing test first?
- Failure message was expected (feature missing, not setup error)?
- Minimal code implemented (no over-engineering)?
- Common Pitfalls avoided?
Expert References
- TDD Patterns & Discovery Protocols
- Testing Anti-Patterns (Safety First)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?