tdd-workflow

Enforce RED-GREEN-REFACTOR TDD cycles with immutable tests and coverage checks.

2|1|Updated Nov 24, 2025
One-click install
npx skills add https://github.com/ToonVos/empty-opensaas --skill tdd-workflow-toonvos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/ToonVos/empty-opensaas/tree/main/.claude/skills/tdd-workflow
Command: npx skills add https://github.com/ToonVos/empty-opensaas --skill tdd-workflow-toonvos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vitest.

What problem does it solves?

This Skill provides a rigorous Test-Driven Development (TDD) workflow specifically designed for AI-assisted development, preventing AI agents from "cheating" on tests. It ensures high-quality, reliable code by making tests immutable guardrails against AI hallucinations.

Core Features & Use Cases

  • 2-Phase TDD Solution: Enforces a RED (write & commit tests) then GREEN + REFACTOR (implement & simplify) workflow to prevent test modifications during implementation.
  • 5 MUST PASS Test Quality Criteria: Defines strict criteria for test quality, ensuring tests verify business logic, cover error paths and edge cases, and focus on observable behavior.
  • Coverage Requirements: Sets and enforces minimum test coverage thresholds (≥80% statements, ≥75% branches) to ensure comprehensive testing.
  • Use Case: When developing a new feature, use this Skill to guide you through writing failing tests first, committing them, then implementing the minimal code to pass, and finally refactoring. This ensures your AI assistant builds robust code without compromising test integrity.

Quick Start

Generate a failing test for a new createOrganization operation. Ensure the test verifies business logic, covers error paths (401, 400), and uses meaningful assertions.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I write tests before implementation in a TDD workflow?

Test-Driven Development requires writing failing tests first, then implementing code to pass them. Start by defining what your feature should do—write assertions for business logic, error cases (like 401 or 400 responses), and edge cases—commit those tests before writing implementation code. This ensures tests remain immutable guardrails against bugs.

Why should I use TDD with AI-assisted development?

AI agents can produce plausible but incorrect code. TDD prevents this by enforcing immutable tests before implementation, making tests reliable checkpoints. Red-Green-Refactor cycles ensure your AI assistant builds to spec without modifying tests to hide failures, catching hallucinations early.

What test quality standards should I enforce for TypeScript projects?

Enforce five must-pass criteria: tests verify business logic, cover error paths and edge cases, use meaningful assertions, focus on observable behavior, and maintain minimum coverage thresholds (≥80% statements, ≥75% branches). Vitest integration automates coverage verification and detects when tests don't genuinely validate behavior.

How do I prevent tests from being rewritten during implementation?

The two-phase TDD approach commits tests in the RED phase before any implementation begins. Lock tests in version control, then move to GREEN (implement) and REFACTOR phases without touching test files. This workflow structure prevents accidental or intentional test modifications that mask implementation failures.

Can I use TDD with Vitest for code quality verification?

Yes. Vitest runs automated test quality and coverage checks, enforcing minimum thresholds and detecting cheating patterns like overly broad assertions or missing edge cases. Integration with your TypeScript/Wasp project provides immediate feedback on whether tests meet reliability standards.