test-driven-development

Guide the Red-Green-Refactor cycle for Test-Driven Development tasks.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/vrazdalovschi/dotfiles --skill test-driven-development-vrazdalovschi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/vrazdalovschi/dotfiles/tree/main/agents/skills/shared/test-driven-development
Command: npx skills add https://github.com/vrazdalovschi/dotfiles --skill test-driven-development-vrazdalovschi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures code quality and reliability by enforcing a rigorous Test-Driven Development (TDD) methodology, preventing bugs and reducing technical debt.

Core Features & Use Cases

  • Enforces TDD principles: Guides users through the Red-Green-Refactor cycle.
  • Prevents common testing anti-patterns: Avoids pitfalls like testing mock behavior or adding test-only methods to production code.
  • Use Case: When developing a new feature, follow the TDD process outlined here to write a failing test first, then implement the minimal code to pass, and finally refactor. This ensures the feature works as intended and is maintainable.

Quick Start

Follow the Red-Green-Refactor cycle for all new features and bug fixes.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start test-driven development for a new software feature?

Test-driven development starts with the Red-Green-Refactor cycle: write a failing test for the feature, implement the minimal code to pass that test, and then refactor. This ensures code quality and prevents regressions.

What are common testing anti-patterns to avoid during refactoring?

Common testing anti-patterns include testing mock behavior instead of real logic or adding test-only methods to production code. Proper test-driven development avoids these pitfalls to ensure tests validate actual software behavior and maintainability.

Can I use test-driven development for bug fixes and refactoring existing code?

Yes, test-driven development is applicable to all software development tasks, including bug fixes and refactoring. You write a failing test that reproduces the bug, then implement the fix to make it pass, ensuring reliability.

What is the Red-Green-Refactor cycle in TDD?

The Red-Green-Refactor cycle is the core TDD process: Red means writing a failing test first, Green means writing minimal implementation code to pass the test, and Refactor means improving code quality without changing behavior.

Why does writing tests before implementation improve code quality?

Writing tests before implementation enforces rigorous test-driven development methodology, which ensures the feature works as intended, reduces technical debt, and prevents bugs by defining expected behavior upfront.