tdd

Enforce test-driven development workflows through RED-GREEN-REFACTOR cycles.

710|89|Updated Nov 14, 2021
One-click install
npx skills add https://github.com/citypaul/.dotfiles --skill tdd-citypaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/citypaul/.dotfiles/tree/main/claude/.claude/skills/tdd
Command: npx skills add https://github.com/citypaul/.dotfiles --skill tdd-citypaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a test-driven development workflow, ensuring production code is written in response to failing tests.

Core Features & Use Cases

  • Fail-fast testing: Write failing tests before implementing code to define expected behavior.
  • Red-Green-Refactor discipline: Guide teams through the red, green, and refactor cycle for reliable changes.
  • Cross-language applicability: Applicable to features, bug fixes, and refactors across programming languages and projects.

Quick Start

Write a failing test that describes the desired behavior, implement the minimum code to pass, and then refactor if beneficial.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I enforce a test-driven development workflow for my code changes?

To enforce test-driven development, you must write a failing test before implementing production code, add the minimum code required to pass it, and then refactor to improve design and maintainability.

What is the red-green-refactor cycle in TDD?

The red-green-refactor cycle is a test-driven development workflow where you write a failing test, implement the minimal production code to make it pass, and then iteratively refactor the codebase to improve overall quality.

Can I apply TDD to bug fixes and refactoring tasks, or is it only for new features?

You can apply test-driven development to bug fixes and refactoring tasks, not just new features. The workflow ensures every code change begins with a failing test that defines the expected behavior before implementation.

What's the best way to start writing tests before implementation across different programming languages?

Start by writing a failing unit test that describes your desired behavior, implement the minimum production code to pass the test, and refactor if beneficial, a process applicable across all programming languages.

Why write minimal production code to pass tests during the TDD workflow?

Writing minimal production code to pass tests prevents over-engineering and ensures every line of implementation is directly driven by a test requirement, which ultimately improves code quality and maintainability during the refactor phase.