hai-tdd

Define behavior before coding and validate changes through a red-green-refactor workflow.

278|15|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/hylarucoder/hai-stack --skill hai-tdd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hai-tdd
Source: https://github.com/hylarucoder/hai-stack/tree/main/skills/hai-tdd
Command: npx skills add https://github.com/hylarucoder/hai-stack --skill hai-tdd

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents unreliable implementations by making behavior explicit before coding and ensuring changes are validated through evidence-based testing instead of assumptions.

Core Features & Use Cases

  • Red-Green-Refactor Workflow: Guides implementation through failing tests first, minimal passing code, and safe refactoring.
  • Test Evidence Reporting: Captures target behavior, RED failures, GREEN verification, refactor decisions, and commands used.
  • Use Case: When adding a feature, fixing a bug, or protecting existing behavior, use this Skill to define the expected behavior, prove the test constraint, and deliver a verified implementation.

Quick Start

Use the hai-tdd skill to implement this feature with a red-green-refactor cycle and provide the completed test evidence report.

Frequently Asked Questions about hai-tdd

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

FAQPage Schema
What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow in test-driven development requires writing a failing test first, implementing minimal production code to pass it, and then safely refactoring while validating behavior changes through evidence-based reporting.

How do I implement a new feature using test-first development?

To implement a feature using test-first development, define the expected behavior upfront, prove the test constraint by showing failing-test evidence, write minimal passing code, and validate refactoring decisions through structured test command reporting.

Can I use test-driven development for bug fixes and regression prevention?

Yes, test-driven development applies to bug fixes and regression prevention by defining expected behavior before patching code, proving the test constraint fails on the bug, and delivering a verified implementation through validated red-green-refactor cycles.

Does test-driven development require failing-test evidence before writing production code?

Yes, test-driven development requires failing-test evidence before writing production code to ensure the test constraint is proven, followed by minimal implementations and refactor validation to guarantee reliable behavior verification.

What is the best way to verify behavior changes during unit testing refactoring?

The best way to verify behavior changes during unit testing refactoring is to capture refactor decisions and validate them against test commands and outcomes, ensuring the red-green-refactor workflow maintains reliable behavior without assumptions.

When should I not use test-first development for software development?

Test-first development may not suit software development scenarios where rapid prototyping without behavior verification is prioritized, as it mandates failing-test evidence, minimal implementations, and structured reporting of test outcomes before delivering features.