tdd-workflow

Guides test-driven development using the RED-GREEN-REFACTOR cycle and AAA test pattern.

41|Updated Apr 14, 2026
One-click install
npx skills add https://github.com/DevayoshaUS/Women-scholarship --skill tdd-workflow-devayoshaus
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/DevayoshaUS/Women-scholarship/tree/main/hackathon-main%20%281%29/hackathon-main/.agent/skills/tdd-workflow
Command: npx skills add https://github.com/DevayoshaUS/Women-scholarship --skill tdd-workflow-devayoshaus

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing code before tests often leads to untested edge cases, over-engineered implementations, and regressions. This Skill enforces a disciplined Test-Driven Development workflow so tests define the specification before any production code exists. ## Core Features & Use Cases - RED-GREEN-REFACTOR Cycle: Structured guidance for writing a failing test first, implementing the minimum code to pass, then refactoring while keeping tests green. - Three Laws of TDD: Constraints that prevent writing production code without a failing test and keep tests minimal and focused. - AAA Test Pattern: Standardizes every test into Arrange, Act, and Assert steps for clarity and consistency. - Use Case: When fixing a bug, write a failing test that reproduces the bug first, then implement the minimal fix and refactor safely with the test suite as a safety net. ## Quick Start Apply the TDD workflow to implement this feature by writing a failing test first, then the minimal code to pass it, then refactoring.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I start test-driven development on a new feature?▼

Begin with the RED phase: write a failing test that describes the expected behavior, such as "should add two numbers". Then write the minimum code to make it pass, and finally refactor while keeping all tests green.

What is the RED-GREEN-REFACTOR cycle in TDD?▼

RED means writing a failing test first, GREEN means writing the minimal code to make that test pass, and REFACTOR means improving code quality while all tests stay green. The cycle repeats for each new behavior.

When should I not use TDD?▼

TDD has low value for exploratory spike work and UI layout tasks. For exploration, prototype first and then apply TDD once the requirements are understood well enough to write a test.

How do I write a failing test for a bug fix?▼

Write a test that reproduces the bug and watch it fail before touching the production code. Then implement the minimal fix to make the test pass, confirming the bug is actually resolved.

What are common TDD anti-patterns to avoid?▼

Avoid skipping the RED phase, writing tests after the code, over-engineering the initial implementation, putting multiple assertions in one test, and testing implementation details instead of behavior.