tdd-workflow

Enforce test-driven development with 80% code coverage across unit, integration, and E2E tests.

Updated Dec 8, 2024
One-click install
npx skills add https://github.com/daehyunpy/my-nix-config --skill tdd-workflow-daehyunpy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/daehyunpy/my-nix-config/tree/main/home-files/cursor/skills/tdd-workflow
Command: npx skills add https://github.com/daehyunpy/my-nix-config --skill tdd-workflow-daehyunpy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) process to ensure high-quality, well-tested code, reducing bugs and improving maintainability.

Core Features & Use Cases

  • Mandatory Test-First Approach: Guarantees tests are written before implementation.
  • Comprehensive Coverage: Enforces a minimum of 80% coverage across unit, integration, and E2E tests.
  • Structured Workflow: Provides clear steps for defining user journeys, writing tests, implementing code, and verifying coverage.
  • Use Case: When developing a new API endpoint, use this Skill to first define the API contract and expected responses with tests, then write the minimal code to satisfy those tests, and finally refactor and verify coverage.

Quick Start

Activate this skill to follow the test-driven development process for any new feature.

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I enforce a test-driven development workflow with Jest and Playwright?

To enforce a test-driven development workflow, this Skill mandates writing tests before implementation and guides you through defining user journeys, edge cases, and error scenarios using Jest and Playwright. It ensures a structured TDD process for new features.

How do I maintain 80% code coverage across unit, integration, and e2e tests?

You maintain 80% code coverage by following the structured workflow that ensures comprehensive test coverage across unit, integration, and end-to-end tests. After implementing minimal code to satisfy initial tests, you verify coverage and refactor.

What is the best way to structure tests before implementing API endpoints?

The best way to structure tests for API endpoints is to first define the API contract and expected responses with tests, then write the minimal code to satisfy those tests, and finally refactor and verify coverage using the TDD workflow.

Does test-driven development work for both unit tests and end-to-end tests?

Yes, test-driven development works for both unit and end-to-end tests. This Skill integrates Jest and Playwright to guide developers through writing tests first, ensuring comprehensive coverage across all testing layers before implementation.

Why write tests before code during software development?

You write tests before code to ensure high-quality, well-tested software, reducing bugs and improving maintainability. By defining expected behavior upfront through user journeys and edge cases, you enforce a rigorous test-first approach.

When should I not use a strict test-first approach for writing tests?

You should not use a strict test-first approach when rapid prototyping unproven concepts where immediate code behavior exploration is more critical than upfront test definition and enforcing 80% code coverage across all layers.