Break a plan or milestone brief into independently-grabbable vertical slices (tracer bullets). Produces slices in `M###-ROADMAP.md` by default, or GitHub issues
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-decompose-into-slices-3aa6741973b5 ,按照其中的说明把「decompose-into-slices」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Typical invocation points:
write-milestone-brief (or after a discuss phase that produced a brief)<core_principle> VERTICAL, NOT HORIZONTAL. A slice that adds "schema + API + UI + tests for feature X on one narrow path" is vertical. A slice that adds "all schemas for all features" is horizontal and is wrong. Horizontal slices destroy the demoability property that makes slice completion meaningful.
MANY THIN, NOT FEW THICK. If a slice could be split into two demoable pieces, split it. Thin slices retire risk earlier, parallelize better, and give the user faster feedback on whether the direction is right.
DEPENDENCY GRAPH, NOT LINEAR LIST. Slices that don't depend on each other should be marked that way — depends:[] means the slice can start immediately. The GSD engine uses this to parallelize.
</core_principle>
M###-CONTEXT.md for the active milestone — the brief is the source of truth for scope.M###-ROADMAP.md if one exists — you may be refining rather than creating from scratch.src/resources/extensions/gsd/templates/roadmap.md for the exact slice format. The parser depends on it.mcp__github__issue_read.If you haven't yet, spawn Agent(subagent_type=Explore) to map the modules the milestone touches. This is fast and prevents proposing slices that don't align with the codebase's seams.
Produce a draft list of slices. For each slice, capture:
S01, S02, ... — assigned in dependency order (earliest first).high / medium / low — slices that retire the most uncertainty go first.[] or [S01] or [S01,S02] — which slices must finish first.Present the draft as a numbered list with ID, title, risk, depends, demo line. Then ask (one round, not many):
Iterate on feedback until the user approves the breakdown. Do not proceed to Step 5 without explicit approval.
Once approved, write or update M###-ROADMAP.md matching the template exactly. Critical format (parsers depend on it):
- [ ] **S01: Title** `risk:high` `depends:[]`
> After this: one sentence showing what's demoable
- [ ] **S02: Title** `risk:medium` `depends:[S01]`
> After this: one sentence showing what's demoable
Fill the rest of the template: Vision, Success Criteria, Key Risks, Proof Strategy, Verification Classes, Definition of Done, Requirement Coverage, Horizontal Checklist (omit entirely for trivial milestones), and the Boundary Map (S01 → S02 produces/consumes blocks — be specific, name real APIs/types/invariants).
Use write to the path .gsd/milestones/<MID>/<MID>-ROADMAP.md. Do not edit checkboxes by hand during normal execution — the gsd_* tools own state.
If the user explicitly asks (and only if — outward actions need confirmation), create one GitHub issue per slice with mcp__github__issue_write. Create in dependency order so "Blocked by" references can cite real issue numbers.
## Parent
#<parent-milestone-issue-number> (if applicable; otherwise omit)
## What to build
<concise description of this vertical slice — end-to-end behavior, not layer-by-layer>
## Acceptance criteria
- [ ] <criterion 1>
- [ ] <criterion 2>
## Blocked by
- Blocked by #<issue-number>
<or "None - can start immediately">
---
From milestone brief at `.gsd/milestones/<MID>/<MID>-CONTEXT.md`.
Do NOT close or modify any parent issue.
<anti_patterns>
/gsd start spike.gsd_* tools own that state during execution.</anti_patterns>
<success_criteria>
depends:[] on slices that can start immediately.M###-ROADMAP.md matches the template format exactly (parsers depend on it).</success_criteria>