test-driven-development

Enforce test-driven development with failing tests before production code.

Updated Oct 29, 2025
One-click install
npx skills add https://github.com/laurenj3250-debug/vethub2.0 --skill test-driven-development-laurenj3250-debug
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/laurenj3250-debug/vethub2.0/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/laurenj3250-debug/vethub2.0 --skill test-driven-development-laurenj3250-debug

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? This Skill ensures that new features and bug fixes are robust and correctly implemented by mandating a "test-first" approach. It prevents the common pitfalls of writing tests after code, leading to higher quality, more maintainable software, fewer regressions, and ultimately saving significant debugging time.

Core Features & Use Cases:

  • Red-Green-Refactor Cycle: Guides you through writing a failing test, writing minimal code to pass, and then refactoring, ensuring every line of code is validated.
  • Iron Law Enforcement: Strictly prohibits writing production code without a preceding failing test, guaranteeing test effectiveness.
  • Use Case: When developing a new API endpoint, use this skill to define its behavior with tests first, ensuring each piece of functionality works exactly as expected before writing the actual implementation, drastically reducing post-development bugs.

Quick Start: Use the test-driven-development skill to implement a new user authentication feature.

Frequently Asked Questions about test-driven-development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write tests before implementing code?

Test-driven development starts by writing a failing test that defines expected behavior, then writing minimal production code to pass it, and finally refactoring while keeping tests green. This red-green-refactor cycle ensures every line of code is validated by tests before it exists.

What's the best way to ensure bug fixes don't introduce regressions?

Write a failing test that reproduces the bug, then fix the code to make the test pass. This approach captures the expected behavior permanently, preventing the same bug from reoccurring and catching similar regressions automatically.

Can I use test-driven development for new features and refactoring?

Yes. TDD applies to new features, bug fixes, refactoring, and behavior changes. You define each requirement with a failing test first, implement minimal code to satisfy it, then refactor safely knowing tests validate correctness throughout.

How do I implement a new API endpoint using test-driven development?

Define endpoint behavior with failing tests covering request formats, responses, and edge cases first. Write minimal code to pass each test incrementally. This ensures the endpoint works exactly as specified before release and catches breaking changes early.

When should I skip writing tests before implementation?

TDD requires tests first for production code. Exceptions are limited to throwaway prototypes, auto-generated code, and configuration files, which require human confirmation before skipping test coverage.