phasegate 0.91.0 → 0.108.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.
Files changed (69) hide show
  1. package/CHANGELOG.md +255 -0
  2. package/README.ja.md +17 -7
  3. package/README.md +26 -4
  4. package/docs/ADR/ADR-015-architecture-preset.md +183 -0
  5. package/docs/guide/cli-reference.md +108 -0
  6. package/docs/guide/codex-integration.md +7 -2
  7. package/docs/guide/installation.md +10 -2
  8. package/docs/guide/preset-selection.md +170 -0
  9. package/docs/guide/quick-vs-full-mode.md +3 -3
  10. package/docs/guide/retrofit-adoption.md +19 -2
  11. package/docs/guide/skills-overview.md +1 -1
  12. package/package.json +7 -1
  13. package/scripts/harness/agent-integration/application/usecases/handle-pre-tool-use-usecase.ts +108 -100
  14. package/scripts/harness/agent-integration/domain/ports/phase-gate-query-port.ts +3 -3
  15. package/scripts/harness/agent-integration/domain/value-objects/write-target-scope.ts +26 -30
  16. package/scripts/harness/agent-integration/infrastructure/adapters/file-system-story-reflection-query-adapter.ts +6 -2
  17. package/scripts/harness/biome-ast-engine/application/dto/analyze-import-graph-input.ts +3 -0
  18. package/scripts/harness/biome-ast-engine/application/dto/resolve-enabled-rules-output.ts +2 -0
  19. package/scripts/harness/biome-ast-engine/application/mappers/resolve-enabled-rules-output-mapper.ts +4 -1
  20. package/scripts/harness/biome-ast-engine/application/usecases/analyze-import-graph-usecase.ts +4 -1
  21. package/scripts/harness/biome-ast-engine/application/usecases/execute-lint-usecase.ts +2 -0
  22. package/scripts/harness/biome-ast-engine/application/usecases/resolve-enabled-rules-usecase.ts +31 -3
  23. package/scripts/harness/biome-ast-engine/composition-root.ts +10 -2
  24. package/scripts/harness/biome-ast-engine/domain/ports/rule-config-provider-port.ts +16 -0
  25. package/scripts/harness/biome-ast-engine/domain/ports/source-module-analyzer-port.ts +5 -1
  26. package/scripts/harness/biome-ast-engine/domain/services/lint-runner.ts +5 -1
  27. package/scripts/harness/biome-ast-engine/domain/value-objects/architecture-spec.ts +38 -0
  28. package/scripts/harness/biome-ast-engine/domain/value-objects/layer-boundary.ts +7 -8
  29. package/scripts/harness/biome-ast-engine/domain/value-objects/layer-name.ts +15 -23
  30. package/scripts/harness/biome-ast-engine/domain/value-objects/source-module-snapshot.ts +11 -4
  31. package/scripts/harness/biome-ast-engine/infrastructure/adapters/harness-config-provider-adapter.ts +29 -3
  32. package/scripts/harness/biome-ast-engine/infrastructure/adapters/typescript-source-module-analyzer-adapter.ts +22 -15
  33. package/scripts/harness/biome-ast-engine/infrastructure/mappers/source-module-snapshot-mapper.ts +26 -17
  34. package/scripts/harness/config-foundation/application/dto/resolved-config-output.ts +1 -0
  35. package/scripts/harness/config-foundation/application/usecases/load-resolved-config-use-case.ts +34 -2
  36. package/scripts/harness/config-foundation/application/usecases/migrate-schema-use-case.ts +89 -0
  37. package/scripts/harness/config-foundation/composition-root.ts +8 -0
  38. package/scripts/harness/config-foundation/domain/harness-config.ts +6 -0
  39. package/scripts/harness/config-foundation/domain/services/architecture-resolution-service.ts +257 -0
  40. package/scripts/harness/config-foundation/domain/value-objects/architecture-config.ts +66 -0
  41. package/scripts/harness/config-foundation/domain/value-objects/architecture-preset-catalog.ts +75 -0
  42. package/scripts/harness/config-foundation/infrastructure/schemas/harness-config-v3.schema.json +546 -0
  43. package/scripts/harness/config-foundation/infrastructure/validators/ajv-config-schema-validator.ts +18 -6
  44. package/scripts/harness/config-foundation/presentation/cli/migrate-schema-command-handler.ts +83 -0
  45. package/scripts/harness/integrations/pre-commit.ts +211 -52
  46. package/scripts/harness/main.ts +460 -340
  47. package/scripts/harness/phase-dependency-model/domain/ports/story-reflection-file-system-port.ts +2 -4
  48. package/scripts/harness/phase-dependency-model/domain/services/story-reflection-checker.ts +54 -17
  49. package/scripts/harness/phase-dependency-model/infrastructure/filesystem/file-system-story-reflection-adapter.ts +154 -36
  50. package/scripts/harness/setup/skill-deployer.ts +140 -102
  51. package/scripts/harness/skill-quality/domain/errors/skill-quality-error.ts +24 -23
  52. package/scripts/harness/skill-quality/domain/value-objects/commit-message.ts +23 -7
  53. package/scripts/harness/traceability-model/application/usecases/apply-work-item-migration-usecase.ts +52 -0
  54. package/scripts/harness/traceability-model/application/usecases/plan-work-item-migration-usecase.ts +29 -0
  55. package/scripts/harness/traceability-model/application/usecases/validate-design-story-annotations-usecase.ts +83 -18
  56. package/scripts/harness/traceability-model/composition-root.ts +48 -30
  57. package/scripts/harness/traceability-model/domain/ports/design-document-port.ts +9 -15
  58. package/scripts/harness/traceability-model/domain/ports/work-item-migration-apply-port.ts +11 -0
  59. package/scripts/harness/traceability-model/domain/ports/work-item-migration-source-port.ts +9 -0
  60. package/scripts/harness/traceability-model/domain/services/work-item-migration-planner.ts +162 -0
  61. package/scripts/harness/traceability-model/domain/value-objects/work-item-frontmatter.ts +57 -0
  62. package/scripts/harness/traceability-model/domain/value-objects/work-item-migration-candidate.ts +47 -0
  63. package/scripts/harness/traceability-model/infrastructure/gateways/file-system-work-item-migration-apply-gateway.ts +110 -0
  64. package/scripts/harness/traceability-model/infrastructure/gateways/file-system-work-item-migration-source-gateway.ts +182 -0
  65. package/scripts/harness/traceability-model/infrastructure/gateways/markdown-design-document-gateway.ts +29 -43
  66. package/scripts/harness/traceability-model/infrastructure/parsers/work-item-frontmatter-parser.ts +136 -0
  67. package/scripts/harness/traceability-model/presentation/cli/migrate-work-items-command-handler.ts +186 -0
  68. package/skills/quick-implementor/SKILL.md +17 -1
  69. package/templates/.husky/commit-msg +1 -0
