@entelligentsia/forgecli 0.21.0 → 1.0.3

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 (364) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +31 -33
  3. package/dist/CHANGELOG-forge-plugin.md +142 -0
  4. package/dist/CHANGELOG-pi.md +24 -1
  5. package/dist/bin/forgecli.d.ts +2 -0
  6. package/dist/bin/forgecli.js +6 -0
  7. package/dist/bin/forgecli.js.map +1 -0
  8. package/dist/extensions/forgecli/add-pipeline.js +1 -1
  9. package/dist/extensions/forgecli/add-pipeline.js.map +1 -1
  10. package/dist/extensions/forgecli/add-task.js +1 -1
  11. package/dist/extensions/forgecli/add-task.js.map +1 -1
  12. package/dist/extensions/forgecli/approve.js +17 -2
  13. package/dist/extensions/forgecli/approve.js.map +1 -1
  14. package/dist/extensions/forgecli/audience-gate.js +1 -1
  15. package/dist/extensions/forgecli/audience-gate.js.map +1 -1
  16. package/dist/extensions/forgecli/calibrate.js +11 -8
  17. package/dist/extensions/forgecli/calibrate.js.map +1 -1
  18. package/dist/extensions/forgecli/collate.js +1 -1
  19. package/dist/extensions/forgecli/collate.js.map +1 -1
  20. package/dist/extensions/forgecli/commit.js +17 -2
  21. package/dist/extensions/forgecli/commit.js.map +1 -1
  22. package/dist/extensions/forgecli/enhance.js +1 -1
  23. package/dist/extensions/forgecli/enhance.js.map +1 -1
  24. package/dist/extensions/forgecli/fix-bug.d.ts +1 -2
  25. package/dist/extensions/forgecli/fix-bug.js +678 -609
  26. package/dist/extensions/forgecli/fix-bug.js.map +1 -1
  27. package/dist/extensions/forgecli/forge-artifact-tool.d.ts +6 -8
  28. package/dist/extensions/forgecli/forge-artifact-tool.js +94 -197
  29. package/dist/extensions/forgecli/forge-artifact-tool.js.map +1 -1
  30. package/dist/extensions/forgecli/forge-commands.js +57 -18
  31. package/dist/extensions/forgecli/forge-commands.js.map +1 -1
  32. package/dist/extensions/forgecli/forge-init/phase4-register.js +6 -7
  33. package/dist/extensions/forgecli/forge-init/phase4-register.js.map +1 -1
  34. package/dist/extensions/forgecli/forge-init/run-phases.d.ts +4 -0
  35. package/dist/extensions/forgecli/forge-init/run-phases.js +304 -0
  36. package/dist/extensions/forgecli/forge-init/run-phases.js.map +1 -0
  37. package/dist/extensions/forgecli/forge-init/verifiers.d.ts +14 -5
  38. package/dist/extensions/forgecli/forge-init/verifiers.js +79 -62
  39. package/dist/extensions/forgecli/forge-init/verifiers.js.map +1 -1
  40. package/dist/extensions/forgecli/forge-init.js +131 -76
  41. package/dist/extensions/forgecli/forge-init.js.map +1 -1
  42. package/dist/extensions/forgecli/forge-subagent.d.ts +26 -0
  43. package/dist/extensions/forgecli/forge-subagent.js +42 -18
  44. package/dist/extensions/forgecli/forge-subagent.js.map +1 -1
  45. package/dist/extensions/forgecli/forge-tools.d.ts +34 -4
  46. package/dist/extensions/forgecli/forge-tools.js +191 -79
  47. package/dist/extensions/forgecli/forge-tools.js.map +1 -1
  48. package/dist/extensions/forgecli/health-check.js +3 -3
  49. package/dist/extensions/forgecli/health-check.js.map +1 -1
  50. package/dist/extensions/forgecli/hook-dispatcher.d.ts +1 -1
  51. package/dist/extensions/forgecli/hooks/check-update.d.ts +8 -0
  52. package/dist/extensions/forgecli/hooks/check-update.js +29 -1
  53. package/dist/extensions/forgecli/hooks/check-update.js.map +1 -1
  54. package/dist/extensions/forgecli/hooks/post-init-hook.js +6 -6
  55. package/dist/extensions/forgecli/hooks/post-init-hook.js.map +1 -1
  56. package/dist/extensions/forgecli/hooks/post-sprint-hook.js +6 -6
  57. package/dist/extensions/forgecli/hooks/post-sprint-hook.js.map +1 -1
  58. package/dist/extensions/forgecli/hooks/triage-error.js +1 -0
  59. package/dist/extensions/forgecli/hooks/triage-error.js.map +1 -1
  60. package/dist/extensions/forgecli/implement.js +20 -2
  61. package/dist/extensions/forgecli/implement.js.map +1 -1
  62. package/dist/extensions/forgecli/index.js +39 -32
  63. package/dist/extensions/forgecli/index.js.map +1 -1
  64. package/dist/extensions/forgecli/lib/pipeline-guard.d.ts +41 -0
  65. package/dist/extensions/forgecli/lib/pipeline-guard.js +100 -0
  66. package/dist/extensions/forgecli/lib/pipeline-guard.js.map +1 -0
  67. package/dist/extensions/forgecli/loaders/persona-skill-loader.js +2 -2
  68. package/dist/extensions/forgecli/loaders/persona-skill-loader.js.map +1 -1
  69. package/dist/extensions/forgecli/migrate.d.ts +3 -0
  70. package/dist/extensions/forgecli/migrate.js +4 -2
  71. package/dist/extensions/forgecli/migrate.js.map +1 -1
  72. package/dist/extensions/forgecli/plan.js +21 -2
  73. package/dist/extensions/forgecli/plan.js.map +1 -1
  74. package/dist/extensions/forgecli/quiz-agent.js +7 -7
  75. package/dist/extensions/forgecli/quiz-agent.js.map +1 -1
  76. package/dist/extensions/forgecli/regenerate.js +49 -18
  77. package/dist/extensions/forgecli/regenerate.js.map +1 -1
  78. package/dist/extensions/forgecli/remove-command.js +1 -1
  79. package/dist/extensions/forgecli/remove-command.js.map +1 -1
  80. package/dist/extensions/forgecli/report-bug.js +1 -1
  81. package/dist/extensions/forgecli/report-bug.js.map +1 -1
  82. package/dist/extensions/forgecli/retrospective.js +9 -9
  83. package/dist/extensions/forgecli/retrospective.js.map +1 -1
  84. package/dist/extensions/forgecli/review-code.d.ts +13 -0
  85. package/dist/extensions/forgecli/review-code.js +62 -3
  86. package/dist/extensions/forgecli/review-code.js.map +1 -1
  87. package/dist/extensions/forgecli/review-plan.d.ts +13 -0
  88. package/dist/extensions/forgecli/review-plan.js +65 -3
  89. package/dist/extensions/forgecli/review-plan.js.map +1 -1
  90. package/dist/extensions/forgecli/run-task.js +461 -391
  91. package/dist/extensions/forgecli/run-task.js.map +1 -1
  92. package/dist/extensions/forgecli/session-registry.d.ts +12 -0
  93. package/dist/extensions/forgecli/session-registry.js +23 -0
  94. package/dist/extensions/forgecli/session-registry.js.map +1 -1
  95. package/dist/extensions/forgecli/skill-curator-subagent.d.ts +2 -1
  96. package/dist/extensions/forgecli/skill-curator-subagent.js +2 -1
  97. package/dist/extensions/forgecli/skill-curator-subagent.js.map +1 -1
  98. package/dist/extensions/forgecli/sprint-intake.js +6 -6
  99. package/dist/extensions/forgecli/sprint-intake.js.map +1 -1
  100. package/dist/extensions/forgecli/sprint-plan.js +9 -9
  101. package/dist/extensions/forgecli/sprint-plan.js.map +1 -1
  102. package/dist/extensions/forgecli/status-command.js +1 -1
  103. package/dist/extensions/forgecli/status-command.js.map +1 -1
  104. package/dist/extensions/forgecli/store-query.js +11 -11
  105. package/dist/extensions/forgecli/store-query.js.map +1 -1
  106. package/dist/extensions/forgecli/store-repair.js +7 -7
  107. package/dist/extensions/forgecli/store-repair.js.map +1 -1
  108. package/dist/extensions/forgecli/subagent/caller-context.d.ts +35 -11
  109. package/dist/extensions/forgecli/subagent/caller-context.js +49 -21
  110. package/dist/extensions/forgecli/subagent/caller-context.js.map +1 -1
  111. package/dist/extensions/forgecli/subagent/orchestrator-transcript.d.ts +66 -0
  112. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js +66 -0
  113. package/dist/extensions/forgecli/subagent/orchestrator-transcript.js.map +1 -0
  114. package/dist/extensions/forgecli/subagent/phase-guard.d.ts +34 -0
  115. package/dist/extensions/forgecli/subagent/phase-guard.js +139 -0
  116. package/dist/extensions/forgecli/subagent/phase-guard.js.map +1 -0
  117. package/dist/extensions/forgecli/subagent/phase-summary-map.d.ts +1 -0
  118. package/dist/extensions/forgecli/subagent/phase-summary-map.js +22 -0
  119. package/dist/extensions/forgecli/subagent/phase-summary-map.js.map +1 -0
  120. package/dist/extensions/forgecli/thread-switcher.js +2 -2
  121. package/dist/extensions/forgecli/thread-switcher.js.map +1 -1
  122. package/dist/extensions/forgecli/validate.js +17 -2
  123. package/dist/extensions/forgecli/validate.js.map +1 -1
  124. package/dist/extensions/forgecli/viewport-events.d.ts +4 -0
  125. package/dist/extensions/forgecli/viewport-events.js +18 -1
  126. package/dist/extensions/forgecli/viewport-events.js.map +1 -1
  127. package/dist/extensions/forgecli/viewport-renderer.d.ts +12 -2
  128. package/dist/extensions/forgecli/viewport-renderer.js +8 -6
  129. package/dist/extensions/forgecli/viewport-renderer.js.map +1 -1
  130. package/dist/forge-payload/.base-pack/commands/check-agent.md +22 -0
  131. package/dist/forge-payload/.base-pack/commands/new-sprint.md +22 -0
  132. package/dist/forge-payload/.base-pack/commands/plan-sprint.md +22 -0
  133. package/dist/forge-payload/.base-pack/commands/quiz-agent.md +2 -18
  134. package/dist/forge-payload/.base-pack/commands/retro.md +22 -0
  135. package/dist/forge-payload/.base-pack/commands/retrospective.md +2 -18
  136. package/dist/forge-payload/.base-pack/commands/sprint-intake.md +2 -18
  137. package/dist/forge-payload/.base-pack/commands/sprint-plan.md +2 -18
  138. package/dist/forge-payload/.base-pack/workflows/_fragments/friction-emit.md +2 -2
  139. package/dist/forge-payload/.base-pack/workflows/_fragments/generation-instructions.md +4 -4
  140. package/dist/forge-payload/.base-pack/workflows/_fragments/iron-laws.md +1 -1
  141. package/dist/forge-payload/.base-pack/workflows/architect_approve.md +13 -1
  142. package/dist/forge-payload/.base-pack/workflows/commit_task.md +12 -1
  143. package/dist/forge-payload/.base-pack/workflows/enhance.md +6 -6
  144. package/dist/forge-payload/.base-pack/workflows/fix_bug.md +11 -29
  145. package/dist/forge-payload/.base-pack/workflows/implement_plan.md +14 -2
  146. package/dist/forge-payload/.base-pack/workflows/migrate_structural.md +2 -2
  147. package/dist/forge-payload/.base-pack/workflows/orchestrate_task.md +20 -4
  148. package/dist/forge-payload/.base-pack/workflows/plan_task.md +14 -2
  149. package/dist/forge-payload/.base-pack/workflows/review_code.md +37 -7
  150. package/dist/forge-payload/.base-pack/workflows/review_plan.md +36 -6
  151. package/dist/forge-payload/.base-pack/workflows/run_sprint.md +2 -2
  152. package/dist/forge-payload/.base-pack/workflows/triage.md +190 -0
  153. package/dist/forge-payload/.base-pack/workflows/validate_task.md +37 -7
  154. package/dist/forge-payload/.claude-plugin/plugin.json +1 -1
  155. package/dist/forge-payload/.schemas/config.schema.json +0 -5
  156. package/dist/forge-payload/.schemas/enum-catalog.json +9 -13
  157. package/dist/forge-payload/.schemas/migrations.json +63 -0
  158. package/dist/forge-payload/agents/tomoshibi.md +150 -6
  159. package/dist/forge-payload/commands/add-pipeline.md +1 -1
  160. package/dist/forge-payload/commands/add-task.md +1 -1
  161. package/dist/forge-payload/commands/calibrate.md +4 -350
  162. package/dist/forge-payload/commands/check-agent.md +38 -0
  163. package/dist/forge-payload/commands/config.md +3 -113
  164. package/dist/forge-payload/commands/enhance.md +5 -32
  165. package/dist/forge-payload/commands/health.md +155 -13
  166. package/dist/forge-payload/commands/init.md +25 -31
  167. package/dist/forge-payload/commands/migrate.md +6 -154
  168. package/dist/forge-payload/commands/quiz-agent.md +2 -34
  169. package/dist/forge-payload/commands/rebuild.md +664 -0
  170. package/dist/forge-payload/commands/regenerate.md +2 -774
  171. package/dist/forge-payload/commands/remove.md +10 -13
  172. package/dist/forge-payload/commands/repair.md +187 -0
  173. package/dist/forge-payload/commands/search.md +73 -0
  174. package/dist/forge-payload/commands/status.md +105 -0
  175. package/dist/forge-payload/commands/store-query.md +2 -69
  176. package/dist/forge-payload/commands/store-repair.md +2 -183
  177. package/dist/forge-payload/commands/update-tools.md +4 -50
  178. package/dist/forge-payload/commands/update.md +64 -58
  179. package/dist/forge-payload/hooks/check-update.cjs +1 -1
  180. package/dist/forge-payload/hooks/post-init.cjs +2 -2
  181. package/dist/forge-payload/hooks/post-sprint.cjs +2 -2
  182. package/dist/forge-payload/hooks/triage-error.cjs +11 -10
  183. package/dist/forge-payload/init/phases/phase-1-collect.md +138 -0
  184. package/dist/forge-payload/init/phases/phase-2-discover.md +127 -0
  185. package/dist/forge-payload/init/phases/phase-3-materialize.md +113 -0
  186. package/dist/forge-payload/init/phases/phase-4-register.md +159 -0
  187. package/dist/forge-payload/integrity.json +21 -24
  188. package/dist/forge-payload/meta/fragments/tool-discipline.md +41 -0
  189. package/dist/forge-payload/meta/templates/meta-retro.md +28 -0
  190. package/dist/forge-payload/meta/workflows/_fragments/friction-emit.md +2 -2
  191. package/dist/forge-payload/meta/workflows/_fragments/generation-instructions.md +4 -4
  192. package/dist/forge-payload/meta/workflows/_fragments/iron-laws.md +1 -1
  193. package/dist/forge-payload/meta/workflows/meta-approve.md +13 -1
  194. package/dist/forge-payload/meta/workflows/meta-bug-triage.md +210 -0
  195. package/dist/forge-payload/meta/workflows/meta-check-agent.md +138 -0
  196. package/dist/forge-payload/meta/workflows/meta-commit.md +12 -1
  197. package/dist/forge-payload/meta/workflows/meta-enhance.md +5 -5
  198. package/dist/forge-payload/meta/workflows/meta-fix-bug.md +11 -29
  199. package/dist/forge-payload/meta/workflows/meta-implement.md +13 -1
  200. package/dist/forge-payload/meta/workflows/meta-migrate.md +3 -3
  201. package/dist/forge-payload/meta/workflows/meta-new-sprint.md +84 -0
  202. package/dist/forge-payload/meta/workflows/meta-orchestrate.md +20 -4
  203. package/dist/forge-payload/meta/workflows/meta-plan-sprint.md +152 -0
  204. package/dist/forge-payload/meta/workflows/meta-plan-task.md +13 -1
  205. package/dist/forge-payload/meta/workflows/meta-retro.md +73 -0
  206. package/dist/forge-payload/meta/workflows/meta-review-implementation.md +37 -7
  207. package/dist/forge-payload/meta/workflows/meta-review-plan.md +36 -6
  208. package/dist/forge-payload/meta/workflows/meta-validate.md +37 -7
  209. package/dist/forge-payload/schemas/config.schema.json +0 -5
  210. package/dist/forge-payload/schemas/enum-catalog.json +9 -13
  211. package/dist/forge-payload/schemas/structure-manifest.json +25 -8
  212. package/dist/forge-payload/tools/artifact.cjs +324 -0
  213. package/dist/forge-payload/tools/banners.cjs +3 -4
  214. package/dist/forge-payload/tools/build-context-pack.cjs +1 -1
  215. package/dist/forge-payload/tools/check-structure.cjs +8 -3
  216. package/dist/forge-payload/tools/store-cli.cjs +67 -7
  217. package/dist/forge-payload/tools/substitute-placeholders.cjs +1 -1
  218. package/dist/forge-payload/tools/verify-apply.cjs +75 -0
  219. package/dist/forge-payload/tools/verify-phase.cjs +259 -0
  220. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  221. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts +0 -17
  222. package/node_modules/@earendil-works/pi-ai/dist/models.generated.d.ts.map +1 -1
  223. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +21 -38
  224. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js.map +1 -1
  225. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.d.ts.map +1 -1
  226. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +5 -4
  227. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js.map +1 -1
  228. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts +2 -1
  229. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.d.ts.map +1 -1
  230. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
  231. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js.map +1 -1
  232. package/node_modules/@earendil-works/pi-ai/package.json +1 -1
  233. package/node_modules/@earendil-works/pi-coding-agent/CHANGELOG.md +24 -1
  234. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.d.ts.map +1 -1
  235. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
  236. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js.map +1 -1
  237. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.d.ts +1 -0
  238. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.d.ts.map +1 -1
  239. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
  240. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js.map +1 -1
  241. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.d.ts.map +1 -1
  242. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +16 -4
  243. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js.map +1 -1
  244. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.d.ts.map +1 -1
  245. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +45 -50
  246. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js.map +1 -1
  247. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.d.ts.map +1 -1
  248. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +43 -81
  249. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js.map +1 -1
  250. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
  251. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
  252. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -1
  253. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.d.ts.map +1 -1
  254. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
  255. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js.map +1 -1
  256. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.d.ts.map +1 -1
  257. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
  258. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js.map +1 -1
  259. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.d.ts.map +1 -1
  260. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
  261. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js.map +1 -1
  262. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.d.ts +2 -0
  263. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.d.ts.map +1 -1
  264. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +37 -0
  265. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js.map +1 -1
  266. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.d.ts.map +1 -1
  267. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
  268. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js.map +1 -1
  269. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.d.ts.map +1 -1
  270. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
  271. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js.map +1 -1
  272. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts +3 -0
  273. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -1
  274. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
  275. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js.map +1 -1
  276. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  277. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
  278. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -1
  279. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.d.ts +3 -1
  280. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.d.ts.map +1 -1
  281. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
  282. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js.map +1 -1
  283. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts +30 -0
  284. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.d.ts.map +1 -0
  285. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
  286. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js.map +1 -0
  287. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.d.ts +2 -0
  288. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.d.ts.map +1 -0
  289. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
  290. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js.map +1 -0
  291. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts +7 -27
  292. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.d.ts.map +1 -1
  293. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
  294. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js.map +1 -1
  295. package/node_modules/@earendil-works/pi-coding-agent/docs/terminal-setup.md +6 -0
  296. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-anthropic/package.json +1 -1
  297. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  298. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/sandbox/package.json +1 -1
  299. package/node_modules/@earendil-works/pi-coding-agent/examples/extensions/with-deps/package.json +1 -1
  300. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +12 -14
  301. package/node_modules/@earendil-works/pi-coding-agent/package.json +5 -5
  302. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts +3 -0
  303. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.d.ts.map +1 -0
  304. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
  305. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js.map +1 -0
  306. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.d.ts.map +1 -1
  307. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
  308. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js.map +1 -1
  309. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts +2 -0
  310. package/node_modules/@earendil-works/pi-tui/dist/terminal.d.ts.map +1 -1
  311. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +13 -1
  312. package/node_modules/@earendil-works/pi-tui/dist/terminal.js.map +1 -1
  313. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  314. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  315. package/node_modules/@earendil-works/pi-tui/package.json +2 -2
  316. package/node_modules/@entelligentsia/forge-compress/dist/compressor.d.ts +6 -0
  317. package/node_modules/@entelligentsia/forge-compress/dist/compressor.js +137 -0
  318. package/node_modules/@entelligentsia/forge-compress/dist/entropy.d.ts +3 -0
  319. package/node_modules/@entelligentsia/forge-compress/dist/entropy.js +99 -0
  320. package/node_modules/@entelligentsia/forge-compress/dist/forge/entity.d.ts +8 -0
  321. package/node_modules/@entelligentsia/forge-compress/dist/forge/entity.js +149 -0
  322. package/node_modules/@entelligentsia/forge-compress/dist/forge/index.d.ts +7 -0
  323. package/node_modules/@entelligentsia/forge-compress/dist/forge/index.js +4 -0
  324. package/node_modules/@entelligentsia/forge-compress/dist/forge/markdown.d.ts +5 -0
  325. package/node_modules/@entelligentsia/forge-compress/dist/forge/markdown.js +92 -0
  326. package/node_modules/@entelligentsia/forge-compress/dist/forge/query.d.ts +7 -0
  327. package/node_modules/@entelligentsia/forge-compress/dist/forge/query.js +60 -0
  328. package/node_modules/@entelligentsia/forge-compress/dist/forge/validate.d.ts +1 -0
  329. package/node_modules/@entelligentsia/forge-compress/dist/forge/validate.js +82 -0
  330. package/node_modules/@entelligentsia/forge-compress/dist/index.d.ts +6 -0
  331. package/node_modules/@entelligentsia/forge-compress/dist/index.js +5 -0
  332. package/node_modules/@entelligentsia/forge-compress/dist/progressive.d.ts +1 -0
  333. package/node_modules/@entelligentsia/forge-compress/dist/progressive.js +108 -0
  334. package/node_modules/@entelligentsia/forge-compress/dist/strip.d.ts +4 -0
  335. package/node_modules/@entelligentsia/forge-compress/dist/strip.js +55 -0
  336. package/node_modules/@entelligentsia/forge-compress/dist/tokens.d.ts +2 -0
  337. package/node_modules/@entelligentsia/forge-compress/dist/tokens.js +17 -0
  338. package/node_modules/@entelligentsia/forge-compress/package.json +45 -0
  339. package/node_modules/@entelligentsia/forge-compress/src/__tests__/compress.test.ts +409 -0
  340. package/node_modules/@entelligentsia/forge-compress/src/compressor.ts +147 -0
  341. package/node_modules/@entelligentsia/forge-compress/src/entropy.ts +105 -0
  342. package/node_modules/@entelligentsia/forge-compress/src/forge/entity.ts +184 -0
  343. package/node_modules/@entelligentsia/forge-compress/src/forge/index.ts +10 -0
  344. package/node_modules/@entelligentsia/forge-compress/src/forge/markdown.ts +122 -0
  345. package/node_modules/@entelligentsia/forge-compress/src/forge/query.ts +105 -0
  346. package/node_modules/@entelligentsia/forge-compress/src/forge/validate.ts +86 -0
  347. package/node_modules/@entelligentsia/forge-compress/src/index.ts +22 -0
  348. package/node_modules/@entelligentsia/forge-compress/src/progressive.ts +123 -0
  349. package/node_modules/@entelligentsia/forge-compress/src/strip.ts +58 -0
  350. package/node_modules/@entelligentsia/forge-compress/src/tokens.ts +19 -0
  351. package/package.json +10 -15
  352. package/dist/extensions/forgecli/forge-init/phase-descriptors.d.ts +0 -72
  353. package/dist/extensions/forgecli/forge-init/phase-descriptors.js +0 -359
  354. package/dist/extensions/forgecli/forge-init/phase-descriptors.js.map +0 -1
  355. package/dist/extensions/forgecli/forge-init/prompts.d.ts +0 -10
  356. package/dist/extensions/forgecli/forge-init/prompts.js +0 -91
  357. package/dist/extensions/forgecli/forge-init/prompts.js.map +0 -1
  358. package/dist/extensions/forgecli/lib/store-error-remediation.d.ts +0 -65
  359. package/dist/extensions/forgecli/lib/store-error-remediation.js +0 -298
  360. package/dist/extensions/forgecli/lib/store-error-remediation.js.map +0 -1
  361. package/dist/forge-payload/hooks/check-update.js +0 -378
  362. package/dist/forge-payload/hooks/forge-permissions.js +0 -164
  363. package/dist/forge-payload/hooks/triage-error.js +0 -77
  364. package/dist/forge-payload/hooks/validate-write.js +0 -250
