/test-driven-development:test-driven-developmentfrom test-driven-development
Guides the Test-Driven Development methodology: Red-Green-Refactor cycle of writing failing tests before implementation, making them pass minimally, then refactoring.
Ships in test-driven-development. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Write failing tests before implementation, make them pass minimally, then refactor.
testing-frameworkdebuggingcode-reviewWhat are you doing?
│
├─ Building a NEW feature from scratch
│ └─ Full TDD cycle: write failing test → minimal implementation → refactor
│
├─ Adding coverage to existing code
│ └─ Identify highest-impact gaps first → write tests for business logic → error handling → edge cases
│
├─ Refactoring existing working code
│ └─ Verify all tests green first → one extraction at a time → run tests after each change
│
├─ Writing E2E tests with Playwright
│ └─ Define expected UX as tests before building → unit/integration for rapid cycles → E2E for workflow spec
│
└─ Working in a specific language/framework?
├─ Python → pytest (references/python-tdd.md)
├─ TypeScript → Vitest (references/vitest-patterns.md)
├─ E2E browser → Playwright (references/playwright-e2e-patterns.md)
├─ Emacs Lisp → ERT (references/elisp-tdd.md)
└─ Schema validation → Zod (references/zod-testing-patterns.md)
RED -> Write a failing test first (define expected behavior)
GREEN -> Write minimal code to pass (just enough, don't over-engineer)
REFACTOR -> Improve code quality (clean up while tests pass)
REPEAT
def test_descriptive_name():
"""Clear description of what is being tested."""
# Arrange - Set up test data and conditions
input_data = prepare_test_data()
expected_result = "expected_value"
# Act - Execute the code under test
actual_result = function_under_test(input_data)
# Assert - Verify the results
assert actual_result == expected_result
Fast, isolated tests for individual functions/methods.
Tests for component interactions and external services.
Full system tests through the user interface.
# Good
def test_calculate_discount_returns_zero_for_empty_cart():
...
# Bad
def test_discount():
...
# Good - specific assertion with message
assert result.status == "success", f"Expected success but got {result.status}"
# Bad - generic assertion
assert result
Tests coupled to implementation — asserting mock call arguments instead of observable behavior.
Testing too much in one test — a single test verifies an entire workflow instead of one behavior.
test_calculate_discount_returns_zero_for_empty_cart not test_discount_works. Break large tests into named behaviors.Skipping the REFACTOR phase — moving to the next test immediately after GREEN.
Test that passes before implementation — the test doesn't actually test the right thing.
Shared mutable state between tests — test order affects results.
test_a must run before test_b, you have shared state.High coverage, shallow tests — 90% line coverage but only happy paths.
See Extended Patterns for detailed language-specific guidance (Python/pytest, TypeScript/Vitest, Playwright E2E, Emacs Lisp/ERT), the 6-phase TDD workflow, quick reference commands, and troubleshooting.
references/extended-patterns.md - Detailed code examples and language guidancereferences/general-tdd.md - TDD principles and methodologyreferences/python-tdd.md - Python-specific TDD practicesreferences/elisp-tdd.md - Emacs Lisp TDD with ERTreferences/vitest-patterns.md - Vitest testing patternsreferences/playwright-e2e-patterns.md - Playwright best practicesreferences/playwright-best-practices.md - E2E testing guidelinesreferences/zod-testing-patterns.md - Schema validation testingreferences/test-design-patterns.md - Common test patternsreferences/test-structure-guide.md - Test organizationreferences/refactoring-with-tests.md - Safe refactoring practicesreferences/coverage-validation.md - Coverage analysis guidescripts/run_tests.py - Test runner utilityscripts/coverage_analyzer.py - Coverage analysis toolscripts/coverage_check.py - Coverage threshold checkerscripts/test_template_generator.py - Generate test boilerplatescripts/skill_validator.py - Validate test implementationstemplates/python_test_template.py.template - pytest test templatetemplates/elisp_test_template.el - ERT test templatetemplates/test_checklist.md - Coverage checklist templatetemplates/tdd_session_log.md - TDD session logging templateThis skill consolidates best practices from test-driven-development-tdd-skill, testing-guide-skill, test-agent-technical-skill, and development-workflow-specialist.
evals/evals.json (opens in a new tab)evals/trigger-evals.json (opens in a new tab)references/coverage-validation.md (opens in a new tab)references/elisp-tdd.md (opens in a new tab)references/extended-patterns.md (opens in a new tab)references/general-tdd.md (opens in a new tab)references/playwright-best-practices.md (opens in a new tab)references/playwright-e2e-patterns.md (opens in a new tab)references/python-tdd.md (opens in a new tab)references/refactoring-with-tests.md (opens in a new tab)references/test-design-patterns.md (opens in a new tab)references/test-structure-guide.md (opens in a new tab)references/vitest-patterns.md (opens in a new tab)references/zod-testing-patterns.md (opens in a new tab)scripts/coverage_analyzer.py (opens in a new tab)scripts/coverage_check.py (opens in a new tab)scripts/run_tests.py (opens in a new tab)scripts/skill_validator.py (opens in a new tab)scripts/test_template_generator.py (opens in a new tab)scripts/with_server.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub viktorbezdek/skillstack --plugin test-driven-developmentOther plugins' skills for the same job