create-tasks
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate Tasks
创建任务
Creates well-formed tasks that provide large amounts of contexts so that engineers that weren't in conversations can implement the task without any prior knowledge and without asking questions.
Tasks should be created using the tools and documentation conventions in the project the skills is being applied to. If the conventions are not clear, ask the user to clarify and then document them.
创建信息完整的规范任务,确保即使未参与前期沟通的工程师也能无需前置知识、无需额外提问即可落地实现。
任务创建需遵循当前项目所使用的工具和文档规范。若规范不明确,请先询问用户确认并记录规范内容。
What Engineers Need
工程师所需信息
Every task must provide:
- What they're building (deliverable)
- Why it matters (context)
- Key decisions and principles they must follow
- Acceptance criteria
- Dependencies
- Related code/patterns
- How to verify it works
每个任务必须包含以下内容:
- 需开发的内容(交付物)
- 任务的重要性(背景)
- 必须遵循的关键决策与原则
- 验收准则
- 依赖项
- 参考代码/实现模式
- 验证方法
Before Creating Tasks: Slice First
创建任务前:先切片拆分
🚨 NEVER create a task without validating its size first. A PRD deliverable is NOT automatically a task—it may be an epic that needs splitting.
🚨 绝对不要在未验证任务规模的情况下直接创建任务。PRD中的交付物并非天然就是可执行任务——它可能是一个需要拆分的史诗(Epic)。
Example Mapping Discovery
示例映射法(Example Mapping)
🚨 Never copy PRD bullets verbatim. Use Example Mapping to transform them into executable specifications.
| Card | What You Do |
|---|---|
| 🟡 Story | State the deliverable in one specific sentence |
| 🔵 Rules | List every business rule/constraint (3-4 max per task) |
| 🟢 Examples | For EACH rule: happy path + edge cases + error cases |
| 🔴 Questions | Surface unknowns → resolve or spike first |
The Examples (🟢) ARE your acceptance criteria. Write them in Given-When-Then format:
Given [context/precondition]
When [action/trigger]
Then [expected outcome]Edge case checklist — for each rule, systematically consider:
| Category | Check For |
|---|---|
| Input | Empty, null, whitespace, boundaries, invalid format, special chars, unicode, too long |
| State | Concurrent updates, race conditions, invalid sequences, already exists, doesn't exist |
| Errors | Network failure, timeout, partial failure, invalid permissions, quota exceeded |
Example: PRD says "User can search products"
Rules identified: (1) Search by title, (2) Pagination, (3) Empty state
For Rule 1 alone, edge case thinking yields:
- Given products exist → When search → Then results (happy path)
- Given no matches → When search → Then empty set
- Given empty search term → When submit → Then validation error OR all products? (🔴 Question!)
- Given special chars in search → When search → Then handled safely
🚨 切勿直接复制PRD中的条目。使用示例映射法将PRD内容转化为可执行的规范。
| 卡片类型 | 操作说明 |
|---|---|
| 🟡 用户故事 | 用一句具体的话描述交付物 |
| 🔵 规则 | 列出所有业务规则/约束(每个任务最多3-4条) |
| 🟢 示例 | 针对每条规则:覆盖正常场景 + 边界场景 + 异常场景 |
| 🔴 疑问 | 提出未知问题 → 先解决或做技术调研 |
🟢示例即为验收准则。需采用Given-When-Then格式编写:
Given [前置条件/背景]
When [操作/触发事件]
Then [预期结果]边界场景检查清单 —— 针对每条规则,系统地考虑以下类别:
| 类别 | 检查项 |
|---|---|
| 输入 | 空值、Null、空白字符、边界值、无效格式、特殊字符、Unicode、过长内容 |
| 状态 | 并发更新、竞态条件、无效序列、已存在、不存在 |
| 错误 | 网络故障、超时、部分失败、权限不足、配额超限 |
示例: PRD要求“用户可搜索商品”
提炼出的规则:(1) 按标题搜索,(2) 分页,(3) 空状态
仅针对规则1,边界场景分析可得到:
- Given 存在商品 → When 执行搜索 → Then 返回结果(正常场景)
- Given 无匹配结果 → When 执行搜索 → Then 返回空集合
- Given 搜索词为空 → When 提交搜索 → Then 显示验证错误还是返回全部商品?(🔴 疑问!)
- Given 搜索词含特殊字符 → When 执行搜索 → Then 安全处理
Splitting Signals (Task Too Big)
任务过大的判断信号
If ANY of these are true, STOP and split:
- ❌ Can't describe in a specific, action-oriented title
- ❌ Would take more than 1 day
- ❌ Title requires "and" or lists multiple things
- ❌ Has multiple clusters of acceptance criteria
- ❌ Cuts horizontally (all DB, then all API, then all UI)
- ❌ PRD calls it "full implementation" or "complete system"
若出现以下任意一种情况,立即停止并拆分任务:
- ❌ 无法用具体的、面向动作的标题描述
- ❌ 预计耗时超过1天
- ❌ 标题中包含“和”或列出多项内容
- ❌ 存在多组验收准则
- ❌ 横向拆分(先做所有DB开发,再做所有API,最后做所有UI)
- ❌ PRD中称为“完整实现”或“全系统”
SPIDR Splitting Techniques
SPIDR拆分技巧
When you need to split, use these techniques:
| Technique | Split By | Example |
|---|---|---|
| Paths | Different user flows | "Pay with card" vs "Pay with PayPal" |
| Interfaces | Different UIs/platforms | "Desktop search" vs "Mobile search" |
| Data | Different data types | "Upload images" vs "Upload videos" |
| Rules | Different business rules | "Basic validation" vs "Premium validation" |
| Spikes | Unknown areas | "Research payment APIs" before "Implement payments" |
需要拆分任务时,可采用以下技巧:
| 技巧 | 拆分维度 | 示例 |
|---|---|---|
| Paths(流程) | 不同用户流程 | “银行卡支付” vs “PayPal支付” |
| Interfaces(界面) | 不同UI/平台 | “桌面端搜索” vs “移动端搜索” |
| Data(数据) | 不同数据类型 | “上传图片” vs “上传视频” |
| Rules(规则) | 不同业务规则 | “基础校验” vs “高级校验” |
| Spikes(调研) | 未知领域 | “调研支付API” 先于 “实现支付功能” |
Vertical Slices Only
仅采用垂直切片
Every task must be a vertical slice—cutting through all layers needed for ONE specific thing:
✅ VERTICAL (correct):
"Add search by title" → touches UI + API + DB for ONE search type
❌ HORIZONTAL (wrong):
"Build search UI" → "Build search API" → "Build search DB"每个任务必须是垂直切片——覆盖完成某一具体功能所需的所有层级:
✅ 垂直切片(正确):
“为商品搜索添加价格区间筛选” → 涉及UI + API + DB,针对单一搜索类型
❌ 横向切片(错误):
“开发搜索UI” → “开发搜索API” → “开发搜索DB”Task Naming
任务命名
Formula
命名公式
[Action verb] [specific object] [outcome/constraint][动作动词] [具体对象] [结果/约束]Good Names
优秀命名示例
- "Add price range filter to product search"
- "Implement POST /api/users endpoint with email validation"
- "Display product recommendations on home page"
- "Enable CSV export for transaction history"
- "Validate required fields on checkout form"
- “为商品搜索添加价格区间筛选”
- “实现带邮箱校验的POST /api/users接口”
- “在首页展示商品推荐”
- “启用交易记录的CSV导出功能”
- “校验结账表单的必填字段”
Rejected Patterns
禁用命名模式
🚨 NEVER use these—they signal an epic, not a task:
| Pattern | Why It's Wrong |
|---|---|
| "Full implementation of X" | Epic masquerading as task |
| "Build the X system" | Too vague, no specific deliverable |
| "Complete X feature" | Undefined scope |
| "Implement X" (alone) | Missing specificity |
| "X and Y" | Two tasks combined |
| "Set up X infrastructure" | Horizontal slice |
If you catch yourself writing one of these, STOP and apply SPIDR.
🚨 绝对不要使用以下命名——它们代表的是史诗(Epic),而非任务:
| 模式 | 问题所在 |
|---|---|
| “完整实现X功能” | 以任务伪装的史诗 |
| “构建X系统” | 过于模糊,无具体交付物 |
| “完成X功能” | 范围不明确 |
| “实现X”(单独使用) | 缺乏具体性 |
| “X和Y” | 合并了两个任务 |
| “搭建X基础设施” | 横向切片 |
若发现自己使用了上述命名,立即停止并应用SPIDR技巧拆分。
Task Size Validation (INVEST)
任务规模验证(INVEST原则)
Every task MUST pass INVEST before creation:
| Criterion | Question | Fail = Split |
|---|---|---|
| Independent | Does it deliver value alone? | Depends on other incomplete tasks |
| Negotiable | Can scope be discussed? | Rigid, all-or-nothing |
| Valuable | Does user/stakeholder see benefit? | Only technical benefit |
| Estimable | Can you size it confidently? | "Uh... maybe 3 days?" |
| Small | Fits in 1 day? | More than 1 day |
| Testable | Has concrete acceptance criteria? | Vague or missing criteria |
创建任务前,必须通过INVEST原则验证:
| 准则 | 验证问题 | 不通过则需拆分 |
|---|---|---|
| Independent(独立) | 能否独立交付价值? | 依赖其他未完成的任务 |
| Negotiable(可协商) | 范围是否可讨论? | 僵化,要么全做要么不做 |
| Valuable(有价值) | 用户/利益相关者能否看到收益? | 仅具备技术价值 |
| Estimable(可估算) | 能否自信地评估工作量? | “呃...大概3天?” |
| Small(小粒度) | 能否在1天内完成? | 耗时超过1天 |
| Testable(可测试) | 是否有明确的验收准则? | 准则模糊或缺失 |
Hard Limits
硬性限制
- Max 1 day of work — if longer, split it
- Must be vertical — touches all layers for ONE thing
- Must be demoable — when done, you can show it working
- 最大工作量为1天 —— 若超过,必须拆分
- 必须是垂直切片 —— 覆盖某一功能的所有层级
- 必须可演示 —— 完成后可展示功能运行效果
Task Template
任务模板
markdown
undefinedmarkdown
undefinedDeliverable: [What user/stakeholder sees]
交付物: [用户/利益相关者可见的内容]
Context
背景
[Where this came from and why it matters. PRD reference, bug report, conversation summary—whatever helps engineer understand WHY. You MUST provide the specific file path or URL for any referenced files like a PRD of bug report - don't assume the engineer knows where things are stored]
[任务来源及重要性。PRD参考链接、Bug报告、沟通摘要——任何能帮助工程师理解WHY的信息。必须提供PRD或Bug报告等参考文件的具体文件路径或URL,不要假设工程师知道文件存储位置]
Key Decisions and principles
关键决策与原则
- [Decision/Principle] — [rationale]
- [决策/原则] —— [理由]
Delivers
交付内容
[Specific outcome in user terms]
[用户视角的具体结果]
Acceptance Criteria
验收准则
- Given [context] When [action] Then [outcome]
- Given [背景] When [操作] Then [结果]
Dependencies
依赖项
- [What must exist first]
- [需先完成的前置内容]
Related Code
参考代码
- — [what pattern/code to use]
path/to/file
- —— [可复用的模式/代码]
path/to/file
Verification
验证方法
[Specific commands/tests that prove it works]
undefined[可证明功能正常的具体命令/测试]
undefinedProcess
流程
- Slice first — Apply Example Mapping. If task has >3-4 rules or fails splitting signals, use SPIDR to break it down.
- Discover acceptance criteria — For each rule: generate happy path, edge cases, error cases using the checklist. Write as Given-When-Then. Surface questions.
- Name it — Write a specific, action-oriented title. If you can't, the task isn't clear enough.
- Validate size — Must pass INVEST. Max 1 day. Must be vertical slice.
- Gather context (from PRD, conversation, bug report, etc.)
- Identify key decisions that affect implementation
- Find related code/patterns in the codebase
- Specify verification commands
- Output task using template
- 先切片拆分 —— 应用示例映射法。若任务包含超过3-4条规则或符合任务过大的判断信号,使用SPIDR技巧拆分。
- 确定验收准则 —— 针对每条规则:利用检查清单生成正常场景、边界场景、异常场景的示例。采用Given-When-Then格式编写。提出疑问。
- 命名任务 —— 编写具体的、面向动作的标题。若无法做到,说明任务不够明确。
- 验证规模 —— 必须通过INVEST原则验证。最大工作量1天。必须是垂直切片。
- 收集背景信息(来自PRD、沟通记录、Bug报告等)
- 识别影响实现的关键决策
- 在代码库中找到可参考的代码/模式
- 明确验证命令
- 使用模板输出任务
Checkpoint
检查点
Before finalizing any task, verify ALL of these:
| Check | Question | If No |
|---|---|---|
| Size | Is this ≤1 day of work? | Split using SPIDR |
| Name | Is the title specific and action-oriented? | Rewrite using formula |
| Vertical | Does it cut through all layers for ONE thing? | Restructure as vertical slice |
| INVEST | Does it pass all 6 criteria? | Fix the failing criterion |
| Context | Can an engineer implement without asking questions? | Add what's missing |
🚨 If the PRD says "full implementation" or similar, you MUST split it. Creating such a task is a critical failure.
最终确定任务前,需验证以下所有项:
| 检查项 | 验证问题 | 若否则需 |
|---|---|---|
| 规模 | 工作量是否≤1天? | 用SPIDR拆分 |
| 命名 | 标题是否具体且面向动作? | 用公式重写 |
| 垂直切片 | 是否覆盖某一功能的所有层级? | 重构为垂直切片 |
| INVEST | 是否通过所有6项准则? | 修复不通过的准则 |
| 背景信息 | 工程师能否无需提问即可实现? | 补充缺失信息 |
🚨 若PRD中提到“完整实现”等类似表述,必须拆分任务。直接创建此类任务属于严重错误。