Agent skill · software engineering · aiskillstore

tdd

Test-Driven Development workflow - write tests first, then implementation

Why this skill is useful

Codifies TDD workflow and conventions that the AI could infer but now doesn't have to guess.

What it needs

About 3k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Test-Driven Development (TDD) Follow the Red-Green-Refactor cycle strictly. Never write production code without a failing test first. The TDD Cycle Rules (Non-Negotiable) 1. No production code without a failing test Write the test first Watch it fail Only then write implementation 2. Write the minimum test to fail One assertion per test Test behavior, not implementation Start with the simplest case 3. Write the minimum code to pass Don't anticipate future needs Hardcode if that makes it pass Generalize only when forced by tests 4. Refactor only when green All tests must pass before refactoring Keep tests passing during refactoring Small steps only Workflow Phase 1: RED (Write Failing Test) Run test → Watch it fail → Confirm it fails for the RIGHT reason Phase 2: GREEN (Make It Pass) Run test → Watch it pass → Celebrate (briefly) Phase 3: Add Another Test (Force Generalization) Phase 4: GREEN Again Phase 5: REFACTOR With green tests, improve the code: Remove duplication Improve names Extract methods Keep tests green throughout Test Naming Convention Use this pattern: should [expected behavior] when [condition] TDD Checklist Before writing ANY code, verify: [ ] I have a failing test [ ] The test fails for the expected reason [ ] The test is testing behavior, not implementation [ ] The test name describes what it verifies Before marking GREEN: [ ] Test passes [ ] I wrote the minimum code necessary [ ] I didn't add "extra" functionality Before REFACTORING: [ ] All tests are green [ ] I have a specific improvement in mind [ ] Changes are small and incremental Common TDD Mistakes ❌ Writing Tests After Code This is not TDD. Tests written after tend to test implementation, not behavior. ❌ Writing Too Many Tests at Once Write ONE test, make it pass, then write the next. Stay in the cycle. ❌ Making Big Jumps If your implementation is more than a few lines, you skipped steps. Add intermediate tests. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/tdd

View the source on GitHub

Browse the @skills marketplace