phasegate 0.146.0 → 0.147.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,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.147.0] - 2026-05-12
11
+
12
+ ### Added
13
+
14
+ - **WI-144 — install/uninstall idempotency umbrella closure** — publish-ready rollup for the installation lifecycle work delivered across WI-145〜WI-148.
15
+ - Documents the complete lifecycle commands (`install`, `doctor`, `uninstall`, `reconcile`) in README / README.ja / guide docs.
16
+ - Marks the WI-144 umbrella as tested after the manifest, doctor, structured install, clean uninstall, reconcile, and init deprecation slices reached tested status.
17
+
10
18
  ## [0.145.4] - 2026-05-11
11
19
 
12
20
  ### Added
package/README.ja.md CHANGED
@@ -18,7 +18,7 @@ Claude Code / Codex / Cursor / Copilot — どの AI agent でも設計意図・
18
18
  2. **コミット前に L1〜L3 のバリデーションが自動で走り**、レイヤー違反・テスト品質違反・依存方向違反を弾く
19
19
  3. **ブロック時のエラーは AI が読んで自己修正できる形式**(理由・必要な設計文書・次に打つべきスキル名が出る)
20
20
 
21
- `npx phasegate init` 1 回打てば、上記が全部入ります。
21
+ 既存プロジェクトには `npx phasegate install` で既存 hooks / scripts を壊さずに組み込み、新規プロジェクトの legacy bootstrap には `npx phasegate init` を使います。導入後は `phasegate doctor` / `uninstall` / `reconcile` で状態確認・削除・アップグレード追従ができます。
22
22
 
23
23
  ---
24
24
 
@@ -77,7 +77,7 @@ claude
77
77
  > /product-architect
78
78
  ```
79
79
 
80
- `init` が生成するもの:
80
+ `init` は初期 bootstrap として以下を生成します:
81
81
 
82
82
  - `phasegate.config.json` — 品質設定の Single Source of Truth
83
83
  - `skills/` — 28 の AIDLC スキル一式
@@ -95,7 +95,7 @@ claude
95
95
  - `docs/product/` 配下の確定設計文書 — `/domain-designer` `/logical-designer` 等が生成
96
96
  - `docs/ADR/` — `/skill-creator` や手動で必要に応じて作成
97
97
 
98
- 「設計してから書け」を強制する仕組みなので、設計文書はユーザーがスキル経由で作るのが既定動作です。
98
+ `init` は legacy 互換の bootstrap 経路です。既存 hooks / scripts / package metadata に構造化 merge したい場合は `install` を使います。「設計してから書け」を強制する仕組みなので、設計文書はユーザーがスキル経由で作るのが既定動作です。
99
99
 
100
100
  既存プロジェクトに導入する場合は、構造化 install で差分を確認してから適用します。
101
101
 
@@ -138,9 +138,12 @@ codex features enable codex_hooks # Codex 本体の feature flag を手動で
138
138
 
139
139
  ```bash
140
140
  npm update phasegate
141
- npx phasegate update-skills # スキルを最新版に再デプロイ
141
+ npx phasegate reconcile --dry-run
142
+ npx phasegate reconcile --apply
142
143
  ```
143
144
 
145
+ `update-skills` は互換 alias として残っていますが、推奨は `reconcile` です。`.phasegate/manifest.json` に記録された PhaseGate 管理ファイル全体を最新版 template に追従できます。
146
+
144
147
  ---
145
148
 
146
149
  ## 主な機能
@@ -312,8 +315,12 @@ npx phasegate <command> [options]
312
315
 
313
316
  | コマンド | 説明 |
314
317
  |---|---|
315
- | `init --name <name>` | 初期化(skills/config/hooks 配置)。`--agent claude\|codex\|both`、`--with-husky`、`--with-ci`、`--preset <full\|standard\|minimal\|custom>` |
316
- | `update-skills` | スキルを最新版に再デプロイ |
318
+ | `init --name <name>` | 新規プロジェクト向け legacy bootstrap(skills/config/hooks 配置)。既存 hooks/scripts/CI がある場合は `install` を推奨 |
319
+ | `install --dry-run` / `--apply` | 既存設定を保持しながら PhaseGate を構造化 merge し、`.phasegate/manifest.json` を作成 |
320
+ | `doctor` | silent / partial installation を診断し、修復 hint を表示(`--json`, `--strict`, `--report-out <path>`) |
321
+ | `uninstall --dry-run` / `--apply` | manifest に基づいて PhaseGate 管理ファイル・管理 block を削除し、ユーザー設定は保持 |
322
+ | `reconcile --dry-run` / `--apply` | 現在の package template に PhaseGate 管理ファイルを追従し、manifest hash を更新 |
323
+ | `update-skills` | `reconcile` の互換 alias |
317
324
  | `lint` | L1 Biome AST チェック |
318
325
  | `validate --layer <L1\|L2\|L3\|L4\|all>` | 指定レイヤーのバリデータ実行(`--format human\|agent\|ci`) |
319
326
  | `ci-check` | CI フルチェック(L2-L4)。`--quick` で Quick Mode |
package/README.md CHANGED
@@ -19,7 +19,7 @@ Phasegate adds project-local hooks, validators, and agent skills that keep gener
19
19
  2. **Before commit and CI, validators check layer boundaries, metadata, test quality, security, performance, and traceability.**
20
20
  3. **Every failure is returned in an agent-readable format** with the reason, missing artifacts, references, and the next skill or command to run.
21
21
 
22
- Run `npx phasegate init` once and the project gets the guardrails, skills, and configuration needed to make that flow repeatable.
22
+ Run `npx phasegate install` to merge those guardrails into an existing project, or `npx phasegate init` for the legacy bootstrap path on a new project. `phasegate doctor`, `uninstall`, and `reconcile` keep the installation observable, removable, and upgradeable.
23
23
 
24
24
  ---
25
25
 
@@ -78,7 +78,7 @@ claude
78
78
  > /product-architect
79
79
  ```
