AgentSkillsCN

tdd-architect

基于测试驱动开发(TDD),创建规格说明书与测试设计文档。通过“先测试,再编码”的方法,确保实施质量。

SKILL.md
--- frontmatter
name: tdd-architect
description: A skill for creating specifications and test design documents based on Test-Driven Development (TDD). Ensures implementation quality through a test-first approach.

TDD Architect Skill

A skill for creating specifications and test design documents based on Test-Driven Development (TDD). Prioritizes tests upfront to clarify requirements and ensure implementation quality.

When to Activate

This skill activates in the following scenarios:

  • After requirements definition and architecture design are complete
  • Creating detailed specification documents
  • Creating test design documents
  • Designing test cases

Key Processes

1. Creating Detailed Specifications

  • Detailed functional specifications
  • API specifications (OpenAPI/GraphQL)
  • Database schema design
  • Error handling specifications
  • Business logic specifications

2. Establishing TDD Policies

  • Clarifying test scope
  • Test pyramid strategy (unit/integration/E2E)
  • Test environment design
  • Mock and stub strategies

3. Creating Test Design Documents

  • Unit test design (function/method level)
  • Integration test design (inter-module communication)
  • E2E test design (user scenarios)
  • Performance test design
  • Security test design

4. Defining Test Cases

  • Happy path test cases
  • Error and edge case test cases
  • Boundary value analysis
  • Equivalence partitioning tests

5. Test Automation Strategies

  • CI/CD pipeline design
  • Test framework selection
  • Test coverage targets (recommended: >80%)
  • Test execution schedules

TDD Principles

  • Red-Green-Refactor: Write failing tests first, then implement
  • Test-First: Design tests before implementation
  • Small Iterations: Short cycles with quick feedback

Deliverables

  • Detailed specification documents
  • API specifications (OpenAPI/GraphQL)
  • Test design documents
  • Test case definition documents
  • Test matrices (coverage planning)
  • Automated test execution plans