@@ -1,6 +1,6 @@
1
1
  <!-- Canonical Friction Emit fragment.
2
2
  Referenced from meta-implement.md, meta-fix-bug.md, meta-validate.md,
3
- meta-plan-task.md, and meta-orchestrate.md. /forge:enhance --phase 2
3
+ meta-plan-task.md, and meta-orchestrate.md. /forge:rebuild --enrich (phase 2)
4
4
  greps generated workflows for `## Friction Emit` to discover the channel.
5
5
 
6
6
  PLAN-11 / SLICE-2 (2026-05-14): friction is now recorded via the
@@ -16,7 +16,7 @@ When the persona detects skill friction during the workflow — a referenced
16
16
  skill is unused, fails on invocation, is missing from the registry, has gone
17
17
  stale relative to current architecture, or is redundant with another skill —
18
18
  record a judgement-only friction signal. The orchestrator drains the
19
- signals and emits the corresponding events so `/forge:enhance --phase 2`
19
+ signals and emits the corresponding events so `/forge:rebuild --enrich` (phase 2)
20
20
  can act on them.
21
21
 
22
22
  ## Trigger conditions
@@ -33,8 +33,8 @@
33
33
  **`Persona Self-Load`** — *conditional*. Required when the generated workflow uses the
34
34
  Persona Self-Load pattern (the generated file must begin by reading a persona `.md` file
35
35
  before any other tool use). Specify the exact persona path. Used in: `meta-collate.md`,
