Translate requirements-clarity skill to English for plugin compatibility

- Translate SKILL.md: All prompts, instructions, and examples to English
- Translate README.md: Documentation and test cases to English
- Translate clarif.md command: Question categories and output templates
- Translate clarif-agent.md: Agent instructions and rubrics to English
- Remove Chinese-only content, keep English throughout
- Maintain skill structure and 100-point scoring system
- Update examples to use English conversation flow

Addresses #17: Plugin support requirement for English-only prompts

Generated by swe-agent
This commit is contained in:
swe-agent[bot]
2025-10-20 19:00:46 +00:00
parent 9d16cb4406
commit 4110ee4600
4 changed files with 343 additions and 342 deletions

View File

@@ -38,7 +38,7 @@ The skill activates when Claude detects:
### Clarification Process ### Clarification Process
``` ```
User: "我要做一个用户登录功能" User: "I want to implement a user login feature"
Claude detects vague requirement Claude detects vague requirement
@@ -67,10 +67,10 @@ Generate PRD files:
| Dimension | Points | Criteria | | Dimension | Points | Criteria |
|-----------|--------|----------| |-----------|--------|----------|
| **功能清晰度** (Functional Clarity) | 30 | Clear inputs/outputs (10), User interaction (10), Success criteria (10) | | **Functional Clarity** | 30 | Clear inputs/outputs (10), User interaction (10), Success criteria (10) |
| **技术具体性** (Technical Specificity) | 25 | Tech stack (8), Integration points (8), Constraints (9) | | **Technical Specificity** | 25 | Tech stack (8), Integration points (8), Constraints (9) |
| **实现完整性** (Implementation Completeness) | 25 | Edge cases (8), Error handling (9), Data validation (8) | | **Implementation Completeness** | 25 | Edge cases (8), Error handling (9), Data validation (8) |
| **业务背景** (Business Context) | 20 | Problem statement (7), Target users (7), Success metrics (6) | | **Business Context** | 20 | Problem statement (7), Target users (7), Success metrics (6) |
**Threshold**: ≥ 90 points required before PRD generation **Threshold**: ≥ 90 points required before PRD generation
@@ -90,26 +90,26 @@ Documents the entire clarification conversation:
Structured PRD with four main sections: Structured PRD with four main sections:
#### 需求描述 (Requirements Description) #### Requirements Description
- 背景 (Background): Business problem, target users, value proposition - Background: Business problem, target users, value proposition
- 功能概述 (Feature Overview): Core functionality, boundaries, user scenarios - Feature Overview: Core functionality, boundaries, user scenarios
- 详细需求 (Detailed Requirements): Inputs/outputs, interactions, data, edge cases - Detailed Requirements: Inputs/outputs, interactions, data, edge cases
#### 设计决策 (Design Decisions) #### Design Decisions
- 技术方案 (Technical Approach): Architecture, components, data storage, APIs - Technical Approach: Architecture, components, data storage, APIs
- 约束条件 (Constraints): Performance, compatibility, security, scalability - Constraints: Performance, compatibility, security, scalability
- 风险评估 (Risk Assessment): Technical, dependency, timeline risks - Risk Assessment: Technical, dependency, timeline risks
#### 验收标准 (Acceptance Criteria) #### Acceptance Criteria
- 功能验收 (Functional): Checklistable feature requirements - Functional: Checklistable feature requirements
- 质量标准 (Quality): Code quality, testing, performance, security - Quality Standards: Code quality, testing, performance, security
- 用户验收 (User): UX, documentation, training - User Acceptance: UX, documentation, training
#### 执行 Phase (Execution Phases) #### Execution Phases
- Phase 1: 准备阶段 (Preparation) - Environment setup - Phase 1: Preparation - Environment setup
- Phase 2: 核心开发 (Core Development) - Core implementation - Phase 2: Core Development - Core implementation
- Phase 3: 集成测试 (Integration & Testing) - QA - Phase 3: Integration & Testing - QA
- Phase 4: 部署上线 (Deployment) - Release - Phase 4: Deployment - Release
## Testing Guide ## Testing Guide
@@ -117,7 +117,7 @@ Structured PRD with four main sections:
**Input**: **Input**:
``` ```
"我要做一个用户登录功能" "I want to implement a user login feature"
``` ```
**Expected Behavior**: **Expected Behavior**:
@@ -259,7 +259,7 @@ The `/clarif` command in `development-essentials/commands/clarif.md` can coexist
See full example in SKILL.md under "Example Clarification Flow" See full example in SKILL.md under "Example Clarification Flow"
**Summary**: **Summary**:
- Input: "我要做一个用户登录功能" - Input: "I want to implement a user login feature"
- Round 1: Login method, scope, tech stack → Score 35→72 - Round 1: Login method, scope, tech stack → Score 35→72
- Round 2: Security, error handling, performance → Score 72→93 - Round 2: Security, error handling, performance → Score 72→93
- Output: Complete PRD with bcrypt, JWT, PostgreSQL, Go backend - Output: Complete PRD with bcrypt, JWT, PostgreSQL, Go backend
@@ -306,5 +306,6 @@ PRD Generated:
- Ported clarification logic from `/clarif` command - Ported clarification logic from `/clarif` command
- Added automatic activation triggers - Added automatic activation triggers
- Implemented 100-point scoring system - Implemented 100-point scoring system
- Created bilingual PRD template (需求描述/设计决策/验收标准/执行Phase) - Created structured PRD template with Requirements/Design/Acceptance/Execution sections
- Added comprehensive test cases and examples - Added comprehensive test cases and examples
- Translated to English for plugin compatibility

