superpowers-mcp 6.3.6 → 6.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.ja.md +56 -62
  2. package/README.ko.md +56 -64
  3. package/README.md +58 -65
  4. package/README.zh-TW.md +56 -64
  5. package/docs/maintainers/upstream-sync.md +42 -0
  6. package/docs/skill-compositions.ja.md +194 -0
  7. package/docs/skill-compositions.ko.md +194 -0
  8. package/docs/skill-compositions.md +216 -0
  9. package/docs/skill-compositions.zh-TW.md +194 -0
  10. package/out/server.js +105 -146
  11. package/out/setup-runner.js +16 -16
  12. package/out/setup.js +17 -17
  13. package/package.json +12 -6
  14. package/scripts/upstream-drift.js +346 -0
  15. package/skills/brainstorming/SKILL.md +125 -25
  16. package/skills/brainstorming/scripts/helper.js +1 -1
  17. package/skills/brainstorming/scripts/server.cjs +61 -6
  18. package/skills/brainstorming/scripts/start-server.ps1 +20 -1
  19. package/skills/brainstorming/scripts/start-server.sh +2 -2
  20. package/skills/executing-plans/SKILL.md +7 -1
  21. package/skills/finishing-a-development-branch/SKILL.md +15 -0
  22. package/skills/subagent-driven-development/SKILL.md +121 -36
  23. package/skills/subagent-driven-development/implementer-prompt.md +19 -0
  24. package/skills/subagent-driven-development/re-review-prompt.md +10 -4
  25. package/skills/subagent-driven-development/scripts/review-package +6 -0
  26. package/skills/subagent-driven-development/scripts/review-package.ps1 +7 -0
  27. package/skills/subagent-driven-development/scripts/sdd-workspace +11 -4
  28. package/skills/subagent-driven-development/scripts/sdd-workspace.ps1 +28 -3
  29. package/skills/subagent-driven-development/task-reviewer-prompt.md +28 -10
  30. package/skills/systematic-debugging/SKILL.md +1 -1
  31. package/skills/systematic-debugging/find-polluter.ps1 +7 -5
  32. package/skills/systematic-debugging/find-polluter.sh +11 -9
  33. package/skills/systematic-debugging/root-cause-tracing.md +2 -2
  34. package/skills/test-driven-development/SKILL.md +27 -3
  35. package/skills/test-driven-development/writing-good-tests.md +7 -0
  36. package/skills/using-git-worktrees/SKILL.md +12 -0
  37. package/skills/using-superpowers/SKILL.md +1 -1
  38. package/skills/verification-before-completion/SKILL.md +54 -1
  39. package/skills/writing-plans/SKILL.md +20 -5
  40. package/skills/writing-skills/SKILL.md +30 -0