36
- `meta-retrospective.md`, `meta-review-sprint-completion.md`, `meta-sprint-intake.md`,
37
- `meta-sprint-plan.md`. Omit for subagent-targeted workflows where the persona is loaded
36
+ `meta-retro.md`, `meta-review-sprint-completion.md`, `meta-new-sprint.md`,
37
+ `meta-plan-sprint.md`. Omit for subagent-targeted workflows where the persona is loaded
38
38
  by the orchestrator before dispatch.
39
39
 
40
40
  **`Workflow Structure`** — *required*. Names the generated file slug and asserts the
@@ -51,8 +51,8 @@ run inline, and mandates the `Agent` tool for sub-tasks.
51
51
  substitutions the generator must embed (stack commands, KB paths, template references,
52
52
  task ID format, etc.).
53
53
 
54
- **`Token Reporting`** — *required* (with one exception: `meta-quiz-agent.md` omits it
55
- because quiz-agent is an inline helper, not an orchestrated phase). Standard form: `See
54
+ **`Token Reporting`** — *required* (with one exception: `meta-check-agent.md` omits it
55
+ because check-agent is an inline helper, not an orchestrated phase). Standard form: `See
56
56
  \`_fragments/finalize.md\` — wire via \`file_ref:\`.` Expanded token-reporting prose is
