test-driven-development

Write failing tests before production code and run test suites to prevent regressions.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/afel6/scal-ai-pipeline --skill test-driven-development-afel6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/afel6/scal-ai-pipeline/tree/main/hermes_skills_library/software-development/test-driven-development
Command: npx skills add https://github.com/afel6/scal-ai-pipeline --skill test-driven-development-afel6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a test-first workflow to prevent regressions, clarify expected behavior, and make development and debugging faster and more reliable by ensuring every production change is backed by a failing test.

Core Features & Use Cases

  • Red-Green-Refactor discipline: Write a minimal failing test, implement the simplest code to pass, then refactor while keeping tests green.
  • Applicable scenarios: New features, bug fixes, refactors, and behavior changes where verifiable, repeatable tests are required.
  • Verification guidance: Run targeted tests to confirm failures, run full test suites to detect regressions, and use CI integration to maintain test hygiene.

Quick Start

Write a failing test for the intended behavior, run the test to confirm it fails, implement the minimal code to make it pass, run the full test suite to check for regressions, and refactor while keeping all tests green.

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 practicing test-driven development for a new feature?

To start test-driven development, write a minimal failing test that defines the intended behavior for your new feature. Run the test to confirm it fails, implement the simplest code to make it pass, run the full test suite to check for regressions, and refactor while keeping all tests green.

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

The red-green-refactor workflow is a test-first development discipline where you write a failing test (red), implement the minimal production code to make it pass (green), and then improve the code structure while ensuring tests remain green (refactor).

Can I use test-first development for bug fixes and refactoring?

Yes, test-first development applies to bug fixes, refactors, and behavior changes across codebases. You write a failing test that reproduces the bug or verifies the new behavior, implement the minimal fix to pass it, and run full test suites to prevent regressions.

How does test-first development prevent regressions in CI environments?

Test-first development prevents regressions in CI environments by requiring every production change to be backed by a failing test. Running targeted tests confirms expected failures, while full test suites detect integration regressions during continuous integration.

What's the best way to maintain test hygiene during code refactoring?

The best way to maintain test hygiene during refactoring is to keep tests green at all times. Run the full test suite after structural changes to ensure behavior remains unchanged, using your existing tests as a safety net to catch regressions immediately.