tdd-workflow

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

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill tdd-workflow-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/everything-claude-code/docs/zh-TW/skills/tdd-workflow
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill tdd-workflow-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code written without tests is fragile, hard to refactor, and prone to regressions reaching production. This Skill enforces a disciplined test-driven development 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 Cycle: Guides the full red-green-refactor loop, from writing user journeys and failing tests to implementing code and verifying coverage thresholds. - Three Test Layers: Provides concrete patterns for unit tests (Jest/Vitest with Testing Library), API integration tests (Next.js route handlers), and E2E tests (Playwright browser automation). - Mocking and Coverage Standards: Includes ready-made mocks for Supabase, Redis, and OpenAI, plus Jest coverage threshold configuration enforcing 80% on branches, functions, lines, and statements. - Use Case: When adding a new API endpoint, the Skill walks you through writing failing integration tests first, implementing the minimal route handler, then validating coverage and edge cases before committing. ## Quick Start Ask the AI to apply the tdd-workflow skill to write tests first and then implement your new feature with at least 80% coverage.

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 a failing test that describes the desired behavior, implement the minimal code to make it pass, then refactor while keeping tests green. This Skill structures that cycle with user journeys, test case generation, and coverage verification.

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 includes patterns for search flows, form submission, and redirect verification.

What code coverage threshold should I enforce in Jest?

This Skill enforces 80% coverage across branches, functions, lines, and statements via Jest's coverageThresholds configuration. Run npm run test:coverage to verify the threshold is met before merging.

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 provides 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 harmless refactors. Test user-visible behavior instead, such as rendered text or API responses, so tests remain stable while implementation evolves.