test-driven-development

Enforce a Red-Green-Refactor TDD workflow requiring failing tests before production code.

Updated May 6, 2026
One-click install
npx skills add https://github.com/johan-Rm/agents --skill test-driven-development-johan-rm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/johan-Rm/agents/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/johan-Rm/agents --skill test-driven-development-johan-rm

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates technical debt and ensures high code reliability by enforcing a strict Test-Driven Development (TDD) workflow, preventing the common pitfalls of writing tests as an afterthought.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the user through the mandatory cycle of writing a failing test, implementing minimal code, and refactoring.
  • Anti-Pattern Prevention: Provides guardrails against common testing mistakes like mocking behavior instead of real logic or polluting production code with test-only methods.
  • Use Case: When implementing a new feature or fixing a bug, this skill ensures you define the expected behavior via a failing test before writing a single line of production code, guaranteeing that your tests are meaningful and your implementation is focused.

Quick Start

Apply the test-driven-development skill to guide the implementation of the new user authentication module by starting with a failing test case.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I enforce a strict test-driven development workflow for new features?

To enforce a strict test-driven development workflow, you must follow the mandatory Red-Green-Refactor cycle, which requires writing a failing test before creating any production code. This prevents technical debt and ensures high code reliability.

What is the Red-Green-Refactor cycle in unit testing?

The Red-Green-Refactor cycle in unit testing is a strict workflow where you first write a failing test, implement minimal code to pass the test, and then refactor the implementation. This guarantees meaningful tests and focused code.

Why does test-driven development prevent mocking behavior instead of real logic?

Test-driven development prevents mocking behavior instead of real logic by providing anti-pattern guardrails. This ensures your tests target actual system behavior and prevents polluting production code with test-only methods.

Can I fix bugs using test-driven development without writing tests first?

No, you cannot fix bugs using test-driven development without writing tests first. The strict workflow prohibits production code creation for bug fixes without a preceding failing test that defines the expected behavior.

What's the best way to define expected behavior before writing production code?

The best way to define expected behavior before writing production code is writing a failing test case first. This test-driven approach guarantees your tests are meaningful and your feature implementation remains strictly focused.