tdd-workflow

Enforces test-driven development with unit, integration, and E2E tests at 80% coverage.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/Femad-6/my-skills --skill tdd-workflow-femad-6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/Femad-6/my-skills/tree/main/.github/skills/tdd-workflow
Command: npx skills add https://github.com/Femad-6/my-skills --skill tdd-workflow-femad-6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written without tests leads to regressions, fragile refactors, and bugs reaching production. This Skill enforces a test-first workflow so every feature, bug fix, and refactor is backed by unit, integration, and E2E tests with at least 80% coverage. ## Core Features & Use Cases - Structured TDD Workflow: Guides the full red-green-refactor cycle from user journeys through failing tests, implementation, and coverage verification. - Test Patterns for Three Layers: Provides ready-to-use Jest/Vitest unit test patterns, Next.js API integration test patterns, and Playwright E2E test patterns. - Mocking and Coverage Guidance: Includes mocking templates for Supabase, Redis, and OpenAI plus Jest coverage threshold configuration. - Use Case: When adding a new API endpoint, the Skill walks you through writing failing integration tests first, implementing the route, then verifying coverage thresholds before committing. ## Quick Start Ask the AI to implement a new feature using the tdd-workflow skill so tests are written before any production code.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I practice test-driven development in a TypeScript project?

Write failing tests first from user journeys, then implement minimal code to make them pass, and refactor while keeping tests green. This Skill structures that cycle with Jest or Vitest unit tests, API integration tests, and Playwright E2E tests.

How to write E2E tests with Playwright for user flows?

Use Playwright's page object to navigate, fill forms, and assert on visible content with semantic selectors like button text or data-testid attributes. The Skill provides complete examples covering search, filtering, and form submission flows.

What code coverage threshold should I enforce in Jest?

This Skill enforces a minimum of 80% coverage for branches, functions, lines, and statements via Jest coverageThresholds configuration. Run npm run test:coverage to verify thresholds are met before committing.

How do I mock Supabase or Redis in unit tests?

Use jest.mock to replace the client module with stubbed methods returning resolved promises of test data. The Skill includes ready-made mock templates for Supabase queries, Redis vector search, and OpenAI embeddings.

Why should tests avoid testing implementation details?

Testing internal state makes tests brittle and breaks them during refactors. Test user-visible behavior instead, such as rendered text or API responses, so tests remain valid when internals change.