tdd-workflow

Enforces test-driven development with unit, integration, and E2E test patterns and 80% coverage thresholds.

5|Updated Jul 8, 2019
One-click install
npx skills add https://github.com/rinchsan/dotfiles --skill tdd-workflow-rinchsan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/rinchsan/dotfiles/tree/main/.claude/skills/tdd-workflow
Command: npx skills add https://github.com/rinchsan/dotfiles --skill tdd-workflow-rinchsan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often skip writing tests or write them after the fact, leading to fragile code, regressions, and low confidence during refactoring. This Skill enforces a disciplined test-driven development workflow with concrete patterns and coverage requirements. ## Core Features & Use Cases - TDD Enforcement: Guides writing tests first for new features, bug fixes, refactoring, API endpoints, and components. - Ready-Made Test Patterns: Provides Jest/Vitest unit test examples, Next.js API integration test patterns, and E2E test file organization. - Coverage Verification: Defines 80% thresholds for branches, functions, lines, and statements, plus watch-mode and pre-commit testing workflows. - Use Case: When adding a new API endpoint to a Next.js app, use this Skill to write the integration test first, implement the route, and verify coverage meets the 80% threshold before committing. ## Quick Start Ask the AI to implement a new feature using the tdd-workflow skill so tests are written first and coverage stays above 80%.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I write unit tests for React components with Jest?

Use React Testing Library with Jest or Vitest to render components and assert on user-visible behavior. Query elements with screen.getByText or getByRole, simulate events with fireEvent, and avoid testing internal state or implementation details.

How to test Next.js API routes with integration tests?

Create a NextRequest object pointing at your route, call the exported handler like GET, and assert on the response status and JSON body. Test success cases, query parameter validation, and database error handling separately.

What test coverage threshold should a project enforce?

This workflow enforces 80% coverage for branches, functions, lines, and statements via Jest coverageThresholds configuration. Run npm run test:coverage to generate the report and identify untested code paths.

Why should tests avoid CSS class selectors in E2E tests?

CSS class selectors break easily when styles change, making tests brittle. Use semantic selectors like button:has-text or data-testid attributes, which remain stable across visual refactors.

When should tests be written in a TDD workflow?

Tests are written before implementation for new features, bug fixes, refactoring, API endpoints, and components. Each test should be independent, set up its own data, and run in under 50ms for unit tests.