tdd-workflow

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

25|13|Updated Jan 27, 2026
One-click install
npx skills add https://github.com/aaione/everything-claude-code-cn --skill tdd-workflow-aaione
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-workflow
Source: https://github.com/aaione/everything-claude-code-cn/tree/main/skills/tdd-workflow
Command: npx skills add https://github.com/aaione/everything-claude-code-cn --skill tdd-workflow-aaione

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

本技能确保在开发新功能、修复缺陷或重构代码时严格遵循测试驱动开发原则,并强制达到 80%+ 的测试覆盖率(包括单元、集成和 E2E 测试),从而提升代码质量和改动的安全性。

Core Features & Use Cases

  • Tests BEFORE Code: 总是先编写测试,再实现代码,以确保需求明确且可测试。
  • 覆盖率要求: 明确的覆盖率目标,涵盖单元、集成以及端到端测试,包含边界条件与错误场景。
  • 测试类型与层级: 覆盖单元测试、集成测试和 Playwright 驱动的端到端测试,确保关键流程可回归。
  • TDD 工作流步骤: 从用户旅程出发,生成测试用例,运行测试,编写实现,重复验证并重构。

Quick Start

以新特性为例,先书写测试用例,然后实现最小代码使测试通过并持续提高覆盖率至 80% 以上。

Quick Start

以新特性为例,先书写测试用例,然后实现最小代码使测试通过并持续提高覆盖率至 80% 以上。

Frequently Asked Questions about tdd-workflow

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

FAQPage Schema
How do I enforce test-driven development across unit, integration, and E2E tests?

Enforcing test-driven development across unit, integration, and E2E tests requires a workflow that mandates writing tests before code and maintaining 80%+ coverage. This approach ensures validation, regression safety, and quality gates are met for new features and refactors.

What is the best way to achieve 80%+ test coverage with Playwright E2E testing?

Achieving 80%+ test coverage with Playwright E2E testing involves driving cross-layer test coverage from user journeys. You generate test cases first, implement the minimal code to pass them, and repeat validation to cover boundary conditions and error scenarios.

Can I use a TDD workflow for bug fixes and refactoring?

You can use a TDD workflow for bug fixes and refactoring to ensure code safety. It applies disciplined test-driven development principles to these tasks, requiring you to write tests that validate fixes and prevent regressions before altering the implementation.

Does a strict TDD workflow require writing tests before implementing code?

A strict TDD workflow does require writing tests before implementing code. This ensures requirements are explicit and testable upfront, creating a repeatable process from writing tests to implementing code and refactoring to hit coverage targets.

What are the limitations of applying TDD to existing software projects?

The limitation of applying TDD to existing software projects is the strict requirement to hit 80%+ coverage across unit, integration, and E2E tests. Achieving this coverage for legacy code demands significant initial effort to write tests for boundary conditions and error scenarios.

How do I start a TDD workflow for a new feature?

To start a TDD workflow for a new feature, you write test cases derived from user journeys first. You then implement the minimal code required to make the tests pass and continuously iterate to improve coverage above 80%.