Changes: - Rename skill.md to SKILL.md (uppercase required) - Add YAML frontmatter with name and description - Reorganize templates/ and examples/ into references/ - Remove extra documentation files (README.md, QUICK_REF.md) - Follow progressive disclosure pattern: keep SKILL.md lean The skill now complies with the official Claude Code skill format. Co-Authored-By: Claude <noreply@anthropic.com>
103 lines
2.1 KiB
Markdown
103 lines
2.1 KiB
Markdown
# Requirement Analysis Template
|
||
|
||
## Template Variables
|
||
- `{user_requirement}`: User's original requirement
|
||
- `{context}`: Project context and background
|
||
- `{constraints}`: Known constraints or limitations
|
||
|
||
## Prompt Template
|
||
|
||
```
|
||
请作为技术架构专家,深入分析以下需求:
|
||
|
||
## 用户需求
|
||
{user_requirement}
|
||
|
||
## 项目背景
|
||
{context}
|
||
|
||
## 已知约束
|
||
{constraints}
|
||
|
||
## 分析要求
|
||
|
||
请提供以下维度的分析:
|
||
|
||
### 1. 需求理解
|
||
- 需求的核心目标是什么
|
||
- 涉及哪些功能模块
|
||
- 用户期望达到什么效果
|
||
- 需求的优先级和紧急程度
|
||
|
||
### 2. 技术可行性
|
||
- 现有技术栈能否支持
|
||
- 是否需要引入新技术或依赖
|
||
- 技术难点在哪里
|
||
- 预估的技术风险
|
||
|
||
### 3. 影响范围评估
|
||
- 涉及哪些模块和组件
|
||
- 是否有现有功能需要调整
|
||
- 是否影响现有数据和API
|
||
- 兼容性考虑
|
||
|
||
### 4. 实施方案建议
|
||
- 推荐的技术方案
|
||
- 实施步骤拆解
|
||
- 关键技术点和注意事项
|
||
- 潜在的替代方案
|
||
|
||
### 5. 风险识别
|
||
- 技术风险
|
||
- 业务风险
|
||
- 兼容性风险
|
||
- 性能风险
|
||
|
||
### 6. 测试策略
|
||
- 需要测试的场景
|
||
- 测试类型建议
|
||
- 关键测试点
|
||
|
||
## 输出格式
|
||
|
||
请以结构化的方式输出,包括:
|
||
1. 需求摘要(1-2句话)
|
||
2. 详细分析(按上述维度)
|
||
3. 推荐方案(优先推荐1个方案,可附带备选)
|
||
4. 行动检查清单
|
||
```
|
||
|
||
## Usage Example
|
||
|
||
```python
|
||
# When user provides a new requirement
|
||
user_requirement = """
|
||
实现一个实时通知系统,支持:
|
||
1. 用户可以订阅不同类型的通知
|
||
2. 支持多种通知渠道(邮件、短信、推送)
|
||
3. 通知可以延迟发送
|
||
4. 用户可以自定义通知规则
|
||
"""
|
||
|
||
context = """
|
||
当前系统是一个SaaS平台,使用:
|
||
- 后端:Python + FastAPI
|
||
- 前端:React + TypeScript
|
||
- 数据库:PostgreSQL + Redis
|
||
- 消息队列:RabbitMQ
|
||
"""
|
||
|
||
constraints = """
|
||
- 需要保持向后兼容
|
||
- 通知发送不能阻塞主流程
|
||
- 成本控制在合理范围内
|
||
"""
|
||
|
||
# Call Codex for analysis
|
||
codex(
|
||
PROMPT=f"<analysis template with variables>",
|
||
cd="/project",
|
||
sandbox="read-only"
|
||
)
|
||
```
|