80
80
 
81
- `init` creates:
81
+ `init` creates the initial project-local harness files:
82
82
 
83
83
  - `phasegate.config.json` as the quality settings source of truth
84
84
  - `skills/` with 28 AIDLC skills
@@ -88,7 +88,7 @@ claude
88
88
  - `.husky/pre-commit`, `.husky/commit-msg`, and `.husky/pre-push` when `--with-husky` is passed
89
89
  - `.github/workflows/aidlc-gate.yml`, `.github/workflows/consistency-check.yml`, and `.github/workflows/agent-context-refresh.yml` when `--with-ci` is passed
90
90
 
91
- `init` intentionally does **not** create `docs/inception/` work item directories or `docs/product/` design documents. Those are produced later by skills such as `/product-architect`, `/domain-designer`, and `/logical-designer`. That is the core contract: no design, no code.
91
+ `init` is the legacy-compatible bootstrap path. For idempotent setup with structured merge into existing hooks, scripts, and package metadata, use `install`. `init` intentionally does **not** create `docs/inception/` work item directories or `docs/product/` design documents. Those are produced later by skills such as `/product-architect`, `/domain-designer`, and `/logical-designer`. That is the core contract: no design, no code.
92
92
 
93
93
  For an existing project, preview and apply a structured install instead:
94
94
 
@@ -131,9 +131,12 @@ Use `--agent both` for projects that use Claude Code and Codex together. Codex n
131
131
 
132
132
  ```bash
133
133
  npm update phasegate
134
- npx phasegate update-skills
134
+ npx phasegate reconcile --dry-run
135
+ npx phasegate reconcile --apply
135
136
  ```
136
137
 
138
+ `update-skills` remains available as a compatibility alias, but `reconcile` is the preferred upgrade path because it updates all PhaseGate-managed files recorded in `.phasegate/manifest.json`, not just skills.
139
+
137
140
  ---
138
141
 
139
142
  ## Core Capabilities
@@ -494,7 +497,11 @@ npx phasegate <command> [options]
494
497
 
495
498
  | Command | Description |
496
499
  |---|---|
497
- | `init --name <name>` | Initialize project, deploy skills, generate config. Use `--with-ci` to deploy GitHub Actions workflows. |
500
+ | `init --name <name>` | Legacy-compatible bootstrap for new projects: deploy skills, generate config, and optionally add hooks/CI. Prefer `install` when the project may already have hooks, scripts, or CI files. |
501
+ | `install --dry-run` / `--apply` | Idempotently merge PhaseGate into the current project, preserve existing user content, add package scripts/devDependency, and write `.phasegate/manifest.json`. |
502
+ | `doctor` | Diagnose silent or partial installations and report repair hints (`--json`, `--strict`, `--report-out <path>`). |
503
+ | `uninstall --dry-run` / `--apply` | Remove PhaseGate-managed files and managed blocks using `.phasegate/manifest.json`, preserving user content. |
504
+ | `reconcile --dry-run` / `--apply` | Update PhaseGate-managed files to the current package templates and refresh manifest hashes. |
498
505
  | `lint` | Run L1 Biome AST checks |
499
506
  | `validate --layer <L1-L4\|all>` | Run validators for specified layer (`--layer L0` prints runtime hook guidance; explicit L4 runs even when scheduled L4 is disabled) |
500
507
  | `ci-check` | Full CI check (L2-L4; disabled L4 is reported as skipped) |
@@ -502,7 +509,7 @@ npx phasegate <command> [options]
502
509
  | `ci:auto-refresh-agent-context --dry-run` / `--apply` | Refresh AGENTS.md pointers and CLAUDE.md standard sections |
503
510
  | `refresh-claude-md --dry-run` / `--apply` | Refresh only CLAUDE.md while preserving the user-owned section |
504
511
  | `p2:check-agent-context` | Check AGENTS.md / CLAUDE.md freshness |
505
- | `update-skills` | Update skills to latest version |
512
+ | `update-skills` | Compatibility alias for `reconcile` |
506
513
  | `phasegate:status` | Display overall harness health summary |
507
514
  | `work-items:status --dry-run` / `--apply` | Derive WI status from artifacts and optionally update stale `description.md` frontmatter. Apply refuses downgrades unless `--allow-downgrade` is supplied. |
