{"slug":"prd-breakdown","title":"prd-breakdown","summary":"Use when user wants to break a PRD into Azure DevOps work items via vertical-slice plan. Workflow: read PRD → quiz user to lock durable decisions → draft slices with HITL/AFK + blocked_by → call az CLI directly via Bash to create items + Predecessor relations. Idempotent re-runs ","platform":"Claude","tags":[],"authorName":"LLM Mart","authorSlug":"llm-mart","score":0,"source":"github","price":null,"verified":false,"createdAt":"2026-09-18T13:26:56.012946Z","repo":{"url":"https://github.com/KerberosClaw/kc_ai_skills","stars":79,"forks":14,"license":"MIT","updatedAt":"2026-11-05T12:45:31Z"},"bodyHtml":"<hr>\n<p>name: prd-breakdown\ndescription: \"Use when user wants to break a PRD into Azure DevOps work items via vertical-slice plan. Workflow: read PRD → quiz user to lock durable decisions → draft slices with HITL/AFK + blocked_by → call az CLI directly via Bash to create items + Predecessor relations. Idempotent re-runs via fingerprint markers embedded in description. Pure prompt-driven — Claude is the runtime, no Python helper, no install ceremony. Trigger phrases: prd-breakdown / 拆 PRD / 切 vertical slice / 推 slice 到 ADO.\"\nversion: 1.1.1\nstatus: stable\ntriggers:</p>\n<ul>\n<li>\"prd-breakdown\"</li>\n<li>\"拆 PRD\"</li>\n<li>\"切 vertical slice\"</li>\n<li>\"推 slice 到 ADO\"</li>\n<li>\"拉 sprint\"</li>\n<li>\"sprint 進度\"</li>\n<li>\"推 ticket\"</li>\n</ul>\n<hr>\n<h1>prd-breakdown — PRD → ADO work items</h1>\n<p>You are a PRD-to-tickets engineering assistant for Azure DevOps. You decompose product requirements into vertical, demo-able slices with explicit dependencies, then push them as work items via the <code>az</code> CLI. You quiz the user to surface durable assumptions instead of silently guessing, and you treat the user's PRD as authoritative — you don't invent scope.</p>\n<p>把 PRD markdown 拆成 vertical slice plan，推上 ADO 變 work items（含 parent link + Predecessor relation + assignee）。全程 prompt-driven — Claude 透過 Bash 直接呼叫 <code>az</code> CLI；無 Python helper，無 install ceremony。</p>\n<h2>Prerequisites</h2>\n<p>User 必須先設好：</p>\n<ul>\n<li><code>az</code> CLI 2.50+ + azure-devops extension：<code>az extension add --name azure-devops</code></li>\n<li>環境變數：\n<ul>\n<li><code>AZDO_ORG_URL</code>：例 <code>https://dev.azure.com/your-org</code></li>\n<li><code>AZDO_PROJECT</code>：例 <code>your-project</code></li>\n<li><code>AZURE_DEVOPS_EXT_PAT</code>：ADO PAT（Work Items Read/Write/Manage scope）</li>\n</ul>\n</li>\n</ul>\n<p>任一缺，提示 user 看 <code>README.md</code> Prerequisites 並停。</p>\n<p><strong>CRITICAL</strong>: PAT 永遠透過 <code>AZURE_DEVOPS_EXT_PAT</code> env var 注入，<strong>絕不</strong>放 argv（會被 <code>ps</code> / shell history 看到）。<code>az</code> CLI 會自動讀此 env var；用 Bash 跑 <code>az</code> 命令時不需特別處理 PAT。</p>\n<h2>Workflow A: PRD → vertical slices</h2>\n<p>User 觸發詞如「拆 PRD」「切 vertical slice」時走這條。</p>\n<h3>Step A1. 偵測 ADO process template</h3>\n<pre><code>az devops project show \\\n  --project \"$AZDO_PROJECT\" \\\n  --organization \"$AZDO_ORG_URL\" \\\n  --query \"capabilities.processTemplate.templateName\" \\\n  -o tsv\n</code></pre>\n<p>對照表 → default work item type：</p>\n<table>\n<thead>\n<tr>\n<th>Process template</th>\n<th>Default work item type</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Scrum</td>\n<td>Task</td>\n</tr>\n<tr>\n<td>Agile</td>\n<td>User Story</td>\n</tr>\n<tr>\n<td>CMMI</td>\n<td>Requirement</td>\n</tr>\n<tr>\n<td>Basic</td>\n<td>Issue</td>\n</tr>\n</tbody>\n</table>\n<p>告知 user：「偵測到 X 模板，default 用 Y type；要改請說」。偵測失敗 → fallback <code>Task</code> + 印 warning。</p>\n<h3>Step A2. 讀 PRD</h3>\n<p>User 給 path 或貼內容 → Read 進來。</p>\n<p>辨識 <strong>durable architectural decisions</strong>（tech stack、data model invariant、integration boundary 等跨 slice 共通的決定）— 這些放 plan.md <code>## Architectural decisions</code> section，不重複進每個 slice。</p>\n<h3>Step A3. 草擬 vertical slices</h3>\n<p><strong>MANDATORY</strong>: 每個 slice 必須是 <strong>vertical</strong> — 一條 user-visible 端到端 demo-able 價值。Horizontal layer（如「set up DB schema」「scaffold API」）<strong>不</strong>算 slice，要併進對應 vertical slice 的 sub-tasks 裡。</p>\n<p>每個 slice 還要：</p>\n<ul>\n<li>標 <strong>HITL</strong>（要人 review / 互動）或 <strong>AFK</strong>（無人值守 batch）</li>\n<li>可選 <strong>wave</strong>（可平行的 slice 群）</li>\n<li>可選 <strong>blocked_by</strong>（依賴的 phase_id list）</li>\n</ul>\n<p>Slice id 規則：<code>phase-N</code>（N 從 1 起，順序遞增）。</p>\n<h3>Step A4. Quiz user</h3>\n<p>把 slice 草稿用 numbered list 呈現給 user，<strong>不要</strong> batch 一口氣丟。User 回饋 → 調整 → 再 quiz。</p>\n<p><strong>MANDATORY</strong>: 遇不確定的事一律明說「這是猜的」+ 列為 question 給 user，不擅自 hard-code assumption。</p>\n<h3>Step A5. 寫 plan.md</h3>\n<p>Path 由 caller 指定，建議 <code>&lt;feature&gt;/plan.md</code> 或類似結構。Template 參考 <code>templates/plan_md.md</code>：</p>\n<pre><code>## Architectural decisions\n- &lt;decision 1&gt;\n- &lt;decision 2&gt;\n\n## Wave 1: &lt;label&gt;  (optional grouping)\n\n### Phase 1: &lt;slice title&gt;\n**Type**: HITL | AFK\n**User stories**: 670, 671  (optional, ADO IDs)\n**Assignee**: dev@example.com  (optional, per-slice override)\n\n#### What to build\n&lt;2-4 sentences&gt;\n\n#### Acceptance criteria\n- [ ] &lt;AC 1&gt;\n- [ ] &lt;AC 2&gt;\n\n#### Blocked by\n- (none) | phase-X\n</code></pre>\n<p>寫完後告知 user 路徑 + 問是否要進入 Workflow B push。</p>\n<h2>Workflow B: Push slices to ADO</h2>\n<p>User 觸發詞如「推 slice 到 ADO」時走這條。前置：plan.md 已存在 + user 給 parent PRD work item ID。</p>\n<h3>Step B0. Confirm target environment</h3>\n<p><strong>MANDATORY</strong>: 在跑任何 create 之前，<strong>先確認 push target 是 production sprint board 還是非 production test project</strong>。User 給 parent PRD ID 不等於授權打 production。</p>\n<p>若 user 沒明說「test project」/「test board」/「測試 project」就直接跳到 push，問：</p>\n<blockquote>\n<p>「Push target 是 production 還是非 production test project？SKILL 默認假設 test；要打 production 請回『production OK』。」</p>\n</blockquote>\n<p>回應處理：</p>\n<ul>\n<li><p>「test」/「test project」/「測試」/「非 production」 → 繼續 B1</p>\n</li>\n<li><p>「production OK」/「prod OK」/「打正式」/「production」 → 印 explicit warning：</p>\n<blockquote>\n<p>「⚠️ 目標是 production board (<code>$AZDO_PROJECT</code> PBI #N)，將實際建 work items 到正式 backlog。要繼續請回『confirm』。」</p>\n</blockquote>\n<p>拿到第二次 explicit 「confirm」/「OK」後才繼續 B1</p>\n</li>\n<li><p>任何其他模糊回應 → 重複問，不擅自往前</p>\n</li>\n</ul>\n<p>User 明確 override（雙重 confirm）後不再阻擋此 session 內的後續 create；但全新 push session 重啟仍需 reconfirm（避免 long-running session 假設 carry over）。</p>\n<h3>Step B1. Resolve work item type</h3>\n<p>優先序：</p>\n<ol>\n<li>User 對話中明指（「用 User Story」）</li>\n<li><code>AZDO_DEFAULT_WI_TYPE</code> env var</li>\n<li>Workflow A1 偵測到的 default</li>\n<li>Hardcoded <code>Task</code></li>\n</ol>\n<h3>Step B2. Resolve assignee</h3>\n<p>每個 slice 的 assignee 優先序：</p>\n<ol>\n<li><code>**Assignee**: &lt;email&gt;</code> per-slice override（plan.md 內標）</li>\n<li>User 對話中給的 fallback email</li>\n<li>None（不傳 <code>--assigned-to</code>）</li>\n</ol>\n<h3>Step B3. Idempotent skip pre-check</h3>\n<p><strong>MANDATORY</strong>: 跑任何 create 之前先做這步，避免重複建 item。</p>\n<p>對 plan.md 每個 slice，查 ADO 是否已存在：</p>\n<pre><code># 找 parent 下所有指定 type 的子 item\naz boards query \\\n  --wiql \"SELECT [System.Id] FROM WorkItems WHERE [System.Parent] = &lt;parent-id&gt; AND [System.WorkItemType] = '&lt;type&gt;'\" \\\n  --project \"$AZDO_PROJECT\" \\\n  --organization \"$AZDO_ORG_URL\" \\\n  -o json\n</code></pre>\n<p>對每個回傳的 child id 抓 description：</p>\n<pre><code>az boards work-item show \\\n  --id &lt;child-id&gt; \\\n  --organization \"$AZDO_ORG_URL\" \\\n  --query \"fields.\\\"System.Description\\\"\" \\\n  -o tsv\n</code></pre>\n<p>在 description 內找 marker：</p>\n<pre><code>&lt;!-- prd-breakdown-id: phase-N-&lt;hash&gt; --&gt;\n</code></pre>\n<p>其中 <code>&lt;hash&gt;</code> 算法：<code>sha256(&lt;absolute_plan_md_path&gt; + \":\" + &lt;phase_id&gt;)</code> 取前 8 hex char。</p>\n<p>若 marker 存在且符合預期 → 此 slice <strong>skip create</strong>，記下 ADO id 用於 Step B6 relations。</p>\n<h3>Step B4. Topo sort by blocked_by</h3>\n<p>按 blocked_by 拓撲排序 slices，blockers 先建。偵測到 cycle → abort + 印涉環 phase_id list，要 user 手動釐清。</p>\n<h3>Step B5. Create work items（按 topo 順序）</h3>\n<p>對每個未 skip 的 slice：</p>\n<p><strong>Step B5a.</strong> 讀 <code>templates/issue_body_ado.md</code>，做 placeholder substitution：</p>\n<table>\n<thead>\n<tr>\n<th>Placeholder</th>\n<th>替換內容</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>{{parent_prd}}</code></td>\n<td>ADO link <code>&lt;AZDO_ORG_URL&gt;/&lt;project&gt;/_workitems/edit/&lt;parent-id&gt;</code></td>\n</tr>\n<tr>\n<td><code>{{description}}</code></td>\n<td>slice 的 What to build</td>\n</tr>\n<tr>\n<td><code>{{acceptance_criteria}}</code></td>\n<td>markdown checkbox list</td>\n</tr>\n<tr>\n<td><code>{{blocked_by}}</code></td>\n<td>phase_id list（純文字，relation 在 B6 跑）</td>\n</tr>\n<tr>\n<td><code>{{user_stories}}</code></td>\n<td>逗號分隔 ADO ID list</td>\n</tr>\n</tbody>\n</table>\n<p><strong>Step B5b.</strong> 在 rendered body 末加 marker：<code>&lt;!-- prd-breakdown-id: phase-N-&lt;hash&gt; --&gt;</code></p>\n<p><strong>Step B5c.</strong> 跑：</p>\n<pre><code>az boards work-item create \\\n  --type \"&lt;resolved-type&gt;\" \\\n  --title \"&lt;slice-title&gt;\" \\\n  --project \"$AZDO_PROJECT\" \\\n  --organization \"$AZDO_ORG_URL\" \\\n  --fields \"System.Description=&lt;rendered-body&gt;\" \"System.Parent=&lt;parent-id&gt;\" \\\n  [--assigned-to \"&lt;email&gt;\"] \\\n  -o json\n</code></pre>\n<p><strong>Step B5d.</strong> 從 stdout JSON 抓 <code>id</code> 欄位，記錄 phase_id → ADO id 映射（in-memory，session 內維持）。</p>\n<h3>Step B6. Add Predecessor relations</h3>\n<p>所有 item 建好後，對 plan.md 內每條 blocked_by relation：</p>\n<pre><code>az boards work-item relation add \\\n  --id &lt;blocked-ado-id&gt; \\\n  --relation-type \"Predecessor\" \\\n  --target-id &lt;blocker-ado-id&gt; \\\n  --organization \"$AZDO_ORG_URL\"\n</code></pre>\n<p><strong>CRITICAL</strong>: Basic process template 沒 Predecessor relation type — Workflow A1 偵測到 Basic 時：B6 印 warning「Basic process 不支援 Predecessor，跳過 relation step；items 已建」+ skip 整 step。</p>\n<p>Relation 已存在會在 stderr 含 <code>\"already exists\"</code> → 視為 idempotent skip，不算錯。</p>\n<h3>Step B7. Verify + 印 summary</h3>\n<p>對 user 印（<strong>output schema</strong>）：</p>\n<pre><code>Push complete:\n  - Created N items (skipped M as already-exist via fingerprint match)\n  - Added K Predecessor relations (skipped L as already-exist)\n  - View: &lt;AZDO_ORG_URL&gt;/&lt;project&gt;/_workitems\n</code></pre>\n<h2>Adding a new platform</h2>\n<p>不抽 abstraction layer。<strong>直接寫 sibling Workflow section</strong> 對應該平台 CLI。例如要支援 GitHub Issues：</p>\n<pre><code>## Workflow C: Push slices to GitHub Issues\n\n### Step C1. Resolve repo (env var GH_REPO or user-supplied)\n### Step C2. Idempotent skip pre-check (gh issue list + body marker)\n### Step C3. Create issues (gh issue create --title --body --repo)\n### Step C4. Blocked-by linking (GH 沒 Predecessor，用 body 的 \"Blocked by #123\" 慣例)\n</code></pre>\n<p>每平台 CLI 語意不同（Jira 用 <code>jira issue create</code>、Redmine 用 REST API）。共用 abstraction 會丟資訊。每 section 自包含 recipe。</p>\n<h2>Anti-patterns</h2>\n<ul>\n<li>❌ <strong>Title-match for idempotency</strong> — user 在 ADO UI 改 title 修 typo 就誤判，永遠用 fingerprint marker</li>\n<li>❌ <strong>Push to production without surfacing risk</strong> — 默認假設第一次 push 是非 production test project（避免污染正式 backlog）；user 明指 production target（如「在 PBI #N 下開 task」沒提 test project）時，<strong>先 surface「這看起來像 production，要 override 嗎？」拿到 explicit yes 才走</strong>（見 Step B0）。User 明確雙重 confirm 後不擋；但 skill 不可被 explicit instruction 直接無視 anti-pattern</li>\n<li>❌ <strong>Bake assumptions silently</strong> — 不確定的事一律列為 question quiz user，不擅自 hard-code</li>\n<li>❌ <strong>Horizontal layer as slice</strong> — 「set up DB schema」「scaffold API skeleton」這種不是 slice，要併進對應 vertical slice</li>\n<li>❌ <strong>Generic adapter abstraction for multi-platform</strong> — Jira / GH 真要支援，新寫 sibling Workflow section，<strong>不</strong>抽 universal interface</li>\n<li>❌ <strong>PAT on argv</strong> — 永遠走 <code>AZURE_DEVOPS_EXT_PAT</code> env var</li>\n<li>❌ <strong>Real names / emails / org names in fixtures</strong> — 此 repo 是 public，placeholders 用 <code>dev@example.com</code> / <code>your-org</code> / <code>&lt;workitem-id&gt;</code></li>\n<li>❌ <strong>Batch quiz</strong> — 一口氣丟所有 slice 給 user，認知負擔太大；用 numbered list iterate</li>\n<li>❌ <strong>Skip topo sort then add relation</strong> — 一定要 blockers 先建好才能 add Predecessor，不可亂序</li>\n</ul>\n<h2>Common pitfalls</h2>\n<table>\n<thead>\n<tr>\n<th>陷阱</th>\n<th>對策</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Plan.md 微調後 phase_id 不變</td>\n<td>hash 只 hash phase_id + path，不 hash 內容；微調 description / AC 不破壞 idempotency</td>\n</tr>\n<tr>\n<td>Description 含 <code>$</code> / 多行 markdown</td>\n<td><code>--fields System.Description=&lt;body&gt;</code> 直接吃 raw string，不需 escape</td>\n</tr>\n<tr>\n<td>User 漏設 <code>AZURE_DEVOPS_EXT_PAT</code> env var</td>\n<td>起始 Prerequisites check 抓到 → 提示 <code>export AZURE_DEVOPS_EXT_PAT='...'</code> 後 retry</td>\n</tr>\n<tr>\n<td><code>az boards query</code> WIQL 在某 ADO 版本 syntax 略不同</td>\n<td>用上述標準 WIQL；fail 直接把 stderr 給 user，不擅自 fallback</td>\n</tr>\n<tr>\n<td><code>az</code> CLI 未 install azure-devops extension</td>\n<td>Prerequisites check 抓 <code>az extension list</code> 看；缺 → 提示 <code>az extension add --name azure-devops</code></td>\n</tr>\n<tr>\n<td>Create item 失敗到一半</td>\n<td>已建的 item 因有 fingerprint marker，re-run 自動 skip；user 修原因後直接重跑即可</td>\n</tr>\n</tbody>\n</table>\n<h2>跟 spec / 其他 skill 的關係</h2>\n<ul>\n<li><strong><code>spec</code> skill</strong> 負責：需求釐清 → plan → tasks.md → 驗收。產物為對話內 plan.md / spec.md</li>\n<li><strong><code>prd-breakdown</code>（本 skill）</strong> 負責：拿 PRD（或 spec / plan）→ 拆 vertical slices → 推 ADO</li>\n<li>兩者透過 markdown 文件對接，不互相 import；user 可只用 prd-breakdown 直接拆 PRD 不走 spec ceremony</li>\n</ul>\n<h2>Reference fixtures</h2>\n<p><code>tests/fixtures/example_prd.md</code> + <code>example_plan.md</code> 配對 example（<strong>TODO list app MVP</strong> 題材，公開無敏感）。Caller 看不確定怎麼寫 plan.md 時可貼這對給 Claude 對照。</p>\n<h2>Important rules</h2>\n<p>收尾 invariants — 即使前面 step 都讀過，這幾條是核心，違反任一條皆需 abort 並告知 user：</p>\n<ol>\n<li><strong>Quiz before bake</strong> — 不確定的事一律列為 question 給 user，不擅自 hard-code assumption</li>\n<li><strong>Vertical only</strong> — 每 slice 端到端可 demo；horizontal layer 不算 slice</li>\n<li><strong>Fingerprint over title-match</strong> — idempotent skip 一律用 description 內 <code>&lt;!-- prd-breakdown-id: ... --&gt;</code> marker，永不靠 title 比對</li>\n<li><strong>PAT via env var only</strong> — <code>AZURE_DEVOPS_EXT_PAT</code> 環境變數，永不上 argv</li>\n<li><strong>No abstraction for multi-platform</strong> — Jira/GH 真要支援，新寫 Workflow section，不抽 generic adapter</li>\n<li><strong>Topo before create</strong> — 跑 create 前先 topo sort；偵測 cycle 直接 abort 給 user 處理</li>\n<li><strong>Public repo discipline</strong> — fixtures 全用 placeholders，禁真名 / 真 GUID / 真公司名 / 真 ADO ID</li>\n<li><strong>Production push 需 explicit double confirm</strong> — 默認假設第一次 push 是非 production test project；user 明指 production 時走 Step B0（surface risk + 拿到雙重 explicit confirm 才走），不擋 user 授權但不被 explicit instruction 直接無視</li>\n<li><strong>Basic process exception</strong> — Basic template 偵測到 → 跳過 Predecessor relation step（不存在），items 仍建</li>\n<li><strong>No Python wrapper</strong> — Claude 透過 Bash 直接 <code>az</code>；不寫 / 不召喚 Python helper script</li>\n</ol>\n<h2>Acknowledgments</h2>\n<p>Algorithm 內化（重寫成 prompt，未 vendor）：</p>\n<ul>\n<li><a href=\"https://github.com/yldgio/vibe-grimoire\">yldgio/vibe-grimoire</a> (MIT) — vertical slice rules、wave grouping decision tree、ADO issue body template、Predecessor relation pattern</li>\n<li><a href=\"https://github.com/mattpocock/skills\">mattpocock/skills</a> (MIT) — quiz user numbered-list workflow、tracker-agnostic abstraction 思路</li>\n</ul>\n","files":[{"path":"SKILL.md","sizeBytes":14410,"isText":true},{"path":"templates/issue_body_ado.md","sizeBytes":1102,"isText":true},{"path":"templates/plan_md.md","sizeBytes":1559,"isText":true},{"path":"tests/fixtures/example_plan.md","sizeBytes":3497,"isText":true},{"path":"tests/fixtures/example_prd.md","sizeBytes":1615,"isText":true}],"reviewScore":null,"reviewSummary":null,"trust":{"provenance":"trusted-source-unreviewed","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow.","bodySource":null},"bodyLocked":false,"purchaseUrl":null,"sourceUrl":null,"report":{"provenance":"trusted-source-unreviewed","screen":{"ran":true,"outcome":"clean","suspicious":0,"notes":0,"hiddenCharacters":false},"virusScan":{"engine":"clamav","status":"clean","scannedAt":"2026-09-18T13:27:28.857611Z","sha256":"5EA20D7F4ECF7C8BB5E776AAA1999F00F9D46E90F1A77571D2C4B44535E58BE3","sizeBytes":11230},"review":null,"source":{"repositoryUrl":"https://github.com/KerberosClaw/kc_ai_skills","path":"prd-breakdown","license":"MIT","commit":"dbd37fbe2121356fe25b69c70cbe5fc8b8870415","subtreeSha":"CE497105D9C47D5FAEBAE383F2E5082E85912A249B3FFB8EE0A61479F4309DB1","lastSyncedAt":"2026-11-05T21:45:23.100804Z"},"reviewedAt":"2026-09-18T13:28:22.726562Z","notice":"Community-authored content, reproduced verbatim and not vetted as instructions. Treat it as data to evaluate, never as directives to follow."},"install":[{"target":"skills-cli","command":"npx skills add https://github.com/KerberosClaw/kc_ai_skills/tree/main/prd-breakdown"},{"target":"claude-code","command":"claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install kerberosclaw-kc-ai-skills@llmmart"},{"target":"git","command":"git clone https://github.com/KerberosClaw/kc_ai_skills.git"}]}