@@ -134,6 +134,114 @@ exit code は `0` = 生成成功 / 上書き成功、`2` = 既存ファイルあ
134
134
 
135
135
  ---
136
136
 
137
+ ## Work Item Migration
138
+
139
+ `docs/inception/` 配下の work item directory を **統一 `WI-XXX` レイアウト**へ移行する CLI。
140
+ WI-026 で導入(v0.100.0、`ISSUE-XXX` 系統)、WI-027 で `H{NN}-{NN}` 形式の旧ストーリー
141
+ directory にも拡張(v0.105.0)、WI-027 follow-up で apply の冪等性を確立(v0.107.0)。
142
+
143
+ | Command | Options | Description |
144
+ |---|---|---|
145
+ | `migrate work-items` | `--dry-run` / `--apply` / `--json` | 旧 directory を `WI-XXX` へ採番移行する。`--dry-run` と `--apply` は排他、どちらかが必須。|
146
+
147
+ ### 検出パターン
148
+
149
+ `docs/inception/` 配下を走査し、以下のいずれかに合致する directory を candidate として列挙する:
150
+
151
+ | 検出パターン | 配置 | scope | nextId 採番方式 |
152
+ |---|---|---|---|
153
+ | `^ISSUE-\d+$` | `docs/inception/issues/` または `{unit}/issues/` | `cross` / `unit` | embedded number そのまま (`ISSUE-026 → WI-026`) |
154
+ | `^WI-\d+$` | 既に WI レイアウトの directory | `cross` / `unit` | 変更なし(idempotent skip) |
155
+ | `^H\d{2}-\d{2}$` | `{unit}/` 直下 | `unit` のみ | sequential allocator: 既存 WI 番号 + 同一 plan 内 ISSUE-XXX 番号を予約したうえで、空き番号の若い順に `WI-XXX` を割り当て |
156
+
157
+ skip 対象: `_shared/` / `_operation/` / `_cross/` / `issues/` 配下(`_cross/WI-XXX/` は WI レイアウトのため再走査不要)。
158
+
159
+ ### Sequential Allocator の挙動(H-ID 採番)
160
+
161
+ ```
162
+ input: entries (混在: WI-XXX / ISSUE-XXX / H{NN}-{NN})
163
+ existingWorkItemIds = ["WI-001", ..., "WI-027"] # _cross/ + {unit}/ から列挙
164
+
165
+ step 1. usedNumbers = parseToInts(existingWorkItemIds) # {1..27}
166
+ step 2. 同一 plan 内 ISSUE-XXX / WI-XXX の embedded number を usedNumbers に追加
167
+ step 3. H-ID entries を sourcePath 昇順でループ:
168
+ cursor = 1
169
+ while usedNumbers.has(cursor): cursor++
170
+ assign WI-{cursor.padStart(3, "0")} to entry
171
+ usedNumbers.add(cursor)
172
+ ```
173
+
174
+ 不変条件:
175
+
176
+ - 既存 WI-XXX directory の番号は新規 H-ID 採番で再利用されない。
177
+ - 同一 plan 呼び出し内で `nextId` は重複しない(usedNumbers が共有される)。
178
+ - `ISSUE-XXX → WI-XXX` の embedded mapping は変更しない(後方互換)。
179
+
180
+ ### Frontmatter 注入
181
+
182
+ `--apply` 時、各 directory の `description.md` に以下の frontmatter を生成する。
183
+ 既存 frontmatter があれば **id 一致 + legacy_id 一致** のときだけ byte-for-byte
184
+ 保持し、それ以外は planner 生成版で置換する(v0.107.0 で冪等化)。
185
+
186
+ ```yaml
187
+ ---
188
+ id: WI-XXX # 採番された ID
189
+ type: story | issue # H-ID 由来は story、ISSUE-XXX 由来は issue
190
+ severity: trivial | normal | high # 元 description の "深刻度" から抽出(既定: normal)
191
+ status: drafted
192
+ legacy_id: H02-04 # または ISSUE-026
193
+ affects: [unit-a, unit-b] # cross scope のみ。元 description の "影響Unit" から抽出
194
+ ---
195
+ ```
196
+
197
+ `description.md` 不在の directory には `# {legacyId}\n` の stub を生成して frontmatter を prepend する。
198
+
199
+ ### 使用例
200
+
201
+ ```bash
202
+ # 移行候補を表示(実際の rename は行わない)
203
+ npx phasegate migrate work-items --dry-run
204
+
205
+ # JSON 出力(CI / スクリプト向け)
206
+ npx phasegate migrate work-items --dry-run --json
207
+
208
+ # 実マイグレーション実行
209
+ npx phasegate migrate work-items --apply
210
+
211
+ # apply 結果を JSON で取得
212
+ npx phasegate migrate work-items --apply --json
213
+ ```
214
+
215
+ ### exit code
216
+
217
+ | code | 意味 |
218
+ |---|---|
219
+ | `0` | 成功(dry-run 時 conflict なし、apply 時 blocked なし)|
220
+ | `1` | dry-run で conflict candidate あり(target directory が既に存在)/ apply で blocked |
221
+ | `2` | 引数不正(`--dry-run` / `--apply` どちらも未指定、両方指定、`--apply` 未配線等)|
222
+
223
+ ### Legacy ID Grep 互換性
224
+
225
+ WI-XXX へ移行後も、frontmatter の `legacy_id:` 経由で旧 ID を逆引きできる:
226
+
227
+ ```bash
228
+ # 旧 H-ID から WI directory を逆引き
229
+ grep -rn "^legacy_id: H02-04" docs/inception/
230
+
231
+ # 旧 ISSUE-XXX から逆引き
232
+ grep -rn "^legacy_id: ISSUE-026" docs/inception/
233
+
234
+ # Work-Item commit trailer による履歴遡及
235
+ git log --grep='Work-Item: WI-074'
236
+ ```
237
+
238
+ また、ソースコード内の `// @story-id H02-04` などの legacy annotation は、
239
+ `FileSystemStoryReflectionAdapter#readLegacyId` が `_cross/` と `{unit}/` の
240
+ 両方の `WI-XXX/description.md` を走査して `legacy_id` を解決するため、
241
+ unit-scoped WI(H-ID 由来)の reflection check でも継続認識される(v0.105.0)。
242
+
243
+ ---
244
+
137
245
  ## Harness API
