test-driven-development

Automates the TDD cycle of red-green-refactor for reliable code development.

111|18|Updated Dec 17, 2025
One-click install
npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill test-driven-development-dralgorhythm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/dralgorhythm/claude-agentic-framework/tree/main/.claude/skills/core-engineering/test-driven-development
Command: npx skills add https://github.com/dralgorhythm/claude-agentic-framework --skill test-driven-development-dralgorhythm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Teaches the Red-Green-Refactor cycle to drive reliable, well-specified code.

Core Features & Use Cases

  • TDD Cycle: Red, Green, Refactor workflow.
  • Test Patterns: AAA pattern and clear test names.
  • Use Case: Add a failing test, then implement the minimal code to pass.

Quick Start

Write a failing test for a simple function and implement it 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 write tests before implementing code?

Test-driven development (TDD) requires writing failing tests first, then implementing minimal code to pass them. This approach ensures your code satisfies functional requirements from the start. Start by defining test cases that describe desired behavior, run them to confirm they fail (red phase), write implementation code, and verify tests pass (green phase).

What is the Red-Green-Refactor cycle?

The Red-Green-Refactor cycle is TDD's core workflow: write a failing test (red), implement minimal code to pass it (green), then improve code quality without changing behavior (refactor). This cycle ensures quality assurance by keeping tests green throughout development while guiding incremental design improvements.

When should I use test-driven development for new features?

TDD is widely applicable when starting new features or fixing bugs. It's most effective when you can clearly describe desired behavior in tests upfront. Use TDD to drive reliable, well-specified code and maintain green tests as you refactor, ensuring your implementation matches functional requirements throughout development.

How do I structure tests using the AAA pattern?

The AAA pattern structures tests into three phases: Arrange (set up test data and conditions), Act (execute the code being tested), and Assert (verify the result matches expectations). Clear test names describing what behavior is being validated help maintain readable, maintainable test suites that document expected functionality.

Can I apply TDD to existing codebases?

Yes, TDD principles apply to both new features and bug fixes in existing code. When fixing bugs, write a failing test that reproduces the issue, then implement the fix to pass it. For new features added to legacy code, follow the Red-Green-Refactor cycle to ensure quality assurance and guide reliable incremental development.