test-driven-development

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

5|2|Updated May 26, 2026
One-click install
npx skills add https://github.com/perasyudha/Nyxora --skill test-driven-development-perasyudha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/perasyudha/Nyxora/tree/main/packages/core/playbooks/software-development/test-driven-development
Command: npx skills add https://github.com/perasyudha/Nyxora --skill test-driven-development-perasyudha

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 strict test-driven development so every behavior is verified by a test that was watched failing before implementation. ## Core Features & Use Cases - Red-Green-Refactor Enforcement: Mandates writing one failing test, verifying the failure, writing minimal code to pass, then refactoring with tests green. - Rationalization Detection: Lists common excuses for skipping TDD and red flags that trigger deleting code and restarting with tests first. - Subagent Integration: Shows how to enforce TDD when dispatching implementation work via delegate_task and pairing with systematic debugging for bug fixes. - Use Case: When fixing a bug, write a failing test that reproduces it, watch it fail, implement the minimal fix, and confirm the full suite passes to prevent regressions. ## Quick Start Ask the agent to implement a new feature using strict TDD with the red-green-refactor cycle, running pytest to verify each test fails before writing 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 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. Refactor only after the test is green, and repeat the cycle one behavior at a time.

What is the red-green-refactor cycle in TDD?

Red means writing a failing test that defines the desired behavior. Green means writing the minimal code to make it pass, even hardcoding values. Refactor means cleaning up duplication and names while keeping all tests passing.

Why should tests be written before production code?

Tests written after code pass immediately, which proves nothing about whether they test the right behavior. Watching a test fail first confirms it actually exercises the missing feature and catches real bugs.

When is it acceptable to skip TDD?

The Skill allows exceptions only for throwaway prototypes, generated code, and configuration files, and only after asking the user explicitly. Exploratory code is permitted if it is deleted and rewritten test-first.

What should I do if a test is too hard to write?

A hard-to-write test signals an unclear or overly coupled design. Simplify the interface, use dependency injection instead of heavy mocking, or write the wished-for API and assertion first to clarify the design.