test-driven-development

Enforce a test-first workflow requiring a failing test before production code changes.

35|5|Updated Sep 20, 2025
One-click install
npx skills add https://github.com/zhanglongxiao111/indesign-cli --skill test-driven-development-zhanglongxiao111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/zhanglongxiao111/indesign-cli/tree/main/.codex/skills/test-driven-development
Command: npx skills add https://github.com/zhanglongxiao111/indesign-cli --skill test-driven-development-zhanglongxiao111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps prevent regressions and unreliable code by enforcing a strict test-first workflow, ensuring you only add production changes that are proven by a failing test.

Core Features & Use Cases

  • Failing-test-first discipline: Forces you to write a minimal test that fails for the right reason before writing implementation code.
  • Red-Green-Refactor cycle: Guides you through writing failing tests (RED), implementing minimal code to pass (GREEN), then cleaning up without changing behavior (REFACTOR).
  • Anti-pattern guardrails: Rejects common testing mistakes like testing mocks instead of real behavior and adding test-only methods to production classes.

Use it when you are implementing a new feature, fixing a bug, or refactoring—so the change is validated by tests and remains trustworthy over time.

Quick Start

Use the test-driven-development Skill to implement your next change by first writing a single minimal test that fails, then writing the smallest production code needed to make it pass, and finally refactoring only after the test suite is green.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is test-driven development and how does it prevent regressions?

Test-driven development is a test-first workflow that prevents regressions by requiring a minimal failing test before writing any production code, ensuring changes are explicitly validated. It enforces a red-green-refactor cycle for reliable software engineering.

How do I implement a new feature using the red-green-refactor cycle?

To implement a feature using red-green-refactor, first write a single minimal test that fails for the right reason (RED), then write the smallest production code needed to pass it (GREEN), and finally clean up without changing behavior (REFACTOR).

Can I use test-driven development for fixing bugs and refactoring existing code?

Yes, test-driven development applies to fixing bugs and refactoring across typical software engineering tasks. It ensures your code change is validated by a failing test first, keeping the behavior trustworthy and preventing regressions during maintenance.

What are common TDD anti-patterns I should avoid during test-first development?

Common test-driven development anti-patterns include testing mocks instead of real behavior and adding test-only methods to production classes. This workflow includes explicit guardrails to reject these mistakes and maintain reliable regression prevention.

Does test-driven development work without external testing frameworks or dependencies?

Test-driven development focuses on the test-first discipline rather than specific frameworks. It enforces the red-green-refactor cycle and anti-pattern prevention rules directly in your workflow, requiring no external dependencies to guide your software engineering tasks.