ct-test-driven-development

Enforces red-green-refactor test-driven development workflow before writing production code.

1|Updated Sep 8, 2026
One-click install
npx skills add https://github.com/mercadona/control-tower --skill ct-test-driven-development-mercadona
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ct-test-driven-development
Source: https://github.com/mercadona/control-tower/tree/main/plugin/skills/ct-test-driven-development
Command: npx skills add https://github.com/mercadona/control-tower --skill ct-test-driven-development-mercadona

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers often write production code first and add tests afterward, which produces tests that pass immediately and prove nothing about correctness. This Skill enforces a strict test-first discipline so every feature and bugfix is backed by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the full cycle of writing a failing test, verifying it fails for the right reason, writing minimal code to pass, and refactoring while staying green. - Rationalization Detection: Lists common excuses for skipping TDD (such as "too simple to test" or "I'll test after") with concrete rebuttals and red flags that trigger a restart. - Testing Anti-Pattern Reference: Ships a companion reference covering mock-behavior testing, test-only production methods, incomplete mocks, and mocking without understanding dependencies. - Use Case: When fixing a bug where an empty email is accepted, write a failing test asserting the rejection, watch it fail, implement the minimal validation, and confirm the suite stays green. ## Quick Start Ask the agent to implement a new feature or bugfix using strict test-driven development with a failing test written first.

Frequently Asked Questions about ct-test-driven-development

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

FAQPage Schema
How do I practice test-driven development on a new feature?

Write one minimal failing test that names the desired behavior, run it to confirm it fails because the feature is missing, then write the simplest code that passes. Refactor only while all tests stay green, then repeat with the next failing test.

How do I write a failing test for a bug fix?

Write a test that reproduces the bug, such as asserting that an empty email returns an error, and run it to watch it fail. Then implement the minimal fix and confirm the test passes along with the rest of the suite.

Why must I watch the test fail before writing code?

A test that passes immediately proves nothing because it may test the wrong thing or existing behavior. Watching it fail for the expected reason confirms the test actually exercises the missing feature rather than a typo or mock.

When is it acceptable to skip test-driven development?

Exceptions are limited to throwaway prototypes, generated code, and configuration files, and only with explicit approval from your human partner. Exploration is allowed, but the exploratory code must be discarded and rewritten test-first.

What are common testing anti-patterns with mocks?

Common anti-patterns include asserting on mock elements instead of real behavior, adding test-only methods to production classes, mocking without understanding side effects, and creating incomplete mocks missing fields downstream code uses. Fix them by testing real behavior and mocking minimally at the right level.