tdd

Enforce red-green-refactor cycles and verify behavior through public interfaces.

21|4|Updated Sep 4, 2024
One-click install
npx skills add https://github.com/gaia-react/gaia --skill tdd-gaia-react
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/gaia-react/gaia/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/gaia-react/gaia --skill tdd-gaia-react

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This skill eliminates the common pitfalls of AI-assisted development, such as writing tests that are coupled to implementation details or failing to maintain a proper red-green-refactor loop, ensuring code remains production-grade and maintainable.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the AI to author honest failing tests before implementation and ensures refactoring only occurs after tests pass.
  • Determinism Classification: Automatically classifies code as strict or emergent to determine the appropriate testing strategy.
  • Worthiness Audit: Provides a structured, fresh-context review process for emergent surface tests to ensure they provide genuine value.
  • Use Case: When building a new feature, use this skill to ensure you are writing integration-style tests that verify behavior through public interfaces, preventing brittle tests that break during refactors.

Quick Start

Use the tdd skill to guide the implementation of the new user authentication module using a test-driven approach.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I enforce a strict red-green-refactor cycle when developing React features?

To enforce red-green-refactor during React development, write honest failing tests first, implement code to pass them, then refactor. This prevents brittle tests coupled to implementation details and ensures maintainable, production-grade code.

Why does my test suite break during refactoring even when behavior stays the same?

Test suites break during refactoring when tests are coupled to internal implementation rather than public interfaces. Testing behavior through public interfaces preserves determinism and prevents structural changes from causing false failures.

How do I write deterministic tests for emergent React component behavior?

Write deterministic tests for emergent behavior by classifying code surfaces as strict or emergent, then apply a structured worthiness audit. This review process verifies that emergent surface tests provide genuine value and validate structural accessibility.

What is the best way to start test-driven development for a new authentication module?

The best way to start test-driven development for an authentication module is authoring integration-style tests that verify behavior through public interfaces before writing implementation code, ensuring high-quality and maintainable test coverage.

Can I use vitest for test-driven development workflows without coupling tests to implementation details?

You can use vitest for test-driven development by verifying behavior through public interfaces rather than internal logic. This approach maintains a proper red-green-refactor loop and prevents brittle tests during structural refactoring.

When should I not use test-driven development for bug fixing?

Avoid test-driven development for bug fixing when the affected surface cannot be classified as strict or emergent, or when deterministic surface testing and emergent surface auditing do not provide genuine value for the behavior being verified.