57
57
  used in workflows where the generated file must mandate a specific sidecar-emit sequence
58
58
  (retrospective, sprint-intake, sprint-plan, review-sprint-completion) — in those cases,
@@ -52,7 +52,7 @@ into the standard three-bullet structure.
52
52
 
53
53
  Some workflows have no `## Iron Laws` section by design:
54
54
 
55
- - `meta-quiz-agent.md` — utility workflow; no store writes; no output contract.
55
+ - `meta-check-agent.md` — utility workflow; no store writes; no output contract.
56
56
  - `meta-review-sprint-completion.md` — read-only verification; no state transitions.
57
57
 
58
58
  Intentional omissions are documented with an inline comment before the `## Algorithm`
@@ -41,13 +41,25 @@ The Architect gives final sign-off on a completed task after Supervisor approval
41
41
 
42
42
  ```
43
43
 
44
- 0. Pre-flight Gate Check:
44
+ 0a. Pre-flight Gate Check:
45
45
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
46
46
  - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
47
47
  - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase approve --{entity_kind} {record_id}`
48
48
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
49
49
  - Exit 2 (misconfiguration) → print stderr and HALT.
50
50
  - Exit 0 → continue.
51
+
52
+ 0b. Pipeline Step Guard (user-invoked state check):
53
+ - If `--force` is present in the invocation arguments, skip this step entirely.
54
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
55
+ - Read current task state:
56
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
57
+ - Extract the `status` field from the JSON output.
58
+ - Allowed states for this phase: `review-approved`.
59
+ - If the current status is NOT in the allowed set:
60
+ Print the following and HALT (do not proceed):
61
+ `× Task {record_id} is in state '{status}' — /forge:review-code (or /forge:validate) must complete first. To run the full pipeline: /forge:run-task {record_id}`
62
+
51
63
  1. Load Context:
