AgentSkillsCN

test-spec

根据产品待办事项和验收标准生成测试规范。在制定测试规范、明确测试策略或规划质量保证覆盖范围时使用。可通过“测试规范”“测试说明”“QA规范”“测试策略”“要测试什么”等关键词触发。

SKILL.md
--- frontmatter
name: test-spec
description: Generate test specifications from PBIs and acceptance criteria. Use when creating test specs, defining test strategy, or planning QA coverage. Triggers on keywords like "test spec", "test specification", "qa spec", "test strategy", "what to test".
infer: true
allowed-tools: Read, Write, Edit, Grep, Glob, Bash, TodoWrite

Test Specification

Generate comprehensive test specifications from requirements.

When to Use

  • PBI ready for QA planning
  • Need test coverage strategy
  • Defining test scope

Pre-Workflow

Activate Skills

  • Activate qa-engineer skill for test specification best practices

Quick Reference

Workflow

  1. Read PBI file and user stories
  2. Extract acceptance criteria and identify test scope
  3. Define test strategy (unit / integration / E2E)
  4. Identify test scenarios (positive/negative/boundary/edge)
  5. Find code evidence (see below)
  6. Create test spec artifact using template
  7. Save to team-artifacts/test-specs/
  8. Suggest next: /test-cases {testspec}

Test Categories

CategoryPurpose
PositiveHappy path verification
NegativeError handling, invalid inputs
BoundaryEdge values, limits
IntegrationComponent interaction
SecurityAuth, injection, XSS

Output

  • Path: team-artifacts/test-specs/{YYMMDD}-testspec-{feature}.md
  • ID Pattern: TC-{MOD}-{NNN} (module-based, not date-based)
    • Rationale: Test cases are tied to modules/services, enabling easier filtering and traceability

Spec Structure

  1. Overview
  2. Test Scope
  3. Test Categories
  4. Test Scenarios (high-level)
  5. Coverage Requirements
  6. Test Data Needs

Find Code Evidence

Before writing test scenarios, search the codebase for supporting evidence:

  1. Search for validation logic - find validators, constraints, rules
  2. Find error messages - locate user-facing error strings
  3. Locate entity constraints - property attributes, DB constraints
  4. Map evidence to files - reference as {file}:{line} in each test case

This step grounds test scenarios in actual implementation and prevents speculative tests.

Module Code Mapping

ServiceCode
TextSnippetTXT
ExampleAppEXP
AccountsACC
CommonCOM

Related

  • Role Skill: qa-engineer
  • Command: /test-spec
  • Input: /story output
  • Next Step: /test-cases

Example

bash
/test-spec team-artifacts/pbis/260119-pbi-dark-mode-toggle.md

Creates: team-artifacts/test-specs/260119-testspec-dark-mode-toggle.md

IMPORTANT Task Planning Notes

  • Always plan and break many small todo tasks
  • Always add a final review todo task to review the works done at the end to find any fix or enhancement needed