- Home
- Skills
- Testing & Debugging
- TDD Enforcer — Strict Red-Green-Refactor
More screenshots
Works with the AI Agents you already use
TDD Enforcer — Strict Red-Green-Refactor
Forces AI coding agents to follow real Test-Driven Development: one failing test at a time, observed red, minimal green, full suite.
$7
TDD Enforcer — Strict Red-Green-Refactor
Example session with this skill installed
Add a function that calculates the total price of a shopping cart with a 10% discount if the subtotal is over $100. Use TDD.
- Read your context and instructions
- Compiled the tdd enforcer
Summary
Enforced strict TDD. Broke the request into two focused behaviors, wrote one failing test at a time, confirmed RED, then wrote minimal code until GREEN.
RED — Behavior 1
TypeScript
// cart.test.ts
import { describe, it, expect } from 'vitest'
import { calculateTotal } from './cart'
describe('calculateTotal', () => {
it('applies 10% discount when subtotal is over 100', () => {
expect(calculateTotal(150)).toBe(135)
})
})
text
FAIL cart.test.ts > calculateTotal > applies 10% discount when subtotal is over 100
Error: calculateTotal is not a function
RED confirmed.
GREEN — Minimal implementation
TypeScript
// cart.ts
export function calculateTotal(subtotal: number): number {
if (subtotal > 100) {
return subtotal * 0.9
}
return subtotal
}
Full suite: all green.
RED → GREEN — Behavior 2
Added the second test (no discount when ≤ 100), confirmed it failed, then extended the function with the minimal change. Full suite remained green.
Behaviors now covered
| Behavior | Test Status |
| --------------------------------------- | ----------- |
| Discount applied when subtotal > 100 | ✅ |
| Full price returned when subtotal ≤ 100 | ✅ |
Connects securely to your tools. The creator never sees your data.
About this skill
Stop agents from writing code first and “adding tests later.”
TDD Enforcer turns any coding agent into a disciplined senior engineer that follows strict Red → Green → Refactor cycles. It refuses to write production code until a failing test has been written and observed to fail.
What it does
- Writes one focused failing test first (RED)
- Confirms the test actually fails for the right reason
- Writes the minimal code needed to make it pass (GREEN)
- Runs the full suite after every change
- Optionally refactors while keeping everything green
- Rejects common agent rationalizations (“I’ll write tests after”, deleting failing tests, etc.)
Why it matters
AI coding agents are fast but they cut corners. Without this skill they routinely:
- Ship untested code
- Write tests that already pass
- Delete or weaken failing tests to get green
- Batch multiple behaviors into one giant change
This skill makes that behavior expensive. The loop becomes the product.
Who it’s for
- Developers who use Claude Code, Cursor, Codex CLI, or any SKILL.md-compatible agent
- Teams that want agent-generated code they can actually trust
- Anyone tired of reviewing PRs full of untested logic
Supported stacks
Works with any language that has a test runner. Auto-detects common setups (pytest, vitest, jest, Go testing, cargo test, JUnit, etc.) and follows your existing project conventions.
Security-clean: pure instructions, no network calls, no dangerous commands. Ready for Agensi’s scan.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
- Does not automatically create or configure a test runner if none exists in the project — you must have a working test setup (pytest, vitest, jest, etc.).
- Requires the agent to be able to run tests in the environment; if the agent cannot execute shell commands or the test suite, the RED/GREEN confirmation steps cannot be completed.
- Works best on unit and component-level behavior. Complex UI, visual, or end-to-end flows still need a thin reliable test seam.
- Will not force TDD if the user explicitly says “skip TDD”, “no tests”, or “just implement”.
- Does not replace human judgment on test design quality — it enforces the process, not perfect test coverage strategy.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 months ago
Permissions
No special permissions declared or detected