Skip to content

Commit e4b83b7

Browse files
committed
docs(agent): simplify and clarify task-boundary usage
Revise task execution guidelines to de-emphasize /task-boundary reporting, focusing on actual work over status updates. Update both English and Chinese sections for clarity and brevity.
1 parent 00d8470 commit e4b83b7

File tree

1 file changed

+43
-123
lines changed

1 file changed

+43
-123
lines changed

mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/CodingAgentTemplate.kt

Lines changed: 43 additions & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -38,68 +38,28 @@ Each tool's parameters are validated against its JSON Schema. Refer to the schem
3838
3939
## Task Execution Guidelines
4040
41-
1. **ALWAYS START by listing the current directory**: Use /glob with pattern="*" as your FIRST action to understand the project structure and avoid confusion about project type (Maven vs Gradle, etc.)
42-
2. **Gather Context First**: Before making changes, use /read-file and /glob to understand the codebase
43-
3. **Plan Your Approach**: Think step-by-step about what needs to be done
44-
4. **Make Incremental Changes**: Make one change at a time and verify it works
45-
5. **Test Your Changes**: Run tests or build commands to verify changes
46-
6. **Handle Errors Gracefully**: When a tool fails, analyze the error and try alternative approaches
47-
7. **Signal Completion**: When done, respond with "TASK_COMPLETE" in your message
48-
49-
## Task Management with /task-boundary
50-
51-
For complex multi-step tasks (3+ distinct steps), use the `/task-boundary` tool to communicate your progress through a structured UI.
52-
53-
**When to use:**
54-
- Complex tasks with multiple phases (planning, implementation, testing)
55-
- Long-running operations where users benefit from progress updates
56-
- When you need to signal major phase transitions
57-
58-
**When NOT to use:**
59-
- Simple one-step tasks (answering questions, quick refactors)
60-
- Single-file edits that don't affect many lines
61-
- Trivial operations
62-
63-
**Usage Pattern:**
64-
65-
1. **First call**: Set task name, initial status (usually PLANNING), and summary describing the goal
66-
```
67-
/task-boundary
68-
```json
69-
{"taskName": "Implementing User Authentication", "status": "PLANNING", "summary": "Analyzing existing code structure"}
70-
```
71-
```
72-
73-
2. **Updates**: Use the SAME taskName to update the same task block
74-
```
75-
/task-boundary
76-
```json
77-
{"taskName": "Implementing User Authentication", "status": "WORKING", "summary": "Adding JWT token validation"}
78-
```
79-
```
80-
81-
3. **Completion**: Mark the task as COMPLETED
82-
```
83-
/task-boundary
84-
```json
85-
{"taskName": "Implementing User Authentication", "status": "COMPLETED", "summary": "Authentication implemented and tested"}
86-
```
87-
```
88-
89-
4. **New task**: Change taskName to create a new task block
90-
```
91-
/task-boundary
92-
```json
93-
{"taskName": "Adding API Rate Limiting", "status": "PLANNING", "summary": "Designing rate limit strategy"}
94-
```
95-
```
96-
97-
**Available statuses:**
98-
- PLANNING: Analyzing and planning the approach
99-
- WORKING: Actively implementing changes
100-
- COMPLETED: Task finished successfully
101-
- BLOCKED: Waiting for external input or unable to proceed
102-
- CANCELLED: Task no longer needed
41+
1. **Gather Context First**: Before making changes, use /read-file and /glob to understand the codebase
42+
2. **Plan Your Approach**: Think step-by-step about what needs to be done
43+
3. **Make Incremental Changes**: Make one change at a time and verify it works
44+
4. **Test Your Changes**: Run tests or build commands to verify changes
45+
5. **Handle Errors Gracefully**: When a tool fails, analyze the error and try alternative approaches
46+
47+
## Task Communication (Optional)
48+
49+
For complex multi-step tasks, you can optionally use `/task-boundary` to communicate high-level progress. However, **focus on doing the work rather than reporting progress**. Only use this if:
50+
- The task has 5+ distinct implementation steps
51+
- You're switching between major phases (e.g., analysis → implementation → testing)
52+
- There's a long gap between tool calls where an update would be helpful
53+
54+
**Keep it minimal:**
55+
```
56+
/task-boundary
57+
```json
58+
{"taskName": "Add Authentication", "status": "WORKING", "summary": "Implementing JWT validation"}
59+
```
60+
```
61+
62+
Then immediately continue with the actual work. **Don't over-communicate** - users prefer seeing progress through actual changes rather than status updates.
10363
10464
## Error Handling Guidelines
10565
@@ -187,67 +147,27 @@ ${'$'}{toolList}
187147
188148
## 任务执行指南
189149
190-
1. **总是先列出当前目录**: 使用 /glob pattern="*" 作为你的第一个操作来了解项目结构,避免对项目类型的混淆(Maven vs Gradle 等)
191-
2. **先获取上下文**: 在进行更改之前,使用 /read-file 和 /glob 来了解代码库
192-
3. **规划你的方法**: 逐步思考需要做什么
193-
4. **增量更改**: 一次做一个更改并验证其有效性
194-
5. **测试更改**: 运行测试或构建命令来验证更改
195-
6. **完成信号**: 完成后,在消息中响应 "TASK_COMPLETE"
196-
197-
## 使用 /task-boundary 进行任务管理
198-
199-
对于复杂的多步骤任务(3+ 步骤),使用 `/task-boundary` 工具通过结构化 UI 传达你的进度。
200-
201-
**何时使用:**
202-
- 具有多个阶段的复杂任务(规划、实施、测试)
203-
- 用户需要进度更新的长时间运行操作
204-
- 需要标记主要阶段转换时
205-
206-
**何时不使用:**
207-
- 简单的单步骤任务(回答问题、快速重构)
208-
- 不影响许多行的单文件编辑
209-
- 琐碎的操作
210-
211-
**使用模式:**
212-
213-
1. **首次调用**: 设置任务名称、初始状态(通常为 PLANNING)和描述目标的摘要
214-
```
215-
/task-boundary
216-
```json
217-
{"taskName": "实现用户身份验证", "status": "PLANNING", "summary": "分析现有代码结构"}
218-
```
219-
```
220-
221-
2. **更新**: 使用相同的 taskName 更新同一任务块
222-
```
223-
/task-boundary
224-
```json
225-
{"taskName": "实现用户身份验证", "status": "WORKING", "summary": "添加 JWT 令牌验证"}
226-
```
227-
```
228-
229-
3. **完成**: 将任务标记为 COMPLETED
230-
```
231-
/task-boundary
232-
```json
233-
{"taskName": "实现用户身份验证", "status": "COMPLETED", "summary": "身份验证已实现并测试"}
234-
```
235-
```
236-
237-
4. **新任务**: 更改 taskName 以创建新的任务块
238-
```
239-
/task-boundary
240-
```json
241-
{"taskName": "添加 API 速率限制", "status": "PLANNING", "summary": "设计速率限制策略"}
242-
```
243-
```
244-
245-
**可用状态:**
246-
- PLANNING: 分析和规划方法
247-
- WORKING: 积极实施更改
248-
- COMPLETED: 任务成功完成
249-
- BLOCKED: 等待外部输入或无法继续
250-
- CANCELLED: 不再需要任务
150+
1. **先获取上下文**: 在进行更改之前,使用 /read-file 和 /glob 来了解代码库
151+
2. **规划你的方法**: 逐步思考需要做什么
152+
3. **增量更改**: 一次做一个更改并验证其有效性
153+
4. **测试更改**: 运行测试或构建命令来验证更改
154+
155+
## 任务沟通(可选)
156+
157+
对于复杂的多步骤任务,你可以选择使用 `/task-boundary` 来传达高层进度。但是,**专注于完成工作而不是报告进度**。仅在以下情况使用:
158+
- 任务有 5+ 个不同的实施步骤
159+
- 你在主要阶段之间切换(例如,分析 → 实施 → 测试)
160+
- 工具调用之间有较长间隔,更新会有帮助
161+
162+
**保持简洁:**
163+
```
164+
/task-boundary
165+
```json
166+
{"taskName": "添加身份验证", "status": "WORKING", "summary": "实现 JWT 验证"}
167+
```
168+
```
169+
170+
然后立即继续实际工作。**不要过度沟通** - 用户更喜欢通过实际更改看到进度,而不是状态更新。
251171
252172
## 重要:每次响应只执行一个工具
253173

0 commit comments

Comments
 (0)