tdd

Guide the Red-Green-Refactor TDD cycle for store actions and React components.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) workflow, ensuring that all new features and bug fixes are implemented with a failing test written before any production code.

Core Features & Use Cases

  • Enforces Red-Green-Refactor Cycle: Guides users through writing a failing test, writing minimal code to pass, and then refactoring.
  • Provides Examples: Demonstrates TDD application for pure logic (store actions) and React components.
  • Use Case: When starting a new feature, use this Skill to ensure you write a test that fails for the missing functionality before you write any of the actual code for that feature.

Quick Start

Follow the Red-Green-Refactor process for any new code you write.

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 (TDD) enforces a Red-Green-Refactor cycle where you write a failing test first, implement minimal code to pass it, then refactor safely. This ensures all new features and bug fixes have test coverage before production code exists.

How do I start writing tests before code for a new feature?

To start Test-Driven Development, write a failing test that defines the missing functionality before writing any production code. Then create the minimal code required to make that test pass, followed by refactoring the implementation while keeping tests green.

Can I apply TDD to React components and store actions?

Yes, Test-Driven Development supports applying the Red-Green-Refactor workflow to both pure logic like store actions and React components. It provides specific examples demonstrating how to write failing tests first for these component types within the HACER project.

Does TDD work with Vitest for testing and refactoring code?

Test-Driven Development integrates with Vitest to guide the testing workflow. You write failing Vitest tests first, implement minimal production code to pass them, and then refactor while maintaining code quality and verifying results through the test suite.

What's the best way to ensure code quality when adding new functionality?

The best way to ensure code quality is enforcing Test-Driven Development. By writing a failing test before any production code, you verify the exact requirement upfront, implement minimal logic to pass, and refactor safely with continuous test validation.

When should I not use the TDD workflow for development?

Test-Driven Development is designed for new features and bug fixes where you can define expected behavior through a failing test. It is not suited for exploratory spikes or trivial configuration changes where writing a failing test first adds overhead without clear behavioral validation.