Skip to content

Commit 1d9e658

Browse files
committed
feat: 新增三层级提示系统,支持任务、计划和步骤级提示管理,增强多Agent协同工作能力,更新文档以反映新功能和使用示例,添加提示功能的综合测试用例
1 parent 7870ce3 commit 1d9e658

6 files changed

Lines changed: 919 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ WaveForge MCP task management system is now largely complete! Core project manag
2626

2727
- **Intelligent Task System**
2828
- **Two-Level Task Model**: Easily manage complex tasks with a structure of "Overall Plans" and "Specific Steps." Get a high-level overview while focusing on the immediate task, unifying macro and micro perspectives.
29+
- **Three-Level Hint System**: Provide contextual guidance to AI agents at task, plan, and step levels. Hints are automatically delivered based on the current operation context, enabling seamless multi-agent collaboration and real-time guidance.
2930
- **Automation-Driven Workflow**: When the last step of a plan is completed, the system automatically completes the plan and prompts the AI to generate steps for the next one. This "relay race" style of automation makes task progression seamless.
3031
- **Seamless Multi-Agent & Cross-Tool Collaboration**
3132
- **Unique Project Identifier**: A revolutionary project-binding mechanism eliminates dependency on the current working directory (CWD) or editor workspace. No matter which tool (Cursor, VSCode, Kiro) or terminal you're in, all agents are guaranteed to collaborate within the same project context.

README.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ WaveForge MCP 任务管理系统已基本完成!核心的项目管理和任务
2727

2828
- **智能任务系统**
2929
- **双层级任务模型**:通过“整体计划 (Plan)”和“具体步骤 (Step)”的结构,轻松驾驭复杂任务。既能总览全局,又能聚焦当下,实现宏观与微观的统一。
30+
- **三层级提示系统**:提供任务、计划和步骤三个层级的提示信息,实现多 Agent 协同工作时的智能指导。提示信息会根据当前操作上下文自动传递给执行任务的 AI Agent。
3031
- **自动化流程驱动**:当计划的最后一步完成时,系统会自动完成该计划并提示 AI 为下一个计划生成步骤。这种“接力棒”式的自动化,让任务推进如丝般顺滑。
3132
- **无缝的多 Agent 与跨工具协作**
3233
- **项目唯一标识**:革命性的项目绑定机制,彻底摆脱对当前工作目录 (CWD) 或编辑器工作区的依赖。无论你在哪个工具(Cursor, VSCode, Kiro)或终端中,都能确保所有 Agent 在同一个项目上下文中协作,不再有“找不着北”的烦恼。

USAGE.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ Update the status of a plan or step.
272272

273273
### current_task_modify
274274

275-
Modify task structure including plans, steps, and goals.
275+
Modify task structure including plans, steps, and goals, including the powerful three-level hint system.
276276

277277
**Schema:**
278278