508
515
  | `phasegate:check-phase --unit <id>` | Check current phase for a Unit |
@@ -12,8 +12,12 @@ npx phasegate <command> [options]
12
12
 
13
13
  | Command | Description |
14
14
  |---|---|
15
- | `init --name <name>` | Deploy skills and generate `phasegate.config.json` |
16
- | `update-skills` | Re-deploy skills to the latest version |
15
+ | `init --name <name>` | Legacy-compatible bootstrap for new projects: deploy skills, generate config, and optionally add hooks/CI |
16
+ | `install --dry-run` / `--apply` | Idempotently merge PhaseGate into an existing project, preserve user content, add package scripts/devDependency, and write `.phasegate/manifest.json` |
17
+ | `doctor` | Diagnose silent or partial installations and report repair hints (`--json`, `--strict`, `--report-out <path>`) |
18
+ | `uninstall --dry-run` / `--apply` | Remove PhaseGate-managed files and managed blocks using `.phasegate/manifest.json` |
19
+ | `reconcile --dry-run` / `--apply` | Update PhaseGate-managed files to current package templates and refresh manifest hashes |
20
+ | `update-skills` | Compatibility alias for `reconcile` |
17
21
  | `list-features` | List available features |
18
22
  | `enable-feature <name>` | Enable a feature |
19
23
  | `disable-feature <name>` | Disable a feature |
@@ -6,7 +6,7 @@
6
6
  - **npm** 9+ or **pnpm**
7
7
  - **TypeScript** 5.x (included as a devDependency)
8
8
 
9
- ## Install from GitHub
9
+ ## Install from npm
10
10
 
11
11
  ```bash
12
12
  npm install --save-dev phasegate
@@ -17,7 +17,7 @@ Or add it directly to your `package.json`:
17
17
  ```json
18
18
  {
19
19
  "devDependencies": {
20
- "phasegate": "^0.145.3"
20
+ "phasegate": "^0.147.0"
21
21
  }
22
22
  }
23
23
  ```
@@ -38,6 +38,8 @@ npx phasegate init --name <project-name>
38
38
 
39
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
40
 
41
+ `init` is the legacy-compatible bootstrap path for new projects. Use `install` when the project may already have hooks, package scripts, or CI files that should be preserved.
42
+
41
43
  For Codex, project initialization stops at the project boundary. After `npx phasegate init --agent codex`, enable the Codex CLI feature flag manually:
42
44
 
43
45
  ```bash
@@ -82,8 +84,6 @@ npx phasegate reconcile --apply
82
84
 
83
85
  `reconcile` updates PhaseGate-managed portions, preserves user content, adds newly introduced managed targets, and refreshes `.phasegate/manifest.json` with current version/hash metadata. If a managed file was edited after install, `reconcile --apply` refuses that entry until you rerun with `--force`, which creates a backup under `.phasegate/backups/reconcile-<timestamp>/`.
84
86
 
85
- `phasegate update-skills` remains available as a compatibility alias for `phasegate reconcile`.
86
-
87
87
  ### Manual Setup Pieces
88
88
 
89
89
  If you do not use `init` or `install`, copy the design principle documents manually:
@@ -110,9 +110,12 @@ Run `/product-architect` to begin the AIDLC process.
110
110
 
111
111
  ```bash
112
112
  npm update phasegate
113
- npx phasegate update-skills
113
+ npx phasegate reconcile --dry-run
114
+ npx phasegate reconcile --apply
114
115
  ```
115
116
 
117
+ `phasegate update-skills` remains available as a compatibility alias, but `reconcile` is the preferred upgrade path because it updates all managed files recorded in `.phasegate/manifest.json`.
118
+
116
119
  ## Recommended .gitignore additions
117
120
 
118
121
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "phasegate",
3
- "version": "0.146.0",
3
+ "version": "0.147.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",
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @layer infrastructure
3
3
  * @unit biome-ast-engine
4
+ * @work-item-id WI-109
4
5
  */
5
6
 
6
7
  import * as ts from 'typescript';
@@ -1,5 +1,6 @@
1
1
  // @layer domain
2
2
  // @unit harness-api
3
+ // @work-item-id WI-108
3
4
  // command-dispatch-service.ts — CommandDispatchService Domain Service
4
5
 
5
6
  import { CommandRegistry } from './command-registry.js';
@@ -2,6 +2,7 @@
2
2
  * @unit harness-api
3
3
  * @layer presentation
4
4
  * @work-item-id WI-141
5
+ * @work-item-id WI-109
5
6
  *
6
7
  * Pre-commit CLI entry.
7
8
  * Runs L2 validators against staged TypeScript files AND design-document
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @unit harness-api
3
3
  * @layer presentation
4
+ * @work-item-id WI-142
4
5
  *
5
6
  * Phasegate CLI エントリポイント。
6
7
  * 各Unitの Composition Root からハンドラーを取得し、コマンドに応じてディスパッチする。
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @layer application
3
3
  * @unit validator-system
4
+ * @work-item-id WI-107
4
5
  *
5
6
  * RunL4ValidatorsUseCase — H08-03: L4バリデータ実行
6
7
  */