superpowers-mcp 6.2.4 → 6.3.1

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 (27) hide show
  1. package/README.ja.md +26 -3
  2. package/README.ko.md +26 -3
  3. package/README.md +26 -3
  4. package/README.zh-TW.md +26 -3
  5. package/out/server.js +1 -1
  6. package/package.json +1 -1
  7. package/skills/brainstorming/SKILL.md +109 -9
  8. package/skills/finishing-a-development-branch/SKILL.md +30 -0
  9. package/skills/requesting-code-review/SKILL.md +1 -1
  10. package/skills/requesting-code-review/code-reviewer.md +9 -0
  11. package/skills/subagent-driven-development/SKILL.md +101 -29
  12. package/skills/subagent-driven-development/implementer-prompt.md +12 -0
  13. package/skills/subagent-driven-development/re-review-prompt.md +9 -0
  14. package/skills/subagent-driven-development/scripts/review-package +11 -1
  15. package/skills/subagent-driven-development/scripts/review-package.ps1 +13 -1
  16. package/skills/subagent-driven-development/scripts/sdd-workspace +43 -4
  17. package/skills/subagent-driven-development/scripts/sdd-workspace.ps1 +66 -4
  18. package/skills/subagent-driven-development/scripts/task-brief +1 -1
  19. package/skills/subagent-driven-development/scripts/task-brief.ps1 +1 -1
  20. package/skills/subagent-driven-development/task-reviewer-prompt.md +25 -5
  21. package/skills/test-driven-development/SKILL.md +10 -0
  22. package/skills/using-superpowers/SKILL.md +1 -0
  23. package/skills/using-superpowers/references/codex-tools.md +70 -1
  24. package/skills/using-superpowers/references/hermes-tools.md +56 -0
  25. package/skills/writing-plans/SKILL.md +3 -0
  26. package/skills/writing-skills/anthropic-best-practices.md +1 -1
  27. package/skills/writing-skills/render-graphs.js +3 -2