138
246
 
139
247
  Commands exposed as npm scripts (`npm run <command>`).
@@ -7,15 +7,20 @@ Phasegate supports [OpenAI Codex CLI](https://developers.openai.com/codex/cli) t
7
7
  ### Quick setup (recommended)
8
8
 
9
9
  ```bash
10
- # 1. Initialize with Codex agent support
10
+ # 1. Initialize the project for Codex
11
11
  npx phasegate init --name my-project --agent codex --with-husky
12
12
 
13
- # 2. Enable Codex hooks feature flag
13
+ # 2. Enable the Codex CLI feature flag manually
14
14
  codex features enable codex_hooks
15
15
  ```
16
16
 
17
17
  For dual-agent projects (Claude + Codex), use `--agent both`.
18
18
 
19
+ Responsibility split:
20
+
21
+ - `phasegate init --agent codex` sets up **project-local artifacts** such as `phasegate.config.json`, `skills/`, `.codex/hooks.json`, and `.codex/skills`
22
+ - `codex features enable codex_hooks` updates the **Codex CLI user environment** and is intentionally left as a manual step
23
+
19
24
  ### Manual setup
20
25
 
21
26
  Alternatively, set up Codex integration manually:
@@ -36,7 +36,13 @@ npm install
36
36
  npx phasegate init --name <project-name>
37
37
  ```
38
38
 
39
- This deploys 28 skills to `.claude/skills/` and generates `phasegate.config.json`.
39
+ This deploys 28 skills to `skills/`, creates the agent-facing skill links (for example `.claude/skills/` or `.codex/skills/`), and generates `phasegate.config.json`.
40
+
41
+ For Codex, project initialization stops at the project boundary. After `npx phasegate init --agent codex`, enable the Codex CLI feature flag manually:
42
+
43
+ ```bash
44
+ codex features enable codex_hooks
45
+ ```
40
46
 
41
47
  ### 2. Copy design principle documents
42
48
 
@@ -69,7 +75,9 @@ npx phasegate update-skills
69
75
 
70
76
  ```
71
77
  node_modules/
72
- .claude/skills/ # regenerated by npx phasegate init
78
+ skills/ # regenerated by npx phasegate init
79
+ .claude/skills/ # symlink to ../skills when Claude is enabled
80
+ .codex/skills/ # symlink to ../skills when Codex is enabled
73
81
  dist/
74
82
  reports/
75
83
  .harness/
@@ -0,0 +1,170 @@
1
+ # Architecture Preset Selection Guide
2
+
3
+ phasegate の `phasegate.config.json` には `architecture.preset` を通じて「そのプロジェクトが採用しているアーキテクチャスタイル」を明示する。L1-003 (`no-layer-violation`) / L1-004 (`enforce-folder-structure`) はこの preset を参照して層名と依存方向を判定する。
4
+
5
+ preset の選択が正しくないと、本来合法な import が violation として検出される / 本来検出されるべき違反が通過する等の誤判定が発生する。本ガイドは preset 選択の判断基準と実例を示す。
6
+
7
+ ---
8
+
9
+ ## 用語の整理(呼称の混同を避ける)
10
+
11
+ phasegate には 2 系統の「プリセット」概念があり、役割が異なる:
12
+
13
+ | 系統 | 概念 | 設定キー | 例 |
14
+ |------|------|---------|----|
15
+ | **防御プリセット** | L3 CI で検査強度を選ぶ | `ci.preset` | `strict` / `lenient` |
16
+ | **アーキプリセット** | L1 の層構造と依存方向を定義 | `architecture.preset` | `clean` / `onion` / `hexagonal` / `layered` / `flat` / `strict-ddd` / `custom` |
17
+
18
+ 本ガイドの対象は **アーキプリセット**。CI 強度の選定は `docs/guide/configuration.md` を参照。
19
+
20
+ ---
21
+
22
+ ## 7 preset の早見表
23
+
24
+ | preset | 層構成 | 典型的な採用対象 |
25
+ |--------|--------|------------------|
26
+ | `clean` (default) | `domain / application / infrastructure / presentation` | Clean Architecture / AIDLC フルハーネス構成 |
27
+ | `strict-ddd` | `clean` + 循環依存禁止を厳格化 | DDD 重視の新規 PJ |
28
+ | `onion` | `domain / application / interface` | Onion Architecture |
29
+ | `hexagonal` | `core / ports / adapters` | Hexagonal / Ports-and-Adapters |
30
+ | `layered` | `presentation / business / data` | 古典的 3 層レイヤード |
31
+ | `flat` | 層分割なし | 小規模スクリプト・CLI ツール / retrofit 導入初期 |
32
+ | `custom` | `layers` + `allowedDependencies` を明示指定 | どの既成プリセットにも当てはまらない PJ |
33
+
34
+ 各 preset の詳細な層行列は `docs/inception/issues/ISSUE-014/wave1_schema_proposal.md §1.2` を参照。
35
+
36
+ ---
37
+
38
+ ## 選択フロー
39
+
40
+ ```
41
+ 1. 既存 PJ か新規 PJ か?
42
+ ├─ 新規 → Q2 へ
43
+ └─ 既存 → retrofit-adoption.md を先に参照 / 初期は `flat` でも可
44
+
45
+ 2. DDD / Clean Architecture を明示採用している?
46
+ ├─ はい → Q3 へ
47
+ └─ いいえ → Q4 へ
48
+
49
+ 3. 4 層分離(domain / application / infrastructure / presentation)を守っている?
50
+ ├─ はい → `clean`(循環依存も潰したい場合は `strict-ddd`)
51
+ └─ いいえ → カスタム Q5 へ
52
+
53
+ 4. フレームワーク構造に寄せている?
54
+ ├─ Onion (3 層 domain/application/interface) → `onion`
55
+ ├─ Hexagonal (core/ports/adapters) → `hexagonal`
56
+ ├─ MVC / 古典 3 層 (presentation/business/data) → `layered`
57
+ ├─ 小規模スクリプト / 層概念なし → `flat`
58
+ └─ それ以外 → `custom`
59
+
60
+ 5. `custom` を選ぶ場合、`layers` と `allowedDependencies` を明示指定する(例は後述)。
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 設定例
66
+
67
+ ### `clean`(default、省略可)
68
+
69
+ ```json
70
+ {
71
+ "$schema": "./node_modules/phasegate/schemas/harness-config-v3.schema.json",
72
+ "architecture": { "preset": "clean" },
73
+ "l1": { "enabled": true, "rules": {} }
74
+ }
75
+ ```
76
+
77
+ ### `onion`
78
+
79
+ ```json
80
+ {
81
+ "architecture": { "preset": "onion" },
82
+ "l1": { "enabled": true, "rules": {} }
83
+ }
84
+ ```
85
+
86
+ ソースファイルの `@layer` タグは `domain` / `application` / `interface` のいずれかを使用する。
87
+
88
+ ### `hexagonal`
89
+
90
+ ```json
91
+ {
92
+ "architecture": { "preset": "hexagonal" },
93
+ "l1": { "enabled": true, "rules": {} }
94
+ }
95
+ ```
96
+
97
+ `@layer core` / `@layer ports` / `@layer adapters`。
98
+
99
+ ### `flat`(層分割なし)
100
+
101
+ ```json
102
+ {
103
+ "architecture": { "preset": "flat" },
104
+ "l1": { "enabled": true, "rules": {} }
105
+ }
106
+ ```
107
+
108
+ `flat` を指定すると L1-001 (`require-unit-comment`) / L1-002 (`require-layer-comment`) / L1-003 / L1-004 が user 明示なき限り auto-disable される。
109
+
110
+ ### `custom`(明示指定)
111
+
112
+ ```json
113
+ {
114
+ "architecture": {
115
+ "preset": "custom",
116
+ "layers": ["model", "service", "controller", "view"],
117
+ "allowedDependencies": {
118
+ "model": ["model"],
119
+ "service": ["service", "model"],
120
+ "controller": ["controller", "service", "model"],
121
+ "view": ["view", "controller"]
122
+ }
123
+ }
124
+ }
125
+ ```
126
+
127
+ `custom` では `layers` と `allowedDependencies` の両方が必須(片方欠けると config 検証で error)。
128
+
129
+ ---
130
+
131
+ ## override(preset に部分的な上書きを掛ける)
132
+
133
+ preset を base にして一部の `allowedDependencies` のみ書き換えたい場合:
134
+
135
+ ```json
136
+ {
137
+ "architecture": {
138
+ "preset": "clean",
139
+ "allowedDependencies": {
140
+ "presentation": ["presentation", "application"]
141
+ }
142
+ }
143
+ }
144
+ ```
145
+
146
+ 上書きしなかった層(`domain` / `application` / `infrastructure`)は preset 既定のまま。
147
+
148
+ 詳細な semantic validation ルール(C1 自己参照 auto-fill / C2 キー不整合 error / C3 値不整合 error / C4 layer 欠落 auto-fill / C5 循環依存 warn)は `docs/inception/issues/ISSUE-014/wave1_schema_proposal.md §1.3` を参照。
149
+
150
+ ---
151
+
152
+ ## 既存 v2 config からの移行
153
+
154
+ v0.86.0 より前の `phasegate.config.json` には `architecture` キーが無い。phasegate は後方互換で v2 も読めるが、**v3 への明示アップグレードを推奨**する:
155
+
156
+ ```bash
157
+ npx phasegate migrate --schema v3
158
+ ```
159
+
160
+ このコマンドは `phasegate.config.json` に `architecture: { preset: "clean" }` を追記して v3 化する(既に `architecture` がある場合は no-op)。
161
+
162
+ ---
163
+
164
+ ## 参照
165
+
166
+ - `docs/inception/issues/ISSUE-014/wave1_schema_proposal.md` — 設計提案とプリセット詳細
167
+ - `docs/inception/issues/ISSUE-014/issue_description.md` — issue 背景
168
+ - `docs/ADR/ADR-015-architecture-preset.md` — アーキ設計決定
169
+ - `docs/guide/retrofit-adoption.md` — 既存 PJ への後付け導入
170
+ - `docs/guide/configuration.md` — 他の config 項目
@@ -130,7 +130,7 @@ Running every change through Full AIDLC is genuinely heavy for one-person projec
130
130
  | Core | `docs/product/construction/<unit>/*.md` (contract docs) | Full |
131
131
  | Periphery | Internal helpers in `application/` that don't change ports | Quick-first, Full if contract impact emerges |
132
132
  | Periphery | `scripts/harness/presentation/` formatting / wording | Quick |
133
- | Periphery | `docs/guide/*`, `README.md`, `.claude/skills/*` tweaks | Quick |
133
+ | Periphery | `docs/guide/*`, `README.md`, `skills/*` tweaks | Quick |
134
134
  | Periphery | Version bumps, `phasegate.config.json` value edits | Quick |
135
135
 
136
136
  Codify the split in your head (or in a project CLAUDE.md note) — "`domain/**` is core, everything else starts Quick" is a healthy default for a single-maintainer project.
@@ -168,5 +168,5 @@ No. `allowedCategories` is a fixed enum (`bugfix`, `docs`, `test`, `config`). If
168
168
  - [Skills Overview](skills-overview.md) — full catalogue of 28 skills
169
169
  - [Layer Model](layer-model.md) — L0 through L4 defence layers
170
170
  - [Configuration](configuration.md) — `quickMode` configuration reference
171
- - `.claude/skills/quick-implementor/SKILL.md` — the Quick Mode skill definition
172
- - `.claude/skills/story-implementor/SKILL.md` — the Full Mode skill definition
171
+ - `skills/quick-implementor/SKILL.md` — the Quick Mode skill definition
172
+ - `skills/story-implementor/SKILL.md` — the Full Mode skill definition
@@ -44,7 +44,7 @@ Step 4: 新規 Unit / 構造変更は scaffold-design で設計文書を起こ
44
44
  npx phasegate init --name <project-name>
45
45
  ```
46
46
 
47
- - `.claude/skills/` に 28 スキルを配置
47
+ - `skills/` に 28 スキルを配置し、有効な agent 用に `.claude/skills` / `.codex/skills` を作成
48
48
  - `phasegate.config.json` を生成
49
49
  - `phasegate.config.json` に `baseline` セクションが未記載でも、v0.71.0 以降は
50
50
  **`baseline.enabled` の default が `true`** のため grandfather は既定で有効
@@ -97,7 +97,24 @@ monorepo など複数ディレクトリを持つ場合は配列で列挙:
97
97
  この設定を忘れると、phase-gate は `scripts/harness/` 配下しか見ないため、
98
98
  retrofit 対象の新規コード作成が block されず、結果として **phasegate が
99
99
  無効化された運用** になってしまう(ISSUE-007 Wave 8 で schema 上 overridable
100
- になるまで、この設定は config validator で拒否されていた)。
100
+ になるまで、この設定は config validator for 拒否されていた)。
101
+
102
+ ### architecture preset の選定(v0.86.0 以降)
103
+
104
+ retrofit 対象 PJ のアーキテクチャスタイルに合わせて `architecture.preset` を
105
+ 選ぶと、L1-003 / L1-004 が preset の層構造に従って判定される。既存コードが
106
+ Clean 4 層でない場合(オニオン / ヘキサゴナル / 古典レイヤード / 層分離なし)、
107
+ preset を合わせないと合法な import が violation として検出される。
108
+
109
+ 初期は層分離無しで運用したい場合は `flat` を選ぶと L1-001〜004 が auto-disable
110
+ される。選定ガイドと設定例は [Preset Selection Guide](./preset-selection.md) 参照。
111
+
112
+ 既存の v2 config(v0.86.0 未満相当、`architecture` キー無し)は下記で自動
113
+ アップグレードできる:
114
+
115
+ ```bash
116
+ npx phasegate migrate --schema v3
117
+ ```
101
118
 
102
119
  ---
103
120
 
@@ -1,6 +1,6 @@
1
1
  # Skills Overview
2
2
 
3
- Phasegate provides 28 skills covering the full AIDLC (AI-Driven Development Life Cycle). Skills are deployed to `.claude/skills/` by `npx phasegate init` and invoked as slash commands in AI agent sessions.
3
+ Phasegate provides 28 skills covering the full AIDLC (AI-Driven Development Life Cycle). `npx phasegate init` deploys the skill bodies to `skills/` and exposes them to enabled agents through `.claude/skills/` / `.codex/skills/` links.
4
4
 
5
5
  ## AIDLC Process — Skill Execution Order
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phasegate",
3
- "version": "0.91.0",
3
+ "version": "0.108.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": "Apache-2.0",
@@ -51,6 +51,12 @@
51
51
  "phasegate:disable": "npx tsx scripts/harness/main.ts disable-feature",
52
52
  "phasegate:check-phase": "npx tsx scripts/harness/main.ts phasegate:check-phase",
53
53
  "phasegate:check-ready": "npx tsx scripts/harness/main.ts phasegate:check-ready",
54
+ "harness:status": "pnpm phasegate:status",
55
+ "harness:init": "npx tsx scripts/harness/main.ts init",
56
+ "harness:enable": "pnpm phasegate:enable",
57
+ "harness:disable": "pnpm phasegate:disable",
58
+ "harness:check-phase": "pnpm phasegate:check-phase",
59
+ "harness:check-ready": "pnpm phasegate:check-ready",
54
60
  "test": "vitest run --config scripts/harness/__tests__/vitest.config.forks.ts && vitest run --config scripts/harness/__tests__/vitest.config.ts"
55
61
  },
56
62
  "dependencies": {