52
64
  - Read task prompt
53
65
  - Read final PLAN.md
@@ -0,0 +1,210 @@
1
+ ---
2
+ requirements:
3
+ reasoning: High
4
+ context: Medium
5
+ speed: Medium
6
+ audience: subagent
7
+ phase: triage
8
+ context:
9
+ architecture: false
10
+ prior_summaries: delta
11
+ persona: summary
12
+ master_index: false
13
+ diff_mode: false
14
+ deps:
15
+ personas: [bug-fixer]
16
+ skills: [bug-fixer, generic]
17
+ templates: []
18
+ sub_workflows: []
19
+ kb_docs: [architecture/stack.md]
20
+ config_fields: [commands.test, paths.engineering]
21
+ ---
22
+
23
+ # 🍂 Meta-Workflow: Bug Triage
24
+
25
+ ## Purpose
26
+
27
+ The Bug Fixer reproduces a reported bug, confirms root cause, decides the
28
+ fix route (Path A short-circuit vs Path B full loop), and writes the
29
+ triage artifact + summary. This is the **first phase** of `/forge:fix-bug`
30
+ and the only phase that records the route decision read by the orchestrator
31
+ (`meta-fix-bug.md`) to select `phases_A` vs `phases_B`.
32
+
33
+ <!-- See _fragments/iron-laws.md for Iron Laws section structure guidance -->
34
+ ## Iron Laws
35
+
36
+ - Reproduce the bug before deciding anything. A bug without a confirmed
37
+ reproduction has no business going to plan-fix or implement.
38
+ - Read `.forge/personas/bug-fixer.md` first; print the persona identity
39
+ line (emoji, name, tagline) to stdout before any other tool use.
40
+ - All store I/O via `forge_store` (or `node "$FORGE_ROOT/tools/store-cli.cjs"`).
41
+ Never edit `.forge/store/*.json` directly.
42
+ - **Triage NEVER writes `bug.status`.** The orchestrator (`meta-fix-bug.md`)
43
+ owns the `reported → triaged` and `triaged → in-progress` transitions.
44
+ Writing `bug.status` from this workflow violates `meta-fix-bug.md
45
+ § Iron Laws #2` (parallel to `meta-review-plan.md`'s "Supervisor NEVER
46
+ writes entity status" rule).
47
+ - Triage is a **single phase**. Do NOT call `forge_preflight` with any
48
+ other `--phase` value. Do NOT call `forge_store update-status`,
49
+ `set-bug-summary` for any non-triage phase, or `forge_store emit`.
50
+ These are orchestrator-owned or other-phase-owned actions. The
51
+ phase-ownership guard in forge-cli will reject violations at the tool
52
+ layer, but the Iron Law names the rule.
53
+
54
+ ## Store-Write Verification
55
+
56
+ <!-- See _fragments/store-write-verification.md for the canonical block content -->
57
+
58
+ ## Algorithm
59
+
60
+ ```
61
+
62
+ 0. Pre-flight Gate Check:
63
+ - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
64
+ - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase triage --bug {bugId}`
65
+ - Exit 1 (gate failed) → print stderr and HALT. Do not proceed.
66
+ - Exit 2 (misconfiguration) → print stderr and HALT.
67
+ - Exit 0 → continue.
68
+
69
+ 1. Load Context:
70
+ - Read `.forge/personas/bug-fixer.md` first; print the persona identity
71
+ line to stdout before any other tool use.
72
+ - Read the bug record:
73
+ `forge_store({ command:"read", entity:"bug", id:"{bugId}" })`
74
+ - Read business domain docs relevant to the reported symptom.
75
+ - store-cli verbs: `read` | `list` | `write` | `emit` |
76
+ `update-status` | `set-summary` | `set-bug-summary` | `describe` |
77
+ `nlp` | `query` | `delete` — there is no `get`/`set`/`find`. See
78
+ `_fragments/store-cli-verbs.md` for full notes.
79
+
80
+ 2. Reproduce:
81
+ - Construct a minimal reproduction: a failing test, a short script,
82
+ or a documented manual sequence that triggers the reported symptom.
83
+ - If reproduction cannot be achieved with the information in the bug
84
+ record, write what was tried in TRIAGE.md, set the route to "B"
85
+ (any uncertainty defaults to Path B), and continue to root-cause
86
+ research with the reporter's narrative as the working hypothesis.
87
+
88
+ 3. Root-Cause Research:
89
+ - Read the code paths implicated by the reproduction.
90
+ - Confirm (or revise) the reporter's stated root cause via direct
91
+ inspection of source files and tests.
92
+ - Note collateral damage: which other call sites, schemas, or
93
+ workflows share the defective shape.
94
+
95
+ 4. Path A / Path B Eligibility:
96
+ - Apply the criteria in § "Path A / Path B Eligibility" below.
97
+ - Record the route decision and the explicit enumeration of each
98
+ criterion in the findings section of the triage summary.
99
+
100
+ 5. Write Triage Artifacts:
101
+ - Write the triage artifact (markdown narrative):
102
+ `forge_artifact({ command:"write", entity:"bug", entityId:"{bugId}",
103
+ artifact:"triage", content:"<markdown>" })`
104
+ - Write the triage-summary sidecar (JSON shape below):
105
+ `forge_artifact({ command:"write", entity:"bug", entityId:"{bugId}",
106
+ artifact:"triage-summary", content:"<JSON>" })`
107
+
108
+ 6. Finalize:
109
+ - **No status write.** The orchestrator (`meta-fix-bug.md`) writes the
110
+ `reported → triaged` and `triaged → in-progress` transitions on
111
+ return. Writing `bug.status` from this workflow is forbidden by
112
+ Iron Laws above and is rejected by the phase-ownership guard.
113
+ - **Do NOT emit a phase event yourself.** The orchestrator owns event
114
+ emission — it composes the canonical event from runtime telemetry
115
+ (model, provider, tokens, wall times) plus the SUMMARY you write
116
+ in the next step.
117
+
118
+ 7. Emit Summary Sidecar:
119
+ - The JSON written in step 5 MUST have this shape (the `route` field
120
+ is required; allowed values: `"A"` or `"B"`):
121
+
122
+ ```json
123
+ {
124
+ "objective": "Triage FORGE-BUG-NNN — reproduce, locate, decide route.",
125
+ "key_changes": ["<up to 12 bullets, 200 chars each — findings or actions>"],
126
+ "findings": [
127
+ "Root cause: <one line>",
128
+ "Reproduction: <one line>",
129
+ "Route decision: A | B",
130
+ "Rationale: <one line>"
131
+ ],
132
+ "verdict": "n/a",
133
+ "written_at": "<current ISO 8601 timestamp>",
134
+ "artifact_ref":"TRIAGE.md",
135
+ "route": "A"
136
+ }
137
+ ```
138
+
139
+ - Call:
140
+ ```
141
+ forge_store({ command:"set-bug-summary", entity:"bug",
142
+ id:"{bugId}", phase:"triage",
143
+ file:"engineering/bugs/{bugDir}/TRIAGE-SUMMARY.json" })
144
+ ```
145
+ - If the set-bug-summary call exits non-zero, fix the sidecar JSON
146
+ and retry (up to 3 attempts per the Store-Write Verification rule).
147
+ Do not proceed without a valid summary.
148
+
149
+ > **Field-naming caution — runtime-tested.** The route field is named
150
+ > `route`, never `path`. The bug schema's top-level `path` field is the
151
+ > bug's **artifact directory** (e.g. `engineering/bugs/EMG-BUG-001-...`).
152
+ > Conflating the two caused EMBERGLOW-BUG-001 (v0.44.0 first run) to land
153
+ > its `TRIAGE.md` under `.forge/store/bugs/` instead of `engineering/bugs/`.
154
+ > Triage MUST NOT touch `bug.path` — that field is set at bug creation
155
+ > and never modified by triage.
156
+ ```
157
+
158
+ ## Path A / Path B Eligibility
159
+
160
+ Path A is **eligible only when ALL** of the following hold. The triage
161
+ summary `findings` array MUST enumerate each criterion explicitly with a
162
+ pass/fail mark, so reviewers can audit the decision:
163
+
164
+ - `bug.severity ∈ {minor}`
165
+ - Fix is contained in a single file
166
+ - Estimated diff ≤ ~20 lines (judgement call; one screen)
167
+ - No schema, API, migration, security, or build-system change
168
+ - A regression test is obvious from the reproduction script (single short
169
+ test case, no new fixtures, no test-harness change)
170
+
171
+ If any criterion fails, the triage subagent MUST select Path B.
172
+
173
+ **Path B is the default.** Any uncertainty resolves to Path B. It runs the
174
+ same plan/review/implement/review/approve/commit shape as
175
+ `meta-orchestrate.md`. Picking Path A under uncertainty is the documented
176
+ failure mode (over-eager short-circuit).
177
+
178
+ ## Triage Artifact Contents (TRIAGE.md)
179
+
180
+ The narrative artifact MUST contain:
181
+
182
+ 1. **Reported symptom** — one paragraph summarising the bug report.
183
+ 2. **Reproduction** — exact steps, commands, or test case that triggers
184
+ the symptom; copy of the failing output.
185
+ 3. **Root cause** — one or two paragraphs naming the defective code path,
186
+ schema, or workflow. Cite file paths and line numbers.
187
+ 4. **Path A / Path B enumeration** — for each criterion above, mark
188
+ pass/fail with one-line evidence.
189
+ 5. **Route decision and rationale** — the chosen route and the
190
+ single-sentence justification.
191
+ 6. **Collateral findings** — any related shapes, call sites, or
192
+ workflows that share the defective pattern (filed as follow-ups in
193
+ the commit phase, not fixed here).
194
+
195
+ <!-- See _fragments/generation-instructions.md for Generation Instructions template -->
196
+ ## Generation Instructions
197
+
198
+ - The generated `triage.md` MUST include all four markers required by
199
+ `forge-cli/src/extensions/forgecli/lib/manifest-checker.ts §
200
+ checkMaterialization`: (1) `## Store-Write Verification` heading;
201
+ (2) `## Iron Laws` heading; (3) literal `forge_store` token in body;
202
+ (4) `.forge/personas/bug-fixer.md` referenced in body.
203
+ - Token Reporting: `_fragments/finalize.md` — wire via `file_ref:`.
204
+ - Event Emission: orchestrator-owned; this workflow MUST NOT call
205
+ `forge_store emit` for phase events.
206
+
207
+ ## Friction Emit
208
+
209
+ Emit `type:friction` `{workflow:triage, persona:bug-fixer, issue}` per
210
+ `_fragments/friction-emit.md`.
@@ -0,0 +1,138 @@
1
+ ---
2
+ requirements:
3
+ reasoning: Medium
4
+ context: High
5
+ speed: Low
6
+ deps:
7
+ personas: [qa-engineer]
8
+ skills: [qa-engineer, generic]
9
+ templates: []
10
+ sub_workflows: []
11
+ kb_docs: [architecture/stack.md, MASTER_INDEX.md]
12
+ config_fields: [paths.engineering]
13
+ ---
14
+
15
+ # 🍵 Meta-Workflow: Quiz Agent
16
+
17
+ ## Purpose
18
+
19
+ Verify that an agent has correctly loaded and understood the project's knowledge
20
+ base before beginning a high-stakes task (e.g. a schema change, a significant
21
+ refactor, a deployment, or a migration step).
22
+
23
+ The quiz is short — 5–7 questions drawn directly from the project's own architecture
24
+ and process docs. Vague answers fail. Pass requires specific, factual responses.
25
+
26
+ <!-- No Iron Laws section: quiz-agent is a utility workflow that makes no store writes and enforces no output contract. Knowledge-check only. It is invoked inline by other workflows, not dispatched as a task phase by the orchestrator. -->
27
+
28
+ ## Algorithm
29
+
30
+ ```
31
+ 1. Ask the quiz questions below (in order).
32
+
33
+ 2. Evaluate each answer:
34
+ - PASS: specific and factually correct per the project KB
35
+ - FAIL: vague ("some validation"), wrong, or "I'm not sure"
36
+
37
+ 3. Verdict:
38
+ - All pass → proceed with the original task.
39
+ - Any fail → re-read the KB docs listed in "Fail Action", then retry the quiz.
40
+ - Fail twice → escalate to the user before beginning the task.
41
+ ```
42
+
43
+ ## Questions
44
+
45
+ (Project-specific questions are generated here during init — see Generation Instructions.)
46
+
47
+ ## Pass Criteria
48
+
49
+ All questions answered correctly and specifically. Vague answers fail.
50
+
51
+ ## Fail Action
52
+
53
+ Re-read the project knowledge base docs listed here, then retry:
54
+
55
+ (Project-specific KB doc paths are embedded here during init.)
56
+
57
+ Then retry the quiz. If the agent fails twice, escalate to the user before
58
+ beginning the task.
59
+
60
+ ---
61
+
62
+ <!-- See _fragments/generation-instructions.md for Generation Instructions template (quiz-agent: no token-reporting or event-emission — inline helper workflow) -->
63
+ ## Generation Instructions
64
+
65
+ ### Overview
66
+
67
+ The generated `quiz_agent.md` tests whether an agent genuinely understands
68
+ THIS project's conventions, architecture, and processes — not Forge in general.
69
+
70
+ Questions must be answerable only by reading the project's own KB docs.
71
+ Generic questions about Claude Code or Forge internals are NOT appropriate
72
+ unless this project's KB explicitly documents them as project conventions.
73
+
74
+ ### Question generation
75
+
76
+ Read the following (already generated by earlier phases):
77
+ - `{KB_PATH}/architecture/` — all .md files
78
+ - `{KB_PATH}/business-domain/` — all .md files
79
+ - `{KB_PATH}/stack-checklist.md`
80
+ - `{KB_PATH}/MASTER_INDEX.md`
81
+
82
+ Generate 5–7 questions that test specific knowledge of this project. Each
83
+ question must:
84
+ 1. Reference a specific fact from the project KB (not common knowledge)
85
+ 2. Have an unambiguous correct answer findable in the KB
86
+ 3. Cover at least three of these categories:
87
+ - Stack conventions (language, framework rules, linting, build)
88
+ - Architecture (key components, service boundaries, data flow)
89
+ - Domain entities (core business objects and their relationships)
90
+ - Process (how work is tracked, committed, reviewed, deployed)
91
+ - Constraints (what is explicitly forbidden or required)
92
+
93
+ Avoid yes/no questions. Prefer "what", "where", "name", "describe" forms.
94
+
95
+ ### Fail Action doc list
96
+
97
+ List the architecture and business-domain docs that cover the question topics.
98
+ Use the actual paths as generated (e.g. `{KB_PATH}/architecture/stack.md`).
99
+ Include `{KB_PATH}/stack-checklist.md` always.
100
+
101
+ ## Template Output Format
102
+
103
+ ```markdown
104
+ # 🍵 Workflow: Quiz Agent — {Project Name}
105
+
106
+ ## Purpose
107
+
108
+ Verify that an agent has correctly loaded and understood the {Project Name}
109
+ knowledge base before beginning a high-stakes task.
110
+
111
+ ---
112
+
113
+ ## Questions
114
+
115
+ 1. **[Category]:** [Question text]
116
+ 2. ...
117
+
118
+ ## Pass Criteria
119
+
120
+ All [N] questions answered correctly and specifically. Vague answers
121
+ ("generally something", "I think it's...") fail.
122
+
123
+ ## Fail Action
124
+
125
+ Re-read:
126
+ - `{KB_PATH}/architecture/[doc1].md`
127
+ - `{KB_PATH}/architecture/[doc2].md`
128
+ - `{KB_PATH}/stack-checklist.md`
129
+ - (any other docs covering the question topics)
130
+
131
+ Then retry the quiz. If the agent fails twice, escalate to the user before
132
+ beginning the task.
133
+ ```
134
+
135
+ ### Token Reporting
136
+
137
+ The generated `quiz_agent.md` does NOT include Token Reporting or Event Emission —
138
+ it is invoked inline by other workflows (not by the orchestrator as a task phase).
@@ -41,7 +41,7 @@ Seal a completed and approved task by committing its artifacts to the VCS and up
41
41
 
42
42
  ```
43
43
 
44
- 0. Pre-flight Gate Check:
44
+ 0a. Pre-flight Gate Check:
45
45
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
46
46
  - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
47
47
  - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase commit --{entity_kind} {record_id}`
@@ -49,6 +49,17 @@ Seal a completed and approved task by committing its artifacts to the VCS and up
49
49
  - Exit 2 (misconfiguration) → print stderr and HALT.
50
50
  - Exit 0 → continue.
51
51
 
52
+ 0b. Pipeline Step Guard (user-invoked state check):
53
+ - If `--force` is present in the invocation arguments, skip this step entirely.
54
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
55
+ - Read current task state:
56
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
57
+ - Extract the `status` field from the JSON output.
58
+ - Allowed states for this phase: `approved`.
59
+ - If the current status is NOT in the allowed set:
60
+ Print the following and HALT (do not proceed):
61
+ `× Task {record_id} is in state '{status}' — /forge:approve must complete first. To run the full pipeline: /forge:run-task {record_id}`
62
+
52
63
  1. Load Context:
53
64
  - Read the record manifest (task or bug, per entity_kind).
54
65
  - Read ARCHITECT_APPROVAL.md from the record's artifact directory:
@@ -104,7 +104,7 @@ Receive the phase flag from the command invocation:
104
104
  |------|------|
105
105
  | `--phase 1` or `--auto` | Auto-apply: placeholder fills only — **use after** `/forge:init` completes to fill `{{KEY}}` placeholders from project signals |
106
106
  | `--phase 2` | Propose-diffs: sprint artifact + friction scan — **use after** a sprint completes to turn friction events into persona/skill enrichments |
107
- | `--phase 3` | Drift detection: full codebase vs structural-element comparison — **use on-demand** or after `/forge:calibrate` to detect stale references |
107
+ | `--phase 3` | Drift detection: full codebase vs structural-element comparison — **use on-demand** or after `/forge:health --fix` to detect stale references |
108
108
 
109
109
  Default to `--phase 3` if no phase flag is given.
110
110
 
@@ -126,7 +126,7 @@ Read `.forge/config.json`. Resolve:
126
126
 
127
127
  ### When to run
128
128
 
129
- Invoked by T09 post-init hook (`--auto`) or manually via `/forge:enhance --phase 1`.
129
+ Invoked by T09 post-init hook (`--auto`) or manually via `/forge:rebuild --enrich --phase 1`.
130
130
 
131
131
  ### Algorithm
132
132
 
@@ -207,7 +207,7 @@ Invoked by T09 post-init hook (`--auto`) or manually via `/forge:enhance --phase
207
207
 
208
208
  ### When to run
209
209
 
210
- Invoked by T09 post-sprint hook or manually via `/forge:enhance --phase 2`.
210
+ Invoked by T09 post-sprint hook or manually via `/forge:rebuild --enrich --phase 2`.
211
211
 
212
212
  ### Algorithm
213
213
 
@@ -595,8 +595,8 @@ Invoked by T09 post-sprint hook or manually via `/forge:enhance --phase 2`.
595
595
 
596
596
  ### When to run
597
597
 
598
- Invoked by `/forge:enhance --phase 3` (default when no phase given), or delegated by
599
- `/forge:calibrate` after its Step 4 drift categorization.
598
+ Invoked by `/forge:rebuild --enrich --phase 3` (default when no phase given), or delegated by
599
+ `/forge:health --fix` after its Step 4 drift categorization.
600
600
 
601
601
  ### Algorithm
602
602
 
@@ -31,7 +31,7 @@ Phases`):
31
31
 
