name: to-tickets description: "将计划、规格或当前对话拆成一组曳光弹式任务,各自声明阻塞依赖,并发布到已配置系统:本地每任务一文件、依赖用文字;真实工单系统优先用原生阻塞链接。" disable-model-invocation: true
把大规格拆成可独立验证的任务
一个好任务是一条窄而完整的行为路径。依赖关系决定谁可以开始,不能用编号顺序代替真实依赖。
还不清楚 Skill、Agent、安装和调用?先读 从零开始的6节入门课。
先把必要的概念讲清楚
本课教你把完整需求拆成可独立领取、验证并逐步集成的任务。最重要的不是拆得多细,而是每片是否交付一个可观察行为、依赖关系是否真实。
下面是老师补充的入门说明;原作者的要求保留在中英对照正文中。所有例子均为帮助理解而构造的教学情境。
issue / ticket|问题或任务工单
跟踪一项需求、缺陷、调查或实施任务的记录,通常有标题、正文、状态和引用。issue 和 ticket 在这些文档里经常都指工单,具体含义由上下文决定。工单写着“已完成”只是状态声明,还需要相应证据支持。
vertical slice / tracer bullet|端到端的小切片
选择一个很窄、却能穿过所需各层的可验证行为。例如只支持收藏一节课,但页面、接口、保存与测试都连通。tracer bullet 借用曳光弹比喻,用一次小而真实的贯通验证整条路径,发现的问题影响下一片。不是先把所有页面做完再写全部后端。
acceptance criteria|验收条件
明确规定结果满足什么才算完成,应尽量可观察、可检验。例如“收藏后刷新页面仍可见,重复点击只保留一条”。“体验很好”“代码完善”没有明确边界,难以判断。验收条件关注结果,不是把实现步骤换个标题列出来。
interface / API|接口
使用者与一项能力交互时遵循的约定,包括可调用什么、传入什么、得到什么、失败怎样表示。接口可以是程序函数,也可以是网络请求。创建收藏接口接收用户和课程信息、返回收藏结果;它不需要向调用者暴露数据库表结构。这里的接口通常不是指页面外观。 本教材涉及更广义的“接口”时,还包括错误、调用顺序和约束等使用约定;不能把接口一概等同于网络 API。
schema|数据结构与约束
描述数据有哪些字段、类型、关系和限制。例如收藏包含用户 ID、课程 ID、创建时间,并要求同一用户与课程组合唯一。改 schema 可能影响存储、接口和旧数据,因此它是工程决定,不只是给变量换名字。
CI|持续集成检查
把修改提交到共享流程时,自动运行测试、类型检查等约定检查,尽早发现集成问题。绿灯表示配置的检查通过,不代表所有需求都正确;红灯也可能由环境故障导致,应看具体证据。需要先检查“配置了什么”,才能解释绿灯的意义。
refactoring|重构
在保持约定外部行为的前提下改善内部结构,例如合并重复逻辑、调整职责归属。用户仍能完成同样操作,但代码更容易理解和修改。重构不等于顺便加新需求;测试帮助证明外部行为未被意外改变。
读原文,理解每一步为什么这样做
左右内容按小节对应;窄屏先中文、后英文。两种语言均完整展示,对应讲解紧接在小节之后。译文传达原文要求;老师讲解补充概念、原因、例子与适用边界。
name: to-tickets description: Break a plan, spec, or the current conversation into a set of tracer-bullet tickets, each declaring its blocking edges, published to the configured tracker (edges as text in one file per ticket locally, or native blocking links on a real tracker). disable-model-invocation: true
把计划和讨论拆成工单
将计划、规格或当前对话拆成一组工单。每张工单是一条范围很小、但从输入到结果完整可验证的功能路径,即“曳光弹式纵向切片”。同时写明哪些其他工单必须先完成,它才能开始。
应已提供工单系统和分诊标签说明;如果没有,告诉用户运行 /setup-matt-pocock-skills。
To Tickets
Break a plan, spec, or conversation into a set of tickets: tracer-bullet vertical slices, each declaring the tickets that block it.
The issue tracker and triage label vocabulary should have been provided to you. If not, tell the user to run /setup-matt-pocock-skills.
工作过程
Process
1. 收集背景
从当前对话已有材料开始。如果用户提供规格路径、工单编号或网址,就获取资料,完整阅读正文和评论。
1. Gather context
Work from whatever is already in the conversation context. If the user passes a reference (a spec path, an issue number or URL) as an argument, fetch it and read its full body and comments.
任务拆分必须沿用已经确认的需求
来源可能是当前对话,也可能是已有规格工单。读取正文和评论,是因为后来澄清常写在评论中,只看标题可能遗漏最新决定。
例如最初要求下载教材,评论明确改为网页直接阅读。拆分仍围绕下载功能,就算工单写得再规范也会做错目标。
探索代码时寻找可复用部分和必要的预重构。预重构是先让后续修改更容易,例如集中已有重复的收藏判断;它不应变成与本需求无关的大规模清理。
2. 查看代码现状(可选)
如果还没探索代码库,就先查看当前实现。工单标题和描述使用项目业务词汇,并遵循涉及范围的架构决策记录。
寻找可以先做的准备性重构,使后续实现更容易。原则是“先把改动变得容易,再完成这个已经变容易的改动”。
2. Explore the codebase (optional)
If you have not already explored the codebase, do so to understand the current state of the code. Ticket titles and descriptions should use the project's domain glossary vocabulary, and respect ADRs in the area you're touching.
Look for opportunities to prefactor the code to make the implementation easier. "Make the change easy, then make the easy change."
3. 拟定纵向工单
按曳光弹式方式拆分工作:
<vertical-slice-rules>
- 每一项范围窄,但应贯穿所需的数据结构、接口、页面和测试,形成完整路径。不要只完成某一个技术层。
- 完成后能够独立演示或验证。
- 工作量适合在一个全新的上下文窗口中完成。
- 必需的准备性重构先做。
</vertical-slice-rules>
给每张工单列出前置依赖:其他哪些工单没有完成,它就不能开始。没有依赖的可以立即开始。
大范围重构是纵向切分的例外。 例如给数据库列改名,或者改变公共符号的类型。一个机械改动可能影响整个代码库,导致成千上万个调用位置同时出错,无法找到单独提交就能通过检查的功能切片。
这时按“扩展—迁移—收缩”安排。先在旧形式旁边增加新形式,保持现有代码可用。再按影响范围分批迁移调用方,例如按软件包或目录分批;每批一张工单,都依赖扩展步骤。旧形式保留期间,每一批都应保持 CI 自动检查通过。最后,没有调用方再使用旧形式时,删除它;删除工单依赖全部迁移批次。
如果连各批次都无法独立通过检查,保留先后顺序,但让它们在一个集成分支汇合。所有批次共同成为最终“集成并验证”工单的前置条件。此时只承诺最终集成检查通过,不承诺每个中间批次都通过。
3. Draft vertical slices
Break the work into tracer bullet tickets.
<vertical-slice-rules>
- Each slice cuts a narrow but COMPLETE path through every layer (schema, API, UI, tests): vertical, NOT a horizontal slice of one layer
- A completed slice is demoable or verifiable on its own
- Each slice is sized to fit in a single fresh context window
- Any prefactoring should be done first
</vertical-slice-rules>
Give each ticket its blocking edges: the other tickets that must complete before it can start. A ticket with no blockers can start immediately.
Wide refactors are the exception to vertical slicing. A wide refactor is one mechanical change (rename a column, retype a shared symbol) whose blast radius fans across the whole codebase, so a single edit breaks thousands of call sites at once and no vertical slice can land green. Don't force it into a tracer bullet; sequence it as expand–contract. First expand: add the new form beside the old so nothing breaks. Then migrate the call sites over in batches sized by blast radius (per package, per directory), each batch its own ticket blocked by the expand, keeping CI green batch to batch because the old form still exists. Finally contract: delete the old form once no caller remains, in a ticket blocked by every migrate batch. When even the batches can't stay green alone, keep the sequence but let them share an integration branch that all block a final integrate-and-verify ticket; green is promised only there.
纵向小切片:窄,但从头到尾连通
“先做全部页面、再做全部接口、最后测试”是按层横向拆分。页面阶段看起来完成很多,却不能实际保存任何东西,集成问题被拖到最后。
**纵向例子:**第一片只支持收藏一门课程,但页面点击、接口、保存和查询验证都连通;第二片增加取消收藏;第三片处理未登录提示。每片都有独立可展示结果。
不是每片必须机械修改所有层。已有接口能复用时,无需为了满足“端到端”而改数据库。端到端描述的是行为验证路径,不是文件修改数量。
收藏功能怎样拆,才不会到最后才发现各部分接不上?
小而完整的工单,应当交付可检查的用户行为。 例如第一张只做“点击收藏、保存、刷新仍显示已收藏”。它涉及多个技术层,但只完成一个很小的目标。
如果第一张只是建表,第二张只是写接口,第三张才做页面,那么前两张完成时,用户仍无法体验收藏。纵向切分让页面与数据保存更早一起接受验证。
依赖也必须写清楚。A 是识别用户,B 是保存该用户收藏,C 是显示收藏列表;B 依赖 A,C 依赖 B。未满足前提叫被阻塞,不等于程序报错。无依赖的其他工单则可以同时推进。
大范围改名是另一种情况。若把公共名称一次改掉会破坏许多调用方,就先保留新旧两种形式,再分批迁移,最后删除旧形式。这里的“扩展—收缩”处理兼容迁移,不是要求每个普通功能都增加这些步骤。
好工单需要使执行者知道做什么、为何必须等待、如何验收。只有标题和编号,还不足以让新会话独立执行。
4. 与用户核对拆分
用编号列表展示方案,每张包含:简短标题、必须先完成哪些工单,以及完成后会打通哪条完整行为。
询问工单大小是否合适,依赖是否真的必要,是否需要合并或进一步拆分。根据反馈调整,直到用户认可。
4. Quiz the user
Present the proposed breakdown as a numbered list. For each ticket, show:
- Title: short descriptive name
- Blocked by: which other tickets (if any) must complete first
- What it delivers: the end-to-end behaviour this ticket makes work
Ask the user:
- Does the granularity feel right? (too coarse / too fine)
- Are the blocking edges correct: does each ticket only depend on tickets that genuinely gate it?
- Should any tickets be merged or split further?
Iterate until the user approves the breakdown.
粒度与阻塞关系怎样判断
过粗的任务很久才产生反馈,过细的任务需要大量协调却无法独立验证。判断尺度可以问:这项完成后,能单独展示什么?其他人能否只读这张工单就接手?
“取消收藏”可能依赖第一片建立保存路径;文章排版优化通常不依赖取消收藏,不能为了顺序整齐人为阻塞。反过来,后台模型未确定,相关迁移测试可能确实必须等待。
原文让用户核对拆分,是确认业务切片和依赖,而不只是请用户批准一张长清单。你可以直接指出“这两项完成后都不能单独看效果,应该合并”。
5. 写入配置好的工单系统
发布已获认可的工单。内容相同,保存方式和依赖的表示方式根据系统不同而变化:
- 本地文件:每张写入
.scratch/<feature-slug>/issues/<NN>-<slug>.md,从01开始按依赖顺序编号,前置任务在先。“Blocked by”记录依赖的编号或标题。使用下方模板,一张工单一个文件,不能合成一个大文件。 - 专门的平台,例如 GitHub、Linear:每张创建一条 issue,也先发布前置工单,使后续工单可以引用真实编号。支持时使用平台内置阻塞关系或子工单关系;否则在“Blocked by”中引用前置工单。除非另有要求,添加
ready-for-agent标签,因为这些工单应已具备 Agent 领取条件。
执行当前所有前提已满足的工单集合。如果任务是一条线性依赖链,就从上往下执行。
不要关闭或修改任何父工单。
<local-ticket-template>
<NN>:<工单标题>
要实现什么: 从用户角度描述完整行为,不要按技术层列工作清单。
前置依赖: 必须先完成的编号或标题;没有就写“无,可以立即开始”。
状态: ready-for-agent
- [ ] 验收条件 1
- [ ] 验收条件 2
</local-ticket-template>
<issue-template>
5. Publish the tickets to the configured tracker
Publish the approved tickets. How depends on the tracker /setup-matt-pocock-skills configured; the tickets are the same either way, only the shape of the blocking edges changes:
- Local files → write one file per ticket under
.scratch/<feature-slug>/issues/<NN>-<slug>.md, numbered from01in dependency order (blockers first). Each file's "Blocked by" lists the numbers/titles it depends on. Use the per-ticket file template below: one ticket per file, never a single combined file. - A real issue tracker (GitHub, Linear, …) → publish one issue per ticket in dependency order (blockers first) so each ticket's blocking edges can reference real identifiers. Use the platform's native blocking / sub-issue relationship where it has one; otherwise set each ticket's "Blocked by" to the blocking issues. Apply the
ready-for-agenttriage label unless instructed otherwise; the tickets are agent-grabbable by construction.
Work the frontier: any ticket whose blockers are all done. For a purely linear chain that means top to bottom.
Do NOT close or modify any parent issue.
<local-ticket-template>
<NN>: <Ticket title>
What to build: the end-to-end behaviour this ticket makes work, from the user's perspective, not a layer-by-layer implementation list.
Blocked by: the numbers/titles of the tickets that gate this one, or "None (can start immediately)".
Status: ready-for-agent
- [ ] Acceptance criterion 1
- [ ] Acceptance criterion 2
</local-ticket-template>
<issue-template>
工单正文需要让下一位实现者知道结果
标题便于识别,Parent 指来源规格,What to build 描述行为,Acceptance criteria 给出可检验条件,Blocked by 写真实前置任务。按依赖顺序发布,才能引用已经存在的真实编号。
**可验收写法:**当前用户收藏课程后,重新打开列表仍能看到它;重复请求不产生第二条记录;另一用户看不到该记录。**不足的写法:**完成接口、完善逻辑、做好测试。后者没有说明正确结果。
本地文件跟踪器还会使用编号和元数据来表达同样关系。无论在哪个平台,文件或标签只是载体,真正有用的是一个人能准确接手的任务契约。
父工单
引用原来的父工单;若来源不是已有工单,省略本节。
Parent
A reference to the parent issue on the tracker (if the source was an existing issue, otherwise omit this section).
要实现什么
从用户角度描述本工单打通的完整行为,不要逐层罗列实现细节。
What to build
The end-to-end behaviour this ticket makes work, from the user's perspective, not layer-by-layer implementation.
验收条件
- [ ] 条件 1
- [ ] 条件 2
Acceptance criteria
- [ ] Criterion 1
- [ ] Criterion 2
前置依赖
- 引用每张必须先完成的工单;没有时写“无,可以立即开始”。
</issue-template>
两种形式都避免写具体代码路径或片段,因为容易过时。例外是原型中比文字更精确表达决定的代码,例如状态机、状态归约函数、数据结构或类型结构。可以直接内嵌关键部分,并注明来自原型;不要带入完整演示,只保留承载决定的内容。
Blocked by
- A reference to each blocking ticket, or "None (can start immediately)".
</issue-template>
In either form, avoid specific file paths or code snippets: they go stale fast. Exception: if a prototype produced a snippet that encodes a decision more precisely than prose can (state machine, reducer, schema, type shape), inline it and note briefly that it came from a prototype. Trim to the decision-rich parts, not a working demo, just the important bits.
先作答,再看参考思路
用自己的话说明:它解决什么问题,完成后会留下什么?
请各用一句话回答。若它只做规划或解释,不要把“已开发”“已部署”写成产物。
为什么拆得越细不一定越快?
我已思考,查看参考思路
过细会增加交接与集成成本,甚至每项都不能独立验证。合适粒度应兼顾完整行为、上下文容量和真实依赖。
原文中哪条要求在你的环境下可能不成立?
说出具体一句及其前提,例如工具不可用、资料缺失、已有项目约定冲突,或它只是作者偏好。把你的答案带回课堂,我们据此继续讨论。
把方法放进一个具体情境
教学案例:学习系统首任务是“读取一份技能原文并显示来源与解释”,比“先做全部数据库”更早暴露教学内容是否正确。第二任务可增加问答,但不应把无关的配色工作设为它的阻塞项。
边界与容易误读的地方
ready-for-agent 表示可领取,不表示已有调度器或执行者。任务图也不会自动解决共享文件冲突。
讨论后再实践:先判断上述情境是否适用,再选择真实任务。现在无需安装、运行命令或修改现有项目。