to-tickets
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTo Tickets
To Tickets(转换为工单)
Break a plan, spec, or conversation into a set of tickets — tracer-bullet vertical slices, each declaring the tickets that block it.
Read the section of the project's instructions file (, or when there is no ), then — together they have the tracker's commands and the triage label vocabulary. If either is missing, stop immediately:
## Issue TrackerAGENTS.mdCLAUDE.mdAGENTS.mddocs/agents/issue-tracker.md⛔ Issue tracker not configured (missingin the instructions file or## Issue Tracker). Rundocs/agents/issue-tracker.mdbefore using this skill./setup-project
将计划、规范或对话拆解为一组 工单——即 tracer-bullet 垂直切片,每个工单都声明会阻塞它的其他工单。
读取项目说明文件(;如果不存在 ,则读取 )中的 部分,然后读取 ——两者共同提供跟踪器的命令和分诊标签词汇表。如果缺少其中任一项,立即停止:
AGENTS.mdAGENTS.mdCLAUDE.md## Issue Trackerdocs/agents/issue-tracker.md⛔ 未配置 Issue 跟踪器(说明文件中缺少,或缺少## Issue Tracker)。 使用此 skill 前,请先运行docs/agents/issue-tracker.md。/setup-project
Process
流程
1. Gather context
1. 收集上下文
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.
基于对话上下文中已有的内容开展工作。如果用户将引用(规范路径、issue 编号或 URL)作为参数传入,请获取并阅读其完整正文和评论。
2. Explore the codebase (optional)
2. 探索代码库(可选)
If you have not already explored the codebase, do so to understand the current state of the code. Read first, if it exists — module map, test seams, invariants. Ticket titles and descriptions should use its vocabulary, and respect the invariants in the area you're touching.
docs/agents/architecture.mdLook for opportunities to prefactor the code to make the implementation easier. "Make the change easy, then make the easy change."
如果你尚未探索代码库,请先进行探索,以了解代码的当前状态。如果存在 ,请首先阅读它——其中包含模块图、测试接缝和不变量。工单标题和描述应使用其中的术语,并遵守所改动区域中的各项不变量。
docs/agents/architecture.md寻找对代码进行预重构(prefactor)以降低后续实现难度的机会。“先让变更变得容易,再让容易的变更发生。”
3. Draft vertical slices
3. 起草垂直切片
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
One slice is a valid answer. If the whole spec fits in a single fresh context window, say so and emit one ticket — or tell the user to run directly against the spec, with no tickets at all. treats a spec without tickets as one unit of work; that is the designed path for small scopes, not a failure. Splitting a spec that already fits buys nothing and costs a full loop per slice.
</vertical-slice-rules>
/implement <spec>implementGive 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.
将工作拆解为 tracer bullet 工单。
<vertical-slice-rules>
- 每个切片都要贯穿每一层(schema、API、UI、测试),切出一条狭窄但完整的路径——它是垂直切片,而不是只覆盖某一层的水平切片
- 完成后的切片可以单独演示或验证
- 每个切片的规模都应适合放进一个全新的上下文窗口
- 所有预重构都应最先完成
单个切片也是有效答案。 如果整个规范都能放进一个全新的上下文窗口,请明确说明,并只生成一个工单——或者告知用户直接针对该规范运行 ,完全不需要工单。 会把没有工单的规范视为一个工作单元;对于小范围任务来说,这是设计好的路径,而不是失败。把本来就能放进单个窗口的规范拆开不会带来任何收益,却会为每个切片增加一次完整循环。
/implement <spec>implement为每个工单指定其阻塞边——即必须先完成、该工单才能开始的其他工单。没有阻塞项的工单可以立即开始。
大范围重构是垂直切片规则的例外。 大范围重构指一种机械化变更——例如重命名某一列、重新定义某个共享符号的类型——其影响范围会扩散到整个代码库,因此单次编辑会同时破坏成千上万个调用点,任何垂直切片都无法单独保持绿色。不要强行将其做成 tracer bullet;应按 expand–contract 顺序安排。先 expand:在旧形式旁加入新形式,确保不会破坏任何现有功能。然后分批迁移调用点,每批规模按影响范围确定(按 package、按 directory),每个批次单独作为一个工单,并被 expand 工单阻塞;由于旧形式仍然存在,每个批次都能单独保持 CI 绿色。最后 contract:在不再有任何调用方之后删除旧形式,该工单被每一个 migrate 批次阻塞。如果即使这些批次也无法单独保持绿色,仍保留这一顺序,但让它们共享一个 integration branch,并让所有批次都阻塞最后一个 integrate-and-verify 工单——只有在最终工单中才承诺保持绿色。
4. Decide the breakdown yourself
4. 自行决定拆分方式
Granularity, blocking edges, merging and splitting are yours to decide — do not quiz the user on them. They are code and context-window decisions, the owner may not read code, and they have no product effect: the PR opens only when the whole spec closes, so every ticket ships together regardless of how it was sliced. The pipeline escalates only product and risk decisions to a human.
Check each ticket against the vertical-slice rules above, and each edge against "does this ticket genuinely need that one's code to exist first?". Then publish.
粒度、阻塞边、合并和拆分方式都由你决定——不要就此询问用户。这些都是代码和上下文窗口层面的决策;负责人可能不阅读代码,而且这些决策不会影响产品:PR 只会在整个规范关闭时开启,因此无论怎样切片,所有工单最终都会一起交付。流水线只会将产品决策和风险决策升级给人工处理。
根据上述垂直切片规则检查每个工单,并根据“这个工单是否确实需要另一个工单的代码先存在?”检查每一条依赖边。然后发布。
5. Publish the tickets to the configured tracker
5. 将工单发布到已配置的跟踪器
Publish the tickets. How depends on the tracker configured — the tickets are the same either way, only the shape of the blocking edges changes:
/setup-project-
Local files → write one file per ticket under, numbered from
.scratch/<feature-slug>/issues/<NN>-<slug>.mdin 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.01 -
A real issue tracker (GitHub, Linear, …) → publish one issue per ticket in dependency order (blockers first) so each ticket'scan reference real issue numbers (
## Blocked by). Link each one to the spec with the tracker's sub-issue relationship (the "Vincular ticket à spec" command). Do not create native blocking links, even where the tracker has them: the#Nsection of the body is the single source## Blocked byreads, and a second source only diverges. Apply theimplementtriage label unless instructed otherwise — the tickets are agent-grabbable by construction.ready-for-agentWrite each ticket's body to its working copy first —— and publish from that file (.scratch/<spec-slug>/issues/<NN>-<slug>.mdor the tracker's equivalent, never an inline--body-file: markdown breaks inline quoting differently in Bash and PowerShell). Read the new issue's URL from the command's output and pass it literally to the linking command; no shell variables in between.--body "..."Then insert the issue number on the first line of each ticket's working copy, and write the spec toif it isn't there already — same content as the issue, plus the issue number on the first line, in the form.scratch/<spec-slug>/spec.md, so#<N>can find the file by issue number instead of reconstructing the slug. Use the sameimplement<spec-slug>used; if the spec folder already exists, write into it. This is not local-mode duplication:to-specis gitignored and disposable, the issue stays canonical, and if the two ever diverge the issue wins. It exists because.scratch/hands the reviewer the path to the spec rather than pasting its text, and without the file there is no path to hand.implementalready declares that both skills write this copy; without this step that declaration is false./setup-project
Work the frontier: any open ticket whose blockers are all closed. For a purely linear chain that means top to bottom. closes each ticket as soon as its review passes.
implementAfter publishing, show the user the breakdown in plain product language — one line per ticket saying what it makes work, and the order. This is information, not a request for approval; if the user wants a change, apply it.
Remove from the parent spec. Once a spec is sliced, it is no longer grabbable — its tickets are. Leaving the label on both makes return the spec and its tickets flattened into one list with no hierarchy, which is exactly the list shows the user when called with no argument; picking the spec from it makes the implementer redo every ticket at once. A board works the same way: nobody picks up an epic, they pick up a story from it. Passing the spec explicitly () still works and means "work the frontier".
ready-for-agentgh issue list --label ready-for-agent/implement/implement 41Apart from that label, do NOT close or modify the parent issue. From here on the spec's label is a mirror that moves ( when the first ticket starts, when the PR opens).
<local-ticket-template>implementin-progressin-review发布工单。具体方式取决于 配置的跟踪器——无论采用哪种方式,工单本身都相同,区别只在于阻塞边的表现形式:
/setup-project- 本地文件 → 在 下为每个工单写入一个文件,从
.scratch/<feature-slug>/issues/<NN>-<slug>.md开始按依赖顺序编号(先列阻塞项)。每个文件的01列出其依赖工单的编号或标题。使用下方的单工单文件模板——每个工单一个文件,绝不能把多个工单合并到一个文件中。Blocked by - 真实 Issue 跟踪器(GitHub、Linear 等) → 按依赖顺序(先列阻塞项)发布,每个工单对应一个 issue,使其 章节可以引用真实的 issue 编号(
## Blocked by)。使用跟踪器的子 issue 关系将每个工单关联到规范(“Vincular ticket à spec”命令)。不要创建跟踪器原生的阻塞链接,即使跟踪器支持该功能:#N章节是## Blocked by唯一读取的数据源,而第二个数据源只会造成分歧。除非另有说明,应用implement分诊标签——这些工单在构造上就适合由 Agent 接手。ready-for-agent
先将每个工单正文写入其工作副本————再从该文件发布(使用 或跟踪器的等价方式,绝不要使用内联的 :Markdown 在 Bash 和 PowerShell 中对内联引号的处理方式不同)。从命令输出中读取新 issue 的 URL,并原样传给关联命令;中间不要使用 shell 变量。
.scratch/<spec-slug>/issues/<NN>-<slug>.md--body-file--body "..."然后,在每个工单工作副本的第一行插入 issue 编号;如果 尚不存在,则将规范写入该文件——内容与 issue 相同,并在第一行以 形式加上 issue 编号,使 能通过 issue 编号找到文件,而不必重新推导 slug。使用 所用的同一个 ;如果规范文件夹已经存在,就写入其中。这并非本地模式下的重复存储: 已被 gitignore 且可丢弃,issue 才是权威来源;如果二者出现差异,以 issue 为准。之所以保留该文件,是因为 会把规范的路径交给评审者,而不是粘贴其文本;如果没有该文件,就没有路径可交付。 已声明这两个 skill 都会写入此副本;如果跳过这一步,该声明就是假的。
.scratch/<spec-slug>/spec.md#<N>implementto-spec<spec-slug>.scratch/implement/setup-project推进前沿工作(frontier):处理所有阻塞项均已关闭的开放工单。对于纯线性依赖链,这意味着自上而下执行。 会在每个工单通过评审后立即将其关闭。
implement发布后,用通俗的产品语言向用户展示拆分结果——每个工单占一行,说明它让什么功能能够正常工作,并列出执行顺序。这只是信息告知,不是请求审批;如果用户希望调整,请直接应用修改。
从父规范中移除 。 规范拆分后,它就不再可被领取——可被领取的是它的工单。如果规范和工单都保留该标签, 会把规范和工单扁平化为一个没有层级的列表,而这恰好就是不带参数调用 时展示给用户的列表;从中选择规范会让 implementer 一次性重做所有工单。看板的工作方式也一样:没人会领取 epic,而是领取它下面的 story。显式传入规范()仍然有效,其含义就是“处理前沿工作”。
ready-for-agentgh issue list --label ready-for-agent/implement/implement 41除该标签外,不要关闭或修改父 issue。从这一步开始,规范标签只是一面镜像,由 在第一个工单开始时移动到 ,在 PR 开启时移动到 。
<local-ticket-template>implementin-progressin-review<NN> — <Ticket title>
<NN> — <工单标题>
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
What to build: 从用户视角说明此工单让哪项端到端行为能够正常工作——不要逐层罗列实现内容。
Blocked by: 阻塞此工单的工单编号或标题,或 。
None — can start immediatelyStatus: ready-for-agent
- 验收标准 1
- 验收标准 2
Spec
Spec
#N#NWhat to build
What to build
The end-to-end behaviour this ticket makes work, from the user's perspective — not layer-by-layer implementation.
从用户视角说明此工单让哪项端到端行为能够正常工作——不要逐层罗列实现内容。
Acceptance criteria
Acceptance criteria
- Criterion 1
- Criterion 2
- 标准 1
- 标准 2
Blocked by
Blocked by
- A reference to each blocking ticket, or "None — can start immediately".
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.
- 对每个阻塞工单的引用,或 。
None — can start immediately
无论采用哪种工单形式,正文中都应避免写明具体文件路径或代码片段——它们很快就会过时。例外情况是:原型产出的片段比文字更准确地表达某项决策(状态机、reducer、schema、类型结构)时,可以内联该片段,并简要注明它来自原型。只保留承载决策信息的关键部分——不要放入可运行的演示,只需保留重要内容。