test-driven-development

Guide the RED-GREEN-REFACTOR workflow for features and bug fixes.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/Junior-Frontend-dev/Hi-u-ng --skill test-driven-development-junior-frontend-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/Junior-Frontend-dev/Hi-u-ng/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/Junior-Frontend-dev/Hi-u-ng --skill test-driven-development-junior-frontend-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-Driven Development (TDD) ensures that requirements are captured as tests before coding, preventing silent regressions and guiding design decisions.

Core Features & Use Cases

  • Red-Green-Refactor cycle as a disciplined workflow for features, bug fixes, and refactors.
  • Minimal, test-first implementations that meet the tests and no more.
  • Clear guidance for writing meaningful tests that verify behavior and guard against regressions.

Quick Start

Begin by writing a failing test, implement the simplest code to pass, and refactor while keeping tests 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 the red-green-refactor workflow operate?

Test-driven development captures requirements as tests before coding. The red-green-refactor workflow enforces writing a failing test first, implementing minimal production code to pass it, and then refactoring while keeping tests green.

How do I apply test-driven development when implementing bug fixes and refactoring?

Apply test-driven development by first writing a failing test that reproduces the bug or verifies the desired behavior. Implement the simplest code change to turn the test green, then refactor iteratively while ensuring automated tests remain passing.

Why should I write failing tests before writing production code?

Writing failing tests first prevents silent regressions by ensuring requirements are captured as tests before production code exists. This approach guides design decisions and verifies behavior through minimal, test-first implementations.

Can I use the test-driven development workflow for both new features and refactoring existing code?

Yes, the test-driven development workflow applies to new features, bug fixes, and refactors. It ensures tests exist before production code across all scenarios, maintaining quality assurance and guarding against regressions throughout the process.

What's the best way to start a test-first implementation for a new software feature?

Begin a test-first implementation by writing a failing test that defines the feature's expected behavior. Next, implement the minimal production code required to pass that test, and finally refactor the codebase while keeping the automated tests green.