phasegate 0.160.16 → 0.160.17
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/README.ja.md +29 -1
- package/README.md +1 -1
- package/docs/guide/installation.md +1 -1
- package/docs/templates/personal/hooks/commit-msg +7 -0
- package/docs/templates/personal/hooks/pre-commit +21 -0
- package/docs/templates/personal/phasegate-local-config.json +2 -2
- package/package.json +1 -1
- package/scripts/harness/installation/application/usecases/run-install.ts +45 -0
- package/scripts/harness/main.ts +3 -2
package/README.ja.md
CHANGED
|
@@ -97,7 +97,17 @@ claude
|
|
|
97
97
|
|
|
98
98
|
`init` は legacy 互換の bootstrap 経路です。既存 hooks / scripts / package metadata に構造化 merge したい場合は `install` を使います。「設計してから書け」を強制する仕組みなので、設計文書はユーザーがスキル経由で作るのが既定動作です。
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
既存プロジェクトへの導入は、**チーム共通で入れる (team install)** か **自分だけで試す (personal install)** かで手順が変わります。誰のリポジトリで誰がメンテするかで選んでください。
|
|
101
|
+
|
|
102
|
+
| シナリオ | コマンド | 影響範囲 |
|
|
103
|
+
|---|---|---|
|
|
104
|
+
| 新規プロジェクトを bootstrap | `npx phasegate init --name <name> --with-husky --with-ci` | リポジトリ全体(team) |
|
|
105
|
+
| 既存プロジェクトにチーム共通で導入 | `npx phasegate install --apply` | リポジトリ全体(team) |
|
|
106
|
+
| チーム所有リポジトリで個人評価 | `npx phasegate install --personal --agent claude --apply` | 自分の作業コピーのみ(ローカル) |
|
|
107
|
+
|
|
108
|
+
#### team install — チーム共通で導入する場合
|
|
109
|
+
|
|
110
|
+
`package.json` / `CLAUDE.md` / `.husky/*` / `.github/workflows/*` などのチーム共有ファイルを merge 対象に含めます。**この変更はコミット後にチーム全員へ影響します**。事前に dry-run で差分を確認してから apply してください。
|
|
101
111
|
|
|
102
112
|
```bash
|
|
103
113
|
npx phasegate install --dry-run
|
|
@@ -107,6 +117,24 @@ npx phasegate doctor
|
|
|
107
117
|
|
|
108
118
|
`install` は既存の Claude / Codex hooks や Husky script を捨てずに PhaseGate の設定を merge します。書き込み前に変更予定を表示し、package scripts と `phasegate` devDependency、root `skills/` への selected bundled skills 配布、agent skill symlink、未作成の CI workflow、`.phasegate/manifest.json` を整えます。強制的な managed 更新が必要な場合は `npx phasegate install --apply --force` を使います。この場合、置き換え対象は `.phasegate/backups/` に退避されます。<!-- @work-item-id WI-210 -->
|
|
109
119
|
|
|
120
|
+
#### personal install — 自分だけで試す場合(チーム所有リポジトリで評価したい)
|
|
121
|
+
|
|
122
|
+
チーム所有のリポジトリで自分だけ PhaseGate を試したい場合は `--personal` フラグを使います。**チーム共有ファイルには一切触れず、自分の agent runtime だけを設定する** ローカル専用パスです。
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
npx phasegate install --personal --agent claude --dry-run
|
|
126
|
+
npx phasegate install --personal --agent claude --apply
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
| 項目 | personal install の挙動 |
|
|
130
|
+
|---|---|
|
|
131
|
+
| **触らないファイル** | `package.json` / `AGENTS.md` / `CLAUDE.md` / `.husky/*` / `.github/workflows/*` / `.gitignore` / GitHub CLI 設定 / repo secrets / CI 設定 |
|
|
132
|
+
| **作るファイル** | `.phasegate-local/phasegate.config.json`(ローカル専用 config)/ `.claude/CLAUDE.local.md` または `.codex/AGENTS.local.md`(agent context)/ `.claude/settings.json` + `.claude/skills/` または `.codex/hooks.json` + `.codex/skills/`(選択した agent の runtime artifact)/ `.git/hooks/pre-commit` + `.git/hooks/commit-msg`(ローカル git hook)/ `.phasegate-local/docs/`(設計原則文書コピー)/ `.phasegate/manifest.json` |
|
|
133
|
+
| **コミット漏れ対策** | `.git/info/exclude` にローカル専用 block を管理して、個人用ファイルが誤ってチームの commit に混ざらないようにする。commit 時の L2 防御は `.git/hooks/` で発火する |
|
|
134
|
+
| **Codex hook flag** | user-level feature flag の有効化は手動アクションとして残る(`codex features enable hooks`) |
|
|
135
|
+
|
|
136
|
+
Codex を併用する場合は `--agent codex` または `--agent both` を指定します。アンインストールは team install と同様に `npx phasegate uninstall --apply` を使えば manifest 経由でローカル成果物のみが除去されます。<!-- @work-item-id WI-207 --> <!-- @work-item-id WI-208 --> <!-- @work-item-id WI-209 --> <!-- @work-item-id WI-213 -->
|
|
137
|
+
|
|
110
138
|
後で PhaseGate を外す場合は、manifest ベースの uninstall を使います。
|
|
111
139
|
|
|
112
140
|
```bash
|
package/README.md
CHANGED
|
@@ -109,7 +109,7 @@ npx phasegate install --personal --agent claude --dry-run
|
|
|
109
109
|
npx phasegate install --personal --agent claude --apply
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
-
`--personal` does not plan or write `package.json`, `AGENTS.md`, `CLAUDE.md`, `.husky/*`, `.github/workflows/*`, `.gitignore`, GitHub CLI config, repo secrets, or CI settings. It creates `.phasegate-local/phasegate.config.json`, real local-only agent runtime artifacts for the selected agent (`.claude/settings.json` + `.claude/skills/` and/or `.codex/hooks.json` + `.codex/skills/`), a managed local-only block in `.git/info/exclude`, and `.phasegate/manifest.json`. Codex user-level hook feature enablement remains a manual action. <!-- @work-item-id WI-207 --> <!-- @work-item-id WI-208 --> <!-- @work-item-id WI-209 -->
|
|
112
|
+
`--personal` does not plan or write `package.json`, `AGENTS.md`, `CLAUDE.md`, `.husky/*`, `.github/workflows/*`, `.gitignore`, GitHub CLI config, repo secrets, or CI settings. It creates `.phasegate-local/phasegate.config.json`, local agent context (`.claude/CLAUDE.local.md` and/or `.codex/AGENTS.local.md`), real local-only agent runtime artifacts for the selected agent (`.claude/settings.json` + `.claude/skills/` and/or `.codex/hooks.json` + `.codex/skills/`), local git hooks under `.git/hooks/`, local reference docs under `.phasegate-local/docs/`, a managed local-only block in `.git/info/exclude`, and `.phasegate/manifest.json`. Codex user-level hook feature enablement remains a manual action. <!-- @work-item-id WI-207 --> <!-- @work-item-id WI-208 --> <!-- @work-item-id WI-209 --> <!-- @work-item-id WI-213 -->
|
|
113
113
|
|
|
114
114
|
For agent-driven setup planning, use:
|
|
115
115
|
|
|
@@ -65,7 +65,7 @@ npx phasegate install --personal --agent claude --dry-run
|
|
|
65
65
|
npx phasegate install --personal --agent claude --apply
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
Personal install keeps team-owned files out of both the plan and apply path: `package.json`, `AGENTS.md`, `CLAUDE.md`, `.husky/*`, `.github/workflows/*`, `.gitignore`, GitHub CLI config, repo secrets, and CI settings are not touched. PhaseGate writes `.phasegate-local/phasegate.config.json`, creates real local-only agent runtime artifacts for the selected agent (`.claude/settings.json` + `.claude/skills/` and/or `.codex/hooks.json` + `.codex/skills/`), records `.phasegate/manifest.json`, and manages a local exclude block in `.git/info/exclude`. Codex user-level hook feature enablement is still reported as a manual action. <!-- @work-item-id WI-207 --> <!-- @work-item-id WI-208 --> <!-- @work-item-id WI-209 -->
|
|
68
|
+
Personal install keeps team-owned files out of both the plan and apply path: `package.json`, `AGENTS.md`, `CLAUDE.md`, `.husky/*`, `.github/workflows/*`, `.gitignore`, GitHub CLI config, repo secrets, and CI settings are not touched. PhaseGate writes `.phasegate-local/phasegate.config.json`, creates local agent context (`.claude/CLAUDE.local.md` and/or `.codex/AGENTS.local.md`), creates real local-only agent runtime artifacts for the selected agent (`.claude/settings.json` + `.claude/skills/` and/or `.codex/hooks.json` + `.codex/skills/`), deploys local git hooks under `.git/hooks/`, copies reference docs under `.phasegate-local/docs/`, records `.phasegate/manifest.json`, and manages a local exclude block in `.git/info/exclude`. Codex user-level hook feature enablement is still reported as a manual action. <!-- @work-item-id WI-207 --> <!-- @work-item-id WI-208 --> <!-- @work-item-id WI-209 --> <!-- @work-item-id WI-213 -->
|
|
69
69
|
|
|
70
70
|
For agent-readable planning before writing files:
|
|
71
71
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/usr/bin/env sh
|
|
2
|
+
# PhaseGate personal pre-commit hook.
|
|
3
|
+
# Local-only counterpart of the Husky pre-commit defense.
|
|
4
|
+
|
|
5
|
+
PHASEGATE_CMD="${PHASEGATE_CMD:-npx phasegate}"
|
|
6
|
+
|
|
7
|
+
echo "PhaseGate personal pre-commit"
|
|
8
|
+
|
|
9
|
+
$PHASEGATE_CMD lint
|
|
10
|
+
L1_EXIT=$?
|
|
11
|
+
if [ $L1_EXIT -ne 0 ]; then
|
|
12
|
+
echo "PhaseGate lint failed."
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
if [ "${HARNESS_QUICK_MODE:-0}" = "1" ]; then
|
|
17
|
+
$PHASEGATE_CMD validate --layer L2 --format human --no-l4
|
|
18
|
+
else
|
|
19
|
+
$PHASEGATE_CMD validate --layer L2 --format human
|
|
20
|
+
fi
|
|
21
|
+
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"deadCodeGC": false
|
|
55
55
|
},
|
|
56
56
|
"paths": {
|
|
57
|
-
"designDocs": "
|
|
58
|
-
"inceptionDocs": "
|
|
57
|
+
"designDocs": ".phasegate-local/product/construction",
|
|
58
|
+
"inceptionDocs": ".phasegate-local/inception"
|
|
59
59
|
},
|
|
60
60
|
"reporting": {
|
|
61
61
|
"format": "json",
|
package/package.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
// @work-item-id WI-208
|
|
12
12
|
// @work-item-id WI-209
|
|
13
13
|
// @work-item-id WI-210
|
|
14
|
+
// @work-item-id WI-213
|
|
14
15
|
|
|
15
16
|
import { mkdir, readFile, writeFile, copyFile, chmod, access, lstat, readlink, symlink, readdir, rm } from "node:fs/promises";
|
|
16
17
|
import { dirname, join } from "node:path";
|
|
@@ -624,6 +625,12 @@ export class RunInstallUseCase {
|
|
|
624
625
|
},
|
|
625
626
|
...(options.includeClaude
|
|
626
627
|
? [
|
|
628
|
+
{
|
|
629
|
+
path: ".claude/CLAUDE.local.md",
|
|
630
|
+
strategy: "markdown-managed" as const,
|
|
631
|
+
templatePath: "docs/templates/agent-context/CLAUDE.md.template.md",
|
|
632
|
+
block: { start: MARKDOWN_BEGIN, end: MARKDOWN_END, content: "phasegate personal CLAUDE.local.md managed section" },
|
|
633
|
+
},
|
|
627
634
|
{
|
|
628
635
|
path: ".claude/settings.json",
|
|
629
636
|
strategy: "copy" as const,
|
|
@@ -633,6 +640,12 @@ export class RunInstallUseCase {
|
|
|
633
640
|
: []),
|
|
634
641
|
...(options.includeCodex
|
|
635
642
|
? [
|
|
643
|
+
{
|
|
644
|
+
path: ".codex/AGENTS.local.md",
|
|
645
|
+
strategy: "markdown-managed" as const,
|
|
646
|
+
templatePath: "docs/templates/agent-context/AGENTS.md.template.md",
|
|
647
|
+
block: { start: MARKDOWN_BEGIN, end: MARKDOWN_END, content: "phasegate personal AGENTS.local.md managed section" },
|
|
648
|
+
},
|
|
636
649
|
{
|
|
637
650
|
path: ".codex/hooks.json",
|
|
638
651
|
strategy: "copy" as const,
|
|
@@ -640,6 +653,38 @@ export class RunInstallUseCase {
|
|
|
640
653
|
},
|
|
641
654
|
]
|
|
642
655
|
: []),
|
|
656
|
+
{
|
|
657
|
+
path: ".git/hooks/pre-commit",
|
|
658
|
+
strategy: "copy" as const,
|
|
659
|
+
templatePath: "docs/templates/personal/hooks/pre-commit",
|
|
660
|
+
executable: true,
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
path: ".git/hooks/commit-msg",
|
|
664
|
+
strategy: "copy" as const,
|
|
665
|
+
templatePath: "docs/templates/personal/hooks/commit-msg",
|
|
666
|
+
executable: true,
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
path: ".phasegate-local/docs/folder_management_rules.md",
|
|
670
|
+
strategy: "copy" as const,
|
|
671
|
+
templatePath: "docs/folder_management_rules.md",
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
path: ".phasegate-local/docs/principles/architecture-philosophy.md",
|
|
675
|
+
strategy: "copy" as const,
|
|
676
|
+
templatePath: "docs/principles/architecture-philosophy.md",
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
path: ".phasegate-local/docs/principles/model-routing.md",
|
|
680
|
+
strategy: "copy" as const,
|
|
681
|
+
templatePath: "docs/principles/model-routing.md",
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
path: ".phasegate-local/docs/principles/testing-rules.md",
|
|
685
|
+
strategy: "copy" as const,
|
|
686
|
+
templatePath: "docs/principles/testing-rules.md",
|
|
687
|
+
},
|
|
643
688
|
{
|
|
644
689
|
path: ".git/info/exclude",
|
|
645
690
|
strategy: "text-managed" as const,
|
package/scripts/harness/main.ts
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @work-item-id WI-202 / WI-204
|
|
18
18
|
* @work-item-id WI-205
|
|
19
19
|
* @work-item-id WI-206
|
|
20
|
+
* @work-item-id WI-213
|
|
20
21
|
*
|
|
21
22
|
* Phasegate CLI エントリポイント。
|
|
22
23
|
* 各Unitの Composition Root からハンドラーを取得し、コマンドに応じてディスパッチする。
|
|
@@ -167,7 +168,7 @@ Setup:
|
|
|
167
168
|
--skills <core|all>, --agent <claude|codex|both>, --workflow <standard|strict>,
|
|
168
169
|
--with-husky, --with-ci, --yes)
|
|
169
170
|
update-skills Alias for reconcile (kept for compatibility)
|
|
170
|
-
doctor Diagnose silent installation failures (--json, --strict, --agent <claude|codex|both>, --report-out <path>)
|
|
171
|
+
doctor Diagnose silent installation failures (--json, --strict, --personal, --agent <claude|codex|both>, --report-out <path>)
|
|
171
172
|
scaffold-wi <unit|_cross> <story|issue|chore>
|
|
172
173
|
Create docs/inception/{unit}/WI-XXX/description.md
|
|
173
174
|
emit-agent-rules Print AGENTS.md / CLAUDE.md WI workflow rules block
|
|
@@ -2001,7 +2002,7 @@ async function main(): Promise<void> {
|
|
|
2001
2002
|
}
|
|
2002
2003
|
|
|
2003
2004
|
case "doctor": {
|
|
2004
|
-
const KNOWN_DOCTOR_FLAGS = ["--json", "--strict", "--agent", "--report-out"];
|
|
2005
|
+
const KNOWN_DOCTOR_FLAGS = ["--json", "--strict", "--personal", "--agent", "--report-out"];
|
|
2005
2006
|
const flagError = validateKnownFlags(args, KNOWN_DOCTOR_FLAGS);
|
|
2006
2007
|
if (flagError) {
|
|
2007
2008
|
console.error(flagError);
|