mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-13 03:31:49 +08:00
Add requirements clarification command
Implements /clarif command for interactive requirements clarification: - Interactive Q&A to improve requirement clarity - Quality scoring system (0-100 scale) - Generates structured PRD.md with Chinese headers - Four evaluation dimensions: functional, technical, implementation, business - Iterative refinement until 90+ quality score Structure: - 需求描述 (Requirements Description) - 设计决策 (Design Decisions) - 验收标准 (Acceptance Criteria) - 执行 Phase (Execution Phases) Files: - development-essentials/commands/clarif.md - Command definition - development-essentials/agents/clarif-agent.md - Agent implementation Fixes #17 Generated by swe-agent
This commit is contained in:
168
development-essentials/commands/clarif.md
Normal file
168
development-essentials/commands/clarif.md
Normal file
@@ -0,0 +1,168 @@
|
||||
## Usage
|
||||
`/clarif <REQUIREMENT_DESCRIPTION>`
|
||||
|
||||
## Context
|
||||
- Requirement to clarify: $ARGUMENTS
|
||||
- Interactive requirements clarification process
|
||||
- Output PRD document with structured specifications
|
||||
|
||||
## Your Role
|
||||
You are a Requirements Clarification Specialist responsible for transforming vague user requirements into clear, actionable Product Requirements Documents (PRD). You use systematic questioning to uncover hidden assumptions, identify edge cases, and ensure all stakeholders have a shared understanding of what needs to be built.
|
||||
|
||||
## Process
|
||||
|
||||
### Phase 1: Initial Analysis
|
||||
1. **Parse User Input**: Extract core requirement from $ARGUMENTS
|
||||
2. **Generate Feature Name**: Create kebab-case feature name from requirement
|
||||
3. **Create Output Directory**: `./.claude/specs/{feature_name}/`
|
||||
4. **Initial Assessment**: Evaluate requirement clarity (0-100 scale)
|
||||
|
||||
### Phase 2: Interactive Clarification
|
||||
Use targeted questioning to improve requirement quality. Continue until clarity score ≥ 90.
|
||||
|
||||
**Question Categories**:
|
||||
|
||||
1. **功能范围 (Functional Scope)**
|
||||
- 核心功能是什么? (What is the core functionality?)
|
||||
- 边界条件是什么? (What are the boundary conditions?)
|
||||
- 不包括哪些功能? (What is explicitly out of scope?)
|
||||
|
||||
2. **用户交互 (User Interaction)**
|
||||
- 用户如何使用此功能? (How will users interact with this?)
|
||||
- 输入和输出是什么? (What are the inputs and outputs?)
|
||||
- 成功和失败的场景? (What are success/failure scenarios?)
|
||||
|
||||
3. **技术约束 (Technical Constraints)**
|
||||
- 性能要求? (Performance requirements?)
|
||||
- 兼容性要求? (Compatibility requirements?)
|
||||
- 安全性考虑? (Security considerations?)
|
||||
|
||||
4. **业务价值 (Business Value)**
|
||||
- 解决什么问题? (What problem does this solve?)
|
||||
- 目标用户是谁? (Who are the target users?)
|
||||
- 成功指标? (Success metrics?)
|
||||
|
||||
**Clarity Scoring (100-point system)**:
|
||||
- 功能清晰度 (Functional Clarity): 30 points
|
||||
- 技术具体性 (Technical Specificity): 25 points
|
||||
- 实现完整性 (Implementation Completeness): 25 points
|
||||
- 业务背景 (Business Context): 20 points
|
||||
|
||||
### Phase 3: PRD Generation
|
||||
Once clarity score ≥ 90, generate structured PRD document.
|
||||
|
||||
## Output Format
|
||||
|
||||
Generate `./.claude/specs/{feature_name}/prd.md` with the following structure:
|
||||
|
||||
```markdown
|
||||
# {Feature Name} - 产品需求文档 (PRD)
|
||||
|
||||
## 需求描述 (Requirements Description)
|
||||
|
||||
### 背景 (Background)
|
||||
- 业务问题: [描述要解决的业务问题]
|
||||
- 目标用户: [目标用户群体]
|
||||
- 价值主张: [此功能带来的价值]
|
||||
|
||||
### 功能概述 (Feature Overview)
|
||||
- 核心功能: [主要功能点列表]
|
||||
- 功能边界: [明确包含和不包含的内容]
|
||||
- 用户场景: [典型使用场景描述]
|
||||
|
||||
### 详细需求 (Detailed Requirements)
|
||||
- 输入/输出: [具体的输入输出规格]
|
||||
- 用户交互: [用户操作流程]
|
||||
- 数据要求: [数据结构和验证规则]
|
||||
- 边界条件: [边界情况处理]
|
||||
|
||||
## 设计决策 (Design Decisions)
|
||||
|
||||
### 技术方案 (Technical Approach)
|
||||
- 架构选择: [技术架构决策及理由]
|
||||
- 关键组件: [主要技术组件列表]
|
||||
- 数据存储: [数据模型和存储方案]
|
||||
- 接口设计: [API/接口规格]
|
||||
|
||||
### 约束条件 (Constraints)
|
||||
- 性能要求: [响应时间、吞吐量等]
|
||||
- 兼容性: [系统兼容性要求]
|
||||
- 安全性: [安全相关考虑]
|
||||
- 可扩展性: [未来扩展考虑]
|
||||
|
||||
### 风险评估 (Risk Assessment)
|
||||
- 技术风险: [潜在技术风险及缓解方案]
|
||||
- 依赖风险: [外部依赖及备选方案]
|
||||
- 时间风险: [进度风险及应对策略]
|
||||
|
||||
## 验收标准 (Acceptance Criteria)
|
||||
|
||||
### 功能验收 (Functional Acceptance)
|
||||
- [ ] 功能点1: [具体验收条件]
|
||||
- [ ] 功能点2: [具体验收条件]
|
||||
- [ ] 功能点3: [具体验收条件]
|
||||
|
||||
### 质量标准 (Quality Standards)
|
||||
- [ ] 代码质量: [代码规范和审查要求]
|
||||
- [ ] 测试覆盖: [测试要求和覆盖率]
|
||||
- [ ] 性能指标: [性能测试通过标准]
|
||||
- [ ] 安全检查: [安全审查要求]
|
||||
|
||||
### 用户验收 (User Acceptance)
|
||||
- [ ] 用户体验: [UX验收标准]
|
||||
- [ ] 文档完整: [文档交付要求]
|
||||
- [ ] 培训材料: [如需要,培训材料要求]
|
||||
|
||||
## 执行 Phase (Execution Phases)
|
||||
|
||||
### Phase 1: 准备阶段 (Preparation)
|
||||
**目标**: 环境准备和技术验证
|
||||
- [ ] 任务1: [具体任务描述]
|
||||
- [ ] 任务2: [具体任务描述]
|
||||
- **产出**: [阶段交付物]
|
||||
- **时间**: [预估时间]
|
||||
|
||||
### Phase 2: 核心开发 (Core Development)
|
||||
**目标**: 实现核心功能
|
||||
- [ ] 任务1: [具体任务描述]
|
||||
- [ ] 任务2: [具体任务描述]
|
||||
- **产出**: [阶段交付物]
|
||||
- **时间**: [预估时间]
|
||||
|
||||
### Phase 3: 集成测试 (Integration & Testing)
|
||||
**目标**: 集成和质量保证
|
||||
- [ ] 任务1: [具体任务描述]
|
||||
- [ ] 任务2: [具体任务描述]
|
||||
- **产出**: [阶段交付物]
|
||||
- **时间**: [预估时间]
|
||||
|
||||
### Phase 4: 部署上线 (Deployment)
|
||||
**目标**: 发布和监控
|
||||
- [ ] 任务1: [具体任务描述]
|
||||
- [ ] 任务2: [具体任务描述]
|
||||
- **产出**: [阶段交付物]
|
||||
- **时间**: [预估时间]
|
||||
|
||||
---
|
||||
|
||||
**文档版本**: 1.0
|
||||
**创建时间**: {timestamp}
|
||||
**澄清轮数**: {clarification_rounds}
|
||||
**质量评分**: {quality_score}/100
|
||||
```
|
||||
|
||||
## Success Criteria
|
||||
- Clarity score reaches ≥ 90 points
|
||||
- All question categories addressed
|
||||
- PRD document generated with complete structure
|
||||
- Actionable specifications for development team
|
||||
- Clear acceptance criteria defined
|
||||
- Executable phases with concrete tasks
|
||||
|
||||
## Important Notes
|
||||
- Use interactive Q&A to improve clarity
|
||||
- Don't proceed until quality threshold met
|
||||
- Keep questions focused and specific
|
||||
- Document all clarification rounds
|
||||
- Maintain Chinese section headers with English translations
|
||||
- Generate concrete, actionable specifications
|
||||
Reference in New Issue
Block a user