tdd-workflow

Guides test-driven development through the red-green-refactor cycle with behavior-focused test naming.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill tdd-workflow-serpro-workshop-fortaleza
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit/tree/main/.github/skills/tdd-workflow
Command: npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill tdd-workflow-serpro-workshop-fortaleza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents untested production code by enforcing a disciplined test-first workflow, giving developers a safety net when working in unfamiliar codebases or fixing bugs. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Enforces writing one failing test, making it pass with minimal code, then refactoring while tests stay green, with a commit at each green step. - Test Selection Guidance: Orders tests from the simplest non-trivial case to single variations, avoiding oversized tests that cover everything at once. - Design Feedback & Anti-Patterns: Diagnoses hard-to-test code as design problems (SRP violations, hidden coupling) and lists anti-patterns like writing tests after code or skipping refactoring. - Use Case: When adding a tax calculation feature in Java, write a failing test like calculatesTaxForTaxExemptCustomer first, implement the minimal code to pass, then refactor, committing at each stage. ## Quick Start Ask the AI to guide you through TDD for your next feature by writing a failing test first and following the red-green-refactor cycle.

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 simplest non-trivial case, such as the happy path with one input, and write the smallest failing test expressing that behavior. Then write minimal code to pass, refactor while green, and commit at each green step.

What is the red-green-refactor cycle in TDD?▼

Red means writing the smallest failing test for the next behavior, green means writing the least code to make it pass, and refactor means improving the design while tests stay green. Each cycle covers exactly one behavior.

When should I use mocks or test doubles in TDD?▼

Use a test double only when the real collaborator is slow, non-deterministic, or does not exist yet. Never mock types you do not control; wrap them in a thin abstraction first, since a test that mocks everything tests nothing.

Why is TDD hard to apply to my code?▼

Difficulty writing tests usually signals design problems: hard-to-construct objects indicate too many collaborators, and needing to mock everything reveals hidden coupling. Introduce abstractions and apply single-responsibility principle to fix the design.

What are common TDD anti-patterns to avoid?▼

Avoid writing code before tests, skipping the refactor phase, tests duplicating implementation details, large shared test fixtures, and asserting on private methods or exact SQL strings. These produce brittle change-detector tests rather than behavior verification.