npx skills add https://github.com/cexll/myclaude --skill test-cases该技能可根据 PRD 文档或用户需求,生成全面、需求驱动的测试用例。
将产品需求转化为结构化的测试用例,确保功能、边界情况、错误场景和状态转换的完整覆盖。该技能遵循务实的测试理念:测试重要内容,确保每个需求都有相应的测试覆盖,并保持测试质量而非数量。
在以下情况触发此技能:
生成测试用例时遵循以下原则:
首先,确定需求来源:
分析需求并提取测试场景:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
针对每个需求,识别:
使用以下结构组织测试用例:
# 测试用例:[功能名称]
## 概述
- **功能**:[功能名称]
- **需求来源**:[PRD 文件路径或描述]
- **测试覆盖**:[覆盖内容摘要]
- **最后更新**:[日期]
## 测试用例类别
### 1. 功能测试
覆盖正常用户流程和核心功能的测试用例。
#### TC-F-001:[测试用例标题]
- **需求**:[指向特定需求的链接]
- **优先级**:[高/中/低]
- **前置条件**:
- [条件 1]
- [条件 2]
- **测试步骤**:
1. [步骤 1]
2. [步骤 2]
3. [步骤 3]
- **预期结果**:
- [预期结果 1]
- [预期结果 2]
- **后置条件**:[测试后的状态]
### 2. 边界情况测试
覆盖边界条件和异常输入的测试用例。
#### TC-E-001:[测试用例标题]
[与上述结构相同]
### 3. 错误处理测试
覆盖错误场景和故障模式的测试用例。
#### TC-ERR-001:[测试用例标题]
[与上述结构相同]
### 4. 状态转换测试
覆盖状态变更和工作流的测试用例(如果适用)。
#### TC-ST-001:[测试用例标题]
[与上述结构相同]
## 测试覆盖矩阵
| 需求 ID | 测试用例 | 覆盖状态 |
|---------------|------------|-----------------|
| REQ-001 | TC-F-001, TC-E-001 | ✓ 完整 |
| REQ-002 | TC-F-002 | ⚠ 部分 |
## 备注
- [任何额外的测试注意事项]
- [已知限制或假设]
针对每个已识别的场景,按照上述结构创建详细的测试用例。确保:
在最终确定之前,验证:
如果存在覆盖缺口,请生成额外的测试用例。
将测试用例写入 tests/<name>-test-cases.md,其中 <name> 来源于:
使用 Write 工具创建包含结构化测试用例的文件。
生成测试用例后,用中文提供简要总结:
在最终确定测试用例之前,验证:
用户:"为 docs/auth-prd.md 中的用户认证功能生成测试用例"
流程:
有关详细的测试方法和最佳实践,请参阅:
references/testing-principles.md - 核心测试原则和模式每周安装数
244
仓库
GitHub 星标数
2.4K
首次出现
Jan 23, 2026
安全审计
安装于
opencode175
claude-code168
codex158
gemini-cli154
cursor152
github-copilot143
This skill generates comprehensive, requirement-driven test cases from PRD documents or user requirements.
Transform product requirements into structured test cases that ensure complete coverage of functionality, edge cases, error scenarios, and state transitions. The skill follows a pragmatic testing philosophy: test what matters, ensure every requirement has corresponding test coverage, and maintain test quality over quantity.
Trigger this skill when:
Follow these principles when generating test cases:
First, identify the source of requirements:
Analyze requirements and extract test scenarios:
For each requirement, identify:
Organize test cases using this structure:
# Test Cases: [Feature Name]
## Overview
- **Feature**: [Feature name]
- **Requirements Source**: [PRD file path or description]
- **Test Coverage**: [Summary of what's covered]
- **Last Updated**: [Date]
## Test Case Categories
### 1. Functional Tests
Test cases covering normal user flows and core functionality.
#### TC-F-001: [Test Case Title]
- **Requirement**: [Link to specific requirement]
- **Priority**: [High/Medium/Low]
- **Preconditions**:
- [Condition 1]
- [Condition 2]
- **Test Steps**:
1. [Step 1]
2. [Step 2]
3. [Step 3]
- **Expected Results**:
- [Expected result 1]
- [Expected result 2]
- **Postconditions**: [State after test]
### 2. Edge Case Tests
Test cases covering boundary conditions and unusual inputs.
#### TC-E-001: [Test Case Title]
[Same structure as above]
### 3. Error Handling Tests
Test cases covering error scenarios and failure modes.
#### TC-ERR-001: [Test Case Title]
[Same structure as above]
### 4. State Transition Tests
Test cases covering state changes and workflows (if applicable).
#### TC-ST-001: [Test Case Title]
[Same structure as above]
## Test Coverage Matrix
| Requirement ID | Test Cases | Coverage Status |
|---------------|------------|-----------------|
| REQ-001 | TC-F-001, TC-E-001 | ✓ Complete |
| REQ-002 | TC-F-002 | ⚠ Partial |
## Notes
- [Any additional testing considerations]
- [Known limitations or assumptions]
For each identified scenario, create a detailed test case following the structure above. Ensure:
Before finalizing, verify:
If coverage gaps exist, generate additional test cases.
Write the test cases to tests/<name>-test-cases.md where <name> is derived from:
Use the Write tool to create the file with the structured test cases.
After generating test cases, provide a brief summary in Chinese:
Before finalizing test cases, verify:
User : "Generate test cases for the user authentication feature in docs/auth-prd.md"
Process :
For detailed testing methodologies and best practices, see:
references/testing-principles.md - Core testing principles and patternsWeekly Installs
244
Repository
GitHub Stars
2.4K
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode175
claude-code168
codex158
gemini-cli154
cursor152
github-copilot143
注册流程转化率优化指南:减少摩擦、提高完成率的专家技巧
25,000 周安装
WordPress站点设置与连接配置指南:WP-CLI与REST API完整教程
349 周安装
营销心理学实战指南:心智模型与行为设计,提升转化率与用户体验
349 周安装
Spring Boot @JsonTest JSON序列化单元测试指南:JacksonTester使用与最佳实践
349 周安装
scikit-learn 机器学习教程:Python 分类、回归、聚类、降维与模型评估实战指南
350 周安装
技术文档撰写专家 | AI辅助生成用户指南、API文档、架构文档、教程
350 周安装
Gemini AI 图像生成技能 - 使用 Google AI 生成和编辑网站图片,支持 4K 分辨率和文本渲染
350 周安装