From spec-writer
This skill should be used when the user asks to "撰寫 spec", "寫 user story", "寫 story", "撰寫需求規格", "write spec", "write user story", "撰寫驗收標準", "寫 acceptance criteria", "拆分 story", "拆解需求", "檢查 story 品質", "INVEST 檢查", "反模式掃描", "review my user stories", "break down a feature into stories", "story mapping", "需求拆解", "user story mapping", "拆解大功能", "建立 story map", or needs guidance on spec writing methodology, story types, scoping, acceptance criteria, prioritization, or INVEST quality checks.
npx claudepluginhub tim80411/ai-agent-extension --plugin spec-writerThis skill uses the workspace's default tool permissions.
引導撰寫高品質的 User Story、Enabler Story 與 Spike,並以 INVEST 標準確保品質。
assets/enabler-story.mdassets/spike.mdassets/user-story.mdreferences/01-story-types.mdreferences/02-scoping.mdreferences/03-acceptance-criteria.mdreferences/04-prioritization.mdreferences/05-invest-checklist.mdreferences/06-anti-patterns.mdreferences/07-frameworks-comparison.mdreferences/08-workflow-conventions.mdreferences/09-story-mapping.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
引導撰寫高品質的 User Story、Enabler Story 與 Spike,並以 INVEST 標準確保品質。
全程使用中文與使用者互動。
建立 todo list 追蹤各階段進度:
Goal: 在進入需求釐清前,取得所有可用的既有脈絡,避免在後續階段重複詢問。
Actions:
使用 AskUserQuestion 工具,一次提出所有背景問題(避免多輪對話消耗 context window):
等待使用者回答後再繼續。
若使用者提供了文件路徑或貼上內容:
context-reader agent(via Task 工具)若使用者確認有程式碼庫:
codebase-explorer agent(via Task 工具)彙整所有 agent 回傳的資訊,建立 Context Summary,供後續階段引用。 若使用者無文件且無 codebase,直接建立空白 Context Summary 並進入 Phase 1。
更新 todo,標記 Phase 0 完成。
Goal: 若需求是模糊的大目標,使用 Story Mapping 從全局拆解出 Stories 清單。
何時觸發:
何時跳過:
Required References:
references/09-story-mapping.md — Story Mapping 方法論Actions:
使用 AskUserQuestion 確認是否需要全局拆解,若使用者確認需要:
啟動 story-mapper agent(via Agent 工具)。
向使用者呈現 Story Map 和候選 Stories 清單。
使用 AskUserQuestion 詢問使用者:
等待使用者確認後,將確認的 Stories 清單作為 Phase 1 的輸入。
更新 todo,標記 Phase 0.5 完成。
Goal: 在撰寫任何 Story 之前,確保對目標、受益者、範圍邊界有明確共識。
CRITICAL: 這個階段不可跳過。若 Phase 0 已取得充分資訊,部分問題可以省略,但三個核心確認點必須明確。
Required References:
references/01-story-types.md — 受益者類型與 Story 分類判斷references/02-scoping.md — No-gos 與 Appetite 定義方法Actions:
回顧 Phase 0 的 Context Summary。
識別仍需確認的項目:
針對尚未明確的項目,使用 AskUserQuestion 工具提問:
(僅提問 Phase 0 尚未取得答案的項目)
等待使用者回答後再繼續。
根據回答與 references/01-story-types.md,初步判斷需求將拆成哪些類型的 Stories,並向使用者確認判斷是否正確。
若使用者說「你覺得怎樣就怎樣」,提供你的建議並取得明確確認。
DO NOT PROCEED TO PHASE 2 UNTIL ALL THREE CORE ITEMS ARE CONFIRMED: 受益者、期望成果、No-gos(或使用者明確說明「無 No-gos」)。
Goal: 依據釐清後的需求,撰寫符合格式規範的 Stories。
Required References:
references/01-story-types.md — Story 格式定義references/03-acceptance-criteria.md — Outcome-Focused 驗收標準撰寫原則references/04-prioritization.md — 優先序排定方法references/08-workflow-conventions.md — 標題命名、Label 規則、Story ID 編號規則、模板對應Actions:
讀取 references/08-workflow-conventions.md,確認命名與 Label 規則。
依序處理每項需求:
a. 判斷 Story 類型(參照 references/01-story-types.md):
終端使用者能直接感受到?
├── 是 → User Story
└── 否 → 能明確指出賦能了哪些 User Story?
├── 能 → Enabler Story
└── 不確定 → Spike
b. 讀取對應模板:
assets/user-story.mdassets/enabler-story.mdassets/spike.mdc. 填寫模板,替換所有佔位符;不適用的段落整段移除。
d. 撰寫驗收標準(參照 references/03-acceptance-criteria.md),以 Given-When-Then 情境格式撰寫:
e. 套用命名規則(來自 references/08-workflow-conventions.md):
f. 標記 Labels 與優先序(參照 references/04-prioritization.md)。
g. 寫入檔案:每個 Story 獨立寫入一個 .md 檔案(參照 references/08-workflow-conventions.md 的檔案結構規範):
.project/specs/{spec-slug}/)story-{N}-{slug}.md(Spike 為 spike-{slug}.md)_overview.md,一併建立(包含 Story Map、優先序總覽、No-gos、修訂紀錄)story_id、title、type、priority 必須填入tracker_type、tracker_id、synced_at 留空(Phase 2.5 填入)完成所有 Stories 草稿後,以清晰格式呈現給使用者確認。
若使用者要求修改,根據反饋調整並再次確認。
DO NOT PROCEED TO PHASE 2.5 UNTIL THE USER EXPLICITLY APPROVES THE DRAFT.
更新 todo,標記 Phase 2 完成。
Goal: 將確認的 Stories 同步到 Issue Tracker(Linear / Jira),並將外部 ID 寫回 frontmatter。
何時觸發:Phase 2 使用者確認草稿後自動進入。
何時跳過:
Actions:
使用 AskUserQuestion 詢問使用者:
等待使用者回答後再繼續。
若使用者選擇同步:
a. 檢查既有映射:讀取每個 Story 檔案的 frontmatter:
tracker_id → 比對 synced_at 與 Tracker 的 updatedAt
tracker_id → 建立新 issueb. 建立 / 更新 Issues:透過 MCP 工具(如 mcp__plugin_linear_linear__save_issue):
priority 對應(P0→Urgent, P1→High, P2→Medium, P3→Low)type 和 priority 設定c. 寫回 frontmatter:將 Tracker 回傳的 ID 和時間寫入每個 Story 檔案:
tracker_type: linear
tracker_id: TIM-51
synced_at: 2026-03-21T07:06:51Z
向使用者呈現同步結果(建立了哪些 issues、更新了哪些)。
更新 todo,標記 Phase 2.5 完成。
Goal: 確保所有 Stories 達到 INVEST 標準,且無常見反模式。
DO NOT START WITHOUT USER APPROVAL FROM PHASE 2.
Required References:
references/05-invest-checklist.md — INVEST 六項標準references/06-anti-patterns.md — 七大反模式清單Actions:
啟動 spec-reviewer agent(via Task 工具)。
Agent 任務:「請對以下 Stories 進行 INVEST 逐條檢查與反模式掃描:[Phase 2 完成的 Stories 全文]。請讀取 references/05-invest-checklist.md 與 references/06-anti-patterns.md 作為評判依據。」
Agent 須回傳:
向使用者呈現審查結果。
若有需修正的 Story:
AskUserQuestion 詢問使用者:「立即修正 / 稍後修正 / 維持現狀」AskUserQuestion 呼叫中。所有 Stories 達到「良」或「優」後,輸出最終版本。
更新 todo,標記 Phase 3 完成。
Phase 0: Context Gathering
↓ AskUserQuestion (existing docs, sprint context, codebase?)
↓ [context-reader agent] ← 若有文件
↓ [codebase-explorer agent] ← 若有 codebase
↓ Build Context Summary
Phase 0.5: Story Decomposition(可選)
↓ 需要全局拆解?
├── 是 → [story-mapper agent] → Story Map + Stories 清單 → user confirm
└── 否 → 直接進入 Phase 1
Phase 1: Requirement Clarification
↓ AskUserQuestion (beneficiary, outcome, no-gos)
↓ Story type pre-classification → user confirm
↓ GATE: user confirms understanding
Phase 2: Story Writing
↓ Per requirement: classify → read template → fill → assign ID → label
↓ Write each Story to individual .md file with frontmatter
↓ Present draft to user
↓ GATE: user satisfied with draft
Phase 2.5: Tracker Sync
↓ AskUserQuestion (sync to tracker? which one? which project?)
├── 是 → Create/update issues via MCP → write back tracker_id to frontmatter
└── 否 → skip
Phase 3: Quality Review
↓ [spec-reviewer agent]
↓ Present INVEST + anti-pattern results
↓ If issues → back to Phase 2 (targeted fix)
↓ Final output when all stories pass
references/01-story-types.md — User Story vs. Enabler Story 的定義、格式、範例references/02-scoping.md — 範圍界定方法(Shape Up pitch、No-gos、Appetite)references/03-acceptance-criteria.md — 驗收標準撰寫原則與好壞對比範例references/04-prioritization.md — 優先序排定方法references/05-invest-checklist.md — INVEST 六項檢查標準與實際操作方式references/06-anti-patterns.md — 常見反模式清單與修正方式references/07-frameworks-comparison.md — 各方法論比較(JTBD、Shape Up、Working Backwards)references/08-workflow-conventions.md — 標題命名、Label 規則、Story ID 編號規則、模板對應references/09-story-mapping.md — Story Mapping 方法論(Activity → Task → Story 拆解、Release Slicing)assets/user-story.md — User Story 模板(Given-When-Then 驗收標準格式)assets/enabler-story.md — Enabler Story 模板(Given-When-Then 驗收標準格式)assets/spike.md — Spike 模板