test-driven-development

Enforce a red-green-refactor workflow with failing tests before production code.

6|Updated Dec 7, 2025
One-click install
npx skills add https://github.com/timequity/plugins --skill test-driven-development-timequity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/timequity/plugins/tree/main/craft-coder/test-driven-development
Command: npx skills add https://github.com/timequity/plugins --skill test-driven-development-timequity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill embodies Test-Driven Development principles, guiding the red-green-refactor cycle to build reliable software.

Core Features & Use Cases

  • Red-Green-Refactor: Write a failing test first, implement minimal code, and refactor.
  • Verification: Ensure tests and code quality before progress.
  • Automation Guidance: Emphasizes maintaining tests as code.

Quick Start

Create a failing test, run it to observe failure, implement minimal code to pass, then run tests again to green.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement test-driven development in my software project?

Test-driven development follows the red-green-refactor cycle: write a failing test first, run it to confirm failure, implement minimal code to pass the test, verify all tests pass, then refactor while keeping tests green. This workflow ensures code changes are validated by tests before release.

What's the difference between writing tests first versus writing code first?

Test-driven development requires writing a failing test before any production code exists. This contrasts with writing code first and testing afterward. Writing tests first ensures requirements are clear, forces modular design, and catches bugs earlier in the development cycle.

When should I use test-driven development versus other testing approaches?

Test-driven development applies across feature implementation, bug fixes, and refactoring tasks to uphold the red-green-refactor discipline. It's most effective when you need reliable software with clear specifications and want to prevent regressions during code changes.

How do I know when a test passes in the TDD workflow?

Execute your test suite after writing minimal production code. When all tests pass with a green status, your implementation meets the test requirements. This verification step confirms the code change is valid before proceeding to refactoring.

Can I refactor code without breaking tests in TDD?

Yes—refactoring in TDD means improving code structure while keeping the full test suite green. All tests must pass before and after refactoring to ensure behavior is preserved. This safety net makes code cleanup and optimization low-risk.