tdd

Enforce red-green-refactor discipline by requiring failing tests before production code.

15|1|Updated Mar 29, 2026
One-click install
npx skills add https://github.com/duronext/jig --skill tdd-duronext
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/duronext/jig/tree/main/core/skills/tdd
Command: npx skills add https://github.com/duronext/jig --skill tdd-duronext

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces defects by ensuring every production change is preceded by a failing test, enforcing accountability and preventing regressions.

Core Features & Use Cases

  • Red-Green-Refactor: Follow the cycle to drive minimal, validated production code.
  • Test-first Confidence: Provides faster feedback and safer refactors during feature work.
  • Use Case: When implementing a new feature or bugfix, write the failing test first, then implement just enough code to pass.

Quick Start

Begin by writing a failing test for the desired behavior, then implement the minimal production code to pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development uses the red-green-refactor cycle to drive code creation. You write a failing test first, implement minimal production code to pass it, then refactor safely. This enforces accountability and prevents regressions across features, bugs, and refactors.

How do I start writing unit tests before implementing new features?

To start writing unit tests before implementation, write a failing test for the desired behavior first. Then, implement just enough minimal production code to make the test pass, ensuring faster feedback and safer refactors during feature work.

Can I apply test-driven development to bug fixes and refactoring across different languages?

Yes, test-driven development is applicable to features, bugs, and refactors across multiple languages. It enforces red-green-refactor discipline by requiring a test framework and failing tests before implementation, regardless of your programming language.

What is the best way to prevent code regressions when adding new production changes?

The best way to prevent regressions is enforcing test-first discipline. By ensuring every production change is preceded by a failing test, you validate minimal code changes and maintain accountability throughout the development process.

Do I need an existing test framework to enforce red-green-refactor discipline?

Yes, you need a test framework to enforce red-green-refactor discipline. The process requires writing failing tests before implementation and validating clean minimal code, which depends entirely on having a functional testing framework in place.

Why does test-driven development require writing a failing test before implementation?

Test-driven development requires a failing test before implementation to validate that the test checks the desired behavior. This ensures every production change is preceded by a failing test, reducing defects and preventing future regressions.