tdd-protocol

Enforces the Red-Green-Mutate-Refactor test-driven development cycle during implementation work.

3|Updated Jul 2, 2026
One-click install
npx skills add https://github.com/ArangoGutierrez/claude-toolkit --skill tdd-protocol-arangogutierrez
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd-protocol
Source: https://github.com/ArangoGutierrez/claude-toolkit/tree/main/.claude/skills/tdd-protocol
Command: npx skills add https://github.com/ArangoGutierrez/claude-toolkit --skill tdd-protocol-arangogutierrez

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents developers and AI agents from writing implementation code before a failing test exists, eliminating test-after-the-fact habits and weak test suites that pass even when the code is broken. ## Core Features & Use Cases - Phased TDD Cycle: Defines the Plan → Red → Green → Mutate → Refactor workflow with explicit phase signals ([RED], [GREEN], [MUTATE], [REFACTOR]) so progress is auditable. - Mutation Testing Gate: After Green, weaken or delete the guard under test and confirm the suite goes red; optionally run gremlins (Go) or Stryker (TS/JS) to catch tests that are theater. - Subagent Isolation: When diffs grow large, split Red (test writing) and Green (implementation) into separate subagent contexts to avoid same-author blind spots. - Use Case: You start a new feature and the tdd-guard.sh hook blocks your edit with "No test file found" — load this protocol, write the failing test first, then implement. ## Quick Start Ask the AI to load the tdd-protocol skill and guide the current task through the Red, Green, Mutate, and Refactor phases starting with a failing test.

Frequently Asked Questions about tdd-protocol

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

FAQPage Schema
How do I follow the Red-Green-Refactor TDD cycle?▼

Write a failing test first and signal [RED], then write the minimum code to pass it and signal [GREEN], and only refactor after tests pass. This protocol adds a Mutate phase between Green and Refactor to verify the tests actually catch broken code.

What is mutation testing in a TDD workflow?▼

Mutation testing deliberately weakens the code under test — deleting a guard, changing a condition, or shifting a boundary — and confirms the test suite goes red. If the suite still passes, the tests are theater and must be strengthened before refactoring.

Which mutation testing tools work with Go and TypeScript?▼

Use gremlins for Go, installed via go install github.com/go-gremlins/gremlins/cmd/gremlins@latest, and Stryker for TypeScript or JavaScript, initialized with npx stryker init. If neither tool is available, the mutation gate is skipped or done by hand.

Why did tdd-guard.sh block my file edit?▼

The hook blocks Write or Edit operations on implementation files when no test file has been touched in the session. Write the failing test first, then retry; the stderr message lists expected test-file locations, and SKIP_TDD_GUARD=1 is the documented escape hatch.

When should I not use the TDD protocol?▼

Do not use it to decide what to build — brainstorming and plan-writing skills own that upstream phase. It governs only the code-writing cycle once a plan exists, and many file types like docs, configs, and shell scripts are exempt from the guard.