phasegate 0.122.0 → 0.123.0

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.123.0] - 2026-05-08
11
+
12
+ ### Added
13
+
14
+ - **WI-088 Phase A — bundled guidance skill `phasegate-toolkit-guide`** — phasegate を導入したプロジェクトで AI エージェントが phasegate ツールキット自体の概念 (L0-L4 / 防御プリセット / アーキプリセット / Quick Mode / Hook 仕様 / config 全般) について質問されたとき、`node_modules/phasegate/docs/guide/` 配下の canonical doc を読み込んで正確に回答するための skill を追加。
15
+ - **設計原則 (stale 回避)**: SKILL 本体に概念知識を固定せず、概念カテゴリごとに canonical doc へのポインタのみを記述。`npm update phasegate` で knowledge が自動追従する構造。
16
+ - **新規ファイル**: `skills/phasegate-toolkit-guide/SKILL.md` を `skill-creator` スキル (`init_skill.py`) 経由で作成 (validation pass)。9 概念カテゴリ (L0-L4 layer model / preset 2 系統 / Quick vs Full Mode / hook 仕様 / config 全般 / CLI / installation / skills overview / codex integration) ごとに `docs/guide/*.md` への参照を整理。
17
+ - **skill-deployer 拡張**: `scripts/harness/setup/skill-deployer.ts` の `SkillCategory` type union に `"guidance"` を追加、`SKILL_CATEGORIES.guidance = ["phasegate-toolkit-guide"]` を登録、`getSkillsForSet("all")` の返り値に guidance カテゴリを含めた。`getSkillsForSet("core")` には含めない (core は continuous governance 用、guidance は ad-hoc Q&A 用なので責務分離)。
18
+ - **テスト追加**: 4 ケース (`scripts/harness/__tests__/unit/setup/skill-deployer.test.ts` に `SKILL_CATEGORIES.guidance` 登録 / `getCategoryForSkill('phasegate-toolkit-guide') === 'guidance'` / `getSkillsForSet('all')` に含まれる / `getSkillsForSet('core')` に含まれない)。全 3495 テスト (前回 3491 + 新規 4) グリーン。
19
+ - **互換性**: 既存 deploy ロジックに変更なし、`getSkillsForSet("core")` の返り値も変更なし。consumer プロジェクトで `phasegate init` 実行時、`.claude/skills/` 配下に `phasegate-toolkit-guide` が追加 deploy されるのみ。
20
+
10
21
  ## [0.122.0] - 2026-05-08
11
22
 
12
23
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phasegate",
3
- "version": "0.122.0",
3
+ "version": "0.123.0",
4
4
  "packageManager": "pnpm@10.30.1",
5
5
  "description": "Phasegate — AI-agnostic quality defense toolkit. Enforces structural integrity between design intent and code.",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@ const HOOKS_TARGET_DIR = ".claude";
17
17
 
18
18
  // ── Skill Category Map ──
19
19
 
20
- export type SkillCategory = "core" | "aidlc" | "utility";
20
+ export type SkillCategory = "core" | "aidlc" | "utility" | "guidance";
21
21
  export type SkillSet = "core" | "all";
22
22
 
23
23
  export const SKILL_CATEGORIES: Record<SkillCategory, readonly string[]> = {
@@ -52,13 +52,19 @@ export const SKILL_CATEGORIES: Record<SkillCategory, readonly string[]> = {
52
52
  "unit-test-logic-designer",
53
53
  ],
54
54
  utility: ["codex-delegator", "skill-creator"],
55
+ guidance: ["phasegate-toolkit-guide"],
55
56
  } as const;
56
57
 
57
58
  export function getSkillsForSet(skillSet: SkillSet): string[] {
58
59
  if (skillSet === "core") {
59
60
  return [...SKILL_CATEGORIES.core];
60
61
  }
61
- return [...SKILL_CATEGORIES.core, ...SKILL_CATEGORIES.aidlc, ...SKILL_CATEGORIES.utility];
62
+ return [
63
+ ...SKILL_CATEGORIES.core,
64
+ ...SKILL_CATEGORIES.aidlc,
65
+ ...SKILL_CATEGORIES.utility,
66
+ ...SKILL_CATEGORIES.guidance,
67
+ ];
62
68
  }
63
69
 
