tdd

Enforces RED-GREEN-REFACTOR test-driven development cycle for Flutter and TypeScript code.

Updated Mar 3, 2026
One-click install
npx skills add https://github.com/manhthien2005/PM_REVIEW --skill tdd-manhthien2005
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/manhthien2005/PM_REVIEW/tree/main/tooling/.windsurf-template/shared/skills/tdd
Command: npx skills add https://github.com/manhthien2005/PM_REVIEW --skill tdd-manhthien2005

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents developers from writing production code without tests by enforcing a strict test-first discipline, ensuring every feature and bugfix is verified by a failing test before implementation begins. ## Core Features & Use Cases - RED-GREEN-REFACTOR Enforcement: Mandates writing a failing test first, verifying it fails for the right reason, then writing minimal code to pass. - Bug Reproduction Workflow: Guides writing a reproduction test, fixing the bug, and reverting the fix to prove the test actually catches the defect. - Multi-Stack Examples: Provides concrete test patterns for Flutter/Dart controllers, Express+Prisma API endpoints, and FastAPI services. - Use Case: When implementing a new SOS confirmation feature in a Flutter app, write the failing controller test first, watch it fail, then implement the minimal controller logic to make it pass. ## Quick Start Use the tdd skill to implement the new feature by writing a failing test first and following the red-green-refactor cycle.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development in Flutter?▼

Write a failing unit test for the desired behavior first, run flutter test to confirm it fails for the right reason, then write the minimal implementation code to make it pass. Refactor only while all tests stay green, and repeat the cycle for each new behavior.

How to write a reproduction test for a bug fix?▼

Write a test that reproduces the bug before touching any code, and confirm it fails with the correct symptom. After fixing, revert the fix temporarily to prove the test fails again, then restore the fix and commit.

When is it acceptable to skip TDD?▼

Exceptions are limited to throwaway prototypes, generated code such as freezed or json_serializable output, and configuration files, and each requires asking the user first. Skipping TDD for convenience is treated as a rationalization to avoid.

Why does my new test pass immediately without implementation?▼

An immediately passing test means you are testing existing behavior rather than new functionality. Rewrite the test to target the missing behavior, then verify it fails before writing any implementation code.

What should I do when tests require mocking everything?▼

Heavy mocking signals high coupling in the design. Use dependency injection with in-memory fakes for repositories instead of mocks, which simplifies test setup and improves the architecture.