@pieai/pro-gov 0.3.17 → 0.4.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.
package/README.md CHANGED
@@ -53,6 +53,7 @@ pro-gov init --profile engineering-runtime --dry-run
53
53
  pro-gov init --profile engineering-runtime --apply
54
54
  pro-gov init --profile doc-only --dry-run
55
55
  pro-gov sync --check --profile engineering-runtime
56
+ pro-gov sync --apply-host-hooks --profile engineering-runtime
56
57
  pro-gov doctor
57
58
  ```
58
59
 
@@ -72,6 +73,7 @@ What these commands do:
72
73
  | `init --dry-run` | Shows starter/profile files that would be needed. | No |
73
74
  | `init --apply` | Installs one profile into a fresh target; refuses the whole operation if any target file exists. Optional CI and Lefthook references are not installed. | Yes |
74
75
  | `sync --check` | Strictly compares shared core files and checks only the presence of project-local seed files. | No |
76
+ | `sync --apply-host-hooks` | Merges current PGS Compound Gate entries into engineering-runtime host configs while preserving consumer-owned keys and hooks. | Only the three host config files |
75
77
  | `doctor` | Checks required packaged assets and whether `doc-gov` is available. | No |
76
78
 
77
79
  ## Full Checkout Commands
@@ -154,8 +156,13 @@ work, run `pro-gov learn recall --query "<task summary>"` and read relevant
154
156
  `docs/solutions/**` or `CONCEPTS.md` hits before changing files.
155
157
 
156
158
  Engineering-runtime starters include cross-host Stop hooks for Codex,
157
- Claude Code, and Antigravity. Those hooks call `pro-gov host-hook` and require
158
- the final report to include either:
159
+ Claude Code, and Antigravity. Those hooks call `pro-gov host-hook`. The starter
160
+ default is `--compound-gate-mode off`: wiring is present, but the hook does not
161
+ interrupt the main session. Use `--compound-gate-mode lite` for a short
162
+ exit-door reminder, or `--compound-gate-mode strict` for the older blocking
163
+ gate.
164
+
165
+ When enabled, the hook expects the final report to include either:
159
166
 
160
167
  ```text
161
168
  Compound Gate: ran ce-compound -> <path>
@@ -6,7 +6,7 @@ status: stable
6
6
  canonical: true
7
7
  owner: human
8
8
  created: 2026-05-06
9
- last_reviewed: 2026-07-02
9
+ last_reviewed: 2026-07-11
10
10
  domain: adoption
11
11
  tags:
12
12
  - adoption
@@ -79,7 +79,8 @@ Current package-based method:
79
79
  merge local truth deliberately instead of asking PGS to overwrite it
80
80
  - run `pro-gov sync --check --profile <profile>` to compare shared core files;
81
81
  project-local router, policy, documentation map, and current-work files are
82
- checked for presence rather than byte equality
82
+ checked for presence rather than byte equality; host configs are compared by
83
+ PGS-owned entries rather than whole-file equality
83
84
  - run `pro-gov assets discover --target <path>` and
84
85
  `pro-gov assets recommend --target <path>` to collect local project signals
85
86
  and suggested agent-asset bundles without changing the project
@@ -98,6 +99,9 @@ Current package-based method:
98
99
  - `.codex/hooks.json`
99
100
  - `.claude/settings.json`
100
101
  - `.agents/hooks.json`
102
+ - prefer `pro-gov sync --apply-host-hooks --profile engineering-runtime` for
103
+ that merge; it preserves consumer `PreToolUse`, other events, other top-level
104
+ keys, and non-PGS Stop/SubagentStop entries
101
105
  - run `doc-gov doctor` after wiring guardrails to verify they are actually
102
106
  connected
103
107
  - run `pro-gov doctor --strict-hooks` after wiring host hooks to prove the
@@ -112,6 +116,7 @@ pnpm pro-gov init --profile engineering-runtime --dry-run
112
116
  pnpm pro-gov init --profile engineering-runtime --apply
113
117
  pnpm doc-gov scan
114
118
  pnpm pro-gov sync --check --profile engineering-runtime
119
+ pnpm pro-gov sync --apply-host-hooks --profile engineering-runtime
115
120
  ```
116
121
 
117
122
  Use `--apply` only for a fresh target. Existing projects normally already own
@@ -225,9 +230,11 @@ so prior lessons can shape the work without making Compound Engineering the
225
230
  default execution workflow.
226
231
 
227
232
  The host-hook gate is deliberately small. It does not make Compound Engineering
228
- the main workflow. It only blocks a final completion report that looks like
229
- finished engineering work but does not say whether the Compound Gate ran or was
230
- skipped:
233
+ the main workflow. Starter hooks default to `--compound-gate-mode off`, so they
234
+ prove the wiring without interrupting the main session. Switch a target to
235
+ `--compound-gate-mode lite` for a short reminder, or `--compound-gate-mode
236
+ strict` when a project intentionally wants the old blocking exit gate. In
237
+ `lite` or `strict`, the hook checks whether a completion report says one of:
231
238
 
232
239
  ```text
233
240
  Compound Gate: ran ce-compound -> <path>
@@ -310,8 +317,9 @@ engineering runtime profile.
310
317
 
311
318
  `pro-gov doctor --strict-hooks` is a wiring check, not a live host simulation.
312
319
  It proves the project has hook files that call `pro-gov host-hook`; PGS package
313
- tests prove the expected Stop/SubagentStop behavior for the supported host
314
- schemas. After installing or changing hooks, validate from a fresh AI session.
320
+ tests prove the expected Stop/SubagentStop behavior for `off`, `lite`, and
321
+ `strict` modes across the supported host schemas. After installing or changing
322
+ hooks, validate from a fresh AI session.
315
323
  For Antigravity, a real invocation writes diagnostics under
316
324
  `.git/pro-gov-hook-debug/` because the starter hook command sets
317
325
  `PGS_HOST_HOOK_DEBUG=1`. Absence of a diagnostic file after a fresh
@@ -0,0 +1,331 @@
1
+ ---
2
+ id: REF-AGENT-WORKFLOW-METHODOLOGY-COMPARISON
3
+ title: Agent Workflow Methodology Comparison
4
+ type: reference
5
+ status: active
6
+ canonical: true
7
+ owner: project
8
+ created: 2026-07-06
9
+ last_reviewed: 2026-07-06
10
+ domain: adoption
11
+ tags:
12
+ - agent-workflows
13
+ - superpowers
14
+ - compound-engineering
15
+ - mattpocock-skills
16
+ - wayfinder
17
+ pinned: false
18
+ related:
19
+ - REF-PUBLIC-RELEASE-CHECKLIST
20
+ - REF-DOWNSTREAM-PROJECT-REGISTRY
21
+ ---
22
+
23
+ # Agent Workflow Methodology Comparison
24
+
25
+ 本文比较 4 套 AI agent 工作方法,观察时间点是 2026-07-06:
26
+
27
+ 1. **Superpowers**
28
+ 2. **Compound Engineering**
29
+ 3. **Matt Pocock skills 主流程**
30
+ 4. **Matt Pocock Wayfinder**
31
+
32
+ 小学生版本:这 4 套东西都不是“更聪明的魔法咒语”。它们更像 4 个不同的帮手。
33
+
34
+ - Superpowers 像工地施工队长。
35
+ - Compound Engineering 像厨师的复盘菜谱本。
36
+ - Matt 主流程像采访员、产品经理、拆票员三个人排队帮你。
37
+ - Wayfinder 像走进大雾森林前的画地图的人。
38
+
39
+ ## 版本和证据
40
+
41
+ 这是一个时间点快照,不是永久真理。Wayfinder 现在变化尤其快。
42
+
43
+ | 系统 | 本次观察到的版本或来源 | 证据 |
44
+ | --- | --- | --- |
45
+ | PGS | 本地 package 版本 `0.4.0` | `package.json`,2026-07-06 检查 |
46
+ | Superpowers | 本机 Codex 插件 `6.1.1` | 本地 `.codex/plugins/cache/superpowers-dev/superpowers/6.1.1`;上游项目:[obra/superpowers](https://github.com/obra/superpowers) |
47
+ | Compound Engineering | 本机插件 `3.18.0` | 本地 `.codex/plugins/cache/compound-engineering-plugin/compound-engineering/3.18.0`;上游项目:[EveryInc/compound-engineering-plugin](https://github.com/EveryInc/compound-engineering-plugin) |
48
+ | Matt Pocock skills | PGS 本地 lock 记录 GitHub 来源和 hash,不记录 semver | 上游项目:[mattpocock/skills](https://github.com/mattpocock/skills);Skill Vault 在 2026-07-05 显示 `1.0.31`、commit `66f92b6` |
49
+ | Wayfinder | 属于 `mattpocock/skills`,2026-07-06 仍在 `skills/in-progress/wayfinder` | 上游文件:[Wayfinder SKILL.md](https://github.com/mattpocock/skills/blob/main/skills/in-progress/wayfinder/SKILL.md);GitHub Actions 显示 Wayfinder 已连续多次发布到 Release #46 |
50
+
51
+ 重要提醒:PGS 本地 `wayfinder` 已在 2026-07-07 通过 `pro-gov assets npx update --skill wayfinder --plan` 更新到包含 **"Plan, don't do"** 和 destination 说明的新版。Wayfinder 仍处在高流动期,后续如果继续升级,需要重新复查这篇文档。
52
+
53
+ ## 一句话结论
54
+
55
+ PGS 最稳的组合是:
56
+
57
+ - **Superpowers** 继续当默认工程流程负责人。
58
+ - **Compound Engineering** 继续当默认复利记录和经验沉淀工具。
59
+ - **Matt 主流程** 用在“想法还模糊,需要问清楚、写 PRD、拆 issue”的时候。
60
+ - **Wayfinder** 只用在“大到一个 session 装不下、前路还在雾里”的任务上。
61
+
62
+ Wayfinder 暂时不应该自动启动。它很有潜力,但现在更像侦察兵,不像自动驾驶车。要用它,最好满足 4 个条件:用户明确叫它、目的地说清楚、issue tracker 支持它的地图/子票规则、关键节点有人类确认。
63
+
64
+ ## 两个贯穿例子
65
+
66
+ 为了更好懂,下面一直用两个例子:
67
+
68
+ - **小安要开发一个 App。** 可能只是一个习惯打卡小工具,也可能是一个很大的 EMS 管理系统。
69
+ - **小宁要写一本小说。** 可能只是一本短篇推理,也可能是一个多卷本奇幻系列。
70
+
71
+ ## Superpowers:工地施工队长
72
+
73
+ Superpowers 像工地施工队长。施工队长不会一上来就让人搬砖。他会先问:要建什么?图纸在哪里?怎么验收?有没有安全检查?
74
+
75
+ 小安做 App 时,Superpowers 会帮:
76
+
77
+ - 问清楚这个功能到底要解决什么问题。
78
+ - 写计划。
79
+ - 尽量用 TDD,先写测试再实现。
80
+ - 完工前检查测试、review、分支状态。
81
+
82
+ 小宁写小说时,Superpowers 也能帮一点,比如安排写作计划。但它脑子里更多是“软件工程施工”。如果小宁只是想探索人物和情绪,Superpowers 可能显得有点硬。
83
+
84
+ 最适合:工程实现、调 bug、测试验证、分支收尾。
85
+
86
+ PGS 判断:Superpowers 继续做默认工程流程负责人。PGS 已在 [integrations/superpowers.md](../../../integrations/superpowers.md) 里这样定位。
87
+
88
+ ## Compound Engineering:厨师的复盘菜谱本
89
+
90
+ Compound Engineering 像厨师的菜谱本。厨师这次做菜发现“火候应该小一点”“这个酱汁可以提前一天做”,就记下来。下次做同类菜,就不用重新踩坑。
91
+
92
+ 小安做 App 时,CE 会帮:
93
+
94
+ - 修完一个难部署 bug 后,把可复用经验记下来。
95
+ - 下次遇到类似问题,AI 可以先读以前的经验。
96
+ - CE 也有计划、review、debug 等完整流程,但 PGS 默认不让它接管整条开发线。
97
+
98
+ 小宁写小说时,CE 可以记录写作经验,比如“多卷本小说需要先做时间线表”。但如果只是自由创作,完整 CE 流程可能也会显得太工程化。
99
+
100
+ 最适合:把一次工作变成下一次工作的优势。
101
+
102
+ PGS 判断:默认只用 **Compound Gate** 做经验沉淀。完整 CE 流程必须用户明确要求。见 [integrations/compound-engineering.md](../../../integrations/compound-engineering.md)。
103
+
104
+ ## Matt 主流程:采访员 + 产品经理 + 拆票员
105
+
106
+ Matt 主流程像 3 个人接力:
107
+
108
+ 1. 采访员先不停追问,把模糊想法问清楚。
109
+ 2. 产品经理把答案整理成 PRD。
110
+ 3. 拆票员把 PRD 切成一个个能独立完成的小 issue。
111
+
112
+ 小安做 App 时:
113
+
114
+ - `/grill-with-docs` 像采访员,边问边更新项目上下文。
115
+ - `/to-prd` 像产品经理,把讨论整理成 PRD。
116
+ - `/to-issues` 像拆票员,把 PRD 拆成竖切 issue。
117
+ - `/implement` 像工程执行员,拿一个 issue 做 TDD、review、commit。
118
+
119
+ 小宁写小说时:
120
+
121
+ - `/grill-me` 可以问清楚题材、主角、冲突、结尾。
122
+ - `/to-prd` 可以变成故事圣经或写作 brief。
123
+ - `/to-issues` 可以变成章节卡、设定任务、资料研究任务。
124
+ - 但它的形状还是偏“产品开发”,所以对纯文学创作可能有点像用项目管理工具写诗。
125
+
126
+ 最适合:把模糊需求变成可保存、可拆分、可执行的东西。
127
+
128
+ PGS 判断:Matt skills 可以完整安装、原样使用,但它产生的原生产物不应该被 PGS 乱改。PGS 不应该为了 Doc Gov 给它的产物硬加 frontmatter。正确做法是:Matt 产物保留原味;只有当人明确决定“这个东西要升级为 PGS 治理真相”时,才另建或更新 PGS 文档。见 [integrations/mattpocock-skills.md](../../../integrations/mattpocock-skills.md)。
129
+
130
+ ## Wayfinder:大雾森林里的画地图的人
131
+
132
+ Wayfinder 像你站在一片大雾森林前。你知道森林另一边可能有城堡,但不知道路在哪里,也不知道哪些桥断了。这时最聪明的事不是冲进去盖房子,而是先画地图。
133
+
134
+ 小安做一个小习惯 App:
135
+
136
+ - 不建议用 Wayfinder。太重了。Matt 主流程或 Superpowers 就够。
137
+
138
+ 小安做一个大型 EMS 系统:
139
+
140
+ - Wayfinder 可以创建一个 map issue。
141
+ - 然后创建子票,比如“决定权限模型”“研究 EMS 审计要求”“原型验证派单时间线 UI”“追问升级规则”。
142
+ - 每个 session 只解决一个票,把答案记回地图。
143
+
144
+ 小宁写短篇推理:
145
+
146
+ - 一般不需要 Wayfinder。
147
+
148
+ 小宁写多卷奇幻系列:
149
+
150
+ - Wayfinder 很可能有用。它可以画出“魔法规则是否影响经济”“第二卷由谁推动主线”“结局前必须先决定哪些世界观问题”等地图。
151
+ - 每张票解决一个大问题。
152
+
153
+ 最适合:很大、很模糊、一个 session 装不下、下一步不清楚的工作。
154
+
155
+ PGS 判断:Wayfinder 只能显式调用。用户说 `/wayfinder`,或者清楚表达“我要为一个大而不清楚的任务画地图”,再用。
156
+
157
+ ## 总对比表
158
+
159
+ | 维度 | Superpowers | Compound Engineering | Matt 主流程 | Wayfinder |
160
+ | --- | --- | --- | --- | --- |
161
+ | 小学生比喻 | 施工队长 | 复盘菜谱本 | 采访员 + 产品经理 + 拆票员 | 大雾地图师 |
162
+ | 主要工作 | 把代码小心做出来 | 让下一次工作更容易 | 把想法变成 PRD / issue / code | 在未知里找到路线 |
163
+ | 最适合规模 | 小到大的工程任务 | 重复出现的工程经验 | 中等复杂产品/功能 | 超大、模糊、多 session |
164
+ | 主要产物 | 计划、测试、review、分支收尾 | `docs/solutions/**` 等经验文档 | `CONTEXT.md`、ADR、PRD、issue | 一个 map issue + 多个 child ticket |
165
+ | 如何启动 | skill routing / session startup | 显式 CE skill 或 PGS Compound Gate | 通常显式 slash command | 显式 `/wayfinder` |
166
+ | 人类角色 | 批准计划和关键选择 | 判断什么值得沉淀 | 回答采访、批准 issue 颗粒度 | 批准目的地、地图、下一步 |
167
+ | 自主程度 | 中等 | PGS 默认低;完整 CE 时较高 | 中等 | 如果不设边界会偏高 |
168
+ | 停止条件 | 测试、review、分支完成 | 学习记录完成或跳过 | PRD / issue / implementation 完成 | 路线清楚,没有更多必须先决定的问题 |
169
+ | 最大优点 | 工程纪律强 | 真正复利 | 需求澄清和竖切很强 | 不假装大雾已经清楚 |
170
+ | 最大风险 | 小任务可能仪式太重 | 用多了会变流程负担 | 可能偏重、偏线性 | 可能造太多票,或选错下一步 |
171
+ | PGS 默认态度 | 默认工程负责人 | 默认复利尾巴 | 可选工具箱 | 显式侦察兵 |
172
+
173
+ ## 外部证据和评论
174
+
175
+ ### Wayfinder
176
+
177
+ 一手来源:Wayfinder 自己说,它处理的是“一个 session 太大、路还在雾里”的工作。它会在 issue tracker 上建共享地图,然后一个 ticket 一个 ticket 解决,直到目的地路线清楚。最新版上游还明确说默认是 **Plan, don't do**:默认产出决策,不产出最终交付物,除非 map Notes 明确允许执行。来源:[Wayfinder SKILL.md](https://github.com/mattpocock/skills/blob/main/skills/in-progress/wayfinder/SKILL.md)。
178
+
179
+ GitHub Actions 显示 Wayfinder 近期更新非常密集,包括 destination/purpose、deferred section、native blocking、assignment claiming、plan big work 等。来源:[mattpocock/skills Actions](https://github.com/mattpocock/skills/actions)。
180
+
181
+ GitHub issue #450 报告了一个真实风险:Wayfinder 在 work-through-map 时没有充分追问资源冲突,导致一个部署任务影响了另一个已存在服务。来源:[Issue #450](https://github.com/mattpocock/skills/issues/450)。
182
+
183
+ 用户提供的 2026-07-06 X 截图也显示两面性:有人觉得 Wayfinder 很震撼,但也观察到它可能继续执行错误的下一张票;Matt 回复说这不应该发生,听起来像 bug。这个证据说明:它很有潜力,但还不能当稳定自动驾驶。
184
+
185
+ PGS 解释:Wayfinder 是侦察兵,不是总司令。
186
+
187
+ ### Matt 主流程
188
+
189
+ 一手来源:Matt README 说这些 skills 是小而可组合、可改造、用于真实工程,不是 vibe coding。它把 `/grill-with-docs`、`CONTEXT.md`、`/to-prd`、`/to-issues`、`/tdd`、`/code-review` 组合成一个流程。来源:[mattpocock/skills](https://github.com/mattpocock/skills)。
190
+
191
+ 公开 `to-issues` 指南说,它会把 PRD 拆成可独立抓取的竖切 issue,并让用户批准颗粒度和依赖。来源:[AI Hero to-issues guide](https://www.aihero.dev/skills-to-issues)。
192
+
193
+ 外部评论是“有用但可能重”。有 Reddit 用户说 Matt 风格的 GitHub issues / TDD / audit loop 质量好,但也担心每个小 issue 都耗时较多。来源:[Reddit discussion](https://www.reddit.com/r/PiCodingAgent/comments/1t2tm5c/am_i_overengineering_matt_pococks_ai_coding/)。
194
+
195
+ 另一个公开写法认为,这套流程适合触达多个模块的 feature/refactor,但不能替代人的判断。来源:[Danny Shmueli writeup](https://dannyshmueli.com/2026/04/29/Matt-Pocock-Skills-Hermes-Subagents-Feature-Work/)。
196
+
197
+ PGS 解释:Matt 主流程适合“把话问明白、把需求切小”。但不要为了治理洁癖去改它原生输出。
198
+
199
+ ### Superpowers
200
+
201
+ 一手来源:Superpowers 自称是基于 composable skills 和启动指令的软件开发方法论,覆盖 brainstorming、worktree、planning、subagent execution、TDD、debugging、review、verification。来源:[obra/superpowers](https://github.com/obra/superpowers)。
202
+
203
+ Superpowers 6 发布说明称,它在作者测试中更快、更省 token,并支持或改进了多个 coding agent,包括 Codex。来源:[Superpowers 6 announcement](https://blog.fsck.com/2026/06/15/Superpowers-6/)。
204
+
205
+ 社区评论也分两面。有些用户喜欢它前半段:澄清假设、写 spec、识别风险、做计划。也有人认为它对小任务会太重,甚至更耗用量。来源:[Reddit ClaudeCode thread](https://www.reddit.com/r/ClaudeCode/comments/1uk7dzk/fable_5_and_superpowers_plugin/) 和 [Reddit Codex thread](https://www.reddit.com/r/codex/comments/1sp7di6/have_any_of_you_guys_been_using_the_superpower/)。
206
+
207
+ PGS 解释:Superpowers 仍然是最适合当默认工程负责人的,因为它端到端纪律强。但 PGS 需要保留轻量路径,小事不要被拖进大仪式。
208
+
209
+ ### Compound Engineering
210
+
211
+ 一手来源:CE 插件强调“每一次工程工作都应该让下一次更容易”,提供 `/ce-brainstorm`、`/ce-plan`、`/ce-code-review`、`/ce-compound` 等技能。来源:[EveryInc/compound-engineering-plugin](https://github.com/EveryInc/compound-engineering-plugin)。
212
+
213
+ Every 的 Compound Engineering 指南强调 safety nets、agent-native environment、parallel work、plan as artifact。来源:[Compound Engineering guide](https://every.to/guides/compound-engineering)。
214
+
215
+ Will Larson 的评论认为它是一个便宜、有用、值得试的实验,同时也提醒有些实践未来可能会被 agent harness 吸收。来源:[Lethain review](https://lethain.com/everyinc-compound-engineering/)。
216
+
217
+ PGS 解释:CE 最珍贵的是“把经验留下来”。但如果 CE 和 Superpowers 同时想当整个流程的老板,AI 就像同时听两个教练喊口令,会乱。PGS 因此让 Superpowers 默认负责施工,让 CE 默认负责复盘。
218
+
219
+ ## 用 Loopy 外骨骼检查
220
+
221
+ `loopy` 技能说,一个好 loop 应该有 6 步:观察、选择、行动、验证、记录、重复或停止。它还要求有明确终点,比如成功、阻塞、需要批准、用尽、停滞。
222
+
223
+ 把 4 套方法放进去看:
224
+
225
+ | 系统 | 观察 | 选择 | 行动 | 验证 | 记录 | 停止 |
226
+ | --- | --- | --- | --- | --- | --- | --- |
227
+ | Superpowers | 强:会问、会读代码 | 强:会写计划 | 强:会实现 | 强:测试/review | 中:计划和 review 记录 | 强,但要真的跑验证 |
228
+ | CE | 中:读任务上下文 | 中:CE plan/review | 中:可执行但 PGS 默认不用 | 中:review/check | 强:复利文档 | capture 很清楚,完整流程较重 |
229
+ | Matt 主流程 | 强:grilling/docs | 强:PRD/issues | 强:implement | 强:TDD/code review | 强:context/ADR/PRD/issues | 中:依赖 smart context hygiene |
230
+ | Wayfinder | 强:map/fog/tickets | 如果 frontier 对,就强 | 默认低:应该 plan,不应该 do | 中:依赖 ticket resolution 质量 | 强:map 和 resolution comments | 需要特别小心:一 session 一票 |
231
+
232
+ Loopy 角度的 PGS 结论:Wayfinder 最大问题不是“不聪明”,而是“权限和刹车”。地图必须写清楚什么时候问人、什么时候停、什么时候绝对不执行。
233
+
234
+ ## 五轮真实评估迭代
235
+
236
+ ### 第 1 轮:先看 PGS 边界
237
+
238
+ 问题:PGS 能不能引入 Wayfinder,而不让 4 套方法互相打架?
239
+
240
+ 判断:可以,但每套方法要分工清楚。
241
+
242
+ - Superpowers 负责默认工程施工。
243
+ - CE 负责默认经验复利。
244
+ - Matt 主流程负责需求澄清、PRD、issue 拆分。
245
+ - Wayfinder 负责大雾任务的地图。
246
+
247
+ 我否掉的方案:让 Wayfinder 自动替代 Matt 旧流程。这太激进,像把整个施工队换成一张地图。
248
+
249
+ ### 第 2 轮:看 Wayfinder 上游原意
250
+
251
+ 问题:Wayfinder 自己到底说它是什么?
252
+
253
+ 判断:它不是更强的 `/implement`。它更像“路线发现”和“决策地图”。上游最新版还明确写了默认 plan,不默认 do。
254
+
255
+ 这改变了推荐:Wayfinder 不应该直接拿来替代实现流程。
256
+
257
+ ### 第 3 轮:看外部评论是不是只有夸
258
+
259
+ 问题:大家是在无脑夸,还是有真实问题?
260
+
261
+ 判断:两者都有。
262
+
263
+ - 夸:有人觉得它能做以前不敢交给 AI 的大规划。
264
+ - 风险:GitHub issue #450 和用户截图都说明,它可能在下一步选择或冲突追问上出错。
265
+
266
+ 这让 PGS 不应该过早自动化采用。
267
+
268
+ ### 第 4 轮:用 Loopy 查循环质量
269
+
270
+ 问题:4 套方法哪个循环最完整?
271
+
272
+ 判断:
273
+
274
+ - Superpowers 和 Matt 主流程的“构建循环”更成熟。
275
+ - CE 的“记录/复利循环”最强。
276
+ - Wayfinder 的“观察/记录”很强,但“谁决定下一步”和“什么时候停止”需要额外护栏。
277
+
278
+ 结论:Wayfinder 必须一 session 一票,chart map 后要人工确认,默认只做决策,不做执行。
279
+
280
+ ### 第 5 轮:看 PGS 最小采用方式
281
+
282
+ 问题:最小、稳妥、有价值的采用方式是什么?
283
+
284
+ 判断:先写边界文档,不急着改运行规则。
285
+
286
+ 如果后续要真正 operationalize Wayfinder,需要:
287
+
288
+ 1. 保持 Matt skill pack 更新到包含最新版 Wayfinder 文案的版本。
289
+ 2. 保持 PGS 中央 `docs/agents/issue-tracker.md` 有 Wayfinding operations。
290
+ 3. 保持 Matt 原生产物不被 PGS 修改。
291
+ 4. Doc Gov 继续忽略 Matt 原生产物,除非人工提升为治理文档。
292
+ 5. 本地主控 AI 保留最终 merge / commit / push 权限。
293
+
294
+ ## PGS 推荐路由
295
+
296
+ | 场景 | 推荐用什么 |
297
+ | --- | --- |
298
+ | 小而明确的代码修复 | Superpowers,必要时直接 TDD |
299
+ | 难 bug | Superpowers systematic debugging;有复用经验再 CE capture |
300
+ | 现有 repo 里的模糊功能想法 | Matt `/grill-with-docs`,然后可能 `/to-prd`、`/to-issues` |
301
+ | 已经有 PRD,需要拆票 | Matt `/to-issues` |
302
+ | 单个 issue 要实现 | Matt `/implement` 或 Superpowers 实现流程,看用户怎么叫 |
303
+ | 巨大、模糊、多 session 的任务 | Wayfinder |
304
+ | 工作结束后有可复用经验 | CE `/ce-compound` 或 PGS fallback capture |
305
+ | 小说、课程、非代码创作 | Matt grilling 或 Wayfinder;不要默认套 Superpowers 工程仪式 |
306
+
307
+ ## 采用 Wayfinder 的护栏
308
+
309
+ 如果 PGS 以后真正启用 Wayfinder,请保留这些护栏:
310
+
311
+ 1. **只能显式启动。** 用户说 `/wayfinder`,或清楚要求“给大任务画地图”。
312
+ 2. **必须说清目的地。** 没有目的地的地图,只是一堆便利贴。
313
+ 3. **一个 session 只解决一张票。** 这样不会跑飞,也保护上下文。
314
+ 4. **默认只计划,不执行。** 除非 map Notes 明确写这个 effort 包含执行。
315
+ 5. **第一次 chart map 后要人工确认。** 不要一口气造几十张票然后自动往下冲。
316
+ 6. **Matt 原生产物保持原味。** 不要为了 PGS Doc Gov 给 map tickets、PRD、scratch、context docs 硬加 frontmatter。
317
+ 7. **要升级为 PGS 真相时,另行提升。** 也就是新建或更新受治理的 PGS 文档,而不是改原生产物。
318
+ 8. **issue tracker 必须保留规则。** PGS 中央的 `docs/agents/issue-tracker.md` 必须包含 Wayfinding operations;正式跑之前先检查它还在。
319
+
320
+ ## 最终建议
321
+
322
+ PGS 应该支持 Wayfinder,但不要把它封王。
323
+
324
+ 最好的搭配是:
325
+
326
+ - **Superpowers**:平时工程施工。
327
+ - **Matt 主流程**:把模糊想法问清楚、写成 PRD、拆成 issue。
328
+ - **Wayfinder**:遇到巨大迷雾任务时先画地图。
329
+ - **CE**:工作结束后把可复用经验存下来。
330
+
331
+ 用小孩能懂的话说:Superpowers 帮你盖树屋,Matt 主流程问清楚你想要什么树屋,Wayfinder 在你连哪棵树能爬都不知道时先画森林地图,CE 把“梯子怎么做更结实”记进小本本,下次少摔一次。
@@ -4,6 +4,11 @@ Directed Development is an optional workflow for mixed, cross-domain, interdepen
4
4
 
5
5
  It is not the default for every task.
6
6
 
7
+ It is not a Superpowers startup adapter and not a second engineering plugin. It
8
+ is a small PGS routing rule for cases where product work must be split into
9
+ ordered dependency-aware Blocks before the selected lane uses its normal
10
+ workflow. Superpowers still owns the engineering process inside that lane.
11
+
7
12
  ## Boundary
8
13
 
9
14
  Directed Development may define:
@@ -16,6 +21,7 @@ Directed Development may define:
16
21
  Directed Development must not define:
17
22
 
18
23
  - artifact locations
24
+ - Superpowers skill invocation rules
19
25
  - project document paths
20
26
  - project lane names
21
27
  - runtime truth
@@ -25,6 +31,10 @@ Those remain owned by the project and doc-gov.
25
31
  Agents routing decides whether this workflow applies. Directed Development does
26
32
  not replace the project router.
27
33
 
34
+ BDD-style scenarios are allowed only as acceptance language for a DD Block. They
35
+ do not turn Directed Development into a default BDD ceremony and do not replace
36
+ Superpowers TDD, debugging, or verification workflows.
37
+
28
38
  ## Trigger
29
39
 
30
40
  Use Directed Development only when all are true:
@@ -0,0 +1,143 @@
1
+ # mattpocock/skills Integration
2
+
3
+ mattpocock/skills is an external npx skill pack. This repository may install
4
+ the pack unchanged, but it does not vendor, rewrite, or fork the skill bodies.
5
+
6
+ ## The Beginner Version
7
+
8
+ Think of the project as a workshop:
9
+
10
+ - PGS is the traffic desk and filing cabinet.
11
+ - Superpowers is the default construction process for engineering work.
12
+ - mattpocock/skills is a set of sharp workshop tools for grilling ideas,
13
+ modeling domain language, turning decisions into PRDs/issues, and running
14
+ specific implementation flows.
15
+ - Compound Engineering is the verified-learning notebook written after the work.
16
+
17
+ Installing a box of tools does not mean every tool runs by itself. PGS decides
18
+ the lane first. Superpowers remains the default engineering workflow. Matt
19
+ skills may add useful artifacts and focused flows when their trigger fits.
20
+
21
+ ## Default Rule
22
+
23
+ For PGS-governed engineering/runtime projects, mattpocock/skills is optional
24
+ capability inside the selected lane. It is not the default workflow owner.
25
+
26
+ Use this order:
27
+
28
+ 1. PGS routes the task and selects the project lane.
29
+ 2. For non-trivial engineering work, run Learning Recall.
30
+ 3. Superpowers owns the normal engineering workflow when that lane needs one.
31
+ 4. Matt skills may run when the user explicitly invokes a Matt flow or when an
32
+ active Matt flow calls one of its helper skills.
33
+ 5. The Compound Gate still runs before final reporting.
34
+
35
+ Do not make routine work choose between Superpowers and Matt. The useful split
36
+ is simpler:
37
+
38
+ - Superpowers owns default engineering discipline.
39
+ - Matt owns demand shaping, domain modeling, PRD/issues generation, triage, and
40
+ explicitly requested Matt implementation flows.
41
+ - CE owns post-work reusable learning.
42
+
43
+ ## Trigger Boundary
44
+
45
+ User-invoked Matt skills, such as `/grill-with-docs`, `/to-prd`,
46
+ `/to-issues`, `/implement`, `/triage`, and `/ask-matt`, require an explicit
47
+ user request or an already active Matt flow that named them.
48
+
49
+ Model-invoked Matt helper skills, such as `domain-modeling`, `tdd`,
50
+ `code-review`, `research`, and `prototype`, may run only when they support the
51
+ current selected lane and do not replace the current workflow owner.
52
+
53
+ If a Matt helper and a Superpowers skill both fit, keep the current workflow
54
+ owner unless the user explicitly switches. For example:
55
+
56
+ - normal feature implementation -> Superpowers remains the default;
57
+ - user says `/implement issue 123` -> Matt `/implement` owns that flow;
58
+ - user says "grill this idea and make docs" -> Matt `/grill-with-docs` owns
59
+ that shaping flow;
60
+ - user says "use CE full workflow" -> CE owns the explicitly requested flow.
61
+
62
+ ## PGS Central Setup
63
+
64
+ The PGS central repository uses these Matt setup choices:
65
+
66
+ | Setup item | PGS central value |
67
+ | --- | --- |
68
+ | Issue tracker | GitHub Issues for `PieAIStudio/ProjectGovernanceSystem` |
69
+ | External PRs as request surface | No by default |
70
+ | Triage labels | Default Matt labels: `needs-triage`, `needs-info`, `ready-for-agent`, `ready-for-human`, `wontfix` |
71
+ | Domain docs layout | Single-context: root `CONTEXT.md` and `docs/adr/**` when Matt creates them |
72
+
73
+ The setup files live under `docs/agents/**`. They are Matt-owned external
74
+ configuration files, not PGS canonical product truth.
75
+
76
+ ## Matt-Owned Artifacts
77
+
78
+ The following outputs are Matt-owned external artifacts:
79
+
80
+ | Path or surface | Owner | Rule |
81
+ | --- | --- | --- |
82
+ | `CONTEXT.md` | Matt | Domain glossary/context. Helpful input, not a replacement for `docs/canon/**`. |
83
+ | `CONTEXT-MAP.md` | Matt | Multi-context map when a project opts into that layout. |
84
+ | `docs/agents/**` | Matt | Per-repo Matt setup: issue tracker, triage labels, domain docs. |
85
+ | `docs/adr/**` | Matt | Matt-generated ADRs. Promote manually to `docs/decisions/**` if they become PGS-governed decisions. |
86
+ | `.scratch/**` | Matt | Local issue tracker or temporary work surface. Keep project-specific. |
87
+ | GitHub/GitLab issues | Matt/project | PRDs, issue breakdowns, triage state. They are work-tracking artifacts, not doc-gov records by themselves. |
88
+
89
+ Doc Gov must ignore `docs/agents/**` and `docs/adr/**` as external artifacts.
90
+ When a Matt artifact becomes durable PGS truth, promote it into the normal
91
+ governed layer:
92
+
93
+ - decisions -> `docs/decisions/**`
94
+ - specs -> `docs/specs/**`
95
+ - plans -> `docs/plans/**`
96
+ - canon -> `docs/canon/**`
97
+ - references -> `docs/reference/**`
98
+
99
+ Do not try to make one file satisfy both Matt's native artifact contract and a
100
+ PGS governed document contract.
101
+
102
+ ## Downstream Install Rule
103
+
104
+ Install or update Matt skills in downstream repositories through the PGS asset
105
+ workflow. Do not run `npx skills add mattpocock/skills` inside every downstream
106
+ project as an unmanaged one-off.
107
+
108
+ The central intake flow is:
109
+
110
+ ```bash
111
+ pro-gov assets npx add mattpocock/skills --plan --root agent-assets/skills/npx-skills
112
+ ```
113
+
114
+ Review the plan, then install into the PGS central npx skill root. Downstream
115
+ projects receive managed symlinks through the private PGS asset bundle
116
+ `mattpocock-skills` and project-local Matt setup files according to their
117
+ selected profile and host support.
118
+
119
+ ## Verification
120
+
121
+ Central verification:
122
+
123
+ ```bash
124
+ node packages/doc-gov/dist/cli.js router-check
125
+ node packages/doc-gov/dist/cli.js check
126
+ node packages/doc-gov/dist/cli.js scan --check
127
+ git diff --check
128
+ ```
129
+
130
+ Matt install verification:
131
+
132
+ ```bash
133
+ test -f agent-assets/skills/npx-skills/skills-lock.json
134
+ find agent-assets/skills/npx-skills/.agents/skills -maxdepth 2 -name SKILL.md
135
+ ```
136
+
137
+ Downstream verification must prove:
138
+
139
+ - the target's project router points to its selected profile;
140
+ - Matt skills are linked from the managed PGS asset source;
141
+ - `docs/agents/**` exists when Matt engineering skills are enabled;
142
+ - Doc Gov ignores Matt-owned external artifacts;
143
+ - Superpowers, Matt, and CE each keep their documented ownership.
@@ -29,6 +29,13 @@ Superpowers owns engineering workflows such as:
29
29
  - verification before completion
30
30
  - worktree usage
31
31
 
32
+ Superpowers 6.x for Codex is skill-routed, not hook-driven. The plugin manifest
33
+ does not need a SessionStart hook for PGS to make use of it. The startup
34
+ behavior comes from the `using-superpowers` skill description, which tells the
35
+ host to check relevant skills at the start of a conversation and before acting.
36
+ Do not add a PGS hook just to force Superpowers startup unless a future
37
+ Superpowers release explicitly requires one.
38
+
32
39
  Project Governance System owns:
33
40
 
34
41
  - documentation lifecycle
@@ -11,6 +11,7 @@ required:
11
11
  optional:
12
12
  compound_engineering: integrations/compound-engineering.md
13
13
  directed_development: integrations/directed-development.md
14
+ mattpocock_skills: integrations/mattpocock-skills.md
14
15
  superpowers: integrations/superpowers.md
15
16
  project_local_required:
16
17
  - docs/policy/best-practice-for-this-project.md
@@ -12,6 +12,7 @@ Use for code-heavy projects: apps, games, runtimes, services, browser products,
12
12
  - `integrations/superpowers.md`
13
13
  - `integrations/compound-engineering.md`
14
14
  - `integrations/directed-development.md`
15
+ - `integrations/mattpocock-skills.md`
15
16
  - starter `docs/governance/` and `docs/policy/` templates
16
17
 
17
18
  ## Requires Project-Local Rules
@@ -31,6 +32,7 @@ Each project must define:
31
32
  - game/app-specific lane wording
32
33
  - Superpowers plugin body
33
34
  - Compound Engineering plugin body
35
+ - mattpocock/skills body
34
36
 
35
37
  ## Automation Boundary
36
38
 
@@ -42,9 +44,10 @@ content under the target project's ownership.
42
44
 
43
45
  Engineering-runtime starters also include Codex, Claude Code, and Antigravity
44
46
  Stop hooks that call `pro-gov host-hook`. Use `pro-gov doctor --strict-hooks`
45
- after sync to confirm the exit gate is wired. The hook enforces the Compound
46
- Gate final-report marker; it does not replace verification, tests, or
47
- `ce-compound` itself.
47
+ after sync to confirm the host configs are wired. The starter default is
48
+ `--compound-gate-mode off`, so the hook does not interrupt the main session
49
+ unless the project explicitly switches to `lite` or `strict`. Even when enabled,
50
+ the hook does not replace verification, tests, or `ce-compound` itself.
48
51
 
49
52
  For non-trivial engineering work, run `pro-gov learn recall --query "<task
50
53
  summary>"` before changing files so existing `docs/solutions/**` and
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then PGS_HOST_HOOK_DEBUG=1 ./node_modules/.bin/pro-gov host-hook --host antigravity --event Stop; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; PGS_HOST_HOOK_DEBUG=1 pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host antigravity --event Stop; else PGS_HOST_HOOK_DEBUG=1 npx --no-install @pieai/pro-gov host-hook --host antigravity --event Stop; fi",
8
+ "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then PGS_HOST_HOOK_DEBUG=1 ./node_modules/.bin/pro-gov host-hook --host antigravity --event Stop --compound-gate-mode off; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; PGS_HOST_HOOK_DEBUG=1 pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host antigravity --event Stop --compound-gate-mode off; else PGS_HOST_HOOK_DEBUG=1 npx --no-install @pieai/pro-gov host-hook --host antigravity --event Stop --compound-gate-mode off; fi",
9
9
  "timeout": 30
10
10
  }
11
11
  ]
@@ -16,7 +16,7 @@
16
16
  "hooks": [
17
17
  {
18
18
  "type": "command",
19
- "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then PGS_HOST_HOOK_DEBUG=1 ./node_modules/.bin/pro-gov host-hook --host antigravity --event SubagentStop; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; PGS_HOST_HOOK_DEBUG=1 pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host antigravity --event SubagentStop; else PGS_HOST_HOOK_DEBUG=1 npx --no-install @pieai/pro-gov host-hook --host antigravity --event SubagentStop; fi",
19
+ "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then PGS_HOST_HOOK_DEBUG=1 ./node_modules/.bin/pro-gov host-hook --host antigravity --event SubagentStop --compound-gate-mode off; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; PGS_HOST_HOOK_DEBUG=1 pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host antigravity --event SubagentStop --compound-gate-mode off; else PGS_HOST_HOOK_DEBUG=1 npx --no-install @pieai/pro-gov host-hook --host antigravity --event SubagentStop --compound-gate-mode off; fi",
20
20
  "timeout": 30
21
21
  }
22
22
  ]
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "cd \"${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel)}\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host claude-code --event Stop; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host claude-code --event Stop; else npx --no-install @pieai/pro-gov host-hook --host claude-code --event Stop; fi",
8
+ "command": "cd \"${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel)}\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host claude-code --event Stop --compound-gate-mode off; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host claude-code --event Stop --compound-gate-mode off; else npx --no-install @pieai/pro-gov host-hook --host claude-code --event Stop --compound-gate-mode off; fi",
9
9
  "timeout": 30
10
10
  }
11
11
  ]
@@ -16,7 +16,7 @@
16
16
  "hooks": [
17
17
  {
18
18
  "type": "command",
19
- "command": "cd \"${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel)}\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host claude-code --event SubagentStop; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host claude-code --event SubagentStop; else npx --no-install @pieai/pro-gov host-hook --host claude-code --event SubagentStop; fi",
19
+ "command": "cd \"${CLAUDE_PROJECT_DIR:-$(git rev-parse --show-toplevel)}\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host claude-code --event SubagentStop --compound-gate-mode off; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host claude-code --event SubagentStop --compound-gate-mode off; else npx --no-install @pieai/pro-gov host-hook --host claude-code --event SubagentStop --compound-gate-mode off; fi",
20
20
  "timeout": 30
21
21
  }
22
22
  ]
@@ -5,7 +5,7 @@
5
5
  "hooks": [
6
6
  {
7
7
  "type": "command",
8
- "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host codex --event Stop; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host codex --event Stop; else npx --no-install @pieai/pro-gov host-hook --host codex --event Stop; fi",
8
+ "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host codex --event Stop --compound-gate-mode off; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host codex --event Stop --compound-gate-mode off; else npx --no-install @pieai/pro-gov host-hook --host codex --event Stop --compound-gate-mode off; fi",
9
9
  "timeout": 30,
10
10
  "statusMessage": "Checking PGS Compound Gate"
11
11
  }
@@ -17,7 +17,7 @@
17
17
  "hooks": [
18
18
  {
19
19
  "type": "command",
20
- "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host codex --event SubagentStop; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host codex --event SubagentStop; else npx --no-install @pieai/pro-gov host-hook --host codex --event SubagentStop; fi",
20
+ "command": "cd \"$(git rev-parse --show-toplevel)\" && if [ -x ./node_modules/.bin/pro-gov ]; then ./node_modules/.bin/pro-gov host-hook --host codex --event SubagentStop --compound-gate-mode off; elif [ -f packages/pro-gov/src/cli.ts ] && { command -v corepack >/dev/null 2>&1 || command -v pnpm >/dev/null 2>&1; }; then pgs_pnpm() { if command -v corepack >/dev/null 2>&1; then corepack pnpm \"$@\"; else pnpm \"$@\"; fi; }; pgs_pnpm --silent --filter @pieai/pro-gov dev host-hook --host codex --event SubagentStop --compound-gate-mode off; else npx --no-install @pieai/pro-gov host-hook --host codex --event SubagentStop --compound-gate-mode off; fi",
21
21
  "timeout": 30,
22
22
  "statusMessage": "Checking PGS subagent Compound Gate"
23
23
  }
@@ -43,7 +43,7 @@
43
43
  - Engineering projects may use Superpowers, Directed Development, GStack, or other external workflows only inside the selected lane; do not copy upstream integration guides into the target project by default.
44
44
  - For engineering projects, Superpowers is the default engineering workflow. Compound Engineering is used by default only as the post-work Compound Gate through `ce-compound`; full CE workflows require an explicit user request.
45
45
  - For engineering projects, PGS Learning Recall is the pre-work companion to that post-work gate: recall existing lessons first, then do the work, then decide whether a new lesson should be compounded.
46
- - Engineering projects should have PGS Stop hooks wired for Codex, Claude Code, and Antigravity. Before final reporting after completed engineering work, report `Compound Gate: ran ce-compound -> <path>`, `Compound Gate: ran fallback capture -> <path>`, or `Compound Gate: skipped -> <reason>`.
46
+ - Engineering projects should have PGS Stop hooks wired for Codex, Claude Code, and Antigravity. Starter hooks default to `--compound-gate-mode off`; opt into `lite` or `strict` only when this project wants runtime exit-gate reminders. Before final reporting after completed engineering work, report `Compound Gate: ran ce-compound -> <path>`, `Compound Gate: ran fallback capture -> <path>`, or `Compound Gate: skipped -> <reason>`.
47
47
  - Use fallback capture only when the current host cannot load Compound Engineering; run `pro-gov learn capture --title "<learning title>" --summary "<reusable lesson>"` so Learning Recall can find the lesson later.
48
48
  - Doc-only projects should say that Superpowers TDD and Directed Development are not enabled by default.
49
49
  - External workflow systems such as Superpowers or GStack run inside the lane selected by this router. They must not replace this project router.
package/cli-guide.md CHANGED
@@ -26,10 +26,12 @@ pro-gov lens inspect --target .
26
26
  pro-gov lens report --target . --out .pro-gov/lens-report.md
27
27
  pro-gov lens audit init --target /path/to/project --out audits/project/2026-07-01
28
28
  pro-gov lens audit check --dir audits/project/2026-07-01
29
+ pro-gov host-hook --host codex --event Stop --compound-gate-mode off|lite|strict
29
30
  pro-gov init --profile engineering-runtime --dry-run
30
31
  pro-gov init --profile engineering-runtime --apply
31
32
  pro-gov init --profile doc-only --dry-run
32
33
  pro-gov sync --check [--profile engineering-runtime|doc-only]
34
+ pro-gov sync --apply-host-hooks --profile engineering-runtime
33
35
  pro-gov doctor
34
36
  ```
35
37
 
@@ -41,8 +43,14 @@ Actions references stay packaged but are not installed by default.
41
43
 
42
44
  `sync --check` is read-only. It compares shared governance core files strictly,
43
45
  but checks project-local seeds such as `AGENTS.md`, project policy, and current
44
- work for presence only. It infers the installed profile when exactly one route
45
- exists; `--profile` resolves an empty or temporarily ambiguous target.
46
+ work for presence only. Host configs are compared by PGS-owned entries, so
47
+ consumer hooks do not create false drift. It infers the installed profile when
48
+ exactly one route exists; `--profile` resolves an empty or temporarily ambiguous target.
49
+
50
+ `sync --apply-host-hooks` is the bounded write path for engineering-runtime
51
+ host configs. It updates only PGS Compound Gate entries and preserves consumer
52
+ `PreToolUse`, other events, other top-level keys, and non-PGS entries inside
53
+ Stop/SubagentStop arrays. All three files are parsed before any write.
46
54
 
47
55
  `learn recall` is the pre-work companion to Compound Engineering's post-work
48
56
  `ce-compound` learning records. It searches `docs/solutions/**` and
@@ -69,6 +77,12 @@ Then report:
69
77
  Compound Gate: ran fallback capture -> docs/solutions/<category>/<file>.md
70
78
  ```
71
79
 
80
+ `host-hook` is the cross-host Compound Gate adapter for Codex, Claude Code, and
81
+ Antigravity. `--compound-gate-mode off` is the default and does not interrupt
82
+ the main session. `lite` emits a short continuation prompt when completed
83
+ engineering work lacks a Compound Gate marker. `strict` emits the fuller legacy
84
+ prompt. The same value can be supplied through `PGS_COMPOUND_GATE_MODE`.
85
+
72
86
  Full upstream-checkout commands:
73
87
 
74
88
  ```bash
@@ -146,6 +160,7 @@ pnpm pro-gov init --profile engineering-runtime --dry-run
146
160
  pnpm pro-gov init --profile engineering-runtime --apply
147
161
  pnpm doc-gov scan
148
162
  pnpm pro-gov sync --check --profile engineering-runtime
163
+ pnpm pro-gov sync --apply-host-hooks --profile engineering-runtime
149
164
  pnpm doc-gov migrate --profile engineering-runtime --check
150
165
  pnpm doc-gov doctor
151
166
  ```
package/dist/cli.js CHANGED
@@ -1763,8 +1763,19 @@ var compoundGateInstruction = [
1763
1763
  "If there is no reusable learning, report:",
1764
1764
  "Compound Gate: skipped -> <reason>"
1765
1765
  ].join("\n");
1766
+ var liteCompoundGateInstruction = [
1767
+ "Pass the PGS Compound Gate before final reporting.",
1768
+ "Report one line:",
1769
+ "Compound Gate: ran ce-compound -> <path>",
1770
+ "Compound Gate: ran fallback capture -> <path>",
1771
+ "Compound Gate: skipped -> <reason>"
1772
+ ].join("\n");
1766
1773
  var maxTranscriptBytes = 2 * 1024 * 1024;
1767
1774
  function evaluateHostHook(request) {
1775
+ const mode = request.compoundGateMode ?? "off";
1776
+ if (mode === "off") {
1777
+ return { action: "allow" };
1778
+ }
1768
1779
  if (request.event !== "Stop" && request.event !== "SubagentStop") {
1769
1780
  return { action: "allow" };
1770
1781
  }
@@ -1781,7 +1792,10 @@ function evaluateHostHook(request) {
1781
1792
  if (!looksLikeCompletedEngineeringWork(input.lastAssistantMessage)) {
1782
1793
  return { action: "allow" };
1783
1794
  }
1784
- return { action: "continue", reason: compoundGateInstruction };
1795
+ return { action: "continue", reason: compoundGateInstructionForMode(mode) };
1796
+ }
1797
+ function compoundGateInstructionForMode(mode) {
1798
+ return mode === "lite" ? liteCompoundGateInstruction : compoundGateInstruction;
1785
1799
  }
1786
1800
  function formatHostHookOutput(host, event, decision) {
1787
1801
  if (decision.action === "allow") {
@@ -1953,6 +1967,9 @@ function isHostHookHost(value) {
1953
1967
  function isHostHookEvent(value) {
1954
1968
  return value === "PostToolUse" || value === "PreToolUse" || value === "Stop" || value === "SubagentStop" || value === "UserPromptSubmit";
1955
1969
  }
1970
+ function isCompoundGateMode(value) {
1971
+ return value === "off" || value === "lite" || value === "strict";
1972
+ }
1956
1973
 
1957
1974
  // src/commands/host-hook.ts
1958
1975
  var defaultStdinTimeoutMs = 750;
@@ -1960,6 +1977,7 @@ var maxDebugRawInputBytes = 256 * 1024;
1960
1977
  async function runHostHook(args) {
1961
1978
  const host = readOption(args, "--host");
1962
1979
  const event = readOption(args, "--event");
1980
+ const compoundGateMode = readCompoundGateMode(args);
1963
1981
  if (!isHostHookHost(host)) {
1964
1982
  console.error("Expected --host <codex|claude-code|antigravity>");
1965
1983
  return 1;
@@ -1970,9 +1988,10 @@ async function runHostHook(args) {
1970
1988
  }
1971
1989
  const rawInput = await readStdinText(defaultStdinTimeoutMs);
1972
1990
  const input = parseStdinJson(rawInput);
1973
- const decision = evaluateHostHook({ host, event, input });
1991
+ const decision = evaluateHostHook({ compoundGateMode, host, event, input });
1974
1992
  const output = formatHostHookOutput(host, event, decision);
1975
1993
  writeDebugLogIfRequested(args, {
1994
+ compoundGateMode,
1976
1995
  decision,
1977
1996
  event,
1978
1997
  host,
@@ -1984,6 +2003,11 @@ async function runHostHook(args) {
1984
2003
  `);
1985
2004
  return 0;
1986
2005
  }
2006
+ function readCompoundGateMode(args) {
2007
+ const value = readOption(args, "--compound-gate-mode") ?? process.env.PGS_COMPOUND_GATE_MODE ?? "off";
2008
+ if (isCompoundGateMode(value)) return value;
2009
+ return "off";
2010
+ }
1987
2011
  function readOption(args, name) {
1988
2012
  const index = args.indexOf(name);
1989
2013
  if (index < 0) return void 0;
@@ -2041,6 +2065,7 @@ function writeDebugLogIfRequested(args, record) {
2041
2065
  {
2042
2066
  schemaVersion: 1,
2043
2067
  cwd: process.cwd(),
2068
+ compoundGateMode: record.compoundGateMode,
2044
2069
  event: record.event,
2045
2070
  host: record.host,
2046
2071
  nodeVersion: process.version,
@@ -2127,9 +2152,12 @@ function classifyOwnership(targetPath) {
2127
2152
  function isOtherProfileRouting(targetPath, profile) {
2128
2153
  return targetPath.startsWith("docs/governance/agents-routing/") && targetPath !== `docs/governance/agents-routing/${profile}-v0.9.md`;
2129
2154
  }
2130
- function isEngineeringOnlyGuardrail(targetPath) {
2155
+ function isHostHookTargetPath(targetPath) {
2131
2156
  return targetPath === ".codex/hooks.json" || targetPath === ".claude/settings.json" || targetPath === ".agents/hooks.json";
2132
2157
  }
2158
+ function isEngineeringOnlyGuardrail(targetPath) {
2159
+ return isHostHookTargetPath(targetPath);
2160
+ }
2133
2161
  function starterTargetPath(sourcePath) {
2134
2162
  if (sourcePath === "starter/AGENTS.template.md") return "AGENTS.md";
2135
2163
  if (sourcePath === "starter/CLAUDE.template.md") return "CLAUDE.md";
@@ -4089,11 +4117,69 @@ function printUsage4() {
4089
4117
  }
4090
4118
 
4091
4119
  // src/commands/sync.ts
4092
- import { existsSync as existsSync23, readFileSync as readFileSync18 } from "node:fs";
4093
- import { join as join22 } from "node:path";
4120
+ import { existsSync as existsSync23, mkdirSync as mkdirSync9, readFileSync as readFileSync18, writeFileSync as writeFileSync8 } from "node:fs";
4121
+ import { dirname as dirname12, join as join22 } from "node:path";
4122
+ import { isDeepStrictEqual } from "node:util";
4123
+
4124
+ // src/host-hooks/config-merge.ts
4125
+ var MANAGED_EVENTS = ["Stop", "SubagentStop"];
4126
+ function mergeHostHookConfig(targetPath, current, template) {
4127
+ const currentRecord = asRecord(current);
4128
+ const templateRecord = asRecord(template);
4129
+ if (targetPath === ".agents/hooks.json") {
4130
+ return {
4131
+ ...currentRecord,
4132
+ "pgs-compound-gate": templateRecord["pgs-compound-gate"]
4133
+ };
4134
+ }
4135
+ const host = targetPath === ".codex/hooks.json" ? "codex" : "claude-code";
4136
+ const currentHooks = asRecord(currentRecord.hooks);
4137
+ const templateHooks = asRecord(templateRecord.hooks);
4138
+ const mergedHooks = { ...currentHooks };
4139
+ for (const event of MANAGED_EVENTS) {
4140
+ const currentEntries = asArray(currentHooks[event]);
4141
+ const templateEntries = asArray(templateHooks[event]);
4142
+ mergedHooks[event] = replaceManagedEntries(currentEntries, templateEntries, host, event);
4143
+ }
4144
+ return {
4145
+ ...currentRecord,
4146
+ hooks: mergedHooks
4147
+ };
4148
+ }
4149
+ function replaceManagedEntries(currentEntries, templateEntries, host, event) {
4150
+ const result = [];
4151
+ let insertedTemplate = false;
4152
+ for (const entry of currentEntries) {
4153
+ if (isManagedEntry(entry, host, event)) {
4154
+ if (!insertedTemplate) {
4155
+ result.push(...templateEntries);
4156
+ insertedTemplate = true;
4157
+ }
4158
+ continue;
4159
+ }
4160
+ result.push(entry);
4161
+ }
4162
+ if (!insertedTemplate) result.push(...templateEntries);
4163
+ return result;
4164
+ }
4165
+ function isManagedEntry(entry, host, event) {
4166
+ const serialized = JSON.stringify(entry);
4167
+ return serialized.includes("pro-gov host-hook") && serialized.includes(`--host ${host}`) && serialized.includes(`--event ${event}`);
4168
+ }
4169
+ function asRecord(value) {
4170
+ if (!value || typeof value !== "object" || Array.isArray(value)) return {};
4171
+ return value;
4172
+ }
4173
+ function asArray(value) {
4174
+ return Array.isArray(value) ? value : [];
4175
+ }
4176
+
4177
+ // src/commands/sync.ts
4094
4178
  function runSync(args) {
4095
- if (!args.includes("--check")) {
4096
- console.error("pro-gov sync is read-only and requires --check.");
4179
+ const check = args.includes("--check");
4180
+ const applyHostHooks = args.includes("--apply-host-hooks");
4181
+ if (check === applyHostHooks) {
4182
+ console.error("pro-gov sync requires exactly one of --check or --apply-host-hooks.");
4097
4183
  return 1;
4098
4184
  }
4099
4185
  const requestedProfile = readFlag2(args, "--profile");
@@ -4113,6 +4199,7 @@ function runSync(args) {
4113
4199
  );
4114
4200
  return 1;
4115
4201
  }
4202
+ if (applyHostHooks) return applyHostHookConfigs(profile);
4116
4203
  let differences = 0;
4117
4204
  console.log("pro-gov sync check");
4118
4205
  console.log(`profile: ${profile}`);
@@ -4127,7 +4214,7 @@ function runSync(args) {
4127
4214
  if (file.ownership === "project-local-seed") continue;
4128
4215
  const source = readFileSync18(file.absoluteSourcePath, "utf8");
4129
4216
  const target = readFileSync18(targetPath, "utf8");
4130
- if (source !== target) {
4217
+ if (!matchesExpectedContent(file.targetPath, source, target)) {
4131
4218
  console.log(`different: ${file.targetPath}`);
4132
4219
  differences += 1;
4133
4220
  }
@@ -4139,6 +4226,48 @@ function runSync(args) {
4139
4226
  console.log("sync check passed: starter files match packaged assets.");
4140
4227
  return 0;
4141
4228
  }
4229
+ function applyHostHookConfigs(profile) {
4230
+ if (profile !== "engineering-runtime") {
4231
+ console.error("Host hooks are installed only for the engineering-runtime profile.");
4232
+ return 1;
4233
+ }
4234
+ const root = process.cwd();
4235
+ const updates = [];
4236
+ try {
4237
+ for (const file of planStarterFiles(profile)) {
4238
+ if (!isHostHookTargetPath(file.targetPath)) continue;
4239
+ const path = join22(root, file.targetPath);
4240
+ const template = JSON.parse(readFileSync18(file.absoluteSourcePath, "utf8"));
4241
+ const targetExists = existsSync23(path);
4242
+ const current = targetExists ? JSON.parse(readFileSync18(path, "utf8")) : {};
4243
+ const merged = mergeHostHookConfig(file.targetPath, current, template);
4244
+ if (targetExists && isDeepStrictEqual(current, merged)) continue;
4245
+ updates.push({ path, content: `${JSON.stringify(merged, null, 2)}
4246
+ ` });
4247
+ }
4248
+ } catch (error) {
4249
+ console.error(`Cannot merge host hook configuration: ${errorMessage(error)}`);
4250
+ console.error("No host hook files were written.");
4251
+ return 1;
4252
+ }
4253
+ for (const update of updates) {
4254
+ mkdirSync9(dirname12(update.path), { recursive: true });
4255
+ writeFileSync8(update.path, update.content);
4256
+ }
4257
+ console.log(`host hooks applied: ${updates.length}`);
4258
+ console.log("Project-owned host config keys and non-PGS hook entries were preserved.");
4259
+ return 0;
4260
+ }
4261
+ function matchesExpectedContent(targetPath, source, target) {
4262
+ if (!isHostHookTargetPath(targetPath)) return source === target;
4263
+ try {
4264
+ const current = JSON.parse(target);
4265
+ const template = JSON.parse(source);
4266
+ return isDeepStrictEqual(current, mergeHostHookConfig(targetPath, current, template));
4267
+ } catch {
4268
+ return false;
4269
+ }
4270
+ }
4142
4271
  function inferInstalledProfile(root) {
4143
4272
  const installed = ["engineering-runtime", "doc-only"].filter(
4144
4273
  (profile) => existsSync23(join22(root, `docs/governance/agents-routing/${profile}-v0.9.md`))
@@ -4150,6 +4279,9 @@ function readFlag2(args, flag) {
4150
4279
  const value = index >= 0 ? args[index + 1] : void 0;
4151
4280
  return value && !value.startsWith("--") ? value : void 0;
4152
4281
  }
4282
+ function errorMessage(error) {
4283
+ return error instanceof Error ? error.message : String(error);
4284
+ }
4153
4285
 
4154
4286
  // src/cli.ts
4155
4287
  var COMMANDS = [
@@ -4172,9 +4304,9 @@ var COMMANDS = [
4172
4304
  "lens report --target <path> --out <path>",
4173
4305
  "lens audit init --target <path> --out <path>",
4174
4306
  "lens audit check --dir <path> [--json]",
4175
- "host-hook --host <codex|claude-code|antigravity> --event <Stop|SubagentStop|...>",
4307
+ "host-hook --host <codex|claude-code|antigravity> --event <Stop|SubagentStop|...> [--compound-gate-mode off|lite|strict]",
4176
4308
  "init --profile <engineering-runtime|doc-only> <--dry-run|--apply>",
4177
- "sync --check [--profile <engineering-runtime|doc-only>]",
4309
+ "sync <--check|--apply-host-hooks> [--profile <engineering-runtime|doc-only>]",
4178
4310
  "doctor"
4179
4311
  ];
4180
4312
  var [command, subcommand] = process.argv.slice(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pieai/pro-gov",
3
- "version": "0.3.17",
3
+ "version": "0.4.1",
4
4
  "description": "Project-level distribution kit for Project Governance System.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -35,7 +35,7 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@pieai/doc-gov": "^0.3.17"
38
+ "@pieai/doc-gov": "^0.4.1"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "24.13.2",