@@ -0,0 +1,216 @@
1
+ # Superpowers MCP: Skill Compositions & Workflow Pipelines
2
+
3
+ [English](skill-compositions.md) | [繁體中文](skill-compositions.zh-TW.md) | [日本語](skill-compositions.ja.md) | [한국어](skill-compositions.ko.md)
4
+
5
+ > **Source of truth:** this English document is canonical. Update it first when skill behavior changes, then sync the translations.
6
+
7
+
8
+ ## 1. Choose a Workflow
9
+
10
+ These prompts are **interactive workflow launchers**, not server-side automation. Selecting one adds structured instructions to the conversation; the host agent must have file, terminal, and Git access and must call `read_skill` for each stage. The workflow pauses whenever a skill requires design approval, plan review, or a branch-finishing choice.
11
+
12
+ | Goal | MCP Prompt | What It Does |
13
+ | :--- | :--- | :--- |
14
+ | Build a new feature | `feature-pipeline` | Starts the complete interactive feature workflow. |
15
+ | Investigate and fix a complex bug | `structured-debug` | Starts the structured debugging workflow. |
16
+ | Plan a large refactor or migration | `skill-composition` with a refactor scenario | Recommends Pipeline 3; there is no dedicated launcher prompt yet. |
17
+ | Stabilize a legacy codebase | `skill-composition` with a legacy scenario | Recommends Pipeline 4; there is no dedicated launcher prompt yet. |
18
+
19
+ The portable invocation method is your client's **MCP Prompts menu**. Slash-command names vary by client and may include the configured MCP server name. Merely mentioning a prompt name in ordinary chat does not guarantee that the client will retrieve that MCP prompt.
20
+
21
+ The same guide is exposed to MCP clients as `guide://superpowers/skill-compositions`.
22
+
23
+ ### Prerequisites
24
+
25
+ - Run in an agent session with access to the target repository, files, terminal, and Git.
26
+ - Worktree creation requires a Git repository and permission to create branches and directories.
27
+ - `subagent-driven-development` requires host-provided multi-agent tools. When unavailable, `feature-pipeline` uses `executing-plans` as its inline fallback.
28
+ - Pushes, pull requests, merges, and destructive cleanup remain explicit user decisions.
29
+
30
+ ## 2. Why Skill Compositions Matter
31
+
32
+ The 14 core skills in `superpowers-mcp` span the entire software development lifecycle (SDLC): from requirements discovery, architecture planning, isolated workspace setup, test-driven development (TDD), and systematic debugging, to full verification, code review, and branch integration.
33
+
34
+ While each atomic skill acts as a precision engineering tool, production-grade development requires **workflow orchestration**. Skill compositions transform ad-hoc AI interactions into disciplined, reproducible, and safety-guarded engineering pipelines.
35
+
36
+ ---
37
+
38
+ ## 3. Core Architectural Principles
39
+
40
+ When composing skills, always enforce these five safety mechanisms:
41
+
42
+ 1. **Isolation First (via Git Worktrees)**: Whenever coordinating multiple subagents or debugging independent hypotheses in parallel, always use `superpowers:using-git-worktrees` to avoid filesystem race conditions and workspace pollution.
43
+ 2. **Test-Driven by Default (TDD)**: No code modifications should occur without a failing test first (Red-Green-Refactor cycle) to guarantee regression safety.
44
+ 3. **Dual-Layer Review Gates**: Never skip task-level spec compliance checks or feature-level branch reviews (`requesting-code-review` / `receiving-code-review`).
45
+ 4. **Full Verification Before Completion**: Run the entire project test suite, type-checker, and linter (`verification-before-completion`) before claiming done or merging branches.
46
+ 5. **Remote-Safety Boundary (Local Commits Only)**: Keep commits local — no push/pull/fetch unless the plan or your human partner says so. Branch from a shared ref with `--no-track` (or `--unset-upstream` before the first commit) so a feature branch never tracks a shared branch, and never rewrite a shared branch (`git revert` is the only remedy you apply yourself).
47
+
48
+ ---
49
+
50
+ ## 4. Four Standard Workflow Pipelines
51
+
52
+ ### Pipeline 1: End-to-End Feature Development
53
+ **Ideal for:** Building new features, major modules, or core subsystem enhancements.
54
+
55
+ ```mermaid
56
+ flowchart LR
57
+ F1[brainstorming] --> F2[writing-plans]
58
+ F2 --> F3[using-git-worktrees]
59
+ F3 --> F4["subagent-driven-development / executing-plans (with TDD)"]
60
+ F4 --> F5[verification-before-completion]
61
+ F5 --> F6[requesting-code-review]
62
+ F6 --> F7[finishing-a-development-branch]
63
+ ```
64
+
65
+ | Step | Skill | Responsibility & Deliverable |
66
+ | :--- | :--- | :--- |
67
+ | **1. Requirements & Design** | `brainstorming` | Clarify intent, constraints, architecture decisions, and edge cases; confirm shared understanding, run the planning-handoff review, and output the Design Spec. |
68
+ | **2. Plan Construction** | `writing-plans` | Decompose Spec into bite-sized, testable tasks annotated with Recommended Skills. |
69
+ | **3. Workspace Isolation** | `using-git-worktrees` | Create an isolated Git worktree to protect the main branch and active work. |
70
+ | **4. Task Execution** | `subagent-driven-development` or `executing-plans` | Use fresh subagents when the host supports them; otherwise execute inline. Load `test-driven-development` for implementation tasks and enforce Red ➔ Green ➔ Refactor. |
71
+ | **5. Full Suite Verification** | `verification-before-completion` | Execute the full test suite, linter, and type checks to ensure zero regressions; when there is no test command, re-open the artifact and account for every part of the request. |
72
+ | **6. Adversarial Review** | `requesting-code-review` | Assemble review package and perform comprehensive code & architecture reviews. |
73
+ | **7. Branch Finalization** | `finishing-a-development-branch` | Export deferred findings (PR checklist or committed follow-ups file), then present the available merge/PR/keep choices and perform only the option the user selects. |
74
+
75
+ ---
76
+
77
+ ### Pipeline 2: Structured Troubleshooting & Multi-failure Debugging
78
+ **Ideal for:** Complex bugs, flaky tests, multiple test failures, or production incidents.
79
+
80
+ ```mermaid
81
+ flowchart LR
82
+ D1[systematic-debugging] --> D2[using-git-worktrees]
83
+ D2 --> D3[dispatching-parallel-agents]
84
+ D3 --> D4[test-driven-development]
85
+ D4 --> D5[verification-before-completion]
86
+ D5 --> D6[requesting-code-review]
87
+ D6 --> D7[finishing-a-development-branch]
88
+ ```
89
+
90
+ 1. **`systematic-debugging`**: Investigate root causes and break failures into distinct, testable hypotheses.
91
+ 2. **`using-git-worktrees`**: Provision isolated worktrees for parallel investigations to prevent test interference.
92
+ 3. **`dispatching-parallel-agents`**: Dispatch concurrent subagents to validate or invalidate individual hypotheses.
93
+ 4. **`test-driven-development`**: Write minimal failing reproduction tests before applying targeted bugfixes.
94
+ 5. **`verification-before-completion`**: Validate that all repository tests pass with clean outputs.
95
+ 6. **`requesting-code-review`** (and `receiving-code-review`): Review the fix delta, ensure defensive regression test coverage, and resolve review findings.
96
+ 7. **`finishing-a-development-branch`**: Merge the bugfix branch, remove temporary worktrees, and clean up workspace.
97
+
98
+ ---
99
+
100
+ ### Pipeline 3: Large Refactoring & System Migration
101
+ **Ideal for:** Architectural refactors, framework migrations, or service decoupling.
102
+
103
+ ```mermaid
104
+ flowchart LR
105
+ R1[brainstorming] --> R2["writing-plans (skeleton-first)"]
106
+ R2 --> R3[using-git-worktrees]
107
+ R3 --> R4[subagent-driven-development]
108
+ R4 --> R5[verification-before-completion]
109
+ R5 --> R6[requesting-code-review]
110
+ R6 --> R7[finishing-a-development-branch]
111
+ ```
112
+
113
+ 1. **`brainstorming`**: Define interface contracts, transition strategies, and parity validation criteria.
114
+ 2. **`writing-plans` (Skeleton-First Mode)**: Design the thinnest end-to-end slice across all subsystems first.
115
+ 3. **`using-git-worktrees`**: Establish dedicated long-lived migration worktrees.
116
+ 4. **`subagent-driven-development`**: Execute phased refactoring tasks with mandatory per-task review gates.
117
+ 5. **`verification-before-completion`** + **`requesting-code-review`**: Full regression verification and architectural review.
118
+ 6. **`finishing-a-development-branch`**: Merge migration branch, clean up worktrees, and finalize delivery.
119
+
120
+ ---
121
+
122
+ ### Pipeline 4: Legacy Codebase Safety Net
123
+ **Ideal for:** Legacy codebases lacking automated test coverage or consistent patterns.
124
+
125
+ ```mermaid
126
+ flowchart LR
127
+ L1[brainstorming] --> L2[writing-plans]
128
+ L2 --> L3["test-driven-development (characterization)"]
129
+ L3 --> L4[systematic-debugging]
130
+ L4 --> L5[verification-before-completion]
131
+ ```
132
+
133
+ 1. **`brainstorming`**: Identify critical business paths and high-risk modules.
134
+ 2. **`writing-plans`**: Create a roadmap for adding characterization and boundary tests.
135
+ 3. **`test-driven-development`**: Author golden-master and regression tests against existing behaviors using the TDD characterization guard (mutate, verify failure, restore via VCS, stay green).
136
+ 4. **`systematic-debugging`**: Root-cause hidden defects surfaced while establishing test baselines.
137
+ 5. **`verification-before-completion`**: Solidify automated CI test barriers.
138
+
139
+ ---
140
+
141
+ ## 5. Plan-Driven Skill Metadata Schema
142
+
143
+ In plans generated by `writing-plans`, specify recommended skills for each task:
144
+
145
+ ```markdown
146
+ ### Task 1: Implement Token Authentication Middleware
147
+ - **Goal**: Validate JWT tokens and extract user claims
148
+ - **Target Files**: `src/auth/jwt.ts`, `tests/auth/jwt.test.ts`
149
+ - **Recommended Skill**: `superpowers:test-driven-development`
150
+ - **Task Brief**:
151
+ 1. Write failing test for expired and invalid signatures (FAIL)
152
+ 2. Implement minimal signature verification (PASS)
153
+ 3. Refactor with strict type safety
154
+ ```
155
+
156
+ ### Controller-to-Subagent Dispatch Protocol
157
+ When the controller agent dispatches a task subagent:
158
+ 1. The controller reads the `Recommended Skill` specified in the plan task.
159
+ 2. The controller injects instructions or guides the subagent to load that skill via `read_skill(skill_name)`.
160
+ 3. The subagent executes under the strict methodology of that skill (e.g., Red-Green-Refactor).
161
+
162
+ ---
163
+
164
+ ## 6. Native MCP Prompts Reference
165
+
166
+ `superpowers-mcp` provides native, ready-to-use MCP prompts across IDEs (Cursor, Antigravity, VS Code, Devin Desktop):
167
+
168
+ | MCP Prompt | Arguments | Purpose |
169
+ | :--- | :--- | :--- |
170
+ | **`feature-pipeline`** | required `feature_name`, optional `requirements` | Interactive launcher for end-to-end feature development. |
171
+ | **`structured-debug`** | `issue_description`, `failing_tests` | Interactive launcher for systematic debugging and optional multi-agent investigation. |
172
+ | **`skill-composition`** | `scenario` | Dynamic skill composition recommender for feature, debug, refactor, or legacy tasks. |
173
+ | **`session-start`** | - | Injects foundational Superpowers context and skill invocation rules. |
174
+ | **`sdd-implementer`** | `brief_file`, `task_name`, ... | SDD task implementer subagent prompt template. |
175
+ | **`sdd-task-reviewer`** | `brief_file`, `report_file`, `review_file`, ... | SDD per-task spec & quality reviewer prompt template. |
176
+ | **`sdd-re-review`** | `brief_file`, `review_file`, `previous_findings`, ... | SDD fix-round scoped re-reviewer prompt template. |
177
+ | **`spec-reviewer`** | `spec_file` | Adversarial design specification reviewer prompt template. |
178
+ | **`plan-reviewer`** | `plan_file`, `spec_file` | Adversarial implementation plan reviewer prompt template. |
179
+
180
+ ---
181
+
182
+ ## 7. Practical Usage Guide
183
+
184
+ With `superpowers-mcp` installed, start from a native MCP prompt and let its instructions load the required skills.
185
+
186
+ ### Method A: MCP Prompts Menu (Recommended)
187
+ In a client that supports MCP prompts:
188
+ 1. Confirm that the configured `superpowers` MCP server is connected.
189
+ 2. **New Feature Development**: Select `feature-pipeline` and provide `feature_name` plus optional `requirements`.
190
+ 3. **Troubleshooting & Bugfixes**: Select `structured-debug` and paste the error logs or failing test names.
191
+ 4. **Custom / Architecture Tasks**: Select `skill-composition` to let the AI recommend the best pipeline for your scenario.
192
+
193
+ Your client may also expose a namespaced slash command. Consult its prompt picker for the exact syntax rather than assuming `/feature-pipeline` is portable.
194
+
195
+ ### Method B: Natural-Language Fallback
196
+ You may ask the agent to follow a named workflow, but this does not guarantee that the client retrieves the native MCP prompt. For deterministic use, select it from the MCP Prompts menu.
197
+ - *"Please follow the `feature-pipeline` to build [Feature Name]."*
198
+ - *"Run the `structured-debug` workflow on this error: [Paste error / trace]."*
199
+ - *"Apply the Refactoring Pipeline from `docs/skill-compositions.md` to refactor [Module]."*
200
+
201
+ ### 💬 Interactive Step-by-Step Walkthrough Example:
202
+ ```text
203
+ [You]: (Selects the `feature-pipeline` MCP prompt and enters "coupon code checkout system".)
204
+ ↓
205
+ [AI]: (Loads brainstorming with `read_skill`) "Understood. Does the coupon have an expiry date, and can it stack with site-wide sales?"
206
+ ↓
207
+ [You]: "It has an expiry date, and it cannot stack."
208
+ ↓
209
+ [AI]: (After design approval, loads `writing-plans`) "Created implementation plan at docs/superpowers/plans/... Please review."
210
+ ↓
211
+ [You]: "Looks good, proceed."
212
+ ↓
213
+ [AI]: (Creates or verifies a worktree ➔ uses SDD or the inline fallback ➔ implements via TDD ➔ verifies ➔ reviews ➔ presents branch-finishing choices)
214
+ ↓
215
+ [AI]: "All tasks and full test suite passed (100%). Code review clean. Branch ready for merge!"
216
+ ```
@@ -0,0 +1,194 @@
1
+ # Superpowers MCP:技能編排與工作流流水線指南 (Skill Compositions & Workflow Pipelines)
2
+
3
+ [English](skill-compositions.md) | [繁體中文](skill-compositions.zh-TW.md) | [日本語](skill-compositions.ja.md) | [한국어](skill-compositions.ko.md)
4
+
5
+ > **重要:**這些 MCP prompts 是互動式工作流啟動器,不是伺服器端自動化。請從客戶端的 MCP Prompts 選單選取;slash command 語法依客戶端而異。Agent 必須能存取檔案、終端機與 Git,並透過 `read_skill` 載入各階段技能。流程會在設計核准、計畫審閱及分支收尾時等待使用者決定。完整指南也可透過 `guide://superpowers/skill-compositions` 讀取。
6
+
7
+ > **單一來源(Source of Truth):** 本英文文件為正式版本。技能行為變更時請先更新英文版,再同步翻譯。
8
+
9
+ ## 1. 為什麼需要技能組合 (Why Skill Compositions Matter)
10
+
11
+ `superpowers-mcp` 的 14 個核心技能涵蓋了現代軟體工程生命週期(SDLC)的各個階段:從需求澄清、架構規劃、隔離實作、TDD 開發、系統化除錯,到全套驗證、代碼審查與分支整合。
12
+
13
+ 單一技能如同「高精度的專業工具」,但真實開發需要「工作流編排(Orchestration)」。透過技能組合(Skill Composition),能將鬆散的 AI 操作轉化為嚴謹、可重複驗證、防護嚴密的工程流水線。
14
+
15
+ ---
16
+
17
+ ## 2. 核心架構守則 (Core Architectural Principles)
18
+
19
+ 在編排技能時,必須恪守以下五大防護機制:
20
+
21
+ 1. **物理隔離優先 (Isolation First via Git Worktrees)**:凡涉及多 Agent 協作或平行除錯,必須強制使用 `superpowers:using-git-worktrees` 建立獨立目錄,防止檔案衝突 (Race Condition) 與環境污染。
22
+ 2. **測試驅動開發 (TDD by Default)**:程式碼變更前必須先有失敗測試(Red-Green-Refactor),確保迴歸安全。
23
+ 3. **雙層審查閘門 (Dual-layer Review)**:Task 級別的規格合規檢查與 Feature 級別的全面分支審查(`requesting-code-review` / `receiving-code-review`)不可省略。
24
+ 4. **全套驗證後方可完結 (Verification Before Completion)**:在交付分支或聲明完成前,必須執行全專案測試套件(`verification-before-completion`)。
25
+ 5. **遠端安全邊界(Local Commits Only)**:Commit 一律保持本地,未經計畫或人類夥伴指示不得 push/pull/fetch;從共享 ref 開分支時必須 `--no-track`(或於首次 commit 前 `--unset-upstream`),確保功能分支不追蹤共享分支;且嚴禁改寫共享分支(只能以 `git revert` 前向修正)。
26
+
27
+ ---
28
+
29
+ ## 3. 四大標準工作流流水線 (Four Standard Workflow Pipelines)
30
+
31
+ ### Pipeline 1: 端到端新功能開發 (Feature Development Pipeline)
32
+ **適用於:** 從零開發新功能、新增模組或重構核心流程。
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ F1[brainstorming] --> F2[writing-plans]
37
+ F2 --> F3[using-git-worktrees]
38
+ F3 --> F4[subagent-driven-development / executing-plans]
39
+ F4 --> F5[test-driven-development]
40
+ F5 --> F6[verification-before-completion]
41
+ F6 --> F7[requesting-code-review]
42
+ F7 --> F8[finishing-a-development-branch]
43
+ ```
44
+
45
+ | 步驟 | 技能 (Skill) | 職責與產出 |
46
+ | :--- | :--- | :--- |
47
+ | **1. 需求與設計** | `brainstorming` | 釐清需求、約束、架構決策與邊界條件,先確認共識理解、通過規劃交接審查,再輸出 Spec/設計文檔。 |
48
+ | **2. 計畫制定** | `writing-plans` | 將 Spec 轉化為可獨立驗證的原子任務清單,標註 Recommended Skill。 |
49
+ | **3. 環境隔離** | `using-git-worktrees` | 建立獨立的 Git Worktree 工作區,保護主分支與日常工作。 |
50
+ | **4. 任務執行** | `subagent-driven-development` | 派發獨立 Subagent 依序執行任務,嚴守上下文乾淨原則。 |
51
+ | **5. 邏輯實作** | `test-driven-development` | 針對各任務邏輯,嚴格執行 Red ➔ Green ➔ Refactor 流程。 |
52
+ | **6. 全套驗證** | `verification-before-completion` | 執行專案完整測試套件、Linter、型別檢查,確認無迴歸問題;若無測試指令,則須重新開啟成品並逐項核對需求。 |
53
+ | **7. 程式碼審查** | `requesting-code-review` | 產生 Review Package,發起多維度架構與程式碼品質審查。 |
54
+ | **8. 分支收尾** | `finishing-a-development-branch` | 先匯出延後發現(PR 清單或提交 follow-ups 檔),再合併/PR、清理 Worktree、刪除暫存分支。 |
55
+
56
+ ---
57
+
58
+ ### Pipeline 2: 結構化多點除錯 (Structured Troubleshooting Pipeline)
59
+ **適用於:** 處理多個測試失敗、難以重現的 Bug 或生產環境 Incident。
60
+
61
+ ```mermaid
62
+ flowchart LR
63
+ D1[systematic-debugging] --> D2[using-git-worktrees]
64
+ D2 --> D3[dispatching-parallel-agents]
65
+ D3 --> D4[test-driven-development]
66
+ D4 --> D5[verification-before-completion]
67
+ D5 --> D6[requesting-code-review]
68
+ D6 --> D7[finishing-a-development-branch]
69
+ ```
70
+
71
+ 1. **`systematic-debugging`**:分析根因,拆解為獨立的待驗證假說或子問題。
72
+ 2. **`using-git-worktrees`**:為平行調查的子問題建立隔離 Worktrees,避免測試環境與檔案讀寫干擾。
73
+ 3. **`dispatching-parallel-agents`**:平行分派 Agent 驗證各假說與修復方案。
74
+ 4. **`test-driven-development`**:為確認的 Bug 編寫重現測試(Reproduction Test),接著進行修復。
75
+ 5. **`verification-before-completion`**:驗證全部測試通過,確保修復未破壞其他功能。
76
+ 6. **`requesting-code-review`**(與 `receiving-code-review`):審查 Bugfix 差異與防護測試完整性,並徹底解決所有審查發現。
77
+ 7. **`finishing-a-development-branch`**:完成分支合併/PR,安全刪除暫存 Worktree 與過期分支。
78
+
79
+ ---
80
+
81
+ ### Pipeline 3: 大型重構與系統遷移 (Large Refactoring & Migration Pipeline)
82
+ **適用於:** 核心架構重構、框架升級或微服務拆分。
83
+
84
+ ```mermaid
85
+ flowchart LR
86
+ R1[brainstorming] --> R2["writing-plans (skeleton-first)"]
87
+ R2 --> R3[using-git-worktrees]
88
+ R3 --> R4[subagent-driven-development]
89
+ R4 --> R5[verification-before-completion]
90
+ R5 --> R6[requesting-code-review]
91
+ R6 --> R7[finishing-a-development-branch]
92
+ ```
93
+
94
+ 1. **`brainstorming`**:定義新舊介面相容性、過渡策略與驗證標準。
95
+ 2. **`writing-plans` (採用 Skeleton-First 模式)**:規劃端到端最小骨架,並拆解各子系統階段任務。
96
+ 3. **`using-git-worktrees`**:建立重構專用長效 Worktree。
97
+ 4. **`subagent-driven-development`**:分階段重構,每一階段均有獨立 Task Review 確保架構未走偏。
98
+ 5. **`verification-before-completion`** + **`requesting-code-review`**:全面迴歸測試與專家架構審查。
99
+ 6. **`finishing-a-development-branch`**:合併遷移分支,清理 Worktrees,乾淨收尾。
100
+
101
+ ---
102
+
103
+ ### Pipeline 4: 舊專案工程防護網建立 (Legacy Codebase Safety Net)
104
+ **適用於:** 缺乏單元測試或架構混亂的遺留代碼庫。
105
+
106
+ ```mermaid
107
+ flowchart LR
108
+ L1[brainstorming] --> L2[writing-plans]
109
+ L2 --> L3["test-driven-development (characterization)"]
110
+ L3 --> L4[systematic-debugging]
111
+ L4 --> L5[verification-before-completion]
112
+ ```
113
+
114
+ 1. **`brainstorming`**:辨識系統關鍵路徑(Critical Path)與高風險模組。
115
+ 2. **`writing-plans`**:制定防護測試(Characterization Tests)補充計畫。
116
+ 3. **`test-driven-development`**:以 TDD 特徵化守門(變異→確認失敗→VCS 還原→維持綠燈)為既有行為編寫金絲雀與規格測試。
117
+ 4. **`systematic-debugging`**:針對補測試過程中發現的潛在隱患進行根因排查。
118
+ 5. **`verification-before-completion`**:建立 CI/CD 測試防線。
119
+
120
+ ---
121
+
122
+ ## 4. 計畫驅動的技能編排規格 (Plan-Driven Skill Metadata Schema)
123
+
124
+ 在 `writing-plans` 產生的 Implementation Plan 中,可針對各任務指定建議使用的 Skill:
125
+
126
+ ```markdown
127
+ ### Task 1: 實作 Token 驗證中介軟體 (Token Middleware)
128
+ - **Goal**: 驗證 JWT Token 並解析 Claims
129
+ - **Target Files**: `src/auth/jwt.ts`, `tests/auth/jwt.test.ts`
130
+ - **Recommended Skill**: `superpowers:test-driven-development`
131
+ - **Task Brief**:
132
+ 1. 編寫 JWT 簽名與過期驗證測試 (FAIL)
133
+ 2. 實作驗證邏輯使測試通過 (PASS)
134
+ 3. 重構並確保型別安全
135
+ ```
136
+
137
+ ### 主 Agent 與 Subagent 調度協議
138
+ 當主 Agent 根據 Plan 派發 Subagent 時:
139
+ 1. 主 Agent 讀取 Task 中的 `Recommended Skill`。
140
+ 2. 主 Agent 透過 `read_skill(skill_name)` 獲取該技能內容,或在 Prompt 中指示 Subagent 自行讀取。
141
+ 3. Subagent 嚴格按照該技能的工作守則(例如 TDD 的紅綠重構環節)執行任務。
142
+
143
+ ---
144
+
145
+ ## 5. MCP Prompts 跨平台支援
146
+
147
+ 為了讓 Cursor, Antigravity, VS Code, Devin Desktop 等客戶端能一鍵發起技能組合,`superpowers-mcp` 原生提供了標準 MCP Prompts:
148
+
149
+ | MCP Prompt 名稱 | 參數 | 用途 |
150
+ | :--- | :--- | :--- |
151
+ | **`feature-pipeline`** | 必填 `feature_name`、選填 `requirements` | 啟動互動式端到端新功能開發流程 |
152
+ | **`structured-debug`** | `issue_description`, `failing_tests` | 啟動互動式結構化除錯流程;主機支援時可平行驗證假說 |
153
+ | **`skill-composition`** | `scenario` | 根據開發情境動態推薦技能組合流程 |
154
+ | **`session-start`** | - | 注入 Superpowers 基礎環境與技能使用守則 |
155
+ | **`sdd-implementer`** | `brief_file`, `task_name`, ... | SDD 任務實作子代理 Prompt |
156
+ | **`sdd-task-reviewer`** | `brief_file`, `report_file`, `review_file`, ... | SDD 單一任務審查子代理 Prompt |
157
+ | **`sdd-re-review`** | `brief_file`, `review_file`, `previous_findings`, ... | SDD 修復輪次局部覆審子代理 Prompt |
158
+ | **`spec-reviewer`** | `spec_file` | 對抗式設計規格審查子代理 Prompt |
159
+ | **`plan-reviewer`** | `plan_file`, `spec_file` | 對抗式實作計畫審查子代理 Prompt |
160
+
161
+ ---
162
+
163
+ ## 6. 如何在 IDE 中實際操作與觸發 (How to Use in Practice)
164
+
165
+ 只要安裝了 `superpowers-mcp`,您**完全不需要手動記住 14 個技能名稱**。有以下兩種最簡單的使用方式:
166
+
167
+ ### 方式 A:使用客戶端的 MCP Prompts 選單(最推薦)
168
+ 在 Cursor, Antigravity, VS Code 或 Devin Desktop 的對話框中:
169
+ 1. **開發新功能**:在 Prompts 選單中選擇 `feature-pipeline`,輸入必要的 `feature_name` 與選填的 `requirements`。Slash command 的實際名稱依客戶端而異,可能包含 MCP server namespace。
170
+ 2. **排查 Bug / 失敗測試**:選擇 `structured-debug`,貼上錯誤訊息或測試檔案。
171
+ 3. **不知道選什麼流程**:選擇 `skill-composition`,讓 AI 針對您的情境為您推薦專屬步驟。
172
+
173
+ ### 方式 B:直接用自然語言告訴 AI
174
+ 您也可以在一般對話中提出以下要求,但這不保證客戶端會取回原生 MCP prompt;需要確定行為時,請使用 MCP Prompts 選單:
175
+ - *「請按照 `feature-pipeline` 的流程,幫我開發 [功能名稱]」*
176
+ - *「請用 `structured-debug` 流程幫我分析並修復這個報錯:[貼上報錯訊息]」*
177
+ - *「請按照 `docs/skill-compositions.zh-TW.md` 的 Refactoring Pipeline 幫我重構 [模組名稱]」*
178
+
179
+ ### 💬 實戰互動節奏示範(以開發新功能為例):
180
+ ```text
181
+ 【您】:(從 MCP Prompts 選單選取 `feature-pipeline`,輸入「購物車折扣券功能」)
182
+ ↓
183
+ 【AI】:(透過 `read_skill` 載入 brainstorming)「好的,請問折扣券是否有使用期限?是否能與其他優惠疊加?」
184
+ ↓
185
+ 【您】:「有期限,不能與全館折扣疊加」
186
+ ↓
187
+ 【AI】:(設計核准後載入 writing-plans)「我已生成實作計畫 docs/superpowers/plans/...,請確認任務清單」
188
+ ↓
189
+ 【您】:「計畫沒問題,開始執行」
190
+ ↓
191
+ 【AI】:(建立或確認 worktree ➔ 使用 SDD 或行內 fallback ➔ TDD 實作 ➔ 驗證與審查 ➔ 提供分支收尾選項)
192
+ ↓
193
+ 【AI】: 「所有任務與全套測試皆已 100% 通過,Review 完成,分支已就緒!」
194
+ ```