test-driven-development

Enforce the red-green-refactor TDD cycle with failing tests before production code.

161|25|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/romiluz13/cc10x --skill test-driven-development-romiluz13
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/romiluz13/cc10x/tree/main/plugins/cc10x/skills/test-driven-development
Command: npx skills add https://github.com/romiluz13/cc10x --skill test-driven-development-romiluz13

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) process, ensuring that all code is built with a functionality-first mindset. It guides the user through understanding requirements, analyzing project test patterns, and executing the RED -> GREEN -> REFACTOR loop, preventing untested code and ensuring features work as intended.

Core Features & Use Cases

  • Context-Dependent Functionality Analysis: Mandates understanding user, admin, and system flows before writing any tests.
  • Project Test Pattern Integration: Guides the identification and adherence to existing project test frameworks, assertion libraries, and mocking patterns.
  • Enforced TDD Loop: Strictly follows RED (failing test) -> GREEN (minimal code) -> REFACTOR (cleanup) with mandatory command execution.
  • Functionality-Focused Test Examples: Provides specific, actionable test examples for various code types (UI, API, Integration).
  • Use Case: When implementing a new API endpoint, use this skill to first define the expected request/response flows, then write a failing test for a specific behavior, implement the minimal code to pass it, and then refactor.

Quick Start

Apply the test-driven-development skill to build the new user registration API endpoint, starting with a failing test for email validation.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I implement test-driven development in my project?

Test-driven development (TDD) follows a strict RED → GREEN → REFACTOR cycle: write a failing test first, implement minimal production code to pass it, then refactor. This ensures all code has test coverage from the start and prevents untested functionality from reaching production.

What's the difference between unit testing and integration testing in TDD?

Unit testing verifies individual functions or components in isolation, while integration testing validates how multiple components work together. TDD applies both: write unit tests for specific behaviors, then integration tests to confirm components interact correctly across your system.

Can I use test-driven development with my existing test framework?

Yes. TDD works with any testing framework, assertion library, and mocking pattern already in your project. The Skill guides you to identify your project's existing test conventions and apply the RED → GREEN → REFACTOR loop consistently within that environment.

How do I enforce the red-green-refactor cycle across my team?

Enforce TDD by requiring a failing test before any production code is written, mandating automated test execution in your CI/CD pipeline, and maintaining code reviews that verify test-first implementation. This prevents untested code and ensures consistent developer workflow.

What should I test first when building a new API endpoint?

Start by defining expected request and response flows for your API contract, then write a failing test for a specific behavior (e.g., email validation). Write minimal code to pass that test, refactor, then repeat for additional endpoint behaviors until the full functionality is complete.

Why is writing a failing test before production code important?

Writing a failing test first ensures you understand the requirement before implementing, prevents writing unnecessary code, and guarantees test coverage from day one. This test-first approach enforces code quality and confirms your implementation actually satisfies the intended functionality.