test-driven-development

Enforces red-green-refactor TDD workflow requiring failing tests before production code.

5|2|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/AjayRajan05/VoiceOS --skill test-driven-development-ajayrajan05
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/AjayRajan05/VoiceOS/tree/main/skills/bundled/community/software-development/test-driven-development
Command: npx skills add https://github.com/AjayRajan05/VoiceOS --skill test-driven-development-ajayrajan05

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write 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 piece of production code is backed by a test that was watched failing first. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Guides the AI through writing one failing test, verifying the failure, writing minimal code to pass, then refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD ("too simple to test", "I'll test after") and red flags that trigger a restart of the cycle. - Subagent Integration: Provides templates for delegating implementation tasks to subagents with TDD requirements embedded in the goal. - Use Case: When fixing a bug, the Skill requires writing a failing test that reproduces the bug first, then implementing the fix, guaranteeing the regression is covered permanently. ## Quick Start Ask the assistant to implement a new feature or bug fix using strict test-driven development with pytest, writing the failing test before any production code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development in Python?▼

Write one failing pytest test describing the desired behavior, run it to confirm it fails for the right reason, then write the minimal code to make it pass. After green, refactor while keeping all tests passing, and repeat one behavior at a time.

What is the red-green-refactor cycle?▼

Red-green-refactor is the TDD loop: write a failing test (red), write the simplest code to pass it (green), then clean up duplication and naming without changing behavior (refactor). Each cycle covers exactly one behavior.

Why must I watch the test fail before writing code?▼

A test that passes immediately proves nothing—it may test the wrong thing or existing behavior. Watching it fail confirms the test actually exercises the missing feature and would catch regressions later.

When is it acceptable to skip TDD?▼

Only for throwaway prototypes, generated code, or configuration files, and only after asking the user first. Bug fixes, new features, and refactoring should always follow the test-first cycle.

What should I do if I already wrote code before tests?▼

Delete the implementation and start over with a failing test. Keeping it as reference or adapting it biases the tests toward the implementation, which defeats the purpose of test-first development.