@@ -316,6 +316,10 @@ Modify task structure including plans, steps, and goals.
316316
"plan_id": {
317317
"type": "string",
318318
"description": "针对特定计划修改时需要的计划ID"
319+
},
320+
"step_id": {
321+
"type": "string",
322+
"description": "针对特定步骤修改时需要的步骤ID(修改步骤级提示时必须同时提供plan_id)"
319323
}
320324
},
321325
"required": ["field", "content", "reason", "change_type"],
@@ -324,6 +328,44 @@ Modify task structure including plans, steps, and goals.
324328
}
325329
```
326330

331+
**Hint System Examples:**
332+
333+
```bash
334+
# Add task-level hints (applies to all operations)
335+
{
336+
"field": "hints",
337+
"content": ["注意代码质量", "遵循安全规范", "及时更新文档"],
338+
"reason": "添加任务级开发指导",
339+
"change_type": "user_request"
340+
}
341+
342+
# Add plan-level hints (applies to specific plan operations)
343+
{
344+
"field": "hints",
345+
"content": ["注意设计模式", "考虑扩展性"],
346+
"reason": "添加设计阶段提示",
347+
"change_type": "user_request",
348+
"plan_id": "plan-001"
349+
}
350+
351+
# Add step-level hints (applies to specific step operations)
352+
{
353+
"field": "hints",
354+
"content": ["仔细分析需求", "与用户确认细节"],
355+
"reason": "添加需求分析提示",
356+
"change_type": "user_request",
357+
"plan_id": "plan-001",
358+
"step_id": "step-001"
359+
}
360+
```
361+
362+
**How Hints Work:**
363+
364+
- **Task-level hints**: Always returned in `current_task_update` responses
365+
- **Plan-level hints**: Returned when updating plans or steps within that plan
366+
- **Step-level hints**: Returned when updating that specific step
367+
- **Multi-Agent Collaboration**: Different agents can add hints at different levels, and executing agents receive all relevant hints based on their current operation context
368+
327369
### current_task_complete
328370

329371
Complete the current task and generate documentation.

docs/hints-examples.md

Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
# 提示功能使用示例
2+
3+
WaveForge MCP 提供了强大的三层级提示系统,支持在任务、计划和步骤三个层级添加提示信息,实现多Agent协同工作时的智能指导。
4+
5+
## 🎯 提示系统概述
6+
7+
### 三个层级
8+
9+
1. **任务级提示 (Task-level Hints)**: 适用于整个任务的通用指导
10+
2. **计划级提示 (Plan-level Hints)**: 适用于特定计划的专项指导
11+
3. **步骤级提示 (Step-level Hints)**: 适用于具体步骤的精确指导
12+
13+
### 上下文传递
14+
15+
- 执行Agent在操作时会自动收到相关层级的所有提示
16+
- 计划级操作:返回任务级 + 计划级提示
17+
- 步骤级操作:返回任务级 + 计划级 + 步骤级提示
18+
19+
## 📝 使用示例
20+
21+
### 1. 任务级提示管理
22+
23+
```bash
24+
# 添加任务级提示
25+
{
26+
"tool": "current_task_modify",
27+
"params": {
28+
"field": "hints",
29+
"content": [
30+
"注意代码质量和可维护性",
31+
"遵循项目的编码规范",
32+
"及时更新相关文档",
33+
"确保测试覆盖率达到80%以上"
34+
],
35+
"reason": "添加项目开发的通用指导原则",
36+
"change_type": "user_request"
37+
}
38+
}
39+
```
40+
41+
### 2. 计划级提示管理
42+
43+
```bash
44+
# 为设计阶段添加专项提示
45+
{
46+
"tool": "current_task_modify",
47+
"params": {
48+
"field": "hints",
49+
"content": [
50+
"采用SOLID设计原则",
51+
"考虑系统的扩展性和可配置性",
52+
"设计时要考虑性能优化",
53+
"确保接口设计的向后兼容性"
54+
],
55+
"reason": "为设计阶段添加架构指导",
56+
"change_type": "user_request",
57+
"plan_id": "plan-design-phase"
58+
}
59+
}
60+
61+
# 为开发阶段添加不同的提示
62+
{
63+
"tool": "current_task_modify",
64+
"params": {
65+
"field": "hints",
66+
"content": [
67+
"优先实现核心功能",
68+
"注意错误处理和边界条件",
69+
"编写单元测试验证功能",
70+
"及时提交代码并写好commit信息"
71+
],
72+
"reason": "为开发阶段添加实现指导",
73+
"change_type": "user_request",
74+
"plan_id": "plan-development-phase"
75+
}
76+
}
77+
```
78+
79+
### 3. 步骤级提示管理
80+
81+
```bash
82+
# 为需求分析步骤添加具体提示
83+
{
84+
"tool": "current_task_modify",
85+
"params": {
86+
"field": "hints",
87+
"content": [
88+
"仔细分析用户需求,确保理解准确",
89+
"识别功能性和非功能性需求",
90+
"与产品经理确认需求细节",
91+
"考虑需求的优先级和依赖关系"
92+
],
93+
"reason": "为需求分析步骤添加详细指导",
94+
"change_type": "user_request",
95+
"plan_id": "plan-design-phase",
96+
"step_id": "step-requirement-analysis"
97+
}
98+
}
99+
100+
# 为代码实现步骤添加技术提示
101+
{
102+
"tool": "current_task_modify",
103+
"params": {
104+
"field": "hints",
105+
"content": [
106+
"使用TypeScript严格模式",
107+
"实现适当的错误处理机制",
108+
"添加JSDoc注释说明",
109+
"考虑代码的可测试性"
110+
],
111+
"reason": "为代码实现步骤添加技术指导",
112+
"change_type": "user_request",
113+
"plan_id": "plan-development-phase",
114+
"step_id": "step-code-implementation"
115+
}
116+
}
117+
```
118+
119+
## 🤝 多Agent协同场景
120+
121+
### 场景1:项目经理 + 开发Agent
122+
123+
```bash
124+
# 项目经理添加任务级提示
125+
{
126+
"field": "hints",
127+
"content": ["项目截止日期是下周五,请合理安排开发进度"],
128+
"reason": "项目经理添加进度提醒",
129+
"change_type": "user_request"
130+
}
131+
132+
# 架构师为设计计划添加提示
133+
{
134+
"field": "hints",
135+
"content": ["采用微服务架构,注意服务间的解耦"],
136+
"reason": "架构师添加设计指导",
137+
"change_type": "user_request",
138+
"plan_id": "plan-architecture-design"
139+
}
140+
141+
# 开发Agent执行步骤时会收到所有相关提示
142+
# current_task_update 响应示例:
143+
{
144+
"success": true,
145+
"hints": {
146+
"task": ["项目截止日期是下周五,请合理安排开发进度"],
147+
"plan": ["采用微服务架构,注意服务间的解耦"],
148+
"step": []
149+
}
150+
}
151+
```
152+
153+
### 场景2:Code Review + 开发指导
154+
155+
```bash
156+
# Code Reviewer添加步骤级提示
157+
{
158+
"field": "hints",
159+
"content": [
160+
"这个函数的复杂度过高,建议拆分",
161+
"缺少输入参数的验证逻辑",
162+
"建议添加更多的单元测试用例"
163+
],
164+
"reason": "Code Review反馈",
165+
"change_type": "user_request",
166+
"plan_id": "plan-implementation",
167+
"step_id": "step-user-service"
168+
}
169+
```
170+
171+
## 🔄 提示的动态更新
172+
173+
### 清空提示
174+
175+
```bash
176+
# 清空任务级提示
177+
{
178+
"field": "hints",
179+
"content": [],
180+
"reason": "清空过期的任务提示",
181+
"change_type": "user_request"
182+
}
183+
```
184+
185+
### 更新提示
186+
187+
```bash
188+
# 更新计划级提示
189+
{
190+
"field": "hints",
191+
"content": [
192+
"更新后的设计指导1",
193+
"更新后的设计指导2"
194+
],
195+
"reason": "根据最新需求更新设计指导",
196+
"change_type": "plan_adjustment",
197+
"plan_id": "plan-design-phase"
198+
}
199+
```
200+
201+
## 📊 提示的自动传递
202+
203+
### 计划级操作
204+
205+
当Agent执行计划级操作时:
206+
207+
```bash
208+
# 输入
209+
{
210+
"tool": "current_task_update",
211+
"params": {
212+
"update_type": "plan",
213+
"plan_id": "plan-design-phase",
214+
"status": "in_progress"
215+
}
216+
}
217+
218+
# 输出(自动包含相关提示)
219+
{
220+
"success": true,
221+
"current_plan_id": "plan-design-phase",
222+
"hints": {
223+
"task": ["注意代码质量和可维护性", "遵循项目的编码规范"],
224+
"plan": ["采用SOLID设计原则", "考虑系统的扩展性"],
225+
"step": []
226+
}
227+
}
228+
```
229+
230+
### 步骤级操作
231+
232+
当Agent执行步骤级操作时:
233+
234+
```bash
235+
# 输入
236+
{
237+
"tool": "current_task_update",
238+
"params": {
239+
"update_type": "step",
240+
"step_id": "step-requirement-analysis",
241+
"status": "completed",
242+
"notes": "需求分析完成"
243+
}
244+
}
245+
246+
# 输出(包含所有层级的相关提示)
247+
{
248+
"success": true,
249+
"hints": {
250+
"task": ["注意代码质量和可维护性", "遵循项目的编码规范"],
251+
"plan": ["采用SOLID设计原则", "考虑系统的扩展性"],
252+
"step": ["仔细分析用户需求,确保理解准确", "识别功能性和非功能性需求"]
253+
}
254+
}
255+
```
256+
257+
## 💡 最佳实践
258+
259+
### 1. 提示内容建议
260+
261+
- **任务级**: 通用的开发原则、项目约束、质量标准
262+
- **计划级**: 特定阶段的方法论、技术选型、注意事项
263+
- **步骤级**: 具体的操作指导、技术细节、检查清单
264+
265+
### 2. 提示管理建议
266+
267+
- 保持提示内容简洁明确
268+
- 及时更新过期的提示信息
269+
- 避免提示内容过多造成信息过载
270+
- 根据项目进展动态调整提示内容
271+
272+
### 3. 多Agent协作建议
273+
274+
- 不同角色的Agent负责不同层级的提示
275+
- 项目经理:任务级提示(进度、质量、资源)
276+
- 架构师:计划级提示(设计、技术选型)
277+
- 开发者:步骤级提示(实现细节、技术要点)
278+
279+
### 4. 提示时机建议
280+
281+
- **项目启动时**: 添加任务级的基础提示
282+
- **阶段切换时**: 更新计划级的专项提示
283+
- **遇到问题时**: 添加步骤级的解决指导
284+
- **Code Review后**: 根据反馈更新相关提示
285+
286+
## 🔍 故障排除
287+
288+
### 常见问题
289+
290+
1. **提示没有显示**
291+
- 检查提示是否添加到正确的层级
292+
- 确认当前操作的上下文是否匹配
293+
294+
2. **提示内容过多**
295+
- 定期清理过期的提示
296+
- 将通用提示上移到更高层级
297+
298+
3. **多Agent冲突**
299+
- 建立提示管理的责任分工
300+
- 使用明确的提示更新原因说明
301+
302+
通过合理使用提示系统,可以大大提升多Agent协同开发的效率和质量!

0 commit comments

Comments
 (0)