tdd-workflow

Implement a Test-Driven Development workflow using the RED-GREEN-REFACTOR cycle.

Updated Aug 5, 2025
One-click install
npx skills add https://github.com/lehuuhau1231/TechJobs --skill tdd-workflow-lehuuhau1231
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/lehuuhau1231/TechJobs/tree/main/tech-job-client/.agent/skills/tdd-workflow
Command: npx skills add https://github.com/lehuuhau1231/TechJobs --skill tdd-workflow-lehuuhau1231

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill helps in streamlining the Test-Driven Development process, ensuring a structured approach to writing tests first and then code to pass those tests.

Core Features & Use Cases

  • RED-GREEN-REFACTOR Cycle: Follows the classic TDD cycle for writing tests, implementing code, and refactoring.
  • Three Laws of TDD: Provides guidance on writing minimal code, sufficient tests, and focusing on behavior over implementation.
  • RED Phase Principles: Outlines what to write in the RED phase and rules to ensure test failures.
  • GREEN Phase Principles: Focuses on the principle of YAGNI, simplicity, and avoiding optimization early.
  • REFACTOR Phase Principles: Details what to improve and rules for maintaining green tests during refactoring.
  • AAA Pattern: Explains the Arrange-Act-Assert pattern for writing tests.
  • When to Use TDD: Offers scenarios where TDD is most beneficial.
  • Test Prioritization: Suggests how to prioritize tests for different scenarios.
  • Anti-Patterns: Lists common mistakes to avoid in TDD.
  • AI-Augmented TDD: Discusses the Multi-Agent Pattern for AI-enhanced TDD workflows.

Quick Start

Apply the tdd-workflow to your project to implement a structured TDD approach by defining a failing test and iteratively improving your code.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
What is the RED-GREEN-REFACTOR cycle in test-driven development?

The RED-GREEN-REFACTOR cycle in test-driven development involves writing a failing test first, implementing minimal code to pass that test, and then refactoring while maintaining green tests.

How do I apply the AAA pattern when writing tests first?

To apply the AAA pattern when writing tests first, structure your tests into Arrange, Act, and Assert sections to clearly define the setup, the behavior execution, and the expected test outcome.

When should I use test-driven development for my coding tasks?

You should use test-driven development for coding tasks requiring a rigorous, systematic approach to behavior verification, particularly when you need structured guidance on writing minimal code and sufficient tests.

What common anti-patterns should I avoid in test-driven development?

Common test-driven development anti-patterns to avoid include focusing on implementation over behavior, optimizing code too early in the GREEN phase, and ignoring the YAGNI principle by writing unnecessary code.

How can AI augmentation improve my test-driven development workflow?

AI augmentation can improve your test-driven development workflow by applying a Multi-Agent Pattern to assist with writing failing tests, generating minimal passing code, and suggesting refactoring improvements.

Do I need any specific testing frameworks to follow the test-driven development workflow?

No specific testing frameworks are required to follow the test-driven development workflow, as the skill provides language-agnostic principles applicable across various programming tasks needing systematic development.