Test-Driven Development

Enforce a red-green-refactor workflow with Vitest and Playwright tests.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Tvshreyas/DISTILL --skill test-driven-development-tvshreyas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Test-Driven Development
Source: https://github.com/Tvshreyas/DISTILL/tree/main/.agent/skills/tdd-workflow
Command: npx skills add https://github.com/Tvshreyas/DISTILL --skill test-driven-development-tvshreyas

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In software development, teams often ship features with defects or design flaws because testing is left as an afterthought. This skill enforces a disciplined TDD approach to catch issues early by writing tests before implementation, driving clearer requirements and safer refactors.

Core Features & Use Cases

  • Red-Green-Refactor workflow: establish a fast feedback loop where failing tests guide minimal code changes and clean refactors.
  • Test-type guidance: distinguishes unit tests (pure logic) from end-to-end tests (user flows) and aligns naming and placement.
  • Documentation of strategy: provides templates, rules, and coverage expectations to standardize testing practices across projects.
  • Use Case: apply this workflow when adding features, fixing bugs, or upgrading libraries to ensure correctness and maintainability.

Quick Start

Start by writing a failing unit or integration test for a feature, then implement the minimal code to pass the test, and finally refactor for clarity.

Frequently Asked Questions about Test-Driven Development

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

FAQPage Schema
What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow in test-driven development is a fast feedback loop where you write a failing test, implement minimal code to pass it, then refactor for clarity. It enforces disciplined testing to catch issues early and drive clear requirements.

How do I start using Vitest for unit tests and Playwright for e2e testing?

To start using Vitest for unit tests and Playwright for e2e testing, write a failing test for a specific feature, implement the minimal code required to pass that test, and finally refactor the implementation for clarity and maintainability.

When do I need test-driven development for software projects?

You need test-driven development for software projects when adding new features, fixing bugs, or upgrading libraries. It prevents late defect discovery and missed design intent by enforcing test-first practices to ensure correctness and maintainability.

Does test-driven development work for both pure logic and user flows?

Yes, test-driven development works for both by distinguishing unit tests for pure logic using Vitest and end-to-end tests for user flows using Playwright. It aligns naming conventions and placement to standardize testing practices across your project.

What are the limitations of using a test-first approach for refactoring?

A limitation of using a test-first approach for refactoring is the strict requirement for high test coverage and disciplined naming conventions. Without standardized templates and coverage expectations, the red-green-refactor loop may not guarantee safer refactors.

What's the best way to standardize testing practices across projects?

The best way to standardize testing practices across projects is to document your test strategy with templates, rules, and coverage expectations. Enforcing a red-green-refactor workflow ensures consistent test types and naming conventions.