do-task
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDo Task
Do Task
Overview
概述
Implement a specific action item from by its ID. Read the task's full context from the roadmap, research as needed, clarify ambiguities with the user, execute the implementation, and deliver a test plan.
docs/ROADMAP.md根据ID执行中的具体行动项。从路线图中读取任务的完整上下文,根据需要开展调研,与用户澄清歧义点,执行实现工作,并交付测试计划。
docs/ROADMAP.mdWorkflow
工作流程
Step 1: Parse and Load Task
步骤1:解析并加载任务
Extract the task ID from the user's arguments (e.g., , , ).
1.12.33.1Read from the current working directory. If the file does not exist, check for at the project root. If neither exists, inform the user and stop.
docs/ROADMAP.mdROADMAP.mdLocate the action item matching the given ID (the heading). Extract:
### X.Y- Phase title — the heading the task belongs to
## Phase N: ... - Task title — the heading text
### X.Y ... - Description — the content
**Description**: - Requirements — the checklist items
**Requirements**: - Implementation Notes — the content
**Implementation Notes**:
If the task ID is not found, list all available task IDs with their titles and ask the user to pick one.
If the task belongs to the Future phase (which uses Description/Features/Rationale instead of Description/Requirements/Implementation Notes), inform the user that Future-phase items are high-level directions, not scoped tasks. Offer to help break it down into concrete action items instead.
从用户参数中提取任务ID(例如、、)。
1.12.33.1读取当前工作目录下的文件。如果该文件不存在,则检查项目根目录下的。若两者都不存在,则告知用户并终止操作。
docs/ROADMAP.mdROADMAP.md找到与给定ID匹配的行动项(即标题),提取以下内容:
### X.Y- 阶段标题 —— 该任务所属的标题
## Phase N: ... - 任务标题 —— 标题文本
### X.Y ... - 描述 —— 对应的内容
**Description**: - 需求 —— 对应的清单项
**Requirements**: - 实现说明 —— 对应的内容
**Implementation Notes**:
如果未找到任务ID,则列出所有可用的任务ID及其标题,并请用户选择其中一个。
如果该任务属于Future阶段(该阶段使用Description/Features/Rationale而非Description/Requirements/Implementation Notes),则告知用户未来阶段的条目是高层级方向,而非已明确范围的任务,同时可协助将其拆解为具体的行动项。
Step 2: Load Project Context
步骤2:加载项目上下文
Read the following files if they exist, to understand the full project context:
- — architecture, tech stack, data models, key decisions
docs/SPEC.md - — design tokens, component styling (for frontend tasks)
docs/STYLES.md
Also review the existing codebase structure to understand what has already been built. Use and to survey the project directory — check for existing files, components, utilities, and patterns that the task should build on or integrate with.
GlobRead若以下文件存在,则读取这些文件以全面了解项目上下文:
- —— 架构、技术栈、数据模型、关键决策
docs/SPEC.md - —— 设计标记、组件样式(针对前端任务)
docs/STYLES.md
同时查看现有代码库结构,了解已完成的开发内容。使用和工具调研项目目录——检查现有文件、组件、工具类和模式,确保任务的实现能够基于或整合这些内容。
GlobReadStep 3: Clarify Ambiguities
步骤3:澄清歧义点
Before writing any code, evaluate whether the task's requirements and implementation notes are clear enough to proceed confidently. Consider:
- Are there technical implementation choices that could go multiple ways?
- Are there UI/UX decisions not specified in the requirements or STYLES.md?
- Are there concerns, trade-offs, or risks worth surfacing?
- Do the requirements reference something that doesn't exist yet or is unclear?
If anything is unclear, use the tool to ask focused follow-up questions. Do not guess on ambiguous requirements — ask.
AskUserQuestionIf everything is clear, proceed without asking unnecessary questions.
在编写任何代码之前,评估任务的需求和实现说明是否足够清晰,以便顺利推进。需考虑以下几点:
- 是否存在多种技术实现方案可选?
- 需求或STYLES.md中是否未明确UI/UX决策?
- 是否有需要提出的关注点、权衡因素或风险?
- 需求中是否引用了尚未存在或含义模糊的内容?
若存在任何模糊点,使用工具提出针对性的跟进问题。请勿对模糊的需求进行猜测——务必询问。
AskUserQuestion若所有内容都清晰明确,则无需额外提问,直接推进。
Step 4: Research (If Needed)
步骤4:调研(如需)
If the task involves unfamiliar APIs, libraries, patterns, or integrations mentioned in the implementation notes, conduct targeted research using to understand:
WebSearch- API usage and current best practices
- Library-specific patterns and gotchas
- Integration approaches
Keep research focused on what is needed for this specific task.
如果任务涉及实现说明中提到的不熟悉的API、库、模式或集成,使用开展针对性调研,以了解:
WebSearch- API使用方法和当前最佳实践
- 特定库的模式和注意事项
- 集成方法
调研需聚焦于完成当前任务所需的内容。
Step 5: Implement
步骤5:执行实现
Execute the task by working through each requirement in the checklist. Follow existing project patterns and conventions discovered in Step 2.
Implementation rules:
- Address every requirement item — do not skip any
- [ ] - Follow the guidance in Implementation Notes
- Match existing code style, naming conventions, and patterns in the project
- Apply styles from when the task involves UI
docs/STYLES.md - Keep changes focused on this task — do not refactor unrelated code
- Write clean, working code — not placeholder stubs
通过逐一处理清单中的每个需求来执行任务。遵循步骤2中发现的现有项目模式和规范。
实现规则:
- 处理每一个需求项——请勿跳过任何一项
- [ ] - 遵循实现说明中的指导
- 匹配项目中现有的代码风格、命名规范和模式
- 当任务涉及UI时,应用中的样式
docs/STYLES.md - 保持变更聚焦于当前任务——请勿重构无关代码
- 编写简洁、可运行的代码——不要使用占位符存根
Step 6: Test Plan
步骤6:测试计划
After completing the implementation, provide a concise, step-by-step test plan the user can follow to verify the task works end-to-end.
Format the test plan as:
undefined完成实现后,提供一份简洁的分步测试计划,供用户验证任务是否端到端正常运行。
测试计划格式如下:
undefinedTest Plan for X.Y: <Task Title>
Test Plan for X.Y: <Task Title>
- <Action to take> → Expected: <What the user should see or experience>
- <Next action> → Expected: <Expected result>
...
Each step should be a concrete action (run a command, navigate to a URL, click something, check a value) with a one-liner describing the expected outcome.
The test plan should cover:
- Happy path verification of each requirement
- Edge cases mentioned in the requirements or implementation notes
- Any error states or fallbacks the task implements- <Action to take> → Expected: <What the user should see or experience>
- <Next action> → Expected: <Expected result>
...
每个步骤应是具体的操作(运行命令、导航到URL、点击内容、检查值),并附带一行描述预期结果的说明。
测试计划应涵盖:
- 每个需求的正常路径验证
- 需求或实现说明中提到的边缘情况
- 任务实现的任何错误状态或降级处理