test-driven-development

Enforce red-green-refactor cycles for feature implementation and bug fixing.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/chokky-education/science-club-web --skill test-driven-development-chokky-education
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/chokky-education/science-club-web/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/chokky-education/science-club-web --skill test-driven-development-chokky-education

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This skill eliminates technical debt and unreliable code by enforcing a strict Test-Driven Development (TDD) workflow, ensuring that every feature is verified by a failing test before implementation.

Core Features & Use Cases

  • Red-Green-Refactor Enforcement: Guides the user through the mandatory cycle of writing a failing test, implementing minimal code, and refactoring.
  • Anti-Pattern Detection: Provides a comprehensive reference to identify and avoid common testing pitfalls like mocking behavior instead of real logic.
  • Use Case: When implementing a new user authentication feature, use this skill to define the expected behavior in a test file first, ensuring the implementation is driven by requirements rather than assumptions.

Quick Start

Use the test-driven-development skill to guide the implementation of a new feature by first writing a failing test case.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start test-driven development for a new software feature?

Start test-driven development by writing a failing test case that defines the expected behavior for your new feature. You then implement the minimal code required to pass that test before moving into the refactoring phase.

What is the Red-Green-Refactor cycle in unit testing?

The Red-Green-Refactor cycle in unit testing is a mandatory workflow where you write a failing test, implement minimal code to make it pass, and then systematically refactor the implementation to ensure high code reliability.

How does TDD prevent technical debt and regressions during software engineering?

TDD prevents technical debt by enforcing a failing-test-first development methodology, ensuring every feature is verified by a test before implementation. This guarantees clear behavioral documentation and prevents regressions in software engineering tasks.

When should I use a test-first approach for bug fixing and refactoring?

You should use a test-first approach for bug fixing and refactoring whenever a development task requires high code reliability and regression prevention. It ensures the bug is captured by a failing test before the minimal fix is implemented.

What are common anti-patterns to avoid when writing unit tests?

Common unit testing anti-patterns include mocking behavior instead of testing real logic. Identifying and avoiding these testing pitfalls ensures your tests accurately validate requirements rather than masking implementation flaws during refactoring.

Can I use TDD methodology for implementing user authentication features?

Yes, you can use TDD methodology for implementing user authentication features by defining the expected behavior in a test file first. This ensures your authentication implementation is driven by requirements rather than assumptions.