64
70
  export function getCategoryForSkill(skillName: string): SkillCategory | null {
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: phasegate-toolkit-guide
3
+ description: phasegate ツールキット自体に関する Q&A スキル。ユーザーが phasegate の概念 (L0-L4 レイヤーモデル / 防御プリセット / アーキプリセット / Quick Mode と Full Mode / Hook 仕様 / config 全般) について質問したとき、対応する canonical doc を読み込んでから回答する。使用タイミング:「phasegate の L1 と L2 の違いは?」「Quick Mode で許可されるカテゴリを増やしたい」「architecture.preset の使い分けは?」「phasegate の hook って何が動いている?」「phasegate.config.json の relaxedGates は何のため?」など phasegate ツールキット内部の仕様・設定を尋ねる質問。
4
+ ---
5
+
6
+ # Phasegate Toolkit Guide
7
+
8
+ phasegate ツールキット自体の概念・仕様・設定について、ユーザーの質問に正確に答えるための skill。
9
+
10
+ ## このスキルが解決する問題
11
+
12
+ ユーザーが phasegate を導入したプロジェクトで、AI に phasegate 関連の質問や設定変更を依頼したとき、AI が `node_modules/phasegate/` を grep で調査して仕様を推測する非効率を防ぐ。
13
+
14
+ phasegate の概念と仕様は **canonical doc が `node_modules/phasegate/docs/guide/` 配下に同梱されている**。本 skill はそれらへの正確なポインタを提供する。
15
+
16
+ ## 重要な設計原則
17
+
18
+ **knowledge を skill 本体に固定しない**。本 SKILL.md は「どの doc を読めば答えられるか」のポインタだけを持つ。実際の概念知識は phasegate 同梱 canonical doc から動的に読み込む。
19
+
20
+ これにより `npm update phasegate` で knowledge が自動追従する (skill markdown に概念本文を書いてしまうとバージョン乖離が起きる)。
21
+
22
+ ## 回答プロセス
23
+
24
+ 1. ユーザー質問を以下の **概念カテゴリ** にマッピング
25
+ 2. 対応する canonical doc を **Read tool で読む**
26
+ 3. Read した内容に基づいて回答
27
+ 4. 回答内に **doc 内の該当セクションへのポインタ** を含める (ユーザーが詳細確認できるように)
28
+
29
+ ### canonical doc の場所
30
+
31
+ phasegate がインストールされたプロジェクトでは、以下のいずれかにある:
32
+
33
+ ```
34
+ node_modules/phasegate/docs/guide/ # npm 経由でインストールされた consumer プロジェクト
35
+ docs/guide/ # phasegate リポジトリ自体 (dogfood)
36
+ ```
37
+
38
+ **先に `node_modules/phasegate/docs/guide/` を試し**、見つからなければ `docs/guide/` を試す。
39
+
40
+ ## 概念カテゴリと参照先 doc
41
+
42
+ ### 1. L0-L4 レイヤーモデル
43
+
44
+ ユーザー質問例:
45
+ - 「phasegate の L1 と L2 の違いって何?」
46
+ - 「L0 ってどこで動いてる?」
47
+ - 「L3 と L4 の検査内容を教えて」
48
+
49
+ **参照先**: `docs/guide/layer-model.md`
50
+
51
+ **読み方**: ファイル全体を読む (各層のセクションが明確に分かれている)。
52
+
53
+ ### 2. 防御プリセット / アーキプリセット (重要: 2 系統あり)
54
+
55
+ ユーザー質問例:
56
+ - 「preset って何?」
57
+ - 「standard と strict の違いは?」
58
+ - 「architecture.preset で onion と clean どっち選ぶべき?」
59
+ - 「アーキプリセットを custom にしたいんだけど」
60
+
61
+ **重要**: phasegate には **「防御プリセット」(`project.preset`) と「アーキプリセット」(`architecture.preset`) の 2 系統** がある。質問が曖昧な場合は **どちらを聞いているか確認** すること:
62
+
63
+ | 呼称 | 概念 | 設定キー | 値の例 |
64
+ |---|---|---|---|
65
+ | **防御プリセット** | L3 CI で検査強度を選ぶ | `project.preset` | `minimal` / `standard` / `strict` |
66
+ | **アーキプリセット** | L1 の層構造と依存方向を定義 | `architecture.preset` | `clean` / `strict-ddd` / `onion` / `hexagonal` / `layered` / `flat` / `custom` |
67
+
68
+ **参照先**: `docs/guide/preset-selection.md` (両系統の詳細解説)
69
+
70
+ ### 3. Quick Mode と Full Mode
71
+
72
+ ユーザー質問例:
73
+ - 「Quick Mode と Full Mode の違いは?」
74
+ - 「Quick Mode で書き込みが許可されるカテゴリを増やしたい」
75
+ - 「relaxedGates って何のため?」
76
+ - 「allowedCategories はどこで設定する?」
77
+
78
+ **参照先**: `docs/guide/quick-vs-full-mode.md`
79
+
80
+ 設定キーは `phasegate.config.json` の `quickMode` セクション (`allowedCategories` / `relaxedGates` / `fullModeRequiredWhen`)。詳細は `docs/guide/configuration.md` の `quickMode` セクションも併読。
81
+
82
+ ### 4. Hook 仕様 (PreToolUse / PostToolUse / Stop / SessionStart / UserPromptSubmit)
83
+
84
+ ユーザー質問例:
85
+ - 「phasegate の hook って何が動いてる?」
86
+ - 「PreToolUse で何が走る?」
87
+ - 「Stop hook の enforce オプションって何?」
88
+ - 「post-tool-use で format / lint が走らない、なぜ?」
89
+
90
+ **参照先**: `docs/guide/hooks-integration.md`
91
+
92
+ `Responsibility Separation` セクションに pre / post / Stop の責務分担表がある (WI-086 で追加)。Stop hook の `agentIntegration.stopHook.enforce` オプションは WI-087 Phase C-2 で追加された。
93
+
94
+ ### 5. config 全般 (`phasegate.config.json`)
95
+
96
+ ユーザー質問例:
97
+ - 「phasegate.config.json の各セクションの意味は?」
98
+ - 「baseline.enabled って何?」
99
+ - 「protectedFiles って何?」
100
+ - 「project.paths にはどうやって書く?」
101
+
102
+ **参照先**: `docs/guide/configuration.md`
103
+
104
+ 各 top-level セクションごとに説明あり: `project` / `layers` / `quickMode` / `phaseDependencies` / `harnesses` / `paths` / `reporting` / `architecture` / `agentIntegration` / `protectedFiles` / `baseline`。
105
+
106
+ ### 6. CLI コマンド一覧
107
+
108
+ ユーザー質問例:
109
+ - 「phasegate のコマンド一覧を教えて」
110
+ - 「validate と lint と check-phase の違いは?」
111
+ - 「init コマンドは何をする?」
112
+
113
+ **参照先**: `docs/guide/cli-reference.md`
114
+
115
+ ### 7. インストールと初期設定
116
+
117
+ ユーザー質問例:
118
+ - 「phasegate のインストール方法は?」
119
+ - 「monorepo で使うときは?」
120
+ - 「既存プロジェクトに後から導入したい」
121
+
122
+ **参照先**:
123
+ - 新規導入: `docs/guide/installation.md`, `docs/guide/quickstart.md` (存在する場合)
124
+ - 既存プロジェクト導入: `docs/guide/retrofit-adoption.md`
125
+
126
+ ### 8. skill 一覧と使い分け
127
+
128
+ ユーザー質問例:
129
+ - 「phasegate にはどんな skill がある?」
130
+ - 「story-implementor と quick-implementor の違いは?」
131
+
132
+ **参照先**: `docs/guide/skills-overview.md`
133
+
134
+ ### 9. Codex 統合
135
+
136
+ ユーザー質問例:
137
+ - 「codex CLI と組み合わせて使うには?」
138
+ - 「codex-delegator って何?」
139
+
140
+ **参照先**: `docs/guide/codex-integration.md`
141
+
142
+ ## 回答時のスタイル
143
+
144
+ - 簡潔に答える (2-3 段落 + コード例 1 つ程度)
145
+ - canonical doc の **該当セクション名** を必ず引用 (ユーザーが doc を直接開いたときの navigation 補助)
146
+ - 質問が複数カテゴリにまたがる場合は、最も関連性の高い doc を先に読む
147
+ - doc を読まずに回答しない (本 skill の存在意義は「正確な情報源を引く」こと)
148
+
149
+ ## マッピングが曖昧な場合
150
+
151
+ ユーザー質問が上記カテゴリのいずれにも明確に当てはまらない場合:
152
+
153
+ 1. `docs/guide/` 配下の doc 一覧 (`ls node_modules/phasegate/docs/guide/`) を取得
154
+ 2. ファイル名から推測して最も近い doc を読む
155
+ 3. それでも見つからなければ、ユーザーに **どの観点を知りたいか** を質問で絞り込む
156
+
157
+ ## 設定変更を伴う質問
158
+
159
+ 「config の X を変更したい」など **設定変更を伴う質問** は、本 skill の範囲外。phasegate-config-doctor skill (存在すれば) に委譲するか、ユーザーに「設定変更には phasegate-config-doctor を起動するのが推奨」と案内する。本 skill は **read-only な Q&A に徹する**。
160
+
161
+ ## アンチパターン
162
+
163
+ - ❌ canonical doc を読まずに training data 依存で答える (バージョン乖離リスク)
164
+ - ❌ doc 全文をユーザーに貼り付ける (要約して該当セクションへのポインタを返す)
165
+ - ❌ `phasegate.config.json` を直接編集する (本 skill は read-only)
166
+ - ❌ skill 本文に概念解説を書き加える (doc に書くべき。skill はポインタ役)