tdd

Enforce the RED-GREEN-REFACTOR cycle with behavior-driven tests before implementation code.

1|Updated Sep 11, 2025
One-click install
npx skills add https://github.com/Ronnasayd/AI-pair-programming --skill tdd-ronnasayd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Ronnasayd/AI-pair-programming/tree/main/skills/tdd
Command: npx skills add https://github.com/Ronnasayd/AI-pair-programming --skill tdd-ronnasayd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a Test-Driven Development (TDD) workflow, ensuring that code is written to meet specific, pre-defined requirements and that tests accurately reflect desired behavior by requiring them to fail first.

Core Features & Use Cases

  • Enforces RED-GREEN-REFACTOR cycle: Guides users through writing a failing test, writing minimal code to pass, and then refactoring.
  • Behavior-Driven Testing: Promotes testing based on observable behaviors rather than internal implementation details.
  • Use Case: When developing a new user authentication feature, use this skill to first write a test for the login success scenario, ensure it fails, then write the minimal code to make it pass, and finally refactor.

Quick Start

Follow the TDD process to implement the new feature.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is the RED-GREEN-REFACTOR cycle in test-driven development?

The RED-GREEN-REFACTOR cycle in test-driven development requires writing a failing test, creating minimal code to pass it, and then refactoring. This methodology ensures code is written to meet specific pre-defined requirements and tests accurately reflect desired behavior.

How do I write behavior-driven tests before implementation code?

To write behavior-driven tests before implementation code, focus on testing observable behaviors rather than internal implementation details. You must first define the desired behavior, ensure the test fails, and then write the minimal implementation code required to make that behavior pass.

When do I need to use a test-driven development workflow?

You need to use a test-driven development workflow when developing new features, such as user authentication, to ensure test validity and code quality. It enforces writing behavior-driven tests before implementation to guarantee code meets pre-defined requirements.

Does test-driven development work for refactoring existing code?

Yes, test-driven development works for refactoring existing code by enforcing the REFACTOR phase of the RED-GREEN-REFACTOR cycle. After writing minimal passing code, you refactor to improve code quality while ensuring the behavior-driven tests remain valid and pass.

What is the best way to ensure unit test validity during development?

The best way to ensure unit test validity during development is by requiring tests to fail first before writing implementation code. This behavior-driven testing approach confirms that your tests accurately reflect desired behaviors and validate specific pre-defined requirements.

Can I write implementation code before tests using this development workflow?

No, you cannot write implementation code before tests using this development workflow. The methodology strictly enforces the RED-GREEN-REFACTOR cycle, requiring you to write a failing test first to ensure the code is written to meet specific pre-defined requirements.