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 commands and coverage requirements that the AI wouldn't reliably generate on its own.

What it needs

About 7k 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 0: Detect the Test Runner Do not assume npm test. The commands in the steps and examples below use <test>, <test-watch>, and <coverage> as placeholders for the project's actual runner. Resolve them once before starting: 1. Run the package-manager detector (ships with ECC): It resolves the package manager (npm / pnpm / yarn / bun) from, in order: CLAUDEPACKAGEMANAGER, .claude/package-manager.json, the package.json packageManager field, the lockfile, then global config. 2. Distinguish the package manager from the test runner — they are not the same. A project can use Bun to install dependencies yet still run Jest or Vitest. Inspect package.json scripts.test and the test files: scripts.test invokes jest / vitest -> run through the detected PM (npm test, pnpm test, yarn test, or bun run test). scripts.test is bun test, or test files import { test, expect } from "bun:test", or there is no jest/vitest config but Bun is present -> use Bun's native runner (bun test). See Bun Native Test Pattern below. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills affaan-m/tdd-workflow--e5c385

View the source on GitHub

Browse the @skills marketplace