32
32
  | Phase | Role | Persona | Workflow | Path A | Path B |
33
33
  |---|---|---|---|---|---|
34
- | triage | `triage` | bug-fixer | (inline algorithm) | yes | yes |
34
+ | triage | `triage` | bug-fixer | `triage.md` | yes | yes |
35
35
  | plan-fix | `plan` | engineer | `plan_task.md` (bug-mode) | no | yes |
36
36
  | review-plan | `review-plan` | supervisor | `review_plan.md` | no | yes |
37
37
  | implement | `implement` | engineer | `implement_plan.md` (bug-mode) | yes | yes |
@@ -101,24 +101,11 @@ The `route` field is required. Allowed values: `"A"` or `"B"`.
101
101
  > Triage subagents MUST NOT touch `bug.path` — that field is set at bug
102
102
  > creation and never modified by triage.
103
103
 
104
- ### Path A short-circuit (eligibility)
104
+ ### Path A / Path B eligibility
105
105
 
106
- Path A is **eligible only when ALL** of the following hold. Triage subagent
107
- must enumerate each in its findings:
108
-
109
- - `bug.severity ∈ {minor}`
110
- - Fix is contained in a single file
111
- - Estimated diff ≤ ~20 lines (judgement call; one screen)
112
- - No schema, API, migration, security, or build-system change
113
- - A regression test is obvious from the reproduction script (single short
114
- test case, no new fixtures, no test-harness change)
115
-
116
- If any criterion fails, the triage subagent MUST select Path B.
117
-
118
- ### Path B — full loop (default)
119
-
120
- Path B runs the same plan/review/implement/review/approve/commit shape as
121
- `meta-orchestrate.md`. It is the default. Any uncertainty defaults Path B.
106
+ See `triage.md § Path A / Path B Eligibility` for the criteria the triage
107
+ subagent applies. The criteria are single-sourced in the triage workflow;
108
+ this orchestrator only reads the resulting `summaries.triage.route` value.
122
109
 
