test-driven-development

Enforces RED-GREEN-REFACTOR test-driven development workflow with tests written before production code.

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill test-driven-development-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/skills/software-development/test-driven-development
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill test-driven-development-chensihakniroth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write code first and add tests afterward, which produces biased tests that pass immediately and prove nothing. This Skill enforces strict test-driven development so every behavior is verified by a failing test before implementation, catching bugs early and preventing regressions. ## Core Features & Use Cases - RED-GREEN-REFACTOR Enforcement: Guides the agent through writing a failing test, verifying the failure, writing minimal passing code, and refactoring safely. - Rationalization Detection: Lists common excuses for skipping TDD and red flags that trigger a delete-and-restart response. - Subagent Integration: Provides templates for delegating TDD-constrained implementation tasks via delegate_task and pairing with systematic-debugging for bug fixes. - Use Case: When fixing a bug, the agent first writes a failing test that reproduces the bug, verifies it fails, implements the minimal fix, and confirms the full test suite stays green. ## Quick Start Ask the agent to implement a new feature or bug fix using strict test-driven development with the project's test command such as pytest tests/ -q.

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 with pytest?▼

Write one minimal failing test for a single behavior, run it with pytest to confirm it fails for the expected reason, then write the simplest code to pass. Finally run the full suite with pytest tests/ -q to check for regressions before refactoring.

Why must the test fail before writing production code?▼

A test that passes immediately proves nothing because it may test existing behavior or the wrong thing. Watching it fail confirms the test actually exercises the missing feature and will catch real bugs.

What should I do if I already wrote code before the test?▼

Delete the code and start over with a failing test. Keeping it as reference or adapting it while writing tests is effectively testing after implementation, which biases the tests toward what was built rather than what is required.

When is it acceptable to skip test-driven development?▼

Only for throwaway prototypes, generated code, or configuration files, and only after asking the user for explicit permission. Exploration is allowed, but the exploratory code must be discarded before starting the TDD cycle.

How does TDD help with debugging existing bugs?▼

Write a failing test that reproduces the bug first, then follow the RED-GREEN-REFACTOR cycle to fix it. The test proves the fix works and permanently prevents the bug from regressing.