test-driven-development

Guide developers through the Red-Green-Refactor cycle for test-driven development.

6|3|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/alo-exp/silver-bullet --skill test-driven-development-alo-exp
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/alo-exp/silver-bullet/tree/main/forge/skills/test-driven-development
Command: npx skills add https://github.com/alo-exp/silver-bullet --skill test-driven-development-alo-exp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Promote high-quality software by requiring tests to fail before code is written, catching design issues early and preventing regressions.

Core Features & Use Cases

  • Red-Green-Refactor cycle: write a failing test, implement minimal code, then refactor for cleanliness.
  • Applies to new features, bug fixes, and behavior changes across projects to ensure correct functionality and maintainability.

Quick Start

Write a failing test for the desired behavior, then implement the minimal production code to pass.

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 using test-driven development for TypeScript feature development?▼

Test-driven development starts by writing a failing unit test for the desired behavior in TypeScript, then implementing the minimal production code required to pass that test. This enforces the Red-Green-Refactor cycle to catch design issues early.

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

The Red-Green-Refactor cycle is a core test-driven development practice where you write a failing test, implement minimal code to make it pass, and then refactor the implementation for cleanliness. It ensures tests fail before production code is written.

Can I apply TDD to bug fixes and refactoring existing JavaScript projects?▼

Yes, test-driven development applies to bug fixes, refactoring, and behavior changes across JavaScript and TypeScript projects. It ensures correct functionality by requiring a failing test before any production code changes are implemented.

Why do my unit tests need to fail before writing production code?▼

Unit tests must fail before writing production code to verify the test is actually checking the desired behavior. This test-driven development requirement catches design issues early and prevents regressions by ensuring a minimal, verifiable implementation.

What's the best way to ensure software reliability when adding behavior changes?▼

The best way to ensure software reliability during behavior changes is enforcing test-driven development. By applying the Red-Green-Refactor cycle, you write failing tests first, implement minimal code, and refactor safely to prevent future regressions.

When should I not use the Red-Green-Refactor cycle for unit testing?▼

You should not use the Red-Green-Refactor cycle when verifying already completed behavior without changes, as test-driven development targets new features, bug fixes, and refactoring to ensure tests fail before minimal production code is written.