tdd-workflow

Enforce test-driven development by requiring tests before code.

1|Updated Mar 20, 2024
One-click install
npx skills add https://github.com/flag3/dotfiles --skill tdd-workflow-flag3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/flag3/dotfiles/tree/main/.claude/skills/tdd-workflow
Command: npx skills add https://github.com/flag3/dotfiles --skill tdd-workflow-flag3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill ensures development follows Test-Driven Development (TDD) by enforcing the practice of writing tests before code, promoting reliability and maintainability across the codebase.

Core Features & Use Cases

  • Test-First Development: Write unit, integration, and end-to-end tests before implementing features to guide design.
  • Coverage Goals: Target 80%+ overall test coverage with emphasis on edge cases, failure modes, and boundary conditions.
  • Workflow Flexibility: Applicable to feature development, bug fixes, refactoring, API changes, and new components to ensure quality throughout the lifecycle.

Quick Start

Start by drafting a failing unit test for a new feature, then implement minimal code to satisfy it.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I implement test-driven development to improve code quality?

Test-driven development (TDD) means writing unit, integration, and end-to-end tests before implementing code. This practice guides design decisions, catches bugs early, and ensures at least 80% test coverage across your codebase for reliable, maintainable features and bug fixes.

Can I apply TDD to bug fixes and refactoring, not just new features?

Yes. TDD applies across the full development lifecycle: new features, bug fixes, refactoring, API changes, and component work. Writing tests first ensures each change maintains quality and prevents regression regardless of the task type.

What's the best way to start a TDD workflow?

Start by drafting a failing unit test for your feature, then implement minimal code to satisfy it. This test-first approach ensures your implementation stays focused and drives design decisions from the requirements outward.

How do I reach 80% test coverage in my codebase?

Prioritize tests for edge cases, failure modes, and boundary conditions across unit, integration, and end-to-end scopes. Consistent test-first development on all changes accumulates coverage naturally while catching real bugs.

Why should I write tests before code instead of after?

Writing tests first clarifies requirements, reveals design issues early, and ensures you actually test the code path. Tests written after often skip edge cases and fail modes, leaving gaps. TDD creates a deterministic, repeatable development process.