123
110
  ### Pipeline selection by path
124
111
 
@@ -164,16 +151,11 @@ Differences are confined to the **triage** step and the **path branch**.
164
151
  b. If .forge/store/bugs/{BUG_ID}.json does NOT exist, write a fresh record
165
152
  via store-cli with status="reported".
166
153
  c. Read the now-guaranteed record.
167
- - Spawn the triage subagent (persona: bug-fixer). It MUST:
168
- Reproduce the bug (failing test or reproduction script).
169
- Confirm the root cause via codebase research.
170
- Decide Path A vs Path B by the criteria above.
171
- Write triage artifact:
172
- forge_artifact({ command:"write", entity:"bug", entityId:"{bugId}", artifact:"triage", content:"<markdown>" })
173
- • Write triage-summary artifact (JSON shape documented in § Triage Judgement):
174
- forge_artifact({ command:"write", entity:"bug", entityId:"{bugId}", artifact:"triage-summary", content:"<JSON>" })
175
- • Call set-bug-summary {bugId} triage via forge_store:
176
- forge_store({ command:"set-bug-summary", bugId:"{bugId}", phase:"triage", file:"TRIAGE-SUMMARY.json" })
154
+ - Spawn the triage subagent (workflow: `triage.md`, persona: bug-fixer).
155
+ It MUST write `TRIAGE.md` + `TRIAGE-SUMMARY.json` with a `route` field
156
+ (`"A"` or `"B"`) and call `set-bug-summary {bugId} triage` per
157
+ `triage.md`. The triage workflow is `audience: subagent`, `phase: triage`;
158
+ the orchestrator MUST NOT pass any other workflow body to this subagent.
177
159
  - On return, orchestrator transitions status:
