|
| 1 | +// TODO: 合码前删除 |
| 2 | + |
| 3 | +# TaskCreate |
| 4 | + |
| 5 | +``` |
| 6 | +{ |
| 7 | + "name": "TaskCreate", |
| 8 | + "description": "Use this tool to create a structured task list for your current coding session. This helps you track progress, organize complex tasks, and demonstrate thoroughness to the user.\nIt also helps the user understand the progress of the task and overall progress of their requests.\n\n## When to Use This Tool\n\nUse this tool proactively in these scenarios:\n\n- Complex multi-step tasks - When a task requires 3 or more distinct steps or actions\n- Non-trivial and complex tasks - Tasks that require careful planning or multiple operations\n- Plan mode - When using plan mode, create a task list to track the work\n- User explicitly requests todo list - When the user directly asks you to use the todo list\n- User provides multiple tasks - When users provide a list of things to be done (numbered or comma-separated)\n- After receiving new instructions - Immediately capture user requirements as tasks\n- When you start working on a task - Mark it as in_progress BEFORE beginning work\n- After completing a task - Mark it as completed and add any new follow-up tasks discovered during implementation\n\n## When NOT to Use This Tool\n\nSkip using this tool when:\n- There is only a single, straightforward task\n- The task is trivial and tracking it provides no organizational benefit\n- The task can be completed in less than 3 trivial steps\n- The task is purely conversational or informational\n\nNOTE that you should not use this tool if there is only one trivial task to do. In this case you are better off just doing the task directly.\n\n## Task Fields\n\n- **subject**: A brief, actionable title in imperative form (e.g., \"Fix authentication bug in login flow\")\n- **description**: Detailed description of what needs to be done, including context and acceptance criteria\n- **activeForm**: Present continuous form shown in spinner when task is in_progress (e.g., \"Fixing authentication bug\"). This is displayed to the user while you work on the task.\n\n**IMPORTANT**: Always provide activeForm when creating tasks. The subject should be imperative (\"Run tests\") while activeForm should be present continuous (\"Running tests\"). All tasks are created with status `pending`.\n\n## Tips\n\n- Create tasks with clear, specific subjects that describe the outcome\n- Include enough detail in the description for another agent to understand and complete the task\n- After creating tasks, use TaskUpdate to set up dependencies (blocks/blockedBy) if needed\n- Check TaskList first to avoid creating duplicate tasks\n", |
| 9 | + "input_schema": { |
| 10 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 11 | + "type": "object", |
| 12 | + "properties": { |
| 13 | + "subject": { |
| 14 | + "description": "A brief title for the task", |
| 15 | + "type": "string" |
| 16 | + }, |
| 17 | + "description": { |
| 18 | + "description": "A detailed description of what needs to be done", |
| 19 | + "type": "string" |
| 20 | + }, |
| 21 | + "activeForm": { |
| 22 | + "description": "Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")", |
| 23 | + "type": "string" |
| 24 | + }, |
| 25 | + "metadata": { |
| 26 | + "description": "Arbitrary metadata to attach to the task", |
| 27 | + "type": "object", |
| 28 | + "propertyNames": { |
| 29 | + "type": "string" |
| 30 | + }, |
| 31 | + "additionalProperties": {} |
| 32 | + } |
| 33 | + }, |
| 34 | + "required": [ |
| 35 | + "subject", |
| 36 | + "description" |
| 37 | + ], |
| 38 | + "additionalProperties": false |
| 39 | + } |
| 40 | +} |
| 41 | +
|
| 42 | +demo |
| 43 | +request |
| 44 | +{ |
| 45 | + "type": "tool_use", |
| 46 | + "id": "toolu_bdrk_01Ueuj6ExPyRFsnebUW84gXR", |
| 47 | + "name": "TaskCreate", |
| 48 | + "input": { |
| 49 | + "subject": "初始化 Next.js 项目", |
| 50 | + "description": "使用 create-next-app 创建 Next.js + TypeScript 项目,配置 Tailwind CSS 用于样式", |
| 51 | + "activeForm": "初始化项目中" |
| 52 | + } |
| 53 | +} |
| 54 | +response |
| 55 | +{ |
| 56 | + "tool_use_id": "toolu_bdrk_01AVCNgPiMFRmJ5tyBWDX8rx", |
| 57 | + "type": "tool_result", |
| 58 | + "content": "Task #12 created successfully: 设计数据模型和存储层" |
| 59 | +} |
| 60 | +
|
| 61 | +
|
| 62 | +``` |
| 63 | + |
| 64 | + |
| 65 | +# TaskUpdate |
| 66 | + |
| 67 | +``` |
| 68 | +{ |
| 69 | + "name": "TaskUpdate", |
| 70 | + "description": "Use this tool to update a task in the task list.\n\n## When to Use This Tool\n\n**Mark tasks as resolved:**\n- When you have completed the work described in a task\n- When a task is no longer needed or has been superseded\n- IMPORTANT: Always mark your assigned tasks as resolved when you finish them\n- After resolving, call TaskList to find your next task\n\n- ONLY mark a task as completed when you have FULLY accomplished it\n- If you encounter errors, blockers, or cannot finish, keep the task as in_progress\n- When blocked, create a new task describing what needs to be resolved\n- Never mark a task as completed if:\n - Tests are failing\n - Implementation is partial\n - You encountered unresolved errors\n - You couldn't find necessary files or dependencies\n\n**Delete tasks:**\n- When a task is no longer relevant or was created in error\n- Setting status to `deleted` permanently removes the task\n\n**Update task details:**\n- When requirements change or become clearer\n- When establishing dependencies between tasks\n\n## Fields You Can Update\n\n- **status**: The task status (see Status Workflow below)\n- **subject**: Change the task title (imperative form, e.g., \"Run tests\")\n- **description**: Change the task description\n- **activeForm**: Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")\n- **owner**: Change the task owner (agent name)\n- **metadata**: Merge metadata keys into the task (set a key to null to delete it)\n- **addBlocks**: Mark tasks that cannot start until this one completes\n- **addBlockedBy**: Mark tasks that must complete before this one can start\n\n## Status Workflow\n\nStatus progresses: `pending` → `in_progress` → `completed`\n\nUse `deleted` to permanently remove a task.\n\n## Staleness\n\nMake sure to read a task's latest state using `TaskGet` before updating it.\n\n## Examples\n\nMark task as in progress when starting work:\n```json\n{\"taskId\": \"1\", \"status\": \"in_progress\"}\n```\n\nMark task as completed after finishing work:\n```json\n{\"taskId\": \"1\", \"status\": \"completed\"}\n```\n\nDelete a task:\n```json\n{\"taskId\": \"1\", \"status\": \"deleted\"}\n```\n\nClaim a task by setting owner:\n```json\n{\"taskId\": \"1\", \"owner\": \"my-name\"}\n```\n\nSet up task dependencies:\n```json\n{\"taskId\": \"2\", \"addBlockedBy\": [\"1\"]}\n```\n", |
| 71 | + "input_schema": { |
| 72 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 73 | + "type": "object", |
| 74 | + "properties": { |
| 75 | + "taskId": { |
| 76 | + "description": "The ID of the task to update", |
| 77 | + "type": "string" |
| 78 | + }, |
| 79 | + "subject": { |
| 80 | + "description": "New subject for the task", |
| 81 | + "type": "string" |
| 82 | + }, |
| 83 | + "description": { |
| 84 | + "description": "New description for the task", |
| 85 | + "type": "string" |
| 86 | + }, |
| 87 | + "activeForm": { |
| 88 | + "description": "Present continuous form shown in spinner when in_progress (e.g., \"Running tests\")", |
| 89 | + "type": "string" |
| 90 | + }, |
| 91 | + "status": { |
| 92 | + "description": "New status for the task", |
| 93 | + "anyOf": [ |
| 94 | + { |
| 95 | + "type": "string", |
| 96 | + "enum": [ |
| 97 | + "pending", |
| 98 | + "in_progress", |
| 99 | + "completed" |
| 100 | + ] |
| 101 | + }, |
| 102 | + { |
| 103 | + "type": "string", |
| 104 | + "const": "deleted" |
| 105 | + } |
| 106 | + ] |
| 107 | + }, |
| 108 | + "addBlocks": { |
| 109 | + "description": "Task IDs that this task blocks", |
| 110 | + "type": "array", |
| 111 | + "items": { |
| 112 | + "type": "string" |
| 113 | + } |
| 114 | + }, |
| 115 | + "addBlockedBy": { |
| 116 | + "description": "Task IDs that block this task", |
| 117 | + "type": "array", |
| 118 | + "items": { |
| 119 | + "type": "string" |
| 120 | + } |
| 121 | + }, |
| 122 | + "owner": { |
| 123 | + "description": "New owner for the task", |
| 124 | + "type": "string" |
| 125 | + }, |
| 126 | + "metadata": { |
| 127 | + "description": "Metadata keys to merge into the task. Set a key to null to delete it.", |
| 128 | + "type": "object", |
| 129 | + "propertyNames": { |
| 130 | + "type": "string" |
| 131 | + }, |
| 132 | + "additionalProperties": {} |
| 133 | + } |
| 134 | + }, |
| 135 | + "required": [ |
| 136 | + "taskId" |
| 137 | + ], |
| 138 | + "additionalProperties": false |
| 139 | + } |
| 140 | +} |
| 141 | +
|
| 142 | +demo |
| 143 | +{ |
| 144 | + "type": "tool_use", |
| 145 | + "id": "toolu_vrtx_01L5UCcmecgjX7jLRh6KXMrt", |
| 146 | + "name": "TaskUpdate", |
| 147 | + "input": { |
| 148 | + "taskId": "2", |
| 149 | + "addBlockedBy": [ |
| 150 | + "1" |
| 151 | + ] |
| 152 | + } |
| 153 | +} |
| 154 | +
|
| 155 | +{ |
| 156 | + "tool_use_id": "toolu_vrtx_01L5UCcmecgjX7jLRh6KXMrt", |
| 157 | + "type": "tool_result", |
| 158 | + "content": "Updated task #2 blockedBy" |
| 159 | +} |
| 160 | +
|
| 161 | +
|
| 162 | +
|
| 163 | +{ |
| 164 | + "type": "tool_use", |
| 165 | + "id": "call_eerrv48i3u7jmzsa3tt147fw", |
| 166 | + "name": "TaskUpdate", |
| 167 | + "input": { |
| 168 | + "taskId": "26", |
| 169 | + "status": "deleted" |
| 170 | + } |
| 171 | +} |
| 172 | +
|
| 173 | +{ |
| 174 | + "tool_use_id": "call_eerrv48i3u7jmzsa3tt147fw", |
| 175 | + "type": "tool_result", |
| 176 | + "content": "Updated task #26 deleted" |
| 177 | +} |
| 178 | +
|
| 179 | +``` |
| 180 | + |
| 181 | +# TaskList |
| 182 | + |
| 183 | +``` |
| 184 | +{ |
| 185 | + "name": "TaskList", |
| 186 | + "description": "Use this tool to list all tasks in the task list.\n\n## When to Use This Tool\n\n- To see what tasks are available to work on (status: 'pending', no owner, not blocked)\n- To check overall progress on the project\n- To find tasks that are blocked and need dependencies resolved\n- After completing a task, to check for newly unblocked work or claim the next available task\n- **Prefer working on tasks in ID order** (lowest ID first) when multiple tasks are available, as earlier tasks often set up context for later ones\n\n## Output\n\nReturns a summary of each task:\n- **id**: Task identifier (use with TaskGet, TaskUpdate)\n- **subject**: Brief description of the task\n- **status**: 'pending', 'in_progress', or 'completed'\n- **owner**: Agent ID if assigned, empty if available\n- **blockedBy**: List of open task IDs that must be resolved first (tasks with blockedBy cannot be claimed until dependencies resolve)\n\nUse TaskGet with a specific task ID to view full details including description and comments.\n", |
| 187 | + "input_schema": { |
| 188 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 189 | + "type": "object", |
| 190 | + "properties": {}, |
| 191 | + "additionalProperties": false |
| 192 | + } |
| 193 | +} |
| 194 | +
|
| 195 | +demo |
| 196 | +
|
| 197 | +{ |
| 198 | + "type": "tool_use", |
| 199 | + "id": "call_08w8phak0uqu1aot9v2t931e", |
| 200 | + "name": "TaskList", |
| 201 | + "input": {} |
| 202 | +} |
| 203 | +
|
| 204 | +{ |
| 205 | + "tool_use_id": "call_08w8phak0uqu1aot9v2t931e", |
| 206 | + "type": "tool_result", |
| 207 | + "content": "#36 [pending] 实现文章编辑API [blocked by #32]\n#41 [pending] 实现文章发布页面 [blocked by #38, #33]\n#40 [pending] 实现文章详情页面 [blocked by #38, #35]\n#37 [pending] 实现文章删除API(软删除) [blocked by #32]\n#30 [pending] 创建项目基础结构 [blocked by #29]\n#31 [pending] 设计数据库模型 [blocked by #30]\n#45 [pending] 添加交互动画效果 [blocked by #44]\n#32 [pending] 实现后端API基础框架 [blocked by #30, #31]\n#33 [pending] 实现文章发布API [blocked by #32]\n#44 [pending] 实现响应式设计 [blocked by #39, #40, #41, #42]\n#29 [pending] 项目规划和技术选型\n#34 [pending] 实现文章列表查询API [blocked by #32]\n#38 [pending] 创建前端页面框架 [blocked by #30]\n#43 [pending] 添加全局CSS样式和主题 [blocked by #38]\n#42 [pending] 实现文章管理页面 [blocked by #38, #34, #36, #37]\n#39 [pending] 实现文章列表页面 [blocked by #38, #34]\n#35 [pending] 实现文章详情查询API [blocked by #32]" |
| 208 | +} |
| 209 | +``` |
| 210 | + |
| 211 | +# TaskGet |
| 212 | + |
| 213 | +``` |
| 214 | +{ |
| 215 | + "name": "TaskGet", |
| 216 | + "description": "Use this tool to retrieve a task by its ID from the task list.\n\n## When to Use This Tool\n\n- When you need the full description and context before starting work on a task\n- To understand task dependencies (what it blocks, what blocks it)\n- After being assigned a task, to get complete requirements\n\n## Output\n\nReturns full task details:\n- **subject**: Task title\n- **description**: Detailed requirements and context\n- **status**: 'pending', 'in_progress', or 'completed'\n- **blocks**: Tasks waiting on this one to complete\n- **blockedBy**: Tasks that must complete before this one can start\n\n## Tips\n\n- After fetching a task, verify its blockedBy list is empty before beginning work.\n- Use TaskList to see all tasks in summary form.\n", |
| 217 | + "input_schema": { |
| 218 | + "$schema": "https://json-schema.org/draft/2020-12/schema", |
| 219 | + "type": "object", |
| 220 | + "properties": { |
| 221 | + "taskId": { |
| 222 | + "description": "The ID of the task to retrieve", |
| 223 | + "type": "string" |
| 224 | + } |
| 225 | + }, |
| 226 | + "required": [ |
| 227 | + "taskId" |
| 228 | + ], |
| 229 | + "additionalProperties": false |
| 230 | + } |
| 231 | +} |
| 232 | +
|
| 233 | +demo |
| 234 | +
|
| 235 | +{ |
| 236 | + "type": "tool_use", |
| 237 | + "id": "call_2vgh9q2xlri7qg07dmi34obx", |
| 238 | + "name": "TaskGet", |
| 239 | + "input": { |
| 240 | + "taskId": "38" |
| 241 | + } |
| 242 | +} |
| 243 | +
|
| 244 | +{ |
| 245 | + "tool_use_id": "call_2vgh9q2xlri7qg07dmi34obx", |
| 246 | + "type": "tool_result", |
| 247 | + "content": "Task #38: 创建前端页面框架\nStatus: pending\nDescription: 搭建前端项目,配置路由,创建基础布局组件(头部、导航、底部)。\nBlocked by: #30\nBlocks: #39, #40, #41, #42, #43" |
| 248 | +} |
| 249 | +
|
| 250 | +``` |
| 251 | + |
| 252 | +# TaskData |
| 253 | + |
| 254 | +``` |
| 255 | +{ |
| 256 | + "id": "29", |
| 257 | + "subject": "项目规划和技术选型", |
| 258 | + "description": "确定项目技术栈(前端框架、后端框架、数据库),设计整体架构,规划目录结构。", |
| 259 | + "activeForm": "规划项目技术栈和架构", |
| 260 | + "status": "completed", |
| 261 | + "blocks": [ |
| 262 | + "30" |
| 263 | + ], |
| 264 | + "blockedBy": [] |
| 265 | +} |
| 266 | +
|
| 267 | +{ |
| 268 | + "id": "30", |
| 269 | + "subject": "创建项目基础结构", |
| 270 | + "description": "初始化项目,创建必要的目录结构,配置开发环境,安装依赖包。", |
| 271 | + "activeForm": "创建项目基础结构", |
| 272 | + "status": "completed", |
| 273 | + "blocks": [ |
| 274 | + "31", |
| 275 | + "32", |
| 276 | + "38" |
| 277 | + ], |
| 278 | + "blockedBy": [ |
| 279 | + "29" |
| 280 | + ] |
| 281 | +} |
| 282 | +
|
| 283 | +{ |
| 284 | + "id": "31", |
| 285 | + "subject": "设计数据库模型", |
| 286 | + "description": "设计文章数据表结构,包含标题、内容、作者、发布时间、分类等字段。创建数据库迁移文件。", |
| 287 | + "activeForm": "设计数据库模型", |
| 288 | + "status": "in_progress", |
| 289 | + "blocks": [ |
| 290 | + "32" |
| 291 | + ], |
| 292 | + "blockedBy": [ |
| 293 | + "30" |
| 294 | + ] |
| 295 | +} |
| 296 | +
|
| 297 | +{ |
| 298 | + "id": "32", |
| 299 | + "subject": "实现后端API基础框架", |
| 300 | + "description": "搭建后端服务器,配置路由,创建基础API框架,设置数据库连接。", |
| 301 | + "activeForm": "实现后端API基础框架", |
| 302 | + "status": "pending", |
| 303 | + "blocks": [ |
| 304 | + "33", |
| 305 | + "34", |
| 306 | + "35", |
| 307 | + "36", |
| 308 | + "37" |
| 309 | + ], |
| 310 | + "blockedBy": [ |
| 311 | + "30", |
| 312 | + "31" |
| 313 | + ] |
| 314 | +} |
| 315 | +``` |
0 commit comments