Skip to content

Commit e7e5741

Browse files
wwch的macwwch的mac
authored andcommitted
feat: add user requirements analysis feature
1 parent 64266f7 commit e7e5741

File tree

7 files changed

+1091
-7
lines changed

7 files changed

+1091
-7
lines changed

prompts/code_prompts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
- PAPER_ALGORITHM_ANALYSIS_PROMPT: 专注算法提取,明确实现优先级
1414
- PAPER_CONCEPT_ANALYSIS_PROMPT: 专注系统架构,突出概念到代码的映射
1515
- CODE_PLANNING_PROMPT: 整合前两者输出,生成高质量复现计划
16+
17+
NEW: 用户需求分析相关提示词
18+
- REQUIREMENT_QUESTION_GENERATION_PROMPT: 基于初始需求生成引导性问题
19+
- REQUIREMENT_SUMMARY_PROMPT: 基于问答生成详细需求文档
1620
"""
1721

1822
# Paper to Code Workflow Prompts
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
"""
2+
User requirement analysis related prompt templates
3+
4+
Contains prompt templates for requirement analysis Agent, supporting question generation and requirement summarization functions.
5+
"""
6+
7+
# ========================================
8+
# User requirement analysis related prompt templates
9+
# ========================================
10+
11+
REQUIREMENT_QUESTION_GENERATION_PROMPT = """You are a professional requirement analysis expert, skilled at helping users refine project requirements through precise questions.
12+
13+
Please generate 5-8 guiding questions based on user's initial requirement description to help users provide more detailed information.
14+
15+
User Initial Requirements:
16+
{user_input}
17+
18+
Please generate a JSON format question list, each question contains the following fields:
19+
- category: Question category (such as "Functional Requirements", "Technology Selection", "Performance Requirements", "User Interface", "Deployment Environment", etc.)
20+
- question: Specific question content
21+
- importance: Importance level ("High", "Medium", "Low")
22+
- hint: Question hint or example (optional)
23+
24+
Requirements:
25+
1. Questions should be highly targeted, based on user's specific requirement scenarios
26+
2. Cover key decision points for project implementation
27+
3. Avoid overly technical questions, maintain user-friendliness
28+
4. Questions should have logical correlation
29+
5. Ensure questions help users think about important details they might have missed
30+
31+
Please return JSON format results directly, without including other text descriptions."""
32+
33+
REQUIREMENT_SUMMARY_PROMPT = """You are a professional technical requirement analyst, skilled at converting user requirement descriptions into detailed technical specification documents.
34+
35+
Please generate a detailed project requirement document based on user's initial requirements and supplementary responses.
36+
37+
User Initial Requirements:
38+
{initial_input}
39+
40+
User Supplementary Responses:
41+
{answers_text}
42+
43+
Please generate a structured requirement document containing the following sections:
44+
45+
## Project Overview
46+
Brief description of project's core goals and value
47+
48+
## Functional Requirements
49+
Detailed list of all functional modules and feature requirements
50+
51+
## Technical Requirements
52+
- Recommended technology stack and frameworks
53+
- Architecture design suggestions
54+
- Data storage solutions
55+
56+
## Performance Requirements
57+
- Expected user volume and concurrency requirements
58+
- Response time requirements
59+
- Scalability considerations
60+
61+
## User Interface Requirements
62+
- UI/UX design requirements
63+
- Interaction method descriptions
64+
- Responsive design requirements
65+
66+
## Deployment and Operations Requirements
67+
- Deployment environment requirements
68+
- Monitoring and logging requirements
69+
- Security considerations
70+
71+
## Implementation Suggestions
72+
- Development phase division
73+
- Priority ranking
74+
- Potential technical risks
75+
76+
Requirements:
77+
1. Requirement document should be detailed and executable, easy for developers to understand and implement
78+
2. Supplement technical details based on user responses, but maintain user's original intent unchanged
79+
3. Provide reasonable technical architecture suggestions and best practices
80+
4. Consider project feasibility and complexity
81+
5. Provide clear functional module division and implementation priorities"""

0 commit comments

Comments
 (0)