178
160
  store-cli update-status bug {bugId} status triaged
179
161
  store-cli update-status bug {bugId} status in-progress
@@ -467,7 +449,7 @@ When the Bug Fixer, Supervisor, Architect, Engineer, or Collator detects skill
467
449
  friction during fix-bug — a referenced skill is unused, fails on invocation,
468
450
  is missing from the registry, has gone stale relative to current architecture,
469
451
  or is redundant with another skill — emit a `friction` event so
470
- `/forge:enhance --phase 2` can act on the signal.
452
+ `/forge:rebuild --enrich` (phase 2) can act on the signal.
471
453
 
472
454
  **Trigger conditions** (set `issue` to the matching token):
473
455
 
@@ -30,13 +30,25 @@ The Engineer implements the approved plan: write code, run tests, verify, and do
30
30
 
31
31
  ```
32
32
 
33
- 0. Pre-flight Gate Check:
33
+ 0a. Pre-flight Gate Check:
34
34
  - Resolve FORGE_ROOT (`node -e "console.log(require('./.forge/config.json').paths.forgeRoot)"`).
35
35
  - **Entity-mode resolution:** read the kickoff arguments. `--task {id}` → `entity_kind = "task"`, `record_id = {id}`. `--bug {id}` → `entity_kind = "bug"`, `record_id = {id}`. All store-cli calls below substitute `{entity_kind}` and `{record_id}` for the literal "task"/{taskId} placeholders.
36
36
  - Run: `node "$FORGE_ROOT/tools/preflight-gate.cjs" --phase implement --{entity_kind} {record_id}`
37
37
  - Exit 1 (gate failed) → print stderr and HALT. Do not proceed; do not attempt to produce the artifact.
38
38
  - Exit 2 (misconfiguration) → print stderr and HALT.
39
39
  - Exit 0 → continue.
40
+
41
+ 0b. Pipeline Step Guard (user-invoked state check):
42
+ - If `--force` is present in the invocation arguments, skip this step entirely.
43
+ - If `entity_kind == "bug"`, skip this step entirely (bug state is managed by meta-fix-bug.md).
44
+ - Read current task state:
45
+ `node "$FORGE_ROOT/tools/store-cli.cjs" read task {record_id} --json`
46
+ - Extract the `status` field from the JSON output.
47
+ - Allowed states for this phase: `plan-approved`.
48
+ - If the current status is NOT in the allowed set:
49
+ Print the following and HALT (do not proceed):
50
+ `× Task {record_id} is in state '{status}' — /forge:review-plan must complete first. To run the full pipeline: /forge:run-task {record_id}`
51
+
40
52
  1. Load Context:
41
53
  - Read `.forge/personas/engineer.md` first; print the persona identity line (emoji, name, tagline) to stdout before any other tool use.
42
54
  - store-cli verbs: `read` | `list` | `write` | `emit` | `update-status` | `set-summary` | `describe` | `nlp` | `query` | `delete` — there is no `get`/`set`/`find`. See `_fragments/store-cli-verbs.md` for full notes; run `--help` before improvising.
@@ -22,7 +22,7 @@ Translate a prose-heavy v0.x `.forge/` instance into the v0.40 format:
22
22
  `structure-versions.json` snapshot tracking (T05). Every operation is
23
23
  reversible, guarded by user confirmation, and idempotent on re-run.
24
24
 
25
- **Trigger:** Invoked by `/forge:migrate` when the user passes `--structural`
25
+ **Trigger:** Invoked by `/forge:init --migrate` when the user passes `--structural`
26
26
  or when `.forge/structure-versions.json` is absent (pre-T05 install detected).
27
27
 
28
28
  **Scope:** v0.x → v0.40 only. Installs older than v0.x should use
@@ -68,7 +68,7 @@ ls .forge/structure-versions.json 2>/dev/null && echo "EXISTS" || echo "ABSENT"
68
68
 
69
69
  - If `structure-versions.json` EXISTS: this is a post-T05 install. Warn the
70
70
  user that structural migration is not needed and offer to run the standard
71
- store-schema migration (Steps 1–7 of `/forge:migrate`) instead. Stop.
71
+ store-schema migration (Steps 1–7 of `/forge:init --migrate`) instead. Stop.
72
72
  - If ABSENT: proceed (pre-T05 install confirmed).
73
73
 
74
74
  **0c. Check for in-progress sentinel (idempotency).**
@@ -293,7 +293,7 @@ node "$FORGE_ROOT/tools/substitute-placeholders.cjs" \
293
293
  ```
294
294
 
295
295
  This overwrites `.forge/personas/`, `.forge/skills/`, `.forge/workflows/`,
296
- `.forge/templates/`, and `.claude/commands/forge/` with the freshly substituted
296
+ `.forge/templates/`, and `.claude/commands/<prefix>/` with the freshly substituted
297
297
  base-pack.
298
298
 
299
299
  If `substitute-placeholders.cjs` exits non-zero: halt, report the error to the