Agent skill · software engineering · affaan-m
tdd-workflow
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
Why this skill is useful
Provides a structured TDD workflow with specific patterns and coverage requirements that the AI wouldn't reliably generate on its own.
What it needs
Requires npm installed locally. About 5k tokens when loaded. Last updated 2026-08-06. 238,342 stars on the source repository.
What this skill does
Test-Driven Development Workflow This skill ensures all code development follows TDD principles with comprehensive test coverage. When to Activate Writing new features or functionality Fixing bugs or issues Refactoring existing code Adding API endpoints Creating new components Core Principles 1. Tests BEFORE Code ALWAYS write tests first, then implement code to make tests pass. 2. Coverage Requirements Minimum 80% coverage (unit + integration + E2E) All edge cases covered Error scenarios tested Boundary conditions verified 3. Test Types Unit Tests Individual functions and utilities Component logic Pure functions Helpers and utilities Integration Tests API endpoints Database operations Service interactions External API calls E2E Tests (Playwright) Critical user flows Complete workflows Browser automation UI interactions TDD Workflow Steps Step 1: Write User Journeys Step 2: Generate Test Cases For each user journey, create comprehensive test cases: Step 3: Run Tests (They Should Fail) Step 4: Implement Code Write minimal code to make tests pass: Step 5: Run Tests Again Step 6: Refactor Improve code quality while keeping tests green: Remove duplication Improve naming Optimize performance Enhance readability Step 7: Verify Coverage Testing Patterns Unit Test Pattern (Jest/Vitest) API Integration Test Pattern E2E Test Pattern (Playwright) Test File Organization Mocking External Services Supabase Mock Redis Mock OpenAI Mock Test Coverage Verification Run Coverage Report Coverage Thresholds Common Testing Mistakes to Avoid FAIL: WRONG: Testing Implementation Details PASS: CORRECT: Test User-Visible Behavior FAIL: WRONG: Brittle Selectors PASS: CORRECT: Semantic Selectors FAIL: WRONG: No Test Isolation PASS: CORRECT: Independent Tests Continuous Testing Watch Mode During Development Pre-Commit Hook CI/CD Integration Best Practices 1. Write Tests First - Always TDD 2. One Assert Per Test - Focus on single behavior 3. Descriptive Test Names - Explain what's tested 4. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills affaan-m/tdd-workflow--9bb58f