View File

@@ -77,22 +77,22 @@ Upon activation, this skill transforms vague requirements into actionable PRDs t
**Assessment Rubric**: **Assessment Rubric**:
``` ```
功能清晰度 (Functional Clarity): /30 points Functional Clarity: /30 points
- Clear inputs/outputs: 10 pts - Clear inputs/outputs: 10 pts
- User interaction defined: 10 pts - User interaction defined: 10 pts
- Success criteria stated: 10 pts - Success criteria stated: 10 pts
技术具体性 (Technical Specificity): /25 points Technical Specificity: /25 points
- Technology stack mentioned: 8 pts - Technology stack mentioned: 8 pts
- Integration points identified: 8 pts - Integration points identified: 8 pts
- Constraints specified: 9 pts - Constraints specified: 9 pts
实现完整性 (Implementation Completeness): /25 points Implementation Completeness: /25 points
- Edge cases considered: 8 pts - Edge cases considered: 8 pts
- Error handling mentioned: 9 pts - Error handling mentioned: 9 pts
- Data validation specified: 8 pts - Data validation specified: 8 pts
业务背景 (Business Context): /20 points Business Context: /20 points
- Problem statement clear: 7 pts - Problem statement clear: 7 pts
- Target users identified: 7 pts - Target users identified: 7 pts
- Success metrics defined: 6 pts - Success metrics defined: 6 pts
@@ -100,42 +100,42 @@ Upon activation, this skill transforms vague requirements into actionable PRDs t
**Initial Response Format**: **Initial Response Format**:
```markdown ```markdown
我已经理解您的需求。让我帮您完善这个需求规格。 I understand your requirement. Let me help you refine this specification.
**当前清晰度评分**: X/100 **Current Clarity Score**: X/100
**已明确的部分**: **Clear Aspects**:
- [List what's clear] - [List what's clear]
**需要澄清的部分**: **Needs Clarification**:
- [List gaps] - [List gaps]
让我开始系统性地澄清这些内容... Let me systematically clarify these points...
``` ```
### Step 2: Gap Analysis ### Step 2: Gap Analysis
Identify missing information across four dimensions: Identify missing information across four dimensions:
**1. 功能范围 (Functional Scope)** **1. Functional Scope**
- What is the core functionality? - What is the core functionality?
- What are the boundaries? - What are the boundaries?
- What is out of scope? - What is out of scope?
- What are edge cases? - What are edge cases?
**2. 用户交互 (User Interaction)** **2. User Interaction**
- How do users interact? - How do users interact?
- What are the inputs? - What are the inputs?
- What are the outputs? - What are the outputs?
- What are success/failure scenarios? - What are success/failure scenarios?
**3. 技术约束 (Technical Constraints)** **3. Technical Constraints**
- Performance requirements? - Performance requirements?
- Compatibility requirements? - Compatibility requirements?
- Security considerations? - Security considerations?
- Scalability needs? - Scalability needs?
**4. 业务价值 (Business Value)** **4. Business Value**
- What problem does this solve? - What problem does this solve?
- Who are the target users? - Who are the target users?
- What are success metrics? - What are success metrics?
@@ -152,16 +152,16 @@ Identify missing information across four dimensions:
**Question Format**: **Question Format**:
```markdown ```markdown
我需要澄清以下几点以完善需求文档: I need to clarify the following points to complete the requirements document:
1. **[Category]**: [Specific question]? 1. **[Category]**: [Specific question]?
- 例如: [Example if helpful] - For example: [Example if helpful]
2. **[Category]**: [Specific question]? 2. **[Category]**: [Specific question]?
3. **[Category]**: [Specific question]? 3. **[Category]**: [Specific question]?
请提供您的答案,我会基于此继续完善 PRD Please provide your answers, and I'll continue refining the PRD.
``` ```
**After Each User Response**: **After Each User Response**:
@@ -173,18 +173,18 @@ Identify missing information across four dimensions:
**Score Update Format**: **Score Update Format**:
```markdown ```markdown
感谢您的补充! Thank you for the additional information!
**清晰度评分更新**: X/100 → Y/100 **Clarity Score Update**: X/100 → Y/100
**新增明确的内容**: **New Clarified Content**:
- [Summarize new information] - [Summarize new information]
**剩余需要澄清的点**: **Remaining Points to Clarify**:
- [List remaining gaps if score < 90] - [List remaining gaps if score < 90]
[If score < 90: Continue with next round of questions] [If score < 90: Continue with next round of questions]
[If score ≥ 90: "完美! 我现在将生成完整的 PRD 文档..."] [If score ≥ 90: "Perfect! I will now generate the complete PRD document..."]
``` ```
### Step 4: PRD Generation ### Step 4: PRD Generation
@@ -201,99 +201,99 @@ Once clarity score ≥ 90, generate comprehensive PRD.
## PRD Document Structure ## PRD Document Structure
```markdown ```markdown
# {Feature Name} - 产品需求文档 (PRD) # {Feature Name} - Product Requirements Document (PRD)
## 需求描述 (Requirements Description) ## Requirements Description
### 背景 (Background) ### Background
- **业务问题**: [描述要解决的业务问题] - **Business Problem**: [Describe the business problem to solve]
- **目标用户**: [目标用户群体] - **Target Users**: [Target user groups]
- **价值主张**: [此功能带来的价值] - **Value Proposition**: [Value this feature brings]
### 功能概述 (Feature Overview) ### Feature Overview
- **核心功能**: [主要功能点列表] - **Core Features**: [List of main features]
- **功能边界**: [明确包含和不包含的内容] - **Feature Boundaries**: [What is and isn't included]
- **用户场景**: [典型使用场景描述] - **User Scenarios**: [Typical usage scenarios]
### 详细需求 (Detailed Requirements) ### Detailed Requirements
- **输入/输出**: [具体的输入输出规格] - **Input/Output**: [Specific input/output specifications]
- **用户交互**: [用户操作流程] - **User Interaction**: [User operation flow]
- **数据要求**: [数据结构和验证规则] - **Data Requirements**: [Data structures and validation rules]
- **边界条件**: [边界情况处理] - **Edge Cases**: [Edge case handling]
## 设计决策 (Design Decisions) ## Design Decisions
### 技术方案 (Technical Approach) ### Technical Approach
- **架构选择**: [技术架构决策及理由] - **Architecture Choice**: [Technical architecture decisions and rationale]
- **关键组件**: [主要技术组件列表] - **Key Components**: [List of main technical components]
- **数据存储**: [数据模型和存储方案] - **Data Storage**: [Data models and storage solutions]
- **接口设计**: [API/接口规格] - **Interface Design**: [API/interface specifications]
### 约束条件 (Constraints) ### Constraints
- **性能要求**: [响应时间、吞吐量等] - **Performance Requirements**: [Response time, throughput, etc.]
- **兼容性**: [系统兼容性要求] - **Compatibility**: [System compatibility requirements]
- **安全性**: [安全相关考虑] - **Security**: [Security considerations]
- **可扩展性**: [未来扩展考虑] - **Scalability**: [Future expansion considerations]
### 风险评估 (Risk Assessment) ### Risk Assessment
- **技术风险**: [潜在技术风险及缓解方案] - **Technical Risks**: [Potential technical risks and mitigation plans]
- **依赖风险**: [外部依赖及备选方案] - **Dependency Risks**: [External dependencies and alternatives]
- **时间风险**: [进度风险及应对策略] - **Schedule Risks**: [Timeline risks and response strategies]
## 验收标准 (Acceptance Criteria) ## Acceptance Criteria
### 功能验收 (Functional Acceptance) ### Functional Acceptance
- [ ] 功能点1: [具体验收条件] - [ ] Feature 1: [Specific acceptance conditions]
- [ ] 功能点2: [具体验收条件] - [ ] Feature 2: [Specific acceptance conditions]
- [ ] 功能点3: [具体验收条件] - [ ] Feature 3: [Specific acceptance conditions]
### 质量标准 (Quality Standards) ### Quality Standards
- [ ] 代码质量: [代码规范和审查要求] - [ ] Code Quality: [Code standards and review requirements]
- [ ] 测试覆盖: [测试要求和覆盖率] - [ ] Test Coverage: [Testing requirements and coverage]
- [ ] 性能指标: [性能测试通过标准] - [ ] Performance Metrics: [Performance test pass criteria]
- [ ] 安全检查: [安全审查要求] - [ ] Security Review: [Security review requirements]
### 用户验收 (User Acceptance) ### User Acceptance
- [ ] 用户体验: [UX验收标准] - [ ] User Experience: [UX acceptance criteria]
- [ ] 文档完整: [文档交付要求] - [ ] Documentation: [Documentation delivery requirements]
- [ ] 培训材料: [如需要,培训材料要求] - [ ] Training Materials: [If needed, training material requirements]
## 执行 Phase (Execution Phases) ## Execution Phases
### Phase 1: 准备阶段 (Preparation) ### Phase 1: Preparation
**目标**: 环境准备和技术验证 **Goal**: Environment preparation and technical validation
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
### Phase 2: 核心开发 (Core Development) ### Phase 2: Core Development
**目标**: 实现核心功能 **Goal**: Implement core functionality
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
### Phase 3: 集成测试 (Integration & Testing) ### Phase 3: Integration & Testing
**目标**: 集成和质量保证 **Goal**: Integration and quality assurance
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
### Phase 4: 部署上线 (Deployment) ### Phase 4: Deployment
**目标**: 发布和监控 **Goal**: Release and monitoring
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
--- ---
**文档版本**: 1.0 **Document Version**: 1.0
**创建时间**: {timestamp} **Created**: {timestamp}
**澄清轮数**: {clarification_rounds} **Clarification Rounds**: {clarification_rounds}
**质量评分**: {quality_score}/100 **Quality Score**: {quality_score}/100
``` ```
--- ---
@@ -328,10 +328,10 @@ Once clarity score ≥ 90, generate comprehensive PRD.
... ...
## Final Clarity Assessment ## Final Clarity Assessment
- 功能清晰度 (Functional Clarity): X/30 - Functional Clarity: X/30
- 技术具体性 (Technical Specificity): X/25 - Technical Specificity: X/25
- 实现完整性 (Implementation Completeness): X/25 - Implementation Completeness: X/25
- 业务背景 (Business Context): X/20 - Business Context: X/20
- **Total**: X/100 ✓ - **Total**: X/100 ✓
## Key Decisions Made ## Key Decisions Made
@@ -369,7 +369,7 @@ Once clarity score ≥ 90, generate comprehensive PRD.
- Provide examples to guide users - Provide examples to guide users
- Maintain conversational tone - Maintain conversational tone
- Document all clarification rounds - Document all clarification rounds
- Use Chinese for section headers - Use clear, professional English
- Generate concrete specifications - Generate concrete specifications
- Stay in clarification mode until score ≥ 90 - Stay in clarification mode until score ≥ 90
@@ -387,80 +387,80 @@ Once clarity score ≥ 90, generate comprehensive PRD.
## Example Clarification Flow ## Example Clarification Flow
``` ```
User: "我要做一个用户登录功能" User: "I want to implement a user login feature"
Claude: (Detects vague requirement → Auto-activates requirements-clarity skill) Claude: (Detects vague requirement → Auto-activates requirements-clarity skill)
我已经理解您的需求。让我帮您完善这个登录功能的需求规格。 I understand your requirement. Let me help you refine this login feature specification.
**当前清晰度评分**: 35/100 **Current Clarity Score**: 35/100
**已明确的部分**: **Clear Aspects**:
- 需要实现用户登录功能 - Need to implement user login functionality
**需要澄清的部分**: **Needs Clarification**:
- 登录方式和技术实现 - Login method and technical implementation
- 功能边界和用户交互 - Feature boundaries and user interaction
- 安全性和性能要求 - Security and performance requirements
让我开始系统性地澄清这些内容: Let me systematically clarify these points:
--- ---
我需要澄清以下几点以完善需求文档: I need to clarify the following points to complete the requirements document:
1. **用户交互**: 用户将通过什么方式登录? 1. **User Interaction**: How will users log in?
- 例如: 用户名+密码, 手机号+验证码, 第三方OAuth (Google/GitHub) - For example: Username+password, phone+SMS code, third-party OAuth (Google/GitHub), etc.
2. **功能范围**: 除了基本登录,是否需要: 2. **Feature Scope**: Besides basic login, do you need:
- 记住登录状态 (Remember Me)? - Remember Me functionality?
- 忘记密码功能? - Forgot password feature?
- 多设备登录管理? - Multi-device login management?
3. **技术约束**: 3. **Technical Constraints**:
- 后端技术栈是什么? (Go/Node/Python/Java) - What is the backend technology stack? (Go/Node/Python/Java, etc.)
- 是否已有用户数据库? - Do you already have a user database?
- 是否需要JWT token认证? - Do you need JWT token authentication?
请提供您的答案,我会基于此继续完善 PRD Please provide your answers, and I'll continue refining the PRD.
--- ---
[User responds: "用户名+密码, 需要记住登录和忘记密码, 后端用Go, 已有PostgreSQL, 需要JWT"] [User responds: "Username+password, need remember me and forgot password, backend is Go, have PostgreSQL, need JWT"]
--- ---
Claude: 感谢您的补充! Claude: Thank you for the additional information!
**清晰度评分更新**: 35/100 → 72/100 **Clarity Score Update**: 35/100 → 72/100
**新增明确的内容**: **New Clarified Content**:
- 登录方式: 用户名+密码 - Login method: Username+password
- 功能范围: 基本登录 + 记住登录 + 忘记密码 - Feature scope: Basic login + Remember Me + Forgot password
- 技术栈: Go后端 + PostgreSQL + JWT认证 - Tech stack: Go backend + PostgreSQL + JWT authentication
**剩余需要澄清的点**: **Remaining Points to Clarify**:
- 安全性要求 - Security requirements
- 错误处理策略 - Error handling strategy
- 性能指标 - Performance metrics
继续澄清: Continuing clarification:
1. **安全性**: 1. **Security**:
- 密码加密方式有要求吗? (bcrypt/argon2/scrypt) - Password encryption requirements? (bcrypt/argon2/scrypt)
- 是否需要限制登录尝试次数? (防暴力破解) - Should we limit login attempts? (brute force protection)
- JWT token过期时间? (例如: 24小时, 7天) - JWT token expiration time? (e.g., 24 hours, 7 days)
- Remember Me token有效期? - Remember Me token validity period?
2. **错误处理**: 2. **Error Handling**:
- 登录失败时如何提示用户? (显示具体错误 vs 模糊提示) - How to notify users on login failure? (specific errors vs vague messages)
- 是否需要审计日志记录登录行为? - Should we log all login attempts for audit?
3. **性能要求**: 3. **Performance Requirements**:
- 预期并发登录用户数? - Expected concurrent login users?
- 响应时间要求? (例如: 登录接口 < 500ms) - Response time requirements? (e.g., login API < 500ms)
请继续补充,我们快完成了! Please continue, we're almost done!
--- ---
@@ -468,33 +468,33 @@ Claude: 感谢您的补充!
--- ---
Claude: 完美! Claude: Perfect!
**清晰度评分更新**: 72/100 → 93/100 ✓ **Clarity Score Update**: 72/100 → 93/100 ✓
**新增明确的内容**: **New Clarified Content**:
- 安全: bcrypt加密, 5次失败锁定15分钟, JWT 24小时过期 - Security: bcrypt encryption, 5 failed attempts locks for 15 min, JWT expires in 24h
- 日志: 记录所有登录尝试 - Logging: Record all login attempts
- 性能: 支持1000并发, 响应 < 300ms - Performance: Support 1000 concurrent users, response < 300ms
需求已经非常清晰,我现在将生成完整的 PRD 文档... Requirements are now very clear. I will now generate the complete PRD document...
[Creates ./.claude/specs/user-login/ directory] [Creates ./.claude/specs/user-login/ directory]
[Generates clarification-log.md] [Generates clarification-log.md]
[Generates prd.md] [Generates prd.md]
✅ **PRD 已生成**: ✅ **PRD Generated**:
1. **需求文档**: `./.claude/specs/user-login/prd.md` 1. **Requirements Document**: `./.claude/specs/user-login/prd.md`
2. **澄清记录**: `./.claude/specs/user-login/clarification-log.md` 2. **Clarification Log**: `./.claude/specs/user-login/clarification-log.md`
**文档概览**: **Document Overview**:
- 需求描述: 完整的功能、用户场景、技术方案 - Requirements Description: Complete features, user scenarios, technical approach
- 设计决策: Go + PostgreSQL + JWT + bcrypt架构 - Design Decisions: Go + PostgreSQL + JWT + bcrypt architecture
- 验收标准: 12项功能验收 + 8项质量标准 - Acceptance Criteria: 12 functional acceptance + 8 quality standards
- 执行Phase: 4个阶段,预估2-3周完成 - Execution Phases: 4 phases, estimated 2-3 weeks
您可以查看文档并确认是否需要调整。如果满意,我可以立即开始实施! 🚀 You can review the document and confirm if any adjustments are needed. If satisfied, I can start implementation immediately! 🚀
``` ```
--- ---
@@ -516,7 +516,7 @@ Claude: 完美!
2. **Persistent Mode**: Stay in clarification mode throughout the conversation until PRD is complete 2. **Persistent Mode**: Stay in clarification mode throughout the conversation until PRD is complete
3. **Never Skip**: Always iterate until ≥ 90 score, never generate PRD prematurely 3. **Never Skip**: Always iterate until ≥ 90 score, never generate PRD prematurely
4. **Document Everything**: Save both clarification-log.md and prd.md 4. **Document Everything**: Save both clarification-log.md and prd.md
5. **User Language**: Use Chinese for section headers, mixed Chinese/English for content 5. **Language**: Use clear, professional English throughout
6. **Concrete Specifications**: Avoid vague language, make everything measurable and actionable 6. **Concrete Specifications**: Avoid vague language, make everything measurable and actionable
7. **Build Context**: Each question round builds on previous answers 7. **Build Context**: Each question round builds on previous answers
8. **Quality Gate**: Requirements clarity is a quality gate - prevent unclear specs from proceeding to implementation 8. **Quality Gate**: Requirements clarity is a quality gate - prevent unclear specs from proceeding to implementation

View File

@@ -42,22 +42,22 @@ You are a specialized Requirements Clarification Agent focused on transforming a
**Assessment Rubric**: **Assessment Rubric**:
``` ```
功能清晰度 (Functional Clarity): /30 points Functional Clarity: /30 points
- Clear inputs/outputs: 10 pts - Clear inputs/outputs: 10 pts
- User interaction defined: 10 pts - User interaction defined: 10 pts
- Success criteria stated: 10 pts - Success criteria stated: 10 pts
技术具体性 (Technical Specificity): /25 points Technical Specificity: /25 points
- Technology stack mentioned: 8 pts - Technology stack mentioned: 8 pts
- Integration points identified: 8 pts - Integration points identified: 8 pts
- Constraints specified: 9 pts - Constraints specified: 9 pts
实现完整性 (Implementation Completeness): /25 points Implementation Completeness: /25 points
- Edge cases considered: 8 pts - Edge cases considered: 8 pts
- Error handling mentioned: 9 pts - Error handling mentioned: 9 pts
- Data validation specified: 8 pts - Data validation specified: 8 pts
业务背景 (Business Context): /20 points Business Context: /20 points
- Problem statement clear: 7 pts - Problem statement clear: 7 pts
- Target users identified: 7 pts - Target users identified: 7 pts
- Success metrics defined: 6 pts - Success metrics defined: 6 pts
@@ -67,25 +67,25 @@ You are a specialized Requirements Clarification Agent focused on transforming a
Identify missing information across four dimensions: Identify missing information across four dimensions:
**1. 功能范围 (Functional Scope)** **1. Functional Scope**
- What is the core functionality? - What is the core functionality?
- What are the boundaries? - What are the boundaries?
- What is out of scope? - What is out of scope?
- What are edge cases? - What are edge cases?
**2. 用户交互 (User Interaction)** **2. User Interaction**
- How do users interact? - How do users interact?
- What are the inputs? - What are the inputs?
- What are the outputs? - What are the outputs?
- What are success/failure scenarios? - What are success/failure scenarios?
**3. 技术约束 (Technical Constraints)** **3. Technical Constraints**
- Performance requirements? - Performance requirements?
- Compatibility requirements? - Compatibility requirements?
- Security considerations? - Security considerations?
- Scalability needs? - Scalability needs?
**4. 业务价值 (Business Value)** **4. Business Value**
- What problem does this solve? - What problem does this solve?
- Who are the target users? - Who are the target users?
- What are success metrics? - What are success metrics?
@@ -102,16 +102,16 @@ Identify missing information across four dimensions:
**Question Format**: **Question Format**:
```markdown ```markdown
我需要澄清以下几点以完善需求文档: I need to clarify the following points to complete the requirements document:
1. [Category]: [Specific question]? 1. [Category]: [Specific question]?
- 例如: [Example if helpful] - For example: [Example if helpful]
2. [Category]: [Specific question]? 2. [Category]: [Specific question]?
3. [Category]: [Specific question]? 3. [Category]: [Specific question]?
请提供您的答案,我会基于此继续完善 PRD Please provide your answers, and I'll continue refining the PRD.
``` ```
**After Each Response**: **After Each Response**:
@@ -127,53 +127,53 @@ Once clarity score ≥ 90, generate comprehensive PRD.
## PRD Document Structure ## PRD Document Structure
```markdown ```markdown
# {Feature Name} - 产品需求文档 (PRD) # {Feature Name} - Product Requirements Document (PRD)
## 需求描述 (Requirements Description) ## Requirements Description
### 背景 (Background) ### Background
[Synthesize business context from clarification] [Synthesize business context from clarification]
### 功能概述 (Feature Overview) ### Feature Overview
[Core functionality with clear boundaries] [Core functionality with clear boundaries]
### 详细需求 (Detailed Requirements) ### Detailed Requirements
[Specific requirements with inputs, outputs, interactions] [Specific requirements with inputs, outputs, interactions]
## 设计决策 (Design Decisions) ## Design Decisions
### 技术方案 (Technical Approach) ### Technical Approach
[Concrete technical decisions] [Concrete technical decisions]
### 约束条件 (Constraints) ### Constraints
[Performance, compatibility, security, scalability] [Performance, compatibility, security, scalability]
### 风险评估 (Risk Assessment) ### Risk Assessment
[Technical, dependency, and timeline risks] [Technical, dependency, and timeline risks]
## 验收标准 (Acceptance Criteria) ## Acceptance Criteria
### 功能验收 (Functional Acceptance) ### Functional Acceptance
[Checklistable functional requirements] [Checklistable functional requirements]
### 质量标准 (Quality Standards) ### Quality Standards
[Code quality, testing, performance, security] [Code quality, testing, performance, security]
### 用户验收 (User Acceptance) ### User Acceptance
[UX, documentation, training requirements] [UX, documentation, training requirements]
## 执行 Phase (Execution Phases) ## Execution Phases
### Phase 1: 准备阶段 (Preparation) ### Phase 1: Preparation
[Environment setup, technical validation] [Environment setup, technical validation]
### Phase 2: 核心开发 (Core Development) ### Phase 2: Core Development
[Core feature implementation] [Core feature implementation]
### Phase 3: 集成测试 (Integration & Testing) ### Phase 3: Integration & Testing
[Integration and QA] [Integration and QA]
### Phase 4: 部署上线 (Deployment) ### Phase 4: Deployment
[Release and monitoring] [Release and monitoring]
``` ```
@@ -222,10 +222,10 @@ Once clarity score ≥ 90, generate comprehensive PRD.
... ...
## Final Clarity Assessment ## Final Clarity Assessment
- 功能清晰度: X/30 - Functional Clarity: X/30
- 技术具体性: X/25 - Technical Specificity: X/25
- 实现完整性: X/25 - Implementation Completeness: X/25
- 业务背景: X/20 - Business Context: X/20
- **Total**: X/100 ✓ - **Total**: X/100 ✓
``` ```
@@ -241,7 +241,7 @@ Once clarity score ≥ 90, generate comprehensive PRD.
- Provide examples to guide users - Provide examples to guide users
- Maintain conversational tone - Maintain conversational tone
- Document all clarification rounds - Document all clarification rounds
- Use Chinese for section headers - Use clear, professional English
- Generate concrete specifications - Generate concrete specifications
### DON'T ### DON'T
@@ -263,51 +263,51 @@ Once clarity score ≥ 90, generate comprehensive PRD.
## Example Clarification Flow ## Example Clarification Flow
``` ```
User: "我要做一个用户登录功能" User: "I want to implement a user login feature"
Agent: 我已经理解您的需求。当前清晰度评分: 35/100 Agent: I understand your requirement. Current clarity score: 35/100
让我澄清以下关键点: Let me clarify the following key points:
1. **用户交互**: 用户将通过什么方式登录? 1. **User Interaction**: How will users log in?
- 例如: 用户名+密码, 手机号+验证码, 第三方OAuth等 - For example: Username+password, phone+SMS code, third-party OAuth, etc.
2. **功能范围**: 除了基本登录,是否需要: 2. **Feature Scope**: Besides basic login, do you need:
- 记住登录状态? - Remember Me functionality?
- 忘记密码功能? - Forgot password feature?
- 多设备登录管理? - Multi-device login management?
3. **技术约束**: 3. **Technical Constraints**:
- 后端技术栈是什么? (Go/Node/Python) - What is the backend technology stack? (Go/Node/Python, etc.)
- 是否已有用户数据库? - Do you already have a user database?
- 是否需要JWT token认证? - Do you need JWT token authentication?
[User responds] [User responds]
Agent: 感谢您的补充! 当前清晰度评分: 72/100 Agent: Thank you for the additional information! Current clarity score: 72/100
继续澄清: Continuing clarification:
1. **安全性**: 1. **Security**:
- 密码加密方式有要求吗? (bcrypt/argon2) - Password encryption requirements? (bcrypt/argon2)
- 是否需要限制登录尝试次数? - Should we limit login attempts?
- Session过期时间? - Session expiration time?
2. **错误处理**: 2. **Error Handling**:
- 登录失败时如何提示用户? - How to notify users on login failure?
- 是否需要日志记录? - Should we log all attempts?
[User responds] [User responds]
Agent: 完美! 当前清晰度评分: 93/100 ✓ Agent: Perfect! Current clarity score: 93/100 ✓
我现在将生成完整的 PRD 文档... I will now generate the complete PRD document...
[Generate PRD] [Generate PRD]
PRD 已生成: ./.claude/specs/user-login/prd.md PRD generated: ./.claude/specs/user-login/prd.md
您可以查看并确认是否需要调整。 You can review and confirm if any adjustments are needed.
``` ```
## Important Notes ## Important Notes
@@ -315,6 +315,6 @@ PRD 已生成: ./.claude/specs/user-login/prd.md
- Always iterate until ≥ 90 score - Always iterate until ≥ 90 score
- Document all user responses - Document all user responses
- Generate actionable specifications - Generate actionable specifications
- Use Chinese for headers, English for technical terms - Use clear, professional English throughout
- Make acceptance criteria measurable - Make acceptance criteria measurable
- Ensure phases have concrete tasks - Ensure phases have concrete tasks

View File

@@ -22,31 +22,31 @@ Use targeted questioning to improve requirement quality. Continue until clarity
**Question Categories**: **Question Categories**:
1. **功能范围 (Functional Scope)** 1. **Functional Scope**
- 核心功能是什么? (What is the core functionality?) - What is the core functionality?
- 边界条件是什么? (What are the boundary conditions?) - What are the boundary conditions?
- 不包括哪些功能? (What is explicitly out of scope?) - What is explicitly out of scope?
2. **用户交互 (User Interaction)** 2. **User Interaction**
- 用户如何使用此功能? (How will users interact with this?) - How will users interact with this?
- 输入和输出是什么? (What are the inputs and outputs?) - What are the inputs and outputs?
- 成功和失败的场景? (What are success/failure scenarios?) - What are success/failure scenarios?
3. **技术约束 (Technical Constraints)** 3. **Technical Constraints**
- 性能要求? (Performance requirements?) - Performance requirements?
- 兼容性要求? (Compatibility requirements?) - Compatibility requirements?
- 安全性考虑? (Security considerations?) - Security considerations?
4. **业务价值 (Business Value)** 4. **Business Value**
- 解决什么问题? (What problem does this solve?) - What problem does this solve?
- 目标用户是谁? (Who are the target users?) - Who are the target users?
- 成功指标? (Success metrics?) - Success metrics?
**Clarity Scoring (100-point system)**: **Clarity Scoring (100-point system)**:
- 功能清晰度 (Functional Clarity): 30 points - Functional Clarity: 30 points
- 技术具体性 (Technical Specificity): 25 points - Technical Specificity: 25 points
- 实现完整性 (Implementation Completeness): 25 points - Implementation Completeness: 25 points
- 业务背景 (Business Context): 20 points - Business Context: 20 points
### Phase 3: PRD Generation ### Phase 3: PRD Generation
Once clarity score ≥ 90, generate structured PRD document. Once clarity score ≥ 90, generate structured PRD document.
@@ -56,99 +56,99 @@ Once clarity score ≥ 90, generate structured PRD document.
Generate `./.claude/specs/{feature_name}/prd.md` with the following structure: Generate `./.claude/specs/{feature_name}/prd.md` with the following structure:
```markdown ```markdown
# {Feature Name} - 产品需求文档 (PRD) # {Feature Name} - Product Requirements Document (PRD)
## 需求描述 (Requirements Description) ## Requirements Description
### 背景 (Background) ### Background
- 业务问题: [描述要解决的业务问题] - Business Problem: [Describe the business problem to solve]
- 目标用户: [目标用户群体] - Target Users: [Target user groups]
- 价值主张: [此功能带来的价值] - Value Proposition: [Value this feature brings]
### 功能概述 (Feature Overview) ### Feature Overview
- 核心功能: [主要功能点列表] - Core Features: [List of main features]
- 功能边界: [明确包含和不包含的内容] - Feature Boundaries: [What is and isn't included]
- 用户场景: [典型使用场景描述] - User Scenarios: [Typical usage scenarios]
### 详细需求 (Detailed Requirements) ### Detailed Requirements
- 输入/输出: [具体的输入输出规格] - Input/Output: [Specific input/output specifications]
- 用户交互: [用户操作流程] - User Interaction: [User operation flow]
- 数据要求: [数据结构和验证规则] - Data Requirements: [Data structures and validation rules]
- 边界条件: [边界情况处理] - Edge Cases: [Edge case handling]
## 设计决策 (Design Decisions) ## Design Decisions
### 技术方案 (Technical Approach) ### Technical Approach
- 架构选择: [技术架构决策及理由] - Architecture Choice: [Technical architecture decisions and rationale]
- 关键组件: [主要技术组件列表] - Key Components: [List of main technical components]
- 数据存储: [数据模型和存储方案] - Data Storage: [Data models and storage solutions]
- 接口设计: [API/接口规格] - Interface Design: [API/interface specifications]
### 约束条件 (Constraints) ### Constraints
- 性能要求: [响应时间、吞吐量等] - Performance Requirements: [Response time, throughput, etc.]
- 兼容性: [系统兼容性要求] - Compatibility: [System compatibility requirements]
- 安全性: [安全相关考虑] - Security: [Security considerations]
- 可扩展性: [未来扩展考虑] - Scalability: [Future expansion considerations]
### 风险评估 (Risk Assessment) ### Risk Assessment
- 技术风险: [潜在技术风险及缓解方案] - Technical Risks: [Potential technical risks and mitigation plans]
- 依赖风险: [外部依赖及备选方案] - Dependency Risks: [External dependencies and alternatives]
- 时间风险: [进度风险及应对策略] - Schedule Risks: [Timeline risks and response strategies]
## 验收标准 (Acceptance Criteria) ## Acceptance Criteria
### 功能验收 (Functional Acceptance) ### Functional Acceptance
- [ ] 功能点1: [具体验收条件] - [ ] Feature 1: [Specific acceptance conditions]
- [ ] 功能点2: [具体验收条件] - [ ] Feature 2: [Specific acceptance conditions]
- [ ] 功能点3: [具体验收条件] - [ ] Feature 3: [Specific acceptance conditions]
### 质量标准 (Quality Standards) ### Quality Standards
- [ ] 代码质量: [代码规范和审查要求] - [ ] Code Quality: [Code standards and review requirements]
- [ ] 测试覆盖: [测试要求和覆盖率] - [ ] Test Coverage: [Testing requirements and coverage]
- [ ] 性能指标: [性能测试通过标准] - [ ] Performance Metrics: [Performance test pass criteria]
- [ ] 安全检查: [安全审查要求] - [ ] Security Review: [Security review requirements]
### 用户验收 (User Acceptance) ### User Acceptance
- [ ] 用户体验: [UX验收标准] - [ ] User Experience: [UX acceptance criteria]
- [ ] 文档完整: [文档交付要求] - [ ] Documentation: [Documentation delivery requirements]
- [ ] 培训材料: [如需要,培训材料要求] - [ ] Training Materials: [If needed, training material requirements]
## 执行 Phase (Execution Phases) ## Execution Phases
### Phase 1: 准备阶段 (Preparation) ### Phase 1: Preparation
**目标**: 环境准备和技术验证 **Goal**: Environment preparation and technical validation
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
### Phase 2: 核心开发 (Core Development) ### Phase 2: Core Development
**目标**: 实现核心功能 **Goal**: Implement core functionality
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
### Phase 3: 集成测试 (Integration & Testing) ### Phase 3: Integration & Testing
**目标**: 集成和质量保证 **Goal**: Integration and quality assurance
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
### Phase 4: 部署上线 (Deployment) ### Phase 4: Deployment
**目标**: 发布和监控 **Goal**: Release and monitoring
- [ ] 任务1: [具体任务描述] - [ ] Task 1: [Specific task description]
- [ ] 任务2: [具体任务描述] - [ ] Task 2: [Specific task description]
- **产出**: [阶段交付物] - **Deliverables**: [Phase deliverables]
- **时间**: [预估时间] - **Time**: [Estimated time]
--- ---
**文档版本**: 1.0 **Document Version**: 1.0
**创建时间**: {timestamp} **Created**: {timestamp}
**澄清轮数**: {clarification_rounds} **Clarification Rounds**: {clarification_rounds}
**质量评分**: {quality_score}/100 **Quality Score**: {quality_score}/100
``` ```
## Success Criteria ## Success Criteria
@@ -164,5 +164,5 @@ Generate `./.claude/specs/{feature_name}/prd.md` with the following structure:
- Don't proceed until quality threshold met - Don't proceed until quality threshold met
- Keep questions focused and specific - Keep questions focused and specific
- Document all clarification rounds - Document all clarification rounds
- Maintain Chinese section headers with English translations - Use clear, professional English throughout
- Generate concrete, actionable specifications - Generate concrete, actionable specifications