package/README.ja.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-6.2.4-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
5
+ [![バージョン](https://img.shields.io/badge/version-6.3.1-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
 
8
8
  このドキュメントは、オリジナルの Superpowers スキルライブラリを独立した MCP Toolpack にパッケージ化するための情報と使用手順をまとめたものです。
@@ -112,7 +112,7 @@
112
112
  これらのスキルは、サポートされている IDE(Antigravity や Cursor など)内で複雑なメタ実行パターンをオーケストレーションするために設計されています。
113
113
 
114
114
  - **`subagent-driven-development`**: サブエージェントを駆動してタスクを実行
115
- - **使用方法**: 定義済みの計画をタスクごとに実行します。システムはタスクごとに新しい「実装」サブエージェントを生成し、その後、統合された **タスクレビューアー**(仕様準拠 + コード品質)サブエージェントと、最後に **全ブランチ最終レビュー** を実行します。**Pre-Flight Plan Review** は、実行開始前のタスク競合をスキャンします。
115
+ - **使用方法**: 定義済みの計画をタスクごとに実行します。システムはタスクごとに新しい「実装」サブエージェントを生成し、その後、統合された **タスクレビューアー**(仕様準拠 + コード品質)サブエージェントと、最後に **全ブランチ最終レビュー** を実行します。**Pre-Flight Plan Review** は、実行開始前のタスク競合をスキャンします。計画は plan-scoped ワークスペース(`.superpowers/sdd/<plan>/`)で実行され、コントローラーは停止せずに衝突を裁定してレジャーに記録(rulings)し、同じ形の小タスクは 1 回のディスパッチにまとめられます。
116
116
  - **モデル選択**: タスクの複雑さに基づいてサブエージェントモデルを選択 — 機械的な作業には低コストモデル、アーキテクチャや微妙な並行性変更には高性能モデル。
117
117
  - **例**: 「subagent-driven-development スキルを読み込んで、docs/plans/feature-plan.md にリストされているタスクを 1 つずつ実行して」
118
118
  - **`dispatching-parallel-agents`**: タスクを並列エージェントに派遣
@@ -128,7 +128,30 @@
128
128
 
129
129
  ## 🆕 最近の更新
130
130
 
131
- ### v6.2.4(最新)
131
+ ### v6.3.1(最新)
132
+
133
+ - **SDD ワークスペース所有権マーカーと物理パス正規化**:`sdd-workspace`(Bash)と `sdd-workspace.ps1`(PowerShell)は `plan-path` マーカーと物理パス正規化(`pwd -P` および動的 `pwd` 検出)を使用。同名のプラン(`docs/alpha/plan.md` と `docs/beta/plan.md` など)が衝突せず個別の `.superpowers/sdd/` ワークスペースに分離されます。
134
+ - **SDD レビューパッケージ範囲ガード**:`review-package` および `review-package.ps1` は `git merge-base --is-ancestor BASE HEAD` とコミット数を検証し、空や逆転した範囲による誤判定(false-pass)を防止。
135
+ - **実行権限喪失への耐性**:`task-brief` と `review-package` は `"${BASH:-bash}"` で明示的に呼び出し、アーカイブ解凍等で `+x` 権限が失われても安定して動作。
136
+ - **TDD プロジェクトスイート検証フロア**:`skills/test-driven-development/SKILL.md` はタスク完了前にプロジェクト全体のテストコマンド(`npm test`、`pytest` 等)の実行を義務化。
137
+ - **Code Review ゴースト変更防止**:`skills/requesting-code-review/SKILL.md` で複数コミットのレビュー起点を `git merge-base origin/main HEAD` に固定。
138
+ - **Brainstorming ツールチェーン決定ゲート**:`skills/brainstorming/SKILL.md` の設計提示フェーズでツールチェーン設定を事前に確認し、`Global Constraints` に記録。
139
+ - **テスト拡充**:`tests/sdd/test-sdd-workspace.sh`(11 アサーション)を追加、PowerShell スイート(70 アサーション)を拡張。
140
+
141
+ ### v6.3.0
142
+
143
+ - **上流 obra/superpowers v6.3.0 との同期** — 適用可能な改善をすべて採用し、フォーク固有のセキュリティ強化と PowerShell サポートは維持。
144
+ - **brainstorming — 3 パスルーター**: すべてのリクエストを事前に `spike` / `bounded` / `architectural` に分類し、プロセス量をタスクに合わせて調整。ただし承認ゲートは常に全パスに適用されます。実行中に隠れた複雑さが判明した場合はパスをアップグレード — ダウングレードはありません。
145
+ - **subagent-driven-development — 裁定、停止しない(rulings, not stalls)**: 衝突・曖昧さ・計画の欠陥はコントローラーが直接裁定しレジャーに記録(`Ruling: ...`)。停止するのは明示された 4 条件のみ。Pre-flight 競合スキャンはレジャー表を出力し、同形状の小タスクは単一ディスパッチにバッチ化され、子エージェント待機は境界付きストレッチを使用。3 つのプロンプトすべてに no-subagents 契約を追加。
146
+ - **Hermes Agent サポート**: 新しい `hermes-tools.md` リファレンスがスキルアクションを Hermes ツール(`delegate_task`、`skill_view` など)にマッピング。
147
+ - **Codex**: V1/V2 マルチエージェントの違い、`followup_task` による修正ラウンド再開、イベント購読型 `wait_agent` のガイダンス。
148
+ - **writing-plans**: プランテンプレートに `Spec:` フィールドを追加。
149
+ - **finishing-a-development-branch**: worktree 削除拒否時の手順 — 自分の判断で `--force` しない。
150
+ - **デュアルエージェント code review による修正**: merged パスで「Commit them to \<branch\>」を選んでもファイルがベースブランチの外に取り残されない(finishing-a-development-branch)。`sdd-workspace.ps1` のスラッグ導出は全プラットフォームで `basename` と一致(`PLAN.MD` は `PLAN.MD` のまま)。
151
+ - **意図的に未採用**: 上流 v6.3.0 のサーバー簡素化(loopback-only バインド、`O_NOFOLLOW` 読み取り、nonce CSP、ローカルブランド SVG の削除)— 本パッケージは強化版サーバーを維持。上流の `.ps1` 削除と plugin-only 再構成もこの MCP サーバー構成には適用されません。
152
+ - **テスト**: MCP フロー、render-graphs(8 アサーション)、PowerShell 完全スイート(64 アサーション)すべて合格。
153
+
154
+ ### v6.2.4
132
155
 
133
156
  - **上流に合わせた brainstorm セッションの永続化**:`--project-dir` 指定時、companion はセッションキーを `.superpowers/brainstorm/.last-token`(オーナーのみ読み取り可、.gitignore 済み)に保存し、`.last-port` と並んで再起動後も再利用します——開いたままのブラウザタブは再起動後も接続を維持し、URL の再共有は不要です。一時 `/tmp` セッションでは従来どおり起動ごとにキーをローテーションします。明示的な `BRAINSTORM_TOKEN` 環境変数は常に優先され、ファイルには書き込まれません。強制的にローテーションするには、サーバー停止後に `.last-token` を削除してください。
134
157
  - **トークンファイル読み取り経路の強化**(`readPrivateFile`):シンボリックリンクや複数リンクの `.last-token` は拒否され、セッションキーとして採用されなくなります。読み取りは `O_NOFOLLOW` 付き fd 経由で行い、identity を再検証し 0600 に締め付けます——既に強化済みの書き込み経路との非対称性を解消しました(独立したセキュリティレビューで発見)。
package/README.ko.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-6.2.4-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
5
+ [![Version](https://img.shields.io/badge/version-6.3.1-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
 
8
8
  이 문서는 원본 Superpowers 스킬 라이브러리를 독립적인 MCP Toolpack으로 패키징하기 위한 정보와 사용 지침을 요약한 것입니다.
@@ -112,7 +112,7 @@
112
112
  이러한 스킬은 지원되는 IDE(Antigravity 또는 Cursor 등) 내에서 복잡한 메타 실행 패턴을 오케스트레이션하기 위해 설계되었습니다.
113
113
 
114
114
  - **`subagent-driven-development`**: 서브에이전트를 구동하여 작업 실행
115
- - **사용법**: 미리 정의된 계획을 작업별로 실행합니다. 시스템은 각 작업마다 새로운 "구현" 서브에이전트를 생성한 후, 통합된 **작업 리뷰어**(명세 준수 + 코드 품질) 서브에이전트와 마지막에 **전체 브랜치 최종 리뷰**를 실행합니다. **Pre-Flight Plan Review**는 실행 시작 전 작업 충돌을 스캔합니다.
115
+ - **사용법**: 미리 정의된 계획을 작업별로 실행합니다. 시스템은 각 작업마다 새로운 "구현" 서브에이전트를 생성한 후, 통합된 **작업 리뷰어**(명세 준수 + 코드 품질) 서브에이전트와 마지막에 **전체 브랜치 최종 리뷰**를 실행합니다. **Pre-Flight Plan Review**는 실행 시작 전 작업 충돌을 스캔합니다. 계획은 plan-scoped 워크스페이스(`.superpowers/sdd/<plan>/`)에서 실행되며, 컨트롤러는 멈추지 않고 충돌을 재결정하여 레저(ledger)에 기록(rulings)하고, 같은 형태의 작은 작업은 단일 디스패치로 배치 처리됩니다.
116
116
  - **모델 선택**: 작업 복잡성에 따라 서브에이전트 모델 선택 — 기계적인 작업에는 저비용 모델, 아키텍처 및 미묘한 동시성 변경에는 고성능 모델
117
117
  - **예시**: "subagent-driven-development 스킬을 읽고 docs/plans/feature-plan.md에 나열된 작업을 하나씩 실행해줘"
118
118
  - **`dispatching-parallel-agents`**: 작업을 병렬 에이전트에 할당
@@ -128,7 +128,30 @@
128
128
 
129
129
  ## 🆕 최근 업데이트
130
130
 
131
- ### v6.2.4 (최신)
131
+ ### v6.3.1 (최신)
132
+
133
+ - **SDD 워크스페이스 소유권 마커 및 물리 경로 정규화**: `sdd-workspace`(Bash) 및 `sdd-workspace.ps1`(PowerShell)은 `plan-path` 마커와 물리 경로 정규화(`pwd -P` 및 동적 `pwd` 감지)를 사용. 동일한 이름의 계획 파일(`docs/alpha/plan.md` 및 `docs/beta/plan.md` 등)이 충돌 없이 별도의 `.superpowers/sdd/` 워크스페이스로 격리됩니다.
134
+ - **SDD 리뷰 패키지 범위 가드**: `review-package` 및 `review-package.ps1`은 `git merge-base --is-ancestor BASE HEAD`와 커밋 수를 검증하여 비어 있거나 역전된 범위로 인한 오탐(false-pass)을 방지합니다.
135
+ - **실행 권한 상실에 대한 복원력**: `task-brief`와 `review-package`는 `"${BASH:-bash}"`로 명시적 호출하여 아카이브 압축 해제 등으로 `+x` 권限이 손실되어도 정상 동작합니다.
136
+ - **TDD 프로젝트 스위트 검증 하한선**: `skills/test-driven-development/SKILL.md`는 작업 완료 선언 전 프로젝트 전체 테스트 명령(`npm test`, `pytest` 등) 실행을 의무화합니다.
137
+ - **Code Review 유령 변경 방지**: `skills/requesting-code-review/SKILL.md`에서 다중 커밋의 리뷰 기준점을 `git merge-base origin/main HEAD`로 고정합니다.
138
+ - **Brainstorming 툴체인 결정 게이트**: `skills/brainstorming/SKILL.md`의 설계 제시 단계에서 툴체인 설정을 사전에 확인하고 `Global Constraints`에 기록합니다.
139
+ - **테스트 확장**: `tests/sdd/test-sdd-workspace.sh`(11개 어서션) 추가 및 PowerShell 스위트(70개 어서션) 확장.
140
+
141
+ ### v6.3.0
142
+
143
+ - **상류 obra/superpowers v6.3.0 동기화** — 적용 가능한 개선 사항을 모두 채택하고, 포크 고유의 보안 강화와 PowerShell 지원은 유지.
144
+ - **brainstorming — 3경로 라우터**: 모든 요청을 사전에 `spike` / `bounded` / `architectural`로 분류하며, 절차의 양은 작업 규모에 맞춰 조정됩니다. 단 승인 게이트는 모든 경로에 동일하게 적용됩니다. 실행 중 숨은 복잡성이 발견되면 경로를 업그레이드 — 다운그레이드는 없습니다.
145
+ - **subagent-driven-development — 멈추지 않고 재결정(rulings, not stalls)**: 충돌·모호성·계획 결함은 컨트롤러가 직접 재결정하고 레저에 기록(`Ruling: ...`). 명시된 4가지 조건에서만 실행을 중지합니다. Pre-flight 충돌 스캔은 레저 테이블을 산출하고, 같은 형태의 소규모 작업은 단일 디스패치로 배치되며, 서브에이전트 대기는 경계 있는 구간(bounded stretches)을 사용합니다. 세 프롬프트 모두 no-subagents 계약 추가.
146
+ - **Hermes Agent 지원**: 새 `hermes-tools.md` 참조 파일이 스킬 액션을 Hermes 도구(`delegate_task`, `skill_view` 등)에 매핑.
147
+ - **Codex**: V1/V2 멀티에이전트 차이, `followup_task` 수정 라운드 재개, 이벤트 구독형 `wait_agent` 가이드.
148
+ - **writing-plans**: 계획 템플릿에 `Spec:` 필드 추가.
149
+ - **finishing-a-development-branch**: worktree 제거 거부 시 절차 — 임의로 `--force`하지 않음.
150
+ - **이중 에이전트 code review 수정**: 병합 경로에서 "Commit them to \<branch\>"를 선택해도 파일이 베이스 브랜치 밖에 남지 않음(finishing-a-development-branch). `sdd-workspace.ps1`의 슬러그 도출은 모든 플랫폼에서 `basename`과 일치(`PLAN.MD`는 `PLAN.MD` 유지).
151
+ - **의도적으로 미채택**: 상류 v6.3.0의 서버 단순화(loopback-only 바인딩, `O_NOFOLLOW` 읽기, nonce CSP, 로컬 브랜드 SVG 제거) — 본 패키지는 강화된 서버를 유지합니다. 상류의 `.ps1` 삭제와 plugin-only 재구성도 이 MCP 서버 구성에는 적용되지 않습니다.
152
+ - **테스트**: MCP 플로우, render-graphs(8개 어서션), PowerShell 전체 스위트(64개 어서션) 모두 통과.
153
+
154
+ ### v6.2.4
132
155
 
133
156
  - **업스트림 정렬 — brainstorm 세션 영속화**: `--project-dir` 사용 시 companion이 세션 키를 `.superpowers/brainstorm/.last-token`(소유자 전용, .gitignore 적용)에 저장하고 `.last-port`와 함께 재시작 후에도 재사용합니다 — 이미 열린 브라우저 탭은 재시작 후에도 연결이 유지되며 URL을 다시 공유할 필요가 없습니다. 임시 `/tmp` 세션은 기존처럼 호출마다 키를 교체하며, 명시적 `BRAINSTORM_TOKEN` 환경 변수는 항상 우선하고 파일에 기록되지 않습니다. 강제 교체를 원하면 서버 중지 후 `.last-token`을 삭제하세요.
134
157
  - **토큰 파일 읽기 경로 강화** (`readPrivateFile`): 심볼릭 링크 또는 다중 링크 `.last-token`은 거부되어 세션 키로 채택되지 않습니다. 읽기는 `O_NOFOLLOW` fd를 통해 수행되고 identity를 재검증하며 0600으로 강화됩니다 — 이미 강화된 쓰기 경로와의 비대칭을 해소했습니다(독립 보안 리뷰에서 발견).
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-6.2.4-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
5
+ [![Version](https://img.shields.io/badge/version-6.3.1-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
6
6
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
 
8
8
  This document summarizes the information and usage instructions for packaging the original Superpowers skills library into an independent MCP Toolpack.
@@ -112,7 +112,7 @@ To help you choose the right skill, we've categorized them into 6 logical phases
112
112
  These skills are designed for orchestrating complex meta-execution patterns within supported IDEs (like Antigravity or Cursor).
113
113
 
114
114
  - **`subagent-driven-development`**: Driving sub-agents to execute tasks
115
- - **Usage**: Used to execute a predefined plan task-by-task. The system spawns a fresh "implementer" sub-agent per task, followed by a consolidated **task reviewer** (spec compliance + code quality) sub-agent, plus a **whole-branch final review** at the end. A **Pre-Flight Plan Review** scans for task conflicts before execution begins.
115
+ - **Usage**: Used to execute a predefined plan task-by-task. The system spawns a fresh "implementer" sub-agent per task, followed by a consolidated **task reviewer** (spec compliance + code quality) sub-agent, plus a **whole-branch final review** at the end. A **Pre-Flight Plan Review** scans for task conflicts before execution begins. Plans run in plan-scoped workspaces (`.superpowers/sdd/<plan>/`), the controller rules on conflicts and records them in the ledger instead of stopping, and small same-shape tasks are batched into a single dispatch.
116
116
  - **Model Selection**: Choose sub-agent models based on task complexity — cheaper models for mechanical work, capable models for architecture and subtle concurrency changes.
117
117
  - **Example**: "Read the subagent-driven-development skill, then execute the tasks listed in docs/plans/feature-plan.md one by one."
118
118
  - **`dispatching-parallel-agents`**: Dispatching tasks to parallel agents
@@ -128,7 +128,30 @@ These skills are designed for orchestrating complex meta-execution patterns with
128
128
 
129
129
  ## 🆕 Recent Updates
130
130
 
131
- ### v6.2.4 (Latest)
131
+ ### v6.3.1 (Latest)
132
+
133
+ - **SDD Ownership Markers & Path Normalization**: `sdd-workspace` (Bash) and `sdd-workspace.ps1` (PowerShell) now manage plan-scoped workspaces using `plan-path` markers with canonical physical path normalization (`pwd -P` and dynamic `pwd` detection). Same-basename plans (e.g. `docs/alpha/plan.md` vs `docs/beta/plan.md`) safely disambiguate into distinct `.superpowers/sdd/` workspaces, preventing artifact and ledger overwrites.
134
+ - **SDD Review Package Range Mechanical Guards**: `review-package` and `review-package.ps1` now enforce `git merge-base --is-ancestor BASE HEAD` and `git rev-list --count BASE..HEAD > 0` (exiting with code 3 on error) to reject invalid or empty commit ranges and prevent false-pass review approvals.
135
+ - **SDD Helper Resilience on Stripped Permissions**: `task-brief` and `review-package` invoke `sdd-workspace` via explicit `"${BASH:-bash}"`, surviving environments where execution bits (`+x`) are stripped during archive extraction.
136
+ - **TDD Verification Floor**: `skills/test-driven-development/SKILL.md` explicitly defines "green" as passing the entire repository test suite (e.g., bare `npm test`, `pytest`, `cargo test`) before declaring a task complete.
137
+ - **Code Review Merge-Base Anchoring**: `skills/requesting-code-review/SKILL.md` now anchors multi-commit review `BASE_SHA` to `git merge-base origin/main HEAD` to prevent phantom deletions when `origin/main` advances.
138
+ - **Brainstorming Tooling Decision Gate**: `skills/brainstorming/SKILL.md` adds a proactive tooling inquiry (linter, formatting, unit/e2e tests, fuzzing) during the Design Presentation phase for new projects, recording choices into the spec's `Global Constraints`.
139
+ - **Tests & Coverage**: Added `tests/sdd/test-sdd-workspace.sh` (11 assertions) and expanded PowerShell suites (70 assertions across 5 files). Full test suites passing 100%.
140
+
141
+ ### v6.3.0
142
+
143
+ - **Upstream sync with obra/superpowers v6.3.0** — all applicable improvements adopted, fork-specific security hardening and PowerShell support preserved.
144
+ - **brainstorming — three-path router**: every request is classified `spike` / `bounded` / `architectural` up front; the ceremony scales with the task but the approval gate never does. Hidden complexity upgrades the path mid-task — never downgrades.
145
+ - **subagent-driven-development — rulings, not stalls**: conflicts, ambiguities, and plan defects are ruled on and ledgered (`Ruling: ...`) instead of parking the session on a human; only four named conditions stop execution. Pre-flight conflict scans produce a ledgered table, small same-shape tasks batch into one dispatch, subagent waits use bounded stretches, and all three prompts carry the no-subagents contract.
146
+ - **Hermes Agent support**: new `hermes-tools.md` reference maps skill actions to Hermes tools (`delegate_task`, `skill_view`, …).
147
+ - **Codex**: V1/V2 multi-agent differences, `followup_task` fix-round resume, and event-subscription `wait_agent` guidance.
148
+ - **writing-plans**: plan template now carries a `Spec:` field.
149
+ - **finishing-a-development-branch**: worktree removal-refused procedure — never `--force` on your own initiative.
150
+ - **Fixes from dual-agent code review**: merged-path "commit them to \<branch\>" no longer strands files outside the base branch (finishing-a-development-branch); `sdd-workspace.ps1` slug derivation matches `basename` on all platforms (`PLAN.MD` stays `PLAN.MD`).
151
+ - **Not adopted (deliberate)**: upstream's v6.3.0 server simplification (it removed loopback-only enforcement, `O_NOFOLLOW` reads, nonce CSP, and the local brand SVG) — this package keeps its hardened server; upstream's `.ps1` deletions and plugin-only restructuring also don't apply to this MCP server layout.
152
+ - **Tests**: MCP flow, render-graphs (8 assertions), and the full PowerShell suite (64 assertions) all pass.
153
+
154
+ ### v6.2.4
132
155
 
133
156
  - **Upstream alignment — persistent brainstorm sessions**: with `--project-dir`, the companion now persists its session key to `.superpowers/brainstorm/.last-token` (owner-only, gitignored) alongside `.last-port` and reuses it across restarts — an already-open browser tab stays connected after a restart, no URL re-sharing needed. Ephemeral `/tmp` sessions keep rotating the key per invocation, and an explicit `BRAINSTORM_TOKEN` env var still wins and is never persisted. Delete `.last-token` (server stopped) to force a fresh key.
134
157
  - **Token-file read path hardened** (`readPrivateFile`): symlinked or multi-link `.last-token` files are rejected instead of being adopted as the session key, with the read performed through an `O_NOFOLLOW` fd whose identity is re-checked and tightened to 0600 — closing the asymmetry with the already-hardened write path (found by independent security review).
package/README.zh-TW.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [繁體中文](README.zh-TW.md) | [日本語](README.ja.md) | [한국어](README.ko.md)
4
4
 
5
- [![版本](https://img.shields.io/badge/version-6.2.4-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
5
+ [![版本](https://img.shields.io/badge/version-6.3.1-blue.svg)](https://github.com/Poseidoncode/superpowers-mcp)
6
6
  [![授權](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
7
7
 
8
8
  本文檔總結了將原始 Superpowers 技能庫打包成獨立 MCP Toolpack 的相關資訊與使用說明。
@@ -112,7 +112,7 @@
112
112
  這是特別針對在支援多重代理 (Multi-Agent) 協作或具備強大推論能力的 IDE(如 Antigravity 或 Cursor)中所設計的高階操作技巧。
113
113
 
114
114
  - **`subagent-driven-development`**: 驅動子代理執行複雜任務
115
- - **具體用法**:適用於「執行已規劃好的詳細計畫」。針對每一個小任務,AI 會派發全新的「實作代理」去寫 Code,完成後啟動合併的 **task reviewer**(規格 + 品質一次審查),並在最後執行 **whole-branch final review**(全分支最終審查)。在執行前還會進行 **Pre-Flight Plan Review**,掃描任務之間的潛在衝突。
115
+ - **具體用法**:適用於「執行已規劃好的詳細計畫」。針對每一個小任務,AI 會派發全新的「實作代理」去寫 Code,完成後啟動合併的 **task reviewer**(規格 + 品質一次審查),並在最後執行 **whole-branch final review**(全分支最終審查)。在執行前還會進行 **Pre-Flight Plan Review**,掃描任務之間的潛在衝突。計畫在 plan-scoped 工作區(`.superpowers/sdd/<plan>/`)執行;控制器對衝突直接裁決並記錄於 ledger(rulings),不再停擺等待;相同形狀的小任務會批次合併為單次派發。
116
116
  - **模型選擇**:根據任務複雜度選擇子代理模型 — 機械性工作用低成本模型,架構設計與細微併發變更需要強大模型。
117
117
  - **指令範例**:「用 read_skill 讀取 subagent-driven-development 技能,然後依照 docs/plans/feature-plan.md 的內容逐一派發子代理實作。」
118
118
  - **`dispatching-parallel-agents`**: 派發平行代理同步執行任務
@@ -128,7 +128,30 @@
128
128
 
129
129
  ## 🆕 最近更新
130
130
 
131
- ### v6.2.4 (最新版)
131
+ ### v6.3.1 (最新版)
132
+
133
+ - **SDD 工作區歸屬標記與實體路徑正規化**:`sdd-workspace`(Bash)與 `sdd-workspace.ps1`(PowerShell)改用 `plan-path` 歸屬標記與標準化實體路徑(`pwd -P` 與動態 `pwd` 偵測)。同名 plan(如 `docs/alpha/plan.md` 與 `docs/beta/plan.md`)會自動解析為獨立的 `.superpowers/sdd/` 工作區,杜絕產物與進度覆蓋。
134
+ - **SDD 審查包範圍機械守衛**:`review-package` 與 `review-package.ps1` 強制校驗 `git merge-base --is-ancestor BASE HEAD` 與 commit 數量大於 0(錯誤時 exit 3),防止空範圍或倒置範圍造成審查假綠燈。
135
+ - **執行權限剝離韌性**:`task-brief` 與 `review-package` 改以 `"${BASH:-bash}"` 調用,在解壓縮或跨系統搬移丟失 `+x` 權限時依然能穩定執行。
136
+ - **TDD 全套件驗證下限**:`skills/test-driven-development/SKILL.md` 明確規定任務完成前必須跑過全專案測試指令(如 `npm test`、`pytest`、`cargo test`)。
137
+ - **Code Review 防幽靈變更**:`skills/requesting-code-review/SKILL.md` 將多 commit 審查起點錨定為 `git merge-base origin/main HEAD`,消除 main 推進引發的幽靈刪除。
138
+ - **Brainstorming 工具鏈決策門禁**:`skills/brainstorming/SKILL.md` 在設計展示階段主動詢問工具鏈配置並記錄於 `Global Constraints`。
139
+ - **測試擴充**:新增 `tests/sdd/test-sdd-workspace.sh`(11 項斷言)並擴充 PowerShell 套件(70 項斷言)。
140
+
141
+ ### v6.3.0
142
+
143
+ - **對齊上游 obra/superpowers v6.3.0** — 採用所有適用改進,保留本 fork 的安全強化與 PowerShell 支援。
144
+ - **brainstorming — 三路分類流程(three-path router)**:每個請求先分類為 `spike` / `bounded` / `architectural`;流程深度隨任務規模調整,但審批門檻永遠不變。隱藏複雜度會在執行途中升級路徑——絕不降級。
145
+ - **subagent-driven-development — 裁決而非停擺(rulings, not stalls)**:衝突、歧義與計畫缺陷由控制器直接裁決並記錄於 ledger(`Ruling: ...`),不再等待人類;僅四種明列情況會停止執行。Pre-flight 衝突掃描產出 ledger 表格,相同形狀的小任務批次合併為單次派發,子代理等待改用有界區間,三個 prompt 都帶有 no-subagents 契約。
146
+ - **Hermes Agent 支援**:新增 `hermes-tools.md` 參考檔,將技能動作對應到 Hermes 工具(`delegate_task`、`skill_view` 等)。
147
+ - **Codex**:V1/V2 多代理差異、`followup_task` 修復輪恢復、事件訂閱式 `wait_agent` 指引。
148
+ - **writing-plans**:計畫範本新增 `Spec:` 欄位。
149
+ - **finishing-a-development-branch**:worktree 移除被拒時的處理程序——絕不擅自 `--force`。
150
+ - **雙代理 code review 修復**:merged path 下「Commit them to \<branch\>」不再讓檔案遺留在 base branch 之外(finishing-a-development-branch);`sdd-workspace.ps1` 的 slug 推導在所有平台與 `basename` 一致(`PLAN.MD` 維持 `PLAN.MD`)。
151
+ - **刻意未採用**:上游 v6.3.0 的 server 簡化(移除 loopback-only 綁定、`O_NOFOLLOW` 讀取、nonce CSP、本地品牌 SVG)——本套件保留加固版 server;上游刪除 `.ps1` 及轉為 plugin-only 架構亦不適用於本 MCP server 佈局。
152
+ - **測試**:MCP 流程、render-graphs(8 斷言)、完整 PowerShell 套件(64 斷言)全部通過。
153
+
154
+ ### v6.2.4
132
155
 
133
156
  - **對齊上游 — brainstorm 持久化 session**:搭配 `--project-dir` 時,companion 現在會把 session 金鑰持久化到 `.superpowers/brainstorm/.last-token`(僅擁有者可讀、已列入 .gitignore),與 `.last-port` 並存並在重啟後重用——已開啟的瀏覽器分頁在重啟後依然保持連線,無需重新分享 URL。暫存 `/tmp` session 仍維持每次啟動輪換金鑰;明確設定的 `BRAINSTORM_TOKEN` env 依然優先且永不寫入檔案。若要強制輪換,請在停止伺服器後刪除 `.last-token`。
134
157
  - **Token 檔讀取路徑加固**(`readPrivateFile`):symlink 或多重連結的 `.last-token` 現在會被拒絕,不再被採納為 session 金鑰;讀取透過 `O_NOFOLLOW` fd 進行,身份複查並收緊為 0600——補上與已加固寫入路徑之間的不對稱(由獨立資安審查發現)。
package/out/server.js CHANGED
@@ -49,7 +49,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
49
49
  `}var vs=class{constructor(t=hf.default.stdin,r=hf.default.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new gs,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=j_(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};var ze=sr(require("fs/promises")),ye=sr(require("path")),$n=10*1024*1024,ys=class{skillsPath;cachedSkills=null;loadingPromise=null;skillMap=new Map;contentCache=new Map;constructor(t){this.skillsPath=t}stripQuotes(t){return t.replace(/^"(.*)"$|^'(.*)'$/,"$1$2").trim()}parseFrontmatter(t){let r=t;if(r.charCodeAt(0)===65279&&(r=r.slice(1)),!r.startsWith("---"))return{name:"",description:""};let n=r.split(/\r?\n/),o=[],i=!1;for(let u=1;u<n.length;u++){if(n[u].trim()==="---"){i=!0;break}o.push(n[u])}if(!i)return{name:"",description:""};let a="",s="",c=!1;for(let u of o){let l=u.match(/^name:\s*(.*?)\s*$/);if(l){a=this.stripQuotes(l[1]),c=!1;continue}let d=u.match(/^description:\s*(.*?)\s*$/);if(d){s=this.stripQuotes(d[1]),c=!0;continue}c&&/^\s+/.test(u)?s+=" "+u.trim():c=!1}return{name:a,description:s}}async exists(t){try{return await ze.access(t),!0}catch{return!1}}async listSkills(t=!1){if(this.cachedSkills&&!t)return this.cachedSkills;if(this.loadingPromise&&!t)return this.loadingPromise;t&&this.contentCache.clear();let r=this.internalListSkills();this.loadingPromise=r;try{return await r}finally{this.loadingPromise===r&&(this.loadingPromise=null)}}async internalListSkills(){if(!await this.exists(this.skillsPath))return this.cachedSkills??[];let t=[],r=new Map,n=!1;try{let o=await ze.readdir(this.skillsPath,{withFileTypes:!0});for(let i of o){if(!i.isDirectory()&&!i.isSymbolicLink())continue;let a=ye.join(this.skillsPath,i.name),s=ye.join(a,"SKILL.md");if(await this.exists(s))try{let c=await this.readFileNoFollow(s,this.skillsPath),{name:u,description:l}=this.parseFrontmatter(c),m={name:u||i.name,description:l,skillPath:s};t.push(m),r.set(m.name.toLowerCase(),m);let p=ye.basename(ye.dirname(m.skillPath)).toLowerCase();r.set(p,m)}catch{process.stderr.write(`Warning: Failed to read skill file in directory "${i.name}"
50
50
  `)}}n=!0}catch(o){process.stderr.write(`Error reading skills directory: ${String(o)}
51
51
  `)}return n&&(this.skillMap=r,this.cachedSkills=t.sort((o,i)=>o.name.localeCompare(i.name))),this.cachedSkills??[]}async findSkill(t){let r=typeof t=="string"?t.trim():"";if(!(!r||r==="."||r===".."||r.includes("/")||r.includes("\\")||r.includes("\0")))return this.cachedSkills||await this.listSkills(),this.skillMap.get(r.toLowerCase())}async readFileNoFollow(t,r){let n=ye.resolve(t),o=ye.resolve(r),i=async()=>{let l=await ze.realpath(n),d=await ze.realpath(o);if(!(await ze.stat(d)).isDirectory())throw new Error("Skills directory must be a directory");let p=ye.relative(d,l);if(p===".."||p.startsWith(`..${ye.sep}`)||ye.isAbsolute(p))throw new Error("File is outside skills directory");let h=await ze.stat(l);if(!h.isFile()||h.nlink!==1)throw new Error("Skill path is not a regular file");if(h.size>$n)throw new Error("Skill file exceeds size limit");return{realFilePath:l,stat:h}},a=await i(),s=await i();if(a.realFilePath!==s.realFilePath||a.stat.dev!==s.stat.dev||a.stat.ino!==s.stat.ino)throw new Error("File changed while validating its path");let c=process.platform==="win32"?0:ze.constants.O_NOFOLLOW,u=await ze.open(s.realFilePath,ze.constants.O_RDONLY|c);try{let l=await u.stat();if(!l.isFile()||l.nlink!==1||l.dev!==s.stat.dev||l.ino!==s.stat.ino||l.size>$n)throw new Error("File changed while opening");let d=[],m=64*1024,p=0;for(;p<=$n;){let v=Buffer.allocUnsafe(Math.min(m,$n+1-p)),{bytesRead:$}=await u.read(v,0,v.length,null);if($===0)break;if(p+=$,d.push(v.subarray(0,$)),p>$n)throw new Error("Skill file exceeds size limit")}let h=await u.stat();if(h.size>$n||h.dev!==s.stat.dev||h.ino!==s.stat.ino)throw new Error("File changed while reading");return Buffer.concat(d,p).toString("utf-8")}finally{await u.close()}}async readSkillContent(t,r=!1){let n=ye.resolve(t),o=ye.resolve(this.skillsPath),i=n,a=o;try{i=await ze.realpath(n),a=await ze.realpath(o)}catch{}let s=ye.relative(a,i);if(s.startsWith("..")||ye.isAbsolute(s))throw new Error(`Access denied: path "${t}" is outside skills directory`);if(this.contentCache.has(i)&&!r)return this.contentCache.get(i);try{let c=await this.readFileNoFollow(t,this.skillsPath);c.charCodeAt(0)===65279&&(c=c.slice(1));let u=c.replace(/^---\s*\r?\n[\s\S]*?\r?\n---\s*\r?\n?/,"").trim();return this.contentCache.set(i,u),u}catch(c){throw new Error(`Failed to read skill content: ${c instanceof Error?c.message:String(c)}`)}}clearCache(){this.cachedSkills=null,this.loadingPromise=null,this.skillMap.clear(),this.contentCache.clear()}};function jT(){let e=process.env.SKILLS_PATH;if(e){let r=ct.resolve(e),n=ct.normalize(r).toLowerCase(),o=ct.parse(r).root.toLowerCase();if(n===o||["/etc","/var","/bin","/sbin","/usr","/root","/sys","/proc","/dev","c:\\windows","c:\\program files","c:\\program files (x86)"].some(s=>n===s||n.startsWith(s+ct.sep)))process.stderr.write(`Warning: Potentially unsafe SKILLS_PATH: "${e}". Fallback to default.
52
- `);else return r}let t=ct.join(__dirname,"..","skills");return E_.existsSync(t)?t:ct.join(__dirname,"skills")}var O_=jT(),It=new ys(O_),Pr=new hs({name:"superpowers-mcp",version:"6.2.4"},{capabilities:{resources:{subscribe:!1},prompts:{},tools:{}}});Pr.setRequestHandler(od,async()=>({resources:(await It.listSkills()).map(t=>({uri:`skill://superpowers/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,mimeType:"text/markdown"}))}));Pr.setRequestHandler(ad,async e=>{let t=e.params.uri,r=t.match(/^skill:\/\/superpowers\/(.+)$/);if(!r)throw new D(M.InvalidRequest,`Invalid skill URI: ${t}`);let n;try{n=decodeURIComponent(r[1])}catch{throw new D(M.InvalidRequest,`Invalid skill URI: ${t}`)}let o=await It.findSkill(n);if(!o)throw new D(M.InvalidRequest,`Skill not found: ${n}`);try{let i=await It.readSkillContent(o.skillPath);return{contents:[{uri:t,mimeType:"text/markdown",text:i}]}}catch{throw new D(M.InternalError,"Failed to read skill content safely.")}});Pr.setRequestHandler(sd,async()=>({prompts:[{name:"session-start",description:"Inject the Superpowers context into an AI agent session. Tells the agent it has superpowers and how to use the skill system."}]}));Pr.setRequestHandler(cd,async e=>{if(e.params.name!=="session-start")throw new D(M.InvalidRequest,`Unknown prompt: ${e.params.name}`);let t=await It.findSkill("using-superpowers"),r="";if(t)try{r=await It.readSkillContent(t.skillPath)}catch{r=`# Superpowers
52
+ `);else return r}let t=ct.join(__dirname,"..","skills");return E_.existsSync(t)?t:ct.join(__dirname,"skills")}var O_=jT(),It=new ys(O_),Pr=new hs({name:"superpowers-mcp",version:"6.3.1"},{capabilities:{resources:{subscribe:!1},prompts:{},tools:{}}});Pr.setRequestHandler(od,async()=>({resources:(await It.listSkills()).map(t=>({uri:`skill://superpowers/${encodeURIComponent(t.name)}`,name:t.name,description:t.description,mimeType:"text/markdown"}))}));Pr.setRequestHandler(ad,async e=>{let t=e.params.uri,r=t.match(/^skill:\/\/superpowers\/(.+)$/);if(!r)throw new D(M.InvalidRequest,`Invalid skill URI: ${t}`);let n;try{n=decodeURIComponent(r[1])}catch{throw new D(M.InvalidRequest,`Invalid skill URI: ${t}`)}let o=await It.findSkill(n);if(!o)throw new D(M.InvalidRequest,`Skill not found: ${n}`);try{let i=await It.readSkillContent(o.skillPath);return{contents:[{uri:t,mimeType:"text/markdown",text:i}]}}catch{throw new D(M.InternalError,"Failed to read skill content safely.")}});Pr.setRequestHandler(sd,async()=>({prompts:[{name:"session-start",description:"Inject the Superpowers context into an AI agent session. Tells the agent it has superpowers and how to use the skill system."}]}));Pr.setRequestHandler(cd,async e=>{if(e.params.name!=="session-start")throw new D(M.InvalidRequest,`Unknown prompt: ${e.params.name}`);let t=await It.findSkill("using-superpowers"),r="";if(t)try{r=await It.readSkillContent(t.skillPath)}catch{r=`# Superpowers
53
53
 
54
54
  You have superpowers. Use the read_skill and list_skills tools to discover and load skills.`}else{let o=ct.join(O_,"using-superpowers","SKILL.md");try{r=await It.readSkillContent(o)}catch{r=`# Superpowers
55
55
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "superpowers-mcp",
3
3
  "displayName": "Superpowers MCP",
4
4
  "description": "Superpowers skills library (TDD, debugging, collaboration workflows) as an MCP server for VSCode and Antigravity",
5
- "version": "6.2.4",
5
+ "version": "6.3.1",
6
6
  "publisher": "superpowers",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -7,20 +7,91 @@ description: "You MUST use this before any creative work - creating features, bu
7
7
 
8
8
  Help turn ideas into fully formed designs and specs through natural collaborative dialogue.
9
9
 
10
- Start by understanding the current project context, then ask questions one at a time to refine the idea. Once you understand what you're building, present the design and get user approval.
10
+ Start by classifying how much process the request needs, then work
11
+ through your path: understand the context, refine the idea, present a
12
+ design, and get your human partner's approval.
11
13
 
12
14
  <HARD-GATE>
13
- Do NOT invoke any implementation skill, write any code, scaffold any project, or take any implementation action until you have presented a design and the user has approved it. This applies to EVERY project regardless of perceived simplicity.
15
+ Do NOT invoke any implementation skill, write any code, scaffold any
16
+ project, or take any implementation action until you have told your
17
+ human partner what you intend and they have approved it. This applies
18
+ to EVERY task on EVERY path below — the ceremony scales with the task;
19
+ the approval gate never does.
14
20
  </HARD-GATE>
15
21
 
16
- ## Anti-Pattern: "This Is Too Simple To Need A Design"
17
-
18
- Every project goes through this process. A todo list, a single-function utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause the most wasted work. The design can be short (a few sentences for truly simple projects), but you MUST present it and get approval.
22
+ ## Three Paths
23
+
24
+ Before your first question, classify the request and say the
25
+ classification out loud — "this looks bounded, so I'll present a short
26
+ design here rather than write a spec" — so your human partner can
27
+ override it:
28
+
29
+ - **Spike** — a feasibility question ("can we...", "is it possible...",
30
+ "quick and dirty is fine") whose output is an answer, not code you
31
+ keep. Present the question and what you'll try in 2-3 sentences, get
32
+ a nod, then find out as cheaply as correctness allows. No design
33
+ doc, no spec file. Report findings as a recommendation; anything you
34
+ built stays labeled throwaway.
35
+ - **Bounded** — a well-scoped change to code that already exists in
36
+ this repo: a new flag, a small endpoint, a one-file fix.
37
+ Understanding the kind of app is not enough — bounded means the flow
38
+ you are changing is already here to read. If there is no existing
39
+ flow to change, the task is not bounded. Ask the clarifying
40
+ questions that matter, present a short design IN CHAT (a few
41
+ sentences to a few short paragraphs), and STOP. Implementation
42
+ starts only after your human partner says yes to that design — a
43
+ bounded task's approval is as hard a gate as an architectural
44
+ one. No spec file, no implementation plan document.
45
+ - **Architectural** — new projects, new subsystems, changes that
46
+ restructure how components fit together or alter interfaces others
47
+ depend on. Follow the full process: questions, approaches, sectioned
48
+ design, written spec, then the writing-plans skill.
49
+
50
+ When in doubt between two paths, take the heavier one. The ratchet is
51
+ one-way: hidden complexity discovered mid-task upgrades the path —
52
+ stop, say so, and step up. Nothing downgrades mid-task.
53
+
54
+ ## Anti-Pattern: "Too Simple To Need Approval"
55
+
56
+ Every path ends with your human partner approving your intent before
57
+ implementation. A todo list, a single-function utility, a config
58
+ change — the design may be two sentences in chat, but you MUST present
59
+ it and get approval. "Simple" tasks are where unexamined assumptions
60
+ cause the most wasted work. What scales with simplicity is the
61
+ artifact, never the approval.
62
+
63
+ ## Red Flags
64
+
65
+ | Thought | Reality |
66
+ |---------|---------|
67
+ | "This is too simple to need a design" | Simple means a short design, not no design. Two sentences in chat, then approval. |
68
+ | "I'll call it bounded and skip the spec" | Reaching for a label to skip work IS the doubt — take the heavier path. |
69
+ | "It's bounded and the design is obvious — I'll start while they read it" | The gate is the approval, not the design's length. Present, then stop until you hear yes. |
70
+ | "I understand this kind of app, so it's bounded" | Bounded measures the repo, not your familiarity. A new project has no existing flow — it is architectural. |
71
+ | "The spike works, so I'll keep the code" | A spike's output is an answer. Keeping the code is a new request — classify it. |
72
+ | "It grew, but I'm almost done — no need to re-classify" | Hidden complexity upgrades the path mid-task. Stop and say so. |
73
+ | "They approved the spike, so the follow-up change is approved too" | Each task gets its own classification and its own approval. |
19
74
 
20
75
  ## Checklist
21
76
 
22
- You MUST create a task for each of these items and complete them in order:
77
+ Classify first, announce the path, then create a task for each item on
78
+ your path and complete them in order.
79
+
80
+ **Spike:**
81
+ 1. **Explore project context** — enough to frame the probe
82
+ 2. **Present question + probe plan** — 2-3 sentences
83
+ 3. **Get approval** — a nod is enough
84
+ 4. **Investigate** — as cheaply as correctness allows
85
+ 5. **Report findings** — a recommendation; label anything built as throwaway
86
+
87
+ **Bounded:**
88
+ 1. **Explore project context** — check files, docs, recent commits
89
+ 2. **Ask clarifying questions** — one at a time, the ones that matter
90
+ 3. **Present short design in chat** — approach, files touched, testing
91
+ 4. **Get approval** — STOP and wait for an explicit yes; presenting the design and starting in the same breath is skipping the gate
92
+ 5. **Implement** — proceed with the normal development workflow (TDD applies); no plan document
23
93
 
94
+ **Architectural:**
24
95
  1. **Explore project context** — check files, docs, recent commits
25
96
  2. **Offer the visual companion just-in-time** — NOT upfront. The first time a question would genuinely be clearer shown than described, offer it then (its own message); on approval its browser tab opens for you. If no visual question ever arises, never offer it. See the Visual Companion section below.
26
97
  3. **Ask clarifying questions** — one at a time, understand purpose/constraints/success criteria
@@ -35,6 +106,13 @@ You MUST create a task for each of these items and complete them in order:
35
106
 
36
107
  ```dot
37
108
  digraph brainstorming {
109
+ "Classify: spike / bounded / architectural" [shape=diamond];
110
+ "Present question + probe (2-3 sentences)" [shape=box];
111
+ "Ask clarifying questions (bounded)" [shape=box];
112
+ "Present short design in chat" [shape=box];
113
+ "Human approves?" [shape=diamond];
114
+ "Investigate; report recommendation" [shape=doublecircle];
115
+ "Implement via normal workflow (no plan doc)" [shape=doublecircle];
38
116
  "Explore project context" [shape=box];
39
117
  "Ask clarifying questions" [shape=box];
40
118
  "Propose 2-3 approaches" [shape=box];
@@ -44,7 +122,17 @@ digraph brainstorming {
44
122
  "Spec self-review\n(fix inline)" [shape=box];
45
123
  "User reviews spec?" [shape=diamond];
46
124
  "Invoke writing-plans skill" [shape=doublecircle];
47
-
125
+ "Hidden complexity? Upgrade path" [shape=box];
126
+
127
+ "Classify: spike / bounded / architectural" -> "Present question + probe (2-3 sentences)" [label="spike"];
128
+ "Classify: spike / bounded / architectural" -> "Ask clarifying questions (bounded)" [label="bounded"];
129
+ "Classify: spike / bounded / architectural" -> "Explore project context" [label="architectural"];
130
+ "Present question + probe (2-3 sentences)" -> "Human approves?";
131
+ "Ask clarifying questions (bounded)" -> "Present short design in chat";
132
+ "Present short design in chat" -> "Human approves?";
133
+ "Human approves?" -> "Investigate; report recommendation" [label="spike: yes"];
134
+ "Human approves?" -> "Implement via normal workflow (no plan doc)" [label="bounded: yes"];
135
+ "Hidden complexity? Upgrade path" -> "Classify: spike / bounded / architectural";
48
136
  "Explore project context" -> "Ask clarifying questions";
49
137
  "Ask clarifying questions" -> "Propose 2-3 approaches";
50
138
  "Propose 2-3 approaches" -> "Present design sections";
@@ -58,10 +146,21 @@ digraph brainstorming {
58
146
  }
59
147
  ```
60
148
 
61
- **The terminal state is invoking writing-plans.** Do NOT invoke frontend-design, mcp-builder, or any other implementation skill. The ONLY skill you invoke after brainstorming is writing-plans.
149
+ **Terminal states are path-bound.** Architectural: the ONLY skill you
150
+ invoke after brainstorming is writing-plans — never frontend-design,
151
+ mcp-builder, or any other implementation skill. Bounded: after
152
+ approval, implementation proceeds directly through the normal
153
+ development workflow; no plan document. Spike: the terminal state is a
154
+ reported recommendation.
62
155
 
63
156
  ## The Process
64
157
 
158
+ The subsections below serve the bounded and architectural paths (a
159
+ spike stops at "present the probe, get a nod"). Sections from
160
+ **Exploring approaches** onward are architectural-path depth — for
161
+ bounded work, context plus a few questions plus a short in-chat design
162
+ is the whole process.
163
+
65
164
  **Understanding the idea:**
66
165
 
67
166
  - Check out the current project state first (files, docs, recent commits)
@@ -85,6 +184,7 @@ digraph brainstorming {
85
184
  - Scale each section to its complexity: a few sentences if straightforward, up to 200-300 words if nuanced
86
185
  - Ask after each section whether it looks right so far
87
186
  - Cover: architecture, components, data flow, error handling, testing
187
+ - For a new project (or one with no configured tooling), the design presentation includes a short tooling question alongside the architecture: which of these to set up from the start — cheapest before any code exists: aggressive linting + auto-formatting (the stack's standard, e.g. ruff+format / eslint+prettier / clippy+rustfmt); unit-test infrastructure (runner, layout, a first passing fixture); end-to-end test infrastructure; fuzz or mutation testing where the stack supports it. The user's selections land in the spec's Global Constraints so every later plan and task inherits them.
88
188
  - Be ready to go back and clarify if something doesn't make sense
89
189
 
90
190
  **Design for isolation and clarity:**
@@ -100,7 +200,7 @@ digraph brainstorming {
100
200
  - Where existing code has problems that affect the work (e.g., a file that's grown too large, unclear boundaries, tangled responsibilities), include targeted improvements as part of the design - the way a good developer improves code they're working in.
101
201
  - Don't propose unrelated refactoring. Stay focused on what serves the current goal.
102
202
 
103
- ## After the Design
203
+ ## After the Design (architectural path)
104
204
 
105
205
  **Documentation:**
106
206
 
@@ -174,6 +174,35 @@ git worktree remove "$WORKTREE_PATH"
174
174
  git worktree prune # Self-healing: clean up any stale registrations
175
175
  ```
176
176
 
177
+ **If removal is refused** (`contains modified or untracked files`): the
178
+ worktree holds files that exist nowhere else — uncommitted plans, notes,
179
+ or scratch work. Never `--force` on your own initiative. Show your human
180
+ partner what is at stake and ask:
181
+
182
+ ```bash
183
+ git -C "$WORKTREE_PATH" status --porcelain -uall
184
+ ```
185
+
186
+ ```
187
+ Worktree removal refused — these files were never committed:
188
+
189
+ <file list>
190
+
191
+ 1. Commit them to <branch> before cleanup
192
+ 2. Move them into <main repo root>
193
+ 3. Delete them (unrecoverable)
194
+
195
+ Which?
196
+ ```
197
+
198
+ Carry out the choice, then remove the worktree.
199
+
200
+ **If you chose "Commit them to <branch>" after a merge (Option 1):** the
201
+ new commit sits on top of the merge, so `git branch -d <feature-branch>`
202
+ will refuse ("not fully merged"). Merge the branch into the base branch
203
+ again — or cherry-pick the new commit there — before cleanup, so the
204
+ saved files survive the branch deletion.
205
+
177
206
  **Otherwise:** The host environment owns this workspace — leave it in
178
207
  place. If your platform provides a workspace-exit tool, use it.
179
208
 
@@ -196,6 +225,7 @@ place. If your platform provides a workspace-exit tool, use it.
196
225
  | "'Yeah, get rid of it' counts as confirmation" | Only the typed word `discard` authorizes deletion. |
197
226
  | "The PR is up, so the worktree is clutter now" | PR feedback gets fixed in that worktree. It stays until the work lands. |
198
227
  | "This other worktree looks stale — I'll clean it too" | Clean up only worktrees under `.worktrees/` or `worktrees/`. Everything else belongs to the host. |
228
+ | "Removal refused — `--force` is just finishing the cleanup" | The refusal means files exist only in that worktree. `--force` destroys them permanently. Show your human partner and ask. |
199
229
  | "The merged-result failure is probably flaky" | A failing merged result stops everything. Branch and worktree stay put while you investigate. |
200
230
  | "The base branch is obviously main" | Confirm the fork point or ask. Merging into the wrong base is expensive to undo. |
201
231
  | "The push was rejected — force-push will fix it" | A rejected push means the remote moved. Investigate; force-push only on your human partner's explicit request. |
@@ -25,7 +25,7 @@ Dispatch a code reviewer subagent to catch issues before they cascade. The revie
25
25
 
26
26
  **1. Get git SHAs:**
27
27
  ```bash
28
- BASE_SHA=$(git rev-parse HEAD~1) # or origin/main
28
+ BASE_SHA=$(git rev-parse HEAD~1) # or: git merge-base origin/main HEAD
29
29
  HEAD_SHA=$(git rev-parse HEAD)
30
30
  ```
31
31
 
@@ -34,6 +34,15 @@ Subagent (general-purpose):
34
34
 
35
35
  Your review is read-only on this checkout. Do not mutate the working tree, the index, HEAD, or branch state in any way. Use tools like `git show`, `git diff`, and `git log` to inspect history. If you need a working copy of a different revision, check it out into a separate temporary directory (e.g. `git worktree add /tmp/review-[SHA] [SHA]`) — never move HEAD on this checkout.
36
36
 
37
+ ## You Do Not Dispatch Subagents
38
+
39
+ Do all of this review yourself. Never spawn a subagent to review part
40
+ of the diff, and never spawn another reviewer for a second opinion.
41
+ This process already provides every review seat the work gets; a
42
+ reviewer you spawn duplicates one of them at full cost, and its
43
+ verdict counts for nothing. If the diff feels too large for one
44
+ pass, review it in passes yourself and say so in your report.
45
+
37
46
  ## What to Check
38
47
 
39
48
  **Plan alignment:**