tdd-agent

Run a Red-Green-Refactor TDD lifecycle with executable assertions and anti-tampering checks.

Updated Apr 20, 2026
One-click install
npx skills add https://github.com/thistleknot/skills --skill tdd-agent-thistleknot
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-agent
Source: https://github.com/thistleknot/skills/tree/main/tdd-agent
Command: npx skills add https://github.com/thistleknot/skills --skill tdd-agent-thistleknot

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

tdd-agent solves the problem of building reliable software by forcing correctness decisions into an executable test lifecycle, preventing agents from writing code first and discovering issues late.

Core Features & Use Cases

  • Phase-Contract TDD Workflow: Runs the Red (write failing tests), Green (implement until tests pass), and Refactor (improve without breaking) loop with explicit contracts.
  • Anti-Tampering Guardrails: Detects and flags test modification during the Green phase to reduce the risk of passing by changing tests.
  • Coverage Gate and Regression Handling: Uses a coverage threshold as a pipeline gate and specifies how to respond to regressions by returning to Red with failing test context.
  • When to Use / When Not to: Provides criteria for test-verifiable correctness versus subjective output or spike-stage exploration.

Quick Start

Use the tdd-agent skill to turn acceptance criteria into failing tests first, then implement the minimum code to make those tests pass, and finally refactor while ensuring the test suite stays green.

Frequently Asked Questions about tdd-agent

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

FAQPage Schema
How do I enforce test-driven development in an agentic workflow?

To enforce test-driven development in an agentic workflow, apply a strict Red-Green-Refactor lifecycle with phase contracts, ensuring tests fail initially, pass without regressions, and remain green during refactoring.

How do I prevent an AI agent from modifying tests to make them pass?

Prevent AI agents from modifying tests to pass by using anti-tampering guardrails that detect and flag test modifications during the Green phase by diffing test files against a saved baseline.

How do I use a coverage gate to prevent regressions during code refactoring?

Use a coverage threshold as a pipeline gate to prevent regressions during refactoring by returning to the Red phase with failing test context whenever the coverage drops below the required threshold.

When should I not use test-driven development for AI code generation?

Avoid test-driven development for AI code generation when handling subjective output, spike-stage exploration, or any behavior that cannot be clearly specified as executable unit, integration, or property-based tests.

Can I use Red-Green-Refactor for bug fixes and refactoring existing code?

Yes, you can apply the Red-Green-Refactor lifecycle to bug fixes and refactoring existing code, provided the expected behavior is specified as executable unit, integration, or property-based tests before code changes.