@warpgogol/forge 5.2.4 → 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (568) hide show
  1. package/AGENTS.md +32 -2
  2. package/README.md +1 -1
  3. package/README.uk.md +8 -8
  4. package/bin/cli.ts +1 -0
  5. package/dist/bin/cli.js +1 -0
  6. package/dist/bin/cli.js.map +1 -1
  7. package/dist/os/adr/adr.module.d.ts.map +1 -1
  8. package/dist/os/adr/adr.module.js +8 -3
  9. package/dist/os/adr/adr.module.js.map +1 -1
  10. package/dist/os/adr/frontmatter-io.js +5 -5
  11. package/dist/os/adr/frontmatter-io.js.map +1 -1
  12. package/dist/os/adr/handlers/archive.d.ts.map +1 -1
  13. package/dist/os/adr/handlers/archive.js +10 -4
  14. package/dist/os/adr/handlers/archive.js.map +1 -1
  15. package/dist/os/adr/handlers/implement-stamp.d.ts.map +1 -1
  16. package/dist/os/adr/handlers/implement-stamp.js +10 -9
  17. package/dist/os/adr/handlers/implement-stamp.js.map +1 -1
  18. package/dist/os/adr/handlers/list-create.js +5 -5
  19. package/dist/os/adr/handlers/list-create.js.map +1 -1
  20. package/dist/os/adr/handlers/validate.js +1 -1
  21. package/dist/os/adr/handlers/validate.js.map +1 -1
  22. package/dist/os/audit/audit.module.js +3 -3
  23. package/dist/os/audit/audit.module.js.map +1 -1
  24. package/dist/os/audit/frontmatter-io.js +5 -5
  25. package/dist/os/audit/frontmatter-io.js.map +1 -1
  26. package/dist/os/audit/handlers/archive.d.ts.map +1 -1
  27. package/dist/os/audit/handlers/archive.js +10 -4
  28. package/dist/os/audit/handlers/archive.js.map +1 -1
  29. package/dist/os/compass/compass.module.d.ts.map +1 -1
  30. package/dist/os/compass/compass.module.js +17 -1
  31. package/dist/os/compass/compass.module.js.map +1 -1
  32. package/dist/os/compass/handlers/compass-audit-handler.d.ts.map +1 -1
  33. package/dist/os/compass/handlers/compass-audit-handler.js +12 -5
  34. package/dist/os/compass/handlers/compass-audit-handler.js.map +1 -1
  35. package/dist/os/compass/handlers/compass-change-summary-handler.d.ts.map +1 -1
  36. package/dist/os/compass/handlers/compass-change-summary-handler.js +3 -2
  37. package/dist/os/compass/handlers/compass-change-summary-handler.js.map +1 -1
  38. package/dist/os/compass/handlers/compass-inventory-handler.d.ts.map +1 -1
  39. package/dist/os/compass/handlers/compass-inventory-handler.js +6 -4
  40. package/dist/os/compass/handlers/compass-inventory-handler.js.map +1 -1
  41. package/dist/os/compass/handlers/compass-inventory.d.ts.map +1 -1
  42. package/dist/os/compass/handlers/compass-inventory.js +10 -8
  43. package/dist/os/compass/handlers/compass-inventory.js.map +1 -1
  44. package/dist/os/compass/handlers/compass-migrate-handler.js +1 -1
  45. package/dist/os/compass/handlers/compass-migrate-handler.js.map +1 -1
  46. package/dist/os/compass/handlers/compass-migrate.d.ts.map +1 -1
  47. package/dist/os/compass/handlers/compass-migrate.js +6 -3
  48. package/dist/os/compass/handlers/compass-migrate.js.map +1 -1
  49. package/dist/os/compass/handlers/git-revision.d.ts.map +1 -1
  50. package/dist/os/compass/handlers/git-revision.js +9 -6
  51. package/dist/os/compass/handlers/git-revision.js.map +1 -1
  52. package/dist/os/compass/handlers/resolve-scan-root.js +1 -1
  53. package/dist/os/compass/handlers/resolve-scan-root.js.map +1 -1
  54. package/dist/os/compass/handlers/summary-record.d.ts.map +1 -1
  55. package/dist/os/compass/handlers/summary-record.js +8 -4
  56. package/dist/os/compass/handlers/summary-record.js.map +1 -1
  57. package/dist/os/core/core.module.d.ts.map +1 -1
  58. package/dist/os/core/core.module.js +43 -4
  59. package/dist/os/core/core.module.js.map +1 -1
  60. package/dist/os/core/handlers/assets-helpers.d.ts.map +1 -1
  61. package/dist/os/core/handlers/assets-helpers.js +6 -3
  62. package/dist/os/core/handlers/assets-helpers.js.map +1 -1
  63. package/dist/os/core/handlers/build.js +1 -1
  64. package/dist/os/core/handlers/build.js.map +1 -1
  65. package/dist/os/core/handlers/determinism-check.d.ts.map +1 -1
  66. package/dist/os/core/handlers/determinism-check.js +10 -6
  67. package/dist/os/core/handlers/determinism-check.js.map +1 -1
  68. package/dist/os/core/handlers/dev.js +1 -1
  69. package/dist/os/core/handlers/dev.js.map +1 -1
  70. package/dist/os/core/handlers/file-size-lint.d.ts.map +1 -1
  71. package/dist/os/core/handlers/file-size-lint.js +11 -7
  72. package/dist/os/core/handlers/file-size-lint.js.map +1 -1
  73. package/dist/os/core/handlers/forge-autonomy-validate.d.ts.map +1 -1
  74. package/dist/os/core/handlers/forge-autonomy-validate.js +9 -5
  75. package/dist/os/core/handlers/forge-autonomy-validate.js.map +1 -1
  76. package/dist/os/core/handlers/knowledge-compact.js +1 -1
  77. package/dist/os/core/handlers/knowledge-compact.js.map +1 -1
  78. package/dist/os/core/handlers/package-health.js +1 -1
  79. package/dist/os/core/handlers/package-health.js.map +1 -1
  80. package/dist/os/core/handlers/pinned-check.js +2 -2
  81. package/dist/os/core/handlers/pinned-check.js.map +1 -1
  82. package/dist/os/core/handlers/pinned-init.d.ts.map +1 -1
  83. package/dist/os/core/handlers/pinned-init.js +9 -8
  84. package/dist/os/core/handlers/pinned-init.js.map +1 -1
  85. package/dist/os/core/handlers/pinned-validate.js +3 -3
  86. package/dist/os/core/handlers/pinned-validate.js.map +1 -1
  87. package/dist/os/core/handlers/profile-resolve.js +1 -1
  88. package/dist/os/core/handlers/profile-resolve.js.map +1 -1
  89. package/dist/os/core/handlers/public-surface.js +1 -1
  90. package/dist/os/core/handlers/public-surface.js.map +1 -1
  91. package/dist/os/core/handlers/release-prepare.d.ts.map +1 -1
  92. package/dist/os/core/handlers/release-prepare.js +10 -6
  93. package/dist/os/core/handlers/release-prepare.js.map +1 -1
  94. package/dist/os/core/handlers/release-publish.js +6 -6
  95. package/dist/os/core/handlers/release-publish.js.map +1 -1
  96. package/dist/os/core/handlers/validate.js +1 -1
  97. package/dist/os/core/handlers/validate.js.map +1 -1
  98. package/dist/os/exploration/exploration.module.d.ts.map +1 -1
  99. package/dist/os/exploration/exploration.module.js +1 -0
  100. package/dist/os/exploration/exploration.module.js.map +1 -1
  101. package/dist/os/exploration/frontmatter-io.js +4 -4
  102. package/dist/os/exploration/frontmatter-io.js.map +1 -1
  103. package/dist/os/exploration/handlers/archive.js +3 -3
  104. package/dist/os/exploration/handlers/archive.js.map +1 -1
  105. package/dist/os/mission/handlers/archive.d.ts.map +1 -1
  106. package/dist/os/mission/handlers/archive.js +22 -19
  107. package/dist/os/mission/handlers/archive.js.map +1 -1
  108. package/dist/os/mission/mission.module.js +3 -3
  109. package/dist/os/mission/mission.module.js.map +1 -1
  110. package/dist/os/naming/naming-convention.d.ts.map +1 -1
  111. package/dist/os/naming/naming-convention.js +7 -3
  112. package/dist/os/naming/naming-convention.js.map +1 -1
  113. package/dist/os/naming/naming.module.d.ts.map +1 -1
  114. package/dist/os/naming/naming.module.js +4 -3
  115. package/dist/os/naming/naming.module.js.map +1 -1
  116. package/dist/os/notes/notes.module.d.ts.map +1 -1
  117. package/dist/os/notes/notes.module.js +6 -3
  118. package/dist/os/notes/notes.module.js.map +1 -1
  119. package/dist/os/plan/frontmatter-io.js +5 -5
  120. package/dist/os/plan/frontmatter-io.js.map +1 -1
  121. package/dist/os/plan/handlers/archive.d.ts.map +1 -1
  122. package/dist/os/plan/handlers/archive.js +10 -4
  123. package/dist/os/plan/handlers/archive.js.map +1 -1
  124. package/dist/os/plan/plan.module.js +3 -3
  125. package/dist/os/plan/plan.module.js.map +1 -1
  126. package/dist/os/plugin/plugin.module.d.ts.map +1 -1
  127. package/dist/os/plugin/plugin.module.js +6 -3
  128. package/dist/os/plugin/plugin.module.js.map +1 -1
  129. package/dist/os/program/discovery.js +2 -2
  130. package/dist/os/program/discovery.js.map +1 -1
  131. package/dist/os/program/handlers/complete.js +1 -1
  132. package/dist/os/program/handlers/complete.js.map +1 -1
  133. package/dist/os/program/handlers/lease.js +1 -1
  134. package/dist/os/program/handlers/lease.js.map +1 -1
  135. package/dist/os/program/handlers/seal.js +1 -1
  136. package/dist/os/program/handlers/seal.js.map +1 -1
  137. package/dist/os/program/lease.js +1 -1
  138. package/dist/os/program/lease.js.map +1 -1
  139. package/dist/os/program/program.module.d.ts.map +1 -1
  140. package/dist/os/program/program.module.js +9 -3
  141. package/dist/os/program/program.module.js.map +1 -1
  142. package/dist/os/queue/index.js +1 -1
  143. package/dist/os/queue/manifest.d.ts.map +1 -1
  144. package/dist/os/queue/manifest.js +4 -8
  145. package/dist/os/queue/manifest.js.map +1 -1
  146. package/dist/os/rfc/acceptance.d.ts.map +1 -1
  147. package/dist/os/rfc/acceptance.js +10 -6
  148. package/dist/os/rfc/acceptance.js.map +1 -1
  149. package/dist/os/rfc/decision-log.d.ts.map +1 -1
  150. package/dist/os/rfc/decision-log.js +4 -3
  151. package/dist/os/rfc/decision-log.js.map +1 -1
  152. package/dist/os/rfc/dna-trace.d.ts.map +1 -1
  153. package/dist/os/rfc/dna-trace.js +7 -2
  154. package/dist/os/rfc/dna-trace.js.map +1 -1
  155. package/dist/os/rfc/frontmatter-io.js +5 -5
  156. package/dist/os/rfc/frontmatter-io.js.map +1 -1
  157. package/dist/os/rfc/handlers/archive.d.ts.map +1 -1
  158. package/dist/os/rfc/handlers/archive.js +11 -5
  159. package/dist/os/rfc/handlers/archive.js.map +1 -1
  160. package/dist/os/rfc/handlers/check.d.ts.map +1 -1
  161. package/dist/os/rfc/handlers/check.js +6 -3
  162. package/dist/os/rfc/handlers/check.js.map +1 -1
  163. package/dist/os/rfc/handlers/implement-stamp.d.ts.map +1 -1
  164. package/dist/os/rfc/handlers/implement-stamp.js +11 -10
  165. package/dist/os/rfc/handlers/implement-stamp.js.map +1 -1
  166. package/dist/os/rfc/handlers/index-graph.js +3 -3
  167. package/dist/os/rfc/handlers/index-graph.js.map +1 -1
  168. package/dist/os/rfc/handlers/lifecycle.d.ts.map +1 -1
  169. package/dist/os/rfc/handlers/lifecycle.js +6 -2
  170. package/dist/os/rfc/handlers/lifecycle.js.map +1 -1
  171. package/dist/os/rfc/handlers/list-create.d.ts.map +1 -1
  172. package/dist/os/rfc/handlers/list-create.js +7 -6
  173. package/dist/os/rfc/handlers/list-create.js.map +1 -1
  174. package/dist/os/rfc/handlers/shared.js +3 -3
  175. package/dist/os/rfc/handlers/shared.js.map +1 -1
  176. package/dist/os/rfc/handlers/supersede-propose.d.ts.map +1 -1
  177. package/dist/os/rfc/handlers/supersede-propose.js +7 -3
  178. package/dist/os/rfc/handlers/supersede-propose.js.map +1 -1
  179. package/dist/os/rfc/handlers/validate-rules.d.ts.map +1 -1
  180. package/dist/os/rfc/handlers/validate-rules.js +8 -5
  181. package/dist/os/rfc/handlers/validate-rules.js.map +1 -1
  182. package/dist/os/rfc/rfc.module.d.ts.map +1 -1
  183. package/dist/os/rfc/rfc.module.js +44 -4
  184. package/dist/os/rfc/rfc.module.js.map +1 -1
  185. package/dist/os/rfc/verification-evidence.d.ts.map +1 -1
  186. package/dist/os/rfc/verification-evidence.js +9 -5
  187. package/dist/os/rfc/verification-evidence.js.map +1 -1
  188. package/dist/os/rfc/verification-refresh.d.ts.map +1 -1
  189. package/dist/os/rfc/verification-refresh.js +4 -3
  190. package/dist/os/rfc/verification-refresh.js.map +1 -1
  191. package/dist/os/session/frontmatter-io.js +12 -12
  192. package/dist/os/session/frontmatter-io.js.map +1 -1
  193. package/dist/os/session/handlers/archive.d.ts.map +1 -1
  194. package/dist/os/session/handlers/archive.js +10 -4
  195. package/dist/os/session/handlers/archive.js.map +1 -1
  196. package/dist/os/session/handlers/metrics-aggregate.d.ts.map +1 -1
  197. package/dist/os/session/handlers/metrics-aggregate.js +9 -5
  198. package/dist/os/session/handlers/metrics-aggregate.js.map +1 -1
  199. package/dist/os/session/handlers/metrics-rfc.d.ts.map +1 -1
  200. package/dist/os/session/handlers/metrics-rfc.js +11 -8
  201. package/dist/os/session/handlers/metrics-rfc.js.map +1 -1
  202. package/dist/os/session/handlers/metrics-session.d.ts.map +1 -1
  203. package/dist/os/session/handlers/metrics-session.js +6 -3
  204. package/dist/os/session/handlers/metrics-session.js.map +1 -1
  205. package/dist/os/session/handlers/save.d.ts.map +1 -1
  206. package/dist/os/session/handlers/save.js +14 -8
  207. package/dist/os/session/handlers/save.js.map +1 -1
  208. package/dist/os/session/session.module.d.ts.map +1 -1
  209. package/dist/os/session/session.module.js +6 -0
  210. package/dist/os/session/session.module.js.map +1 -1
  211. package/dist/os/spec/live-spec-list.js +4 -4
  212. package/dist/os/spec/live-spec-list.js.map +1 -1
  213. package/dist/os/spec/live-spec-merge.js +5 -5
  214. package/dist/os/spec/live-spec-merge.js.map +1 -1
  215. package/dist/os/spec/live-spec-show.js +3 -3
  216. package/dist/os/spec/live-spec-show.js.map +1 -1
  217. package/dist/os/spec/live-spec-validate.js +4 -4
  218. package/dist/os/spec/live-spec-validate.js.map +1 -1
  219. package/dist/os/spec/spec-materialize.js +9 -9
  220. package/dist/os/spec/spec-materialize.js.map +1 -1
  221. package/dist/os/spec/spec-status.js +9 -9
  222. package/dist/os/spec/spec-status.js.map +1 -1
  223. package/dist/os/spec/spec-validate.js +7 -7
  224. package/dist/os/spec/spec-validate.js.map +1 -1
  225. package/dist/os/spec/spec.module.d.ts.map +1 -1
  226. package/dist/os/spec/spec.module.js +8 -0
  227. package/dist/os/spec/spec.module.js.map +1 -1
  228. package/dist/os/werkstatt/handlers/lock.js +16 -16
  229. package/dist/os/werkstatt/handlers/lock.js.map +1 -1
  230. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js +3 -3
  231. package/dist/os/werkstatt/handlers/werkstatt-lock-recover.js.map +1 -1
  232. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.d.ts.map +1 -1
  233. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js +3 -2
  234. package/dist/os/werkstatt/handlers/werkstatt-operation-validate.js.map +1 -1
  235. package/dist/os/werkstatt/werkstatt.module.d.ts.map +1 -1
  236. package/dist/os/werkstatt/werkstatt.module.js +6 -2
  237. package/dist/os/werkstatt/werkstatt.module.js.map +1 -1
  238. package/dist/os/workflow/handlers.d.ts.map +1 -1
  239. package/dist/os/workflow/handlers.js +8 -5
  240. package/dist/os/workflow/handlers.js.map +1 -1
  241. package/dist/os/workflow/workflow.module.d.ts.map +1 -1
  242. package/dist/os/workflow/workflow.module.js +6 -3
  243. package/dist/os/workflow/workflow.module.js.map +1 -1
  244. package/dist/src/compass/contract-registry.js +1 -1
  245. package/dist/src/compass/contract-registry.js.map +1 -1
  246. package/dist/src/config/forge-config.d.ts +1 -1
  247. package/dist/src/config/forge-config.js +1 -1
  248. package/dist/src/config/forge-config.js.map +1 -1
  249. package/dist/src/knowledge/budgets.js +1 -1
  250. package/dist/src/knowledge/budgets.js.map +1 -1
  251. package/dist/src/knowledge/compact.js +1 -1
  252. package/dist/src/knowledge/compact.js.map +1 -1
  253. package/dist/src/knowledge/parse.js +1 -1
  254. package/dist/src/knowledge/parse.js.map +1 -1
  255. package/dist/src/knowledge/sync.d.ts.map +1 -1
  256. package/dist/src/knowledge/sync.js +3 -5
  257. package/dist/src/knowledge/sync.js.map +1 -1
  258. package/dist/src/migration-adapters/git-utils.js +2 -2
  259. package/dist/src/migration-adapters/git-utils.js.map +1 -1
  260. package/dist/src/migration-adapters/ignored-files.js +2 -2
  261. package/dist/src/migration-adapters/ignored-files.js.map +1 -1
  262. package/dist/src/migration-adapters/node-typescript-pnpm/index.js +1 -1
  263. package/dist/src/migration-adapters/node-typescript-pnpm/index.js.map +1 -1
  264. package/dist/src/migration-adapters/phaser-pnpm/index.js +1 -1
  265. package/dist/src/migration-adapters/phaser-pnpm/index.js.map +1 -1
  266. package/dist/src/onboarding/agents-generate.d.ts.map +1 -1
  267. package/dist/src/onboarding/agents-generate.js +60 -31
  268. package/dist/src/onboarding/agents-generate.js.map +1 -1
  269. package/dist/src/onboarding/create.d.ts.map +1 -1
  270. package/dist/src/onboarding/create.js +10 -10
  271. package/dist/src/onboarding/create.js.map +1 -1
  272. package/dist/src/onboarding/doctor.d.ts.map +1 -1
  273. package/dist/src/onboarding/doctor.js +68 -59
  274. package/dist/src/onboarding/doctor.js.map +1 -1
  275. package/dist/src/onboarding/init.d.ts.map +1 -1
  276. package/dist/src/onboarding/init.js +30 -1
  277. package/dist/src/onboarding/init.js.map +1 -1
  278. package/dist/src/onboarding/invariant-engine.js +1 -1
  279. package/dist/src/onboarding/invariant-engine.js.map +1 -1
  280. package/dist/src/onboarding/memory-compact.d.ts.map +1 -1
  281. package/dist/src/onboarding/memory-compact.js +5 -4
  282. package/dist/src/onboarding/memory-compact.js.map +1 -1
  283. package/dist/src/onboarding/memory-scaffold.js +1 -1
  284. package/dist/src/onboarding/memory-scaffold.js.map +1 -1
  285. package/dist/src/onboarding/nested-agents-generate.d.ts +4 -1
  286. package/dist/src/onboarding/nested-agents-generate.d.ts.map +1 -1
  287. package/dist/src/onboarding/nested-agents-generate.js +34 -5
  288. package/dist/src/onboarding/nested-agents-generate.js.map +1 -1
  289. package/dist/src/onboarding/nested-agents-templates.d.ts.map +1 -1
  290. package/dist/src/onboarding/nested-agents-templates.js +8 -12
  291. package/dist/src/onboarding/nested-agents-templates.js.map +1 -1
  292. package/dist/src/onboarding/npm-token-check.js +2 -2
  293. package/dist/src/onboarding/npm-token-check.js.map +1 -1
  294. package/dist/src/onboarding/prettierignore.d.ts +29 -0
  295. package/dist/src/onboarding/prettierignore.d.ts.map +1 -0
  296. package/dist/src/onboarding/prettierignore.js +231 -0
  297. package/dist/src/onboarding/prettierignore.js.map +1 -0
  298. package/dist/src/onboarding/profile-validate.d.ts.map +1 -1
  299. package/dist/src/onboarding/profile-validate.js +5 -4
  300. package/dist/src/onboarding/profile-validate.js.map +1 -1
  301. package/dist/src/onboarding/scaffold-project.d.ts.map +1 -1
  302. package/dist/src/onboarding/scaffold-project.js +35 -27
  303. package/dist/src/onboarding/scaffold-project.js.map +1 -1
  304. package/dist/src/onboarding/scaffold.js +1 -1
  305. package/dist/src/onboarding/scaffold.js.map +1 -1
  306. package/dist/src/onboarding/skill-markers.d.ts +27 -0
  307. package/dist/src/onboarding/skill-markers.d.ts.map +1 -0
  308. package/dist/src/onboarding/skill-markers.js +131 -0
  309. package/dist/src/onboarding/skill-markers.js.map +1 -0
  310. package/dist/src/onboarding/upgrade.d.ts +10 -0
  311. package/dist/src/onboarding/upgrade.d.ts.map +1 -1
  312. package/dist/src/onboarding/upgrade.js +215 -74
  313. package/dist/src/onboarding/upgrade.js.map +1 -1
  314. package/dist/src/onboarding/workspace-discovery.js +1 -1
  315. package/dist/src/onboarding/workspace-discovery.js.map +1 -1
  316. package/dist/src/pipeline-status.d.ts +6 -5
  317. package/dist/src/pipeline-status.d.ts.map +1 -1
  318. package/dist/src/pipeline-status.js +24 -19
  319. package/dist/src/pipeline-status.js.map +1 -1
  320. package/dist/src/profiles/stack-profile.js +1 -1
  321. package/dist/src/profiles/stack-profile.js.map +1 -1
  322. package/dist/src/registry.d.ts +1 -1
  323. package/dist/src/registry.d.ts.map +1 -1
  324. package/dist/src/registry.js +3 -3
  325. package/dist/src/registry.js.map +1 -1
  326. package/dist/src/skill-schema.d.ts +1 -1
  327. package/dist/src/skill-schema.d.ts.map +1 -1
  328. package/dist/src/skill-schema.js +4 -1
  329. package/dist/src/skill-schema.js.map +1 -1
  330. package/dist/src/types.d.ts +116 -0
  331. package/dist/src/types.d.ts.map +1 -1
  332. package/dist/src/utils/editable-region.d.ts +46 -0
  333. package/dist/src/utils/editable-region.d.ts.map +1 -0
  334. package/dist/src/utils/editable-region.js +125 -0
  335. package/dist/src/utils/editable-region.js.map +1 -0
  336. package/dist/src/utils/fs-idempotent.d.ts +2 -1
  337. package/dist/src/utils/fs-idempotent.d.ts.map +1 -1
  338. package/dist/src/utils/fs-idempotent.js +11 -7
  339. package/dist/src/utils/fs-idempotent.js.map +1 -1
  340. package/dist/src/utils/generated-marker.d.ts +17 -0
  341. package/dist/src/utils/generated-marker.d.ts.map +1 -1
  342. package/dist/src/utils/generated-marker.js +29 -1
  343. package/dist/src/utils/generated-marker.js.map +1 -1
  344. package/dist/src/utils/index.d.ts +3 -1
  345. package/dist/src/utils/index.d.ts.map +1 -1
  346. package/dist/src/utils/index.js +3 -1
  347. package/dist/src/utils/index.js.map +1 -1
  348. package/dist/src/utils/io.d.ts +9 -0
  349. package/dist/src/utils/io.d.ts.map +1 -0
  350. package/dist/src/utils/io.js +130 -0
  351. package/dist/src/utils/io.js.map +1 -0
  352. package/dist/src/utils/markdown-table.d.ts +21 -0
  353. package/dist/src/utils/markdown-table.d.ts.map +1 -0
  354. package/dist/src/utils/markdown-table.js +116 -0
  355. package/dist/src/utils/markdown-table.js.map +1 -0
  356. package/dist/src/utils/sync-fs.d.ts +5 -0
  357. package/dist/src/utils/sync-fs.d.ts.map +1 -0
  358. package/dist/src/utils/sync-fs.js +26 -0
  359. package/dist/src/utils/sync-fs.js.map +1 -0
  360. package/dist/src/validators/note-frontmatter-validate.js +1 -1
  361. package/dist/src/validators/note-frontmatter-validate.js.map +1 -1
  362. package/dist/src/validators/note-link-validate.js +1 -1
  363. package/dist/src/validators/note-link-validate.js.map +1 -1
  364. package/dist/src/validators/note-orphan-detect.js +1 -1
  365. package/dist/src/validators/note-orphan-detect.js.map +1 -1
  366. package/dist/src/validators/port-validate.js +1 -1
  367. package/dist/src/validators/port-validate.js.map +1 -1
  368. package/dist/src/validators/skill-validate.d.ts.map +1 -1
  369. package/dist/src/validators/skill-validate.js +34 -13
  370. package/dist/src/validators/skill-validate.js.map +1 -1
  371. package/os/adr/adr.module.ts +136 -132
  372. package/os/adr/frontmatter-io.ts +5 -5
  373. package/os/adr/handlers/archive.ts +8 -4
  374. package/os/adr/handlers/implement-stamp.ts +14 -9
  375. package/os/adr/handlers/list-create.ts +5 -5
  376. package/os/adr/handlers/validate.ts +1 -1
  377. package/os/audit/audit.module.ts +33 -34
  378. package/os/audit/frontmatter-io.ts +5 -5
  379. package/os/audit/handlers/archive.ts +8 -4
  380. package/os/compass/compass.module.ts +17 -1
  381. package/os/compass/handlers/compass-audit-handler.ts +13 -5
  382. package/os/compass/handlers/compass-change-summary-handler.ts +4 -2
  383. package/os/compass/handlers/compass-inventory-handler.ts +7 -4
  384. package/os/compass/handlers/compass-inventory.ts +11 -8
  385. package/os/compass/handlers/compass-migrate-handler.ts +1 -1
  386. package/os/compass/handlers/compass-migrate.ts +7 -3
  387. package/os/compass/handlers/git-revision.ts +11 -6
  388. package/os/compass/handlers/resolve-scan-root.ts +1 -1
  389. package/os/compass/handlers/summary-record.ts +10 -4
  390. package/os/compass/handlers/tests/compass-audit-plan.test.ts +2 -1
  391. package/os/core/core.module.ts +43 -4
  392. package/os/core/handlers/assets-helpers.ts +7 -3
  393. package/os/core/handlers/build.ts +1 -1
  394. package/os/core/handlers/determinism-check.ts +12 -6
  395. package/os/core/handlers/dev.ts +1 -1
  396. package/os/core/handlers/file-size-lint.ts +16 -9
  397. package/os/core/handlers/forge-autonomy-validate.ts +10 -5
  398. package/os/core/handlers/knowledge-compact.ts +1 -1
  399. package/os/core/handlers/package-health.ts +1 -1
  400. package/os/core/handlers/pinned-check.ts +2 -2
  401. package/os/core/handlers/pinned-init.ts +9 -8
  402. package/os/core/handlers/pinned-validate.ts +3 -3
  403. package/os/core/handlers/profile-resolve.ts +1 -1
  404. package/os/core/handlers/public-surface.ts +1 -1
  405. package/os/core/handlers/release-prepare.ts +11 -6
  406. package/os/core/handlers/release-publish.ts +6 -6
  407. package/os/core/handlers/validate.ts +1 -1
  408. package/os/exploration/exploration.module.ts +1 -0
  409. package/os/exploration/frontmatter-io.ts +4 -4
  410. package/os/exploration/handlers/archive.ts +3 -3
  411. package/os/mission/handlers/archive.ts +27 -19
  412. package/os/mission/mission.module.ts +38 -39
  413. package/os/naming/naming-convention.ts +9 -3
  414. package/os/naming/naming.module.ts +25 -25
  415. package/os/notes/notes.module.ts +87 -85
  416. package/os/plan/frontmatter-io.ts +5 -5
  417. package/os/plan/handlers/archive.ts +8 -4
  418. package/os/plan/plan.module.ts +33 -34
  419. package/os/plugin/plugin.module.ts +8 -6
  420. package/os/program/discovery.ts +2 -2
  421. package/os/program/handlers/complete.ts +1 -1
  422. package/os/program/handlers/lease.ts +1 -1
  423. package/os/program/handlers/seal.ts +1 -1
  424. package/os/program/lease.ts +1 -1
  425. package/os/program/program.module.ts +198 -193
  426. package/os/queue/index.ts +1 -1
  427. package/os/queue/manifest.ts +10 -9
  428. package/os/queue/queue-validate.test.ts +6 -15
  429. package/os/rfc/acceptance.ts +12 -6
  430. package/os/rfc/decision-log.ts +4 -3
  431. package/os/rfc/dna-trace.ts +8 -2
  432. package/os/rfc/frontmatter-io.ts +5 -5
  433. package/os/rfc/handlers/archive.ts +9 -5
  434. package/os/rfc/handlers/check.ts +5 -3
  435. package/os/rfc/handlers/implement-stamp.ts +15 -10
  436. package/os/rfc/handlers/index-graph.ts +3 -3
  437. package/os/rfc/handlers/lifecycle.ts +7 -2
  438. package/os/rfc/handlers/list-create.ts +7 -6
  439. package/os/rfc/handlers/shared.ts +3 -3
  440. package/os/rfc/handlers/supersede-propose.ts +8 -3
  441. package/os/rfc/handlers/validate-rules-rfc1006.test.ts +18 -6
  442. package/os/rfc/handlers/validate-rules.ts +10 -5
  443. package/os/rfc/rfc-create-concurrent.test.ts +11 -3
  444. package/os/rfc/rfc.module.ts +413 -374
  445. package/os/rfc/verification-evidence.ts +11 -5
  446. package/os/rfc/verification-refresh.ts +4 -3
  447. package/os/session/frontmatter-io.ts +14 -14
  448. package/os/session/handlers/archive.ts +8 -4
  449. package/os/session/handlers/metrics-aggregate.ts +34 -13
  450. package/os/session/handlers/metrics-rfc.ts +13 -8
  451. package/os/session/handlers/metrics-session.ts +7 -3
  452. package/os/session/handlers/save.ts +12 -8
  453. package/os/session/session.module.ts +6 -0
  454. package/os/spec/live-spec-list.ts +4 -4
  455. package/os/spec/live-spec-merge.ts +5 -5
  456. package/os/spec/live-spec-show.ts +3 -3
  457. package/os/spec/live-spec-validate.ts +4 -4
  458. package/os/spec/spec-materialize.ts +9 -9
  459. package/os/spec/spec-status.ts +9 -9
  460. package/os/spec/spec-validate.ts +7 -7
  461. package/os/spec/spec.module.ts +8 -0
  462. package/os/werkstatt/handlers/lock.ts +16 -16
  463. package/os/werkstatt/handlers/werkstatt-lock-recover.ts +3 -3
  464. package/os/werkstatt/handlers/werkstatt-operation-validate.ts +4 -2
  465. package/os/werkstatt/werkstatt.module.ts +8 -5
  466. package/os/workflow/handlers.ts +7 -5
  467. package/os/workflow/workflow.module.ts +45 -44
  468. package/package.json +1 -1
  469. package/skills/fo/fo-add-tests/SKILL.md +2 -2
  470. package/skills/fo/fo-architecture/SKILL.md +2 -2
  471. package/skills/fo/fo-compass-annotate/SKILL.md +2 -2
  472. package/skills/fo/fo-design-summit/SKILL.md +2 -2
  473. package/skills/fo/fo-doc-audit/SKILL.md +2 -2
  474. package/skills/fo/fo-explore/SKILL.md +2 -2
  475. package/skills/fo/fo-extract-dna/SKILL.md +2 -2
  476. package/skills/fo/fo-fix/SKILL.md +2 -2
  477. package/skills/fo/fo-handoff/SKILL.md +2 -2
  478. package/skills/fo/fo-harvest/SKILL.md +2 -2
  479. package/skills/fo/fo-idea/SKILL.md +2 -2
  480. package/skills/fo/fo-idea-audit/SKILL.md +2 -2
  481. package/skills/fo/fo-idea-create-adr/SKILL.md +3 -3
  482. package/skills/fo/fo-idea-create-rfc/SKILL.md +3 -3
  483. package/skills/fo/fo-idea-enhance/SKILL.md +2 -2
  484. package/skills/fo/fo-idea-i-just-want-to-see-the-plan/SKILL.md +2 -2
  485. package/skills/fo/fo-idea-i-just-want-to-see-the-result/SKILL.md +1 -1
  486. package/skills/fo/fo-idea-implement/SKILL.md +2 -2
  487. package/skills/fo/fo-idea-plan/SKILL.md +2 -2
  488. package/skills/fo/fo-idea-status/SKILL.md +2 -2
  489. package/skills/fo/fo-knowledge-distill/SKILL.md +2 -2
  490. package/skills/fo/fo-memory-sync/SKILL.md +2 -2
  491. package/skills/fo/fo-qa/SKILL.md +2 -2
  492. package/skills/fo/fo-review/SKILL.md +2 -2
  493. package/skills/fo/fo-session-retro/SKILL.md +2 -2
  494. package/skills/fo/fo-session-save/SKILL.md +2 -2
  495. package/skills/fo/fo-spec-ingest/SKILL.md +2 -2
  496. package/skills/fo/fo-step-commit/SKILL.md +1 -1
  497. package/skills/fo/fo-triage/SKILL.md +2 -2
  498. package/skills/meta/forge-bootstrap/SKILL.md +1 -1
  499. package/skills/meta/port-to-forge/SKILL.md +1 -1
  500. package/skills/meta/skill-create/SKILL.md +1 -1
  501. package/skills/shared/grilling/SKILL.md +1 -1
  502. package/skills/shared/grilling/learned-principles.archive.md +17 -0
  503. package/skills/shared/grilling/learned-principles.md +0 -1
  504. package/skills/shared/knowledge/learned-principles.md +6 -0
  505. package/skills/shared/my-preferences/SKILL.md +1 -1
  506. package/skills/shared/windows-ai-tooling/SKILL.md +1 -1
  507. package/skills/shared/writing-great-skills/SKILL.md +1 -1
  508. package/src/compass/contract-registry.ts +1 -1
  509. package/src/config/forge-config.ts +1 -1
  510. package/src/knowledge/__tests__/sync.test.ts +2 -7
  511. package/src/knowledge/budgets.ts +1 -1
  512. package/src/knowledge/compact.ts +1 -1
  513. package/src/knowledge/parse.ts +1 -1
  514. package/src/knowledge/sync.ts +3 -5
  515. package/src/migration-adapters/git-utils.ts +2 -2
  516. package/src/migration-adapters/ignored-files.ts +2 -2
  517. package/src/migration-adapters/node-typescript-pnpm/index.ts +1 -1
  518. package/src/migration-adapters/phaser-pnpm/index.ts +1 -1
  519. package/src/onboarding/agents-generate.ts +74 -33
  520. package/src/onboarding/create.ts +10 -10
  521. package/src/onboarding/doctor.ts +70 -55
  522. package/src/onboarding/init.ts +38 -1
  523. package/src/onboarding/invariant-engine.ts +1 -1
  524. package/src/onboarding/memory-compact.ts +5 -4
  525. package/src/onboarding/memory-scaffold.ts +1 -1
  526. package/src/onboarding/nested-agents-generate.ts +45 -4
  527. package/src/onboarding/nested-agents-templates.ts +19 -13
  528. package/src/onboarding/npm-token-check.ts +2 -2
  529. package/src/onboarding/prettierignore.ts +263 -0
  530. package/src/onboarding/profile-validate.ts +5 -4
  531. package/src/onboarding/scaffold-project.ts +38 -27
  532. package/src/onboarding/scaffold.ts +1 -1
  533. package/src/onboarding/skill-markers.ts +162 -0
  534. package/src/onboarding/templates/behavioral-layer-core.md +2 -4
  535. package/src/onboarding/upgrade.ts +285 -89
  536. package/src/onboarding/workspace-discovery.ts +1 -1
  537. package/src/pipeline-status.test.ts +1 -4
  538. package/src/pipeline-status.ts +30 -13
  539. package/src/profiles/stack-profile.ts +1 -1
  540. package/src/registry.ts +4 -4
  541. package/src/skill-schema.ts +4 -1
  542. package/src/tests/acceptance-probe-kinds.test.ts +5 -15
  543. package/src/tests/agents-generate.test.ts +6 -4
  544. package/src/tests/contract-registry.test.ts +12 -6
  545. package/src/tests/doctor-fix.test.ts +1 -4
  546. package/src/tests/doctor-nested-agents.test.ts +53 -1
  547. package/src/tests/editable-generated-region.test.ts +231 -0
  548. package/src/tests/file-size-lint.test.ts +8 -12
  549. package/src/tests/fixtures/agents-generate-business-before.txt +54 -54
  550. package/src/tests/markdown-table.test.ts +107 -0
  551. package/src/tests/prettierignore-manage.test.ts +134 -0
  552. package/src/tests/skill-agents-sync.test.ts +168 -0
  553. package/src/tests/skill-sync-marker.test.ts +134 -0
  554. package/src/tests/skill-validate.test.ts +12 -5
  555. package/src/tests/upgrade.test.ts +87 -41
  556. package/src/types.ts +123 -0
  557. package/src/utils/editable-region.ts +156 -0
  558. package/src/utils/fs-idempotent.ts +12 -6
  559. package/src/utils/generated-marker.ts +36 -2
  560. package/src/utils/index.ts +17 -0
  561. package/src/utils/io.ts +143 -0
  562. package/src/utils/markdown-table.ts +121 -0
  563. package/src/utils/sync-fs.ts +43 -0
  564. package/src/validators/note-frontmatter-validate.ts +1 -1
  565. package/src/validators/note-link-validate.ts +1 -1
  566. package/src/validators/note-orphan-detect.ts +1 -1
  567. package/src/validators/port-validate.ts +1 -1
  568. package/src/validators/skill-validate.ts +38 -13
@@ -1,7 +1,9 @@
1
1
  <!-- knowledge-layer: L2 -->
2
+
2
3
  # learned-principles.md (archive)
3
4
 
4
5
  Archived entries from learned-principles.md. Generated by forge.skill.knowledge.compact (RFC-0662).
6
+
5
7
  ### K-0001: Extend infrastructure before feature logic
6
8
 
7
9
  ```knowledge-entry
@@ -15,6 +17,7 @@ status: superseded
15
17
  ```
16
18
 
17
19
  Promoted to shared layer as shared/K-0003.
20
+
18
21
  ### K-0002: Unknown is not green
19
22
 
20
23
  ```knowledge-entry
@@ -28,6 +31,7 @@ status: superseded
28
31
  ```
29
32
 
30
33
  Promoted to shared layer as shared/K-0001.
34
+
31
35
  ### K-0003: Quality claims bind to immutable identity
32
36
 
33
37
  ```knowledge-entry
@@ -41,6 +45,7 @@ status: superseded
41
45
  ```
42
46
 
43
47
  Promoted to shared layer as shared/K-0001.
48
+
44
49
  ### K-0004: Evaluation must not mutate its subject
45
50
 
46
51
  ```knowledge-entry
@@ -54,6 +59,7 @@ status: superseded
54
59
  ```
55
60
 
56
61
  Promoted to shared layer as shared/K-0004.
62
+
57
63
  ### K-0005: Immutable history and current health are separate
58
64
 
59
65
  ```knowledge-entry
@@ -67,6 +73,7 @@ status: superseded
67
73
  ```
68
74
 
69
75
  Promoted to shared layer as shared/K-0001.
76
+
70
77
  ### K-0006: Migration complexity follows the real estate
71
78
 
72
79
  ```knowledge-entry
@@ -80,6 +87,7 @@ status: superseded
80
87
  ```
81
88
 
82
89
  Promoted to shared layer as shared/K-0003.
90
+
83
91
  ### K-0007: Integrity requires an independent authority
84
92
 
85
93
  ```knowledge-entry
@@ -93,6 +101,7 @@ status: superseded
93
101
  ```
94
102
 
95
103
  Promoted to shared layer as shared/K-0002.
104
+
96
105
  ### K-0008: Historical verification preserves policy bytes
97
106
 
98
107
  ```knowledge-entry
@@ -106,6 +115,7 @@ status: superseded
106
115
  ```
107
116
 
108
117
  Promoted to shared layer as shared/K-0001.
118
+
109
119
  ### K-0009: Distributed evidence uses authority order and immutable cuts
110
120
 
111
121
  ```knowledge-entry
@@ -119,6 +129,7 @@ status: superseded
119
129
  ```
120
130
 
121
131
  Promoted to shared layer as shared/K-0002.
132
+
122
133
  ### K-0010: Bootstrap safety does not create legacy authority
123
134
 
124
135
  ```knowledge-entry
@@ -132,6 +143,7 @@ status: superseded
132
143
  ```
133
144
 
134
145
  Promoted to shared layer as shared/K-0003.
146
+
135
147
  ### K-0011: Documents are execution boundaries
136
148
 
137
149
  ```knowledge-entry
@@ -145,6 +157,7 @@ status: superseded
145
157
  ```
146
158
 
147
159
  Promoted to shared layer as shared/K-0005.
160
+
148
161
  ### K-0012: Supersede decision authority, preserve useful mechanisms deliberately
149
162
 
150
163
  ```knowledge-entry
@@ -158,6 +171,7 @@ status: superseded
158
171
  ```
159
172
 
160
173
  Promoted to shared layer as shared/K-0003.
174
+
161
175
  ### K-0013: Deterministic aggregators need scale contracts
162
176
 
163
177
  ```knowledge-entry
@@ -171,6 +185,7 @@ status: superseded
171
185
  ```
172
186
 
173
187
  Promoted to shared layer as shared/K-0006.
188
+
174
189
  ### K-0014: Canonical identities require a closed snapshot boundary
175
190
 
176
191
  ```knowledge-entry
@@ -184,6 +199,7 @@ status: superseded
184
199
  ```
185
200
 
186
201
  Promoted to shared layer as shared/K-0007.
202
+
187
203
  ### K-0015: Permanent formats profile standards instead of imitating them
188
204
 
189
205
  ```knowledge-entry
@@ -197,6 +213,7 @@ status: superseded
197
213
  ```
198
214
 
199
215
  Promoted to shared layer as shared/K-0007.
216
+
200
217
  ### K-0016: Cutover enforcement starts after executor bootstrap
201
218
 
202
219
  ```knowledge-entry
@@ -10,4 +10,3 @@ Concrete principles distilled from past grilling sessions. Each principle has a
10
10
  - **confirmations:** <N>
11
11
  - **Added:** <date>
12
12
  -->
13
-
@@ -18,6 +18,7 @@ status: active
18
18
 
19
19
  - **Condition:** A consequential durable decision depends on evidence, policy, or artifact state that may later change or become unavailable.
20
20
  - **Recommended answer:** Represent missing, stale, malformed, or unavailable evidence explicitly and fail closed. Bind the decision to immutable subject and policy bytes, preserve its evidence as append-only history, and calculate current health separately rather than rewriting the historical result.
21
+
21
22
  ### K-0002: Integrity requires authority ordering
22
23
 
23
24
  ```knowledge-entry
@@ -32,6 +33,7 @@ status: active
32
33
 
33
34
  - **Condition:** Evidence or events may be produced concurrently, retried, submitted by the artifact author, delivered out of order, or received after a decision closes.
34
35
  - **Recommended answer:** Admit evidence through a separate least-privilege authority that assigns a monotonic sequence and freezes every decision at an explicit evaluation cut. Producer timestamps never determine precedence, self-authored consistency is not authority, and late results create a new decision or incident instead of rewriting history.
36
+
35
37
  ### K-0003: Forward-only cutovers preserve recovery, not legacy authority
36
38
 
37
39
  ```knowledge-entry
@@ -46,6 +48,7 @@ status: active
46
48
 
47
49
  - **Condition:** A forward-only transition replaces an authority model, runtime, toolchain, or deployment contract while still requiring prerequisites and a recoverable first cutover.
48
50
  - **Recommended answer:** Provision and verify the required executor and infrastructure before activating enforcement. Then supersede the old authority through the smallest complete cutover that fits the real estate. Preserve useful old mechanisms only as explicitly non-authorizing infrastructure; permit a narrow, one-time rollback target with explicit closure conditions, never an indefinite compatibility path.
51
+
49
52
  ### K-0004: Evaluation must not mutate its subject
50
53
 
51
54
  ```knowledge-entry
@@ -60,6 +63,7 @@ status: active
60
63
 
61
64
  - **Condition:** A gate, evaluator, audit, review, or certification process discovers a defect in the artifact it judges.
62
65
  - **Recommended answer:** Keep evaluation read-only with respect to the judged artifact. Emit precise, anchored remediation tasks; apply fixes in a separate authoring flow that produces a new artifact identity and a new evidence chain.
66
+
63
67
  ### K-0005: Documents are executable boundaries
64
68
 
65
69
  ```knowledge-entry
@@ -74,6 +78,7 @@ status: active
74
78
 
75
79
  - **Condition:** A specification or implementation document will be executed by another agent—possibly less capable—in an isolated session.
76
80
  - **Recommended answer:** Decompose work into dependency-ordered documents that each define their inputs, outputs, forbidden shortcuts, acceptance evidence, and bounded validation. Every document must leave its affected scope internally consistent; use a final integration document for cross-module laws instead of relying on unstated context.
81
+
77
82
  ### K-0006: Deterministic mechanisms require scale contracts
78
83
 
79
84
  ```knowledge-entry
@@ -88,6 +93,7 @@ status: active
88
93
 
89
94
  - **Condition:** A deterministic evaluator, selector, validator, or aggregator processes potentially growing collections and may gate a consequential transition.
90
95
  - **Recommended answer:** Specify hard input limits, time and memory complexity, overflow behavior, and a deterministic stress fixture. Reject overflow explicitly without truncation or synthesized success, and forbid repeated full scans when an indexed or single-pass design is available.
96
+
91
97
  ### K-0007: Canonical identities use closed snapshots and named standards
92
98
 
93
99
  ```knowledge-entry
@@ -7,6 +7,7 @@ concerns: document-only
7
7
  dependsOn: []
8
8
  languagePolicy: ref(PREFERENCES.md)
9
9
  ---
10
+
10
11
  <!--
11
12
  <MODULE_CONTRACT>
12
13
  <purpose>my-preferences skill — Read, create, or edit the operator's preferences file at the repository root. Run when the operator wants to change language settings for AI conversations, grilling, or project documentation.</purpose>
@@ -21,7 +22,6 @@ Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from
21
22
  </CHANGE_SUMMARY>
22
23
  -->
23
24
 
24
-
25
25
  # my-preferences
26
26
 
27
27
  Before starting, read `PREFERENCES.md` at the repository root. If the file is missing, create it using the semantics below.
@@ -7,6 +7,7 @@ concerns: code-mutation
7
7
  dependsOn: []
8
8
  languagePolicy: ref(PREFERENCES.md)
9
9
  ---
10
+
10
11
  <!--
11
12
  <MODULE_CONTRACT>
12
13
  <purpose>windows-ai-tooling skill — Bootstrap a Windows project for AI agents. Installs verified tools, generates .gitattributes, and emits a command allow-list for agent prompts. Run when starting a new project or when agents fail.</purpose>
@@ -21,7 +22,6 @@ Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from
21
22
  </CHANGE_SUMMARY>
22
23
  -->
23
24
 
24
-
25
25
  # Windows AI Tooling
26
26
 
27
27
  Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
@@ -7,6 +7,7 @@ concerns: read-only
7
7
  dependsOn: []
8
8
  languagePolicy: ref(PREFERENCES.md)
9
9
  ---
10
+
10
11
  <!--
11
12
  <MODULE_CONTRACT>
12
13
  <purpose>writing-great-skills skill — Reference for writing and editing skills well — the vocabulary and principles that make a skill predictable.</purpose>
@@ -21,7 +22,6 @@ Sweep batch 1: add Compass v2 headers to 45 SKILL.md files (purpose derived from
21
22
  </CHANGE_SUMMARY>
22
23
  -->
23
24
 
24
-
25
25
  Before starting, read `PREFERENCES.md` at the repository root. If the file is missing or `aiLanguage` is unset, ask the operator once and create the file using the `my-preferences` skill semantics.
26
26
 
27
27
  A skill exists to wrangle determinism out of a stochastic system. **Predictability** — the agent taking the same _process_ every run, not producing the same output — is the root virtue; every lever below serves it.
@@ -12,7 +12,7 @@
12
12
  </CHANGE_SUMMARY>
13
13
  */
14
14
 
15
- import fs from "node:fs";
15
+ import * as fs from "../utils/sync-fs.ts";
16
16
  import path from "node:path";
17
17
  import { parse as parseYaml } from "yaml";
18
18
  import picomatch from "picomatch";
@@ -19,7 +19,7 @@ Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PU
19
19
  </CHANGE_SUMMARY>
20
20
  */
21
21
 
22
- import fs from "node:fs";
22
+ import * as fs from "../utils/sync-fs.ts";
23
23
  import path from "node:path";
24
24
  import { z } from "zod";
25
25
  import { parse as parseYaml } from "yaml";
@@ -24,8 +24,7 @@ afterEach(() => {
24
24
  });
25
25
 
26
26
  function entry(id: string, title: string, body: string, layer = "L0"): string {
27
- const confirmations =
28
- layer === "L2" ? `lastConfirmedAt: 2026-08-03\nconfirmations: 1\n` : "";
27
+ const confirmations = layer === "L2" ? `lastConfirmedAt: 2026-08-03\nconfirmations: 1\n` : "";
29
28
  return `### ${id}: ${title}\n\n\`\`\`knowledge-entry\nid: ${id}\nlayer: ${layer}\ncreated: 2026-08-03\n${confirmations}status: active\n\`\`\`\n\n${body}\n`;
30
29
  }
31
30
 
@@ -99,11 +98,7 @@ test("merges: local entries preserved, new source entries appended", () => {
99
98
  test("merge into empty template appends all source entries", () => {
100
99
  const src = join(tempDir, "qa-log.md");
101
100
  const dest = join(tempDir, "dest.md");
102
- writeFileSync(
103
- src,
104
- knowledgeFile("L0", [entry("K-0001", "First", "Body one.")]),
105
- "utf8",
106
- );
101
+ writeFileSync(src, knowledgeFile("L0", [entry("K-0001", "First", "Body one.")]), "utf8");
107
102
  // Destination is the shipped empty template (layer marker, no entries)
108
103
  writeFileSync(dest, `<!-- knowledge-layer: L0 -->\n\n# Q&A Log (L0)\n`, "utf8");
109
104
 
@@ -13,7 +13,7 @@
13
13
  */
14
14
 
15
15
  import path from "node:path";
16
- import { readFileSync } from "node:fs";
16
+ import { readFileSync } from "../utils/sync-fs.ts";
17
17
  import { parse as parseYaml } from "yaml";
18
18
  import type { ParsedKnowledgeFile, KnowledgeLayer } from "./schema.ts";
19
19
 
@@ -13,7 +13,7 @@
13
13
  </CHANGE_SUMMARY>
14
14
  */
15
15
 
16
- import fs from "node:fs";
16
+ import * as fs from "../utils/sync-fs.ts";
17
17
  import path from "node:path";
18
18
  import { parse as parseYaml } from "yaml";
19
19
  import type { ParsedKnowledgeFile, KnowledgeEntry, KnowledgeEntryMeta } from "./schema.ts";
@@ -11,7 +11,7 @@
11
11
  </CHANGE_SUMMARY>
12
12
  */
13
13
 
14
- import fs from "node:fs";
14
+ import * as fs from "../utils/sync-fs.ts";
15
15
  import path from "node:path";
16
16
  import { parse as parseYaml } from "yaml";
17
17
  import {
@@ -12,11 +12,11 @@ the synced copy with the package version.</purpose>
12
12
  </non-goals>
13
13
  </MODULE_CONTRACT>
14
14
  <CHANGE_SUMMARY>
15
- <item>2026-09-24: initial append-only knowledge sync — merge by entry-ID union, local wins conflicts, skip divergent non-cumulative files, recurse into declared directories.</item>
15
+ <item>RFC-0660: initial append-only knowledge sync — merge by entry-ID union, local wins conflicts, skip divergent non-cumulative files, recurse into declared directories.</item>
16
16
  </CHANGE_SUMMARY>
17
17
  */
18
18
 
19
- import fs from "node:fs";
19
+ import * as fs from "../utils/sync-fs.ts";
20
20
  import path from "node:path";
21
21
  import { parseKnowledgeFile } from "./parse.ts";
22
22
  import { serializeKnowledgeFile } from "./serialize.ts";
@@ -80,9 +80,7 @@ function planFileSync(srcPath: string, destPath: string): KnowledgeSyncPlan {
80
80
  if (isCumulative(srcParsed) && isCumulative(destParsed)) {
81
81
  const destIds = new Set(destParsed.entries.map((e) => e.meta.id));
82
82
  const appendedEntries = srcParsed.entries.filter((e) => !destIds.has(e.meta.id));
83
- const conflicts = srcParsed.entries
84
- .filter((e) => destIds.has(e.meta.id))
85
- .map((e) => e.meta.id);
83
+ const conflicts = srcParsed.entries.filter((e) => destIds.has(e.meta.id)).map((e) => e.meta.id);
86
84
 
87
85
  const destLegacyTexts = new Set(destParsed.legacySections.map((l) => l.text.trim()));
88
86
  const appendedLegacy = srcParsed.legacySections.filter(
@@ -17,9 +17,9 @@ Sweep batch 4: 73 Compass headers on headerless engine files (certification, com
17
17
  </CHANGE_SUMMARY>
18
18
  */
19
19
 
20
- import fs from "node:fs";
20
+ import * as fs from "../utils/sync-fs.ts";
21
21
  import path from "node:path";
22
- import { execFileSync } from "node:child_process";
22
+ import { execFileSync } from "../utils/sync-fs.ts";
23
23
  import { trashSync } from "../utils/fs-trash-sync.ts";
24
24
  import type { AdapterAnalysis } from "./types.ts";
25
25
 
@@ -16,9 +16,9 @@ Sweep batch 4: 73 Compass headers on headerless engine files (certification, com
16
16
  </CHANGE_SUMMARY>
17
17
  */
18
18
 
19
- import fs from "node:fs";
19
+ import * as fs from "../utils/sync-fs.ts";
20
20
  import path from "node:path";
21
- import { execFileSync } from "node:child_process";
21
+ import { execFileSync } from "../utils/sync-fs.ts";
22
22
 
23
23
  export type IgnoredFileCategoryId = "config" | "data" | "runtime-state" | "cache" | "other";
24
24
 
@@ -13,7 +13,7 @@
13
13
  </CHANGE_SUMMARY>
14
14
  */
15
15
 
16
- import fs from "node:fs";
16
+ import * as fs from "../../utils/sync-fs.ts";
17
17
  import path from "node:path";
18
18
  import type { MigrationAdapter, AdapterAnalysis, MigrationResult, Conflict } from "../types.ts";
19
19
  import { FORGE_PROTECTED_PATHS, DEFAULT_EXCLUDE_PATTERNS } from "../types.ts";
@@ -13,7 +13,7 @@
13
13
  </CHANGE_SUMMARY>
14
14
  */
15
15
 
16
- import fs from "node:fs";
16
+ import * as fs from "../../utils/sync-fs.ts";
17
17
  import path from "node:path";
18
18
  import type { MigrationAdapter, AdapterAnalysis, MigrationResult, Conflict } from "../types.ts";
19
19
  import { FORGE_PROTECTED_PATHS, DEFAULT_EXCLUDE_PATTERNS } from "../types.ts";
@@ -20,13 +20,14 @@ Sweep batch 2: real KEY_DECISIONS on 10 files, expanded purposes (CONTRACT-02/PU
20
20
  </CHANGE_SUMMARY>
21
21
  */
22
22
 
23
- import fs from "node:fs";
23
+ import * as fs from "../utils/sync-fs.ts";
24
+ import { resolveIo } from "../utils/io.ts";
24
25
  import path from "node:path";
25
26
  import { parse as parseYaml } from "yaml";
26
27
  import { loadForgeConfig, resolveBinding, resolveForgePackageRoot, resolveForgeRoot } from "../config/forge-config.ts";
27
28
  import { resolveAllTerminology } from "../profiles/terminology-utils.ts";
28
29
  import { FORGE_SKILLS } from "../registry.ts";
29
- import { buildGeneratedHeader, hasGeneratedMarker, writeFileIfChanged } from "../utils/index.ts";
30
+ import { alignMarkdownTable, buildGeneratedHeader, hasEditableGeneratedMarker, hasGeneratedMarker, mergeEditableGenerated, writeFileIfChanged } from "../utils/index.ts";
30
31
  import { generateNestedAgentsMd } from "./nested-agents-generate.ts";
31
32
  import { listStackProfiles } from "../profiles/stack-profile.ts";
32
33
  import type { StackProfile } from "../profiles/stack-profile.ts";
@@ -140,9 +141,11 @@ function readRegister(workspaceRoot: string): BehavioralRegister {
140
141
  return "business";
141
142
  }
142
143
 
143
- function extractTriggers(workspaceRoot: string): Array<{ name: string; triggers: string[] }> {
144
+ function extractTriggerPhrases(
145
+ workspaceRoot: string,
146
+ ): Array<{ name: string; triggerPhrases: string[] }> {
144
147
  const forgeRoot = path.join(workspaceRoot, "packages", "forge");
145
- const result: Array<{ name: string; triggers: string[] }> = [];
148
+ const result: Array<{ name: string; triggerPhrases: string[] }> = [];
146
149
  for (const skill of FORGE_SKILLS) {
147
150
  if (skill.category !== "fo") continue;
148
151
  const skillPath = path.join(forgeRoot, skill.path);
@@ -151,10 +154,12 @@ function extractTriggers(workspaceRoot: string): Array<{ name: string; triggers:
151
154
  const fmMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
152
155
  if (!fmMatch) continue;
153
156
  const fm = parseYaml(fmMatch[1]) as Record<string, unknown>;
154
- if (Array.isArray(fm["triggers"])) {
157
+ if (Array.isArray(fm["triggerPhrases"])) {
155
158
  result.push({
156
159
  name: skill.name,
157
- triggers: (fm["triggers"] as unknown[]).filter((v): v is string => typeof v === "string"),
160
+ triggerPhrases: (fm["triggerPhrases"] as unknown[]).filter(
161
+ (v): v is string => typeof v === "string",
162
+ ),
158
163
  });
159
164
  }
160
165
  } catch {
@@ -164,21 +169,28 @@ function extractTriggers(workspaceRoot: string): Array<{ name: string; triggers:
164
169
  return result;
165
170
  }
166
171
 
167
- function generateTriggersTable(triggers: Array<{ name: string; triggers: string[] }>): string {
168
- const rows: string[] = [];
169
- for (const { name, triggers: skillTriggers } of triggers) {
172
+ // RFC-1154: emits the full aligned table (header + separator + rows) since
173
+ // column widths depend on substituted trigger rows — the template carries only
174
+ // the {{triggersTable}} placeholder, no static header lines.
175
+ function generateTriggersTable(
176
+ triggerPhrases: Array<{ name: string; triggerPhrases: string[] }>,
177
+ ): string {
178
+ const rows: string[][] = [];
179
+ for (const { name, triggerPhrases: skillTriggers } of triggerPhrases) {
170
180
  if (skillTriggers.length === 0) continue;
171
181
  const display = skillTriggers.map((t) => `"${t}"`).join(", ");
172
- rows.push(`| ${display} | \`${name}\` |`);
182
+ rows.push([display, `\`${name}\``]);
173
183
  }
174
- return rows.length > 0 ? rows.join("\n") + "\n" : "";
184
+ // Always emit the header + separator — even with zero trigger rows the
185
+ // section documents the routing contract (matches pre-RFC-1154 behavior).
186
+ return alignMarkdownTable(["Operator says something like", "Skill"], rows) + "\n";
175
187
  }
176
188
 
177
189
  function generateBehavioralLayer(
178
190
  workspaceRoot: string,
179
191
  register: BehavioralRegister,
180
192
  ): string {
181
- const triggers = extractTriggers(workspaceRoot);
193
+ const triggerPhrases = extractTriggerPhrases(workspaceRoot);
182
194
 
183
195
  let template: string;
184
196
  try {
@@ -187,7 +199,7 @@ function generateBehavioralLayer(
187
199
  return "";
188
200
  }
189
201
 
190
- const triggersTable = generateTriggersTable(triggers);
202
+ const triggersTable = generateTriggersTable(triggerPhrases);
191
203
 
192
204
  let extendedLayer = "";
193
205
  if (register === "creative") {
@@ -225,6 +237,7 @@ export async function runAgentsGenerate(
225
237
  context: ForgeRuntimeContext,
226
238
  ): Promise<ForgeCommandResult<AgentsGenerateResult>> {
227
239
  const { workspaceRoot, logger, outputFormat, dryRun } = context;
240
+ const fio = resolveIo(context.io);
228
241
 
229
242
  let config;
230
243
  try {
@@ -253,8 +266,8 @@ export async function runAgentsGenerate(
253
266
  // Edit guard: never overwrite a hand-written AGENTS.md — skip the root file
254
267
  // with a warning and continue to nested generation (RFC-1150, non-fatal).
255
268
  let rootSkipped = false;
256
- if (!dryRun && fs.existsSync(agentsMdPath)) {
257
- const existing = fs.readFileSync(agentsMdPath, "utf8");
269
+ if (!dryRun && (await fio.exists(agentsMdPath))) {
270
+ const existing = await fio.readFile(agentsMdPath);
258
271
  if (!hasGeneratedMarker(existing)) {
259
272
  rootSkipped = true;
260
273
  if (outputFormat === "pretty") {
@@ -279,14 +292,15 @@ export async function runAgentsGenerate(
279
292
  // Build dynamic sections (skills table, capabilities, behavioral layer)
280
293
  const dynamicLines: string[] = [];
281
294
 
282
- // Skills table
295
+ // Skills table (RFC-1154: emitted prettier-normal via alignMarkdownTable)
283
296
  dynamicLines.push("## Skills");
284
297
  dynamicLines.push("");
285
- dynamicLines.push("| Name | Category | Invocation | Concerns |");
286
- dynamicLines.push("| --- | --- | --- | --- |");
287
- for (const skill of FORGE_SKILLS) {
288
- dynamicLines.push(`| ${skill.name} | ${skill.category} | ${skill.invocation} | ${skill.concerns} |`);
289
- }
298
+ dynamicLines.push(
299
+ alignMarkdownTable(
300
+ ["Name", "Category", "Invocation", "Concerns"],
301
+ FORGE_SKILLS.map((skill) => [skill.name, skill.category, skill.invocation, skill.concerns]),
302
+ ),
303
+ );
290
304
  dynamicLines.push("");
291
305
 
292
306
  // Capabilities section (RFC-0393)
@@ -295,8 +309,6 @@ export async function runAgentsGenerate(
295
309
  dynamicLines.push("");
296
310
  dynamicLines.push("Bindings resolved from `forge.yaml`:");
297
311
  dynamicLines.push("");
298
- dynamicLines.push("| Key | Status | Value |");
299
- dynamicLines.push("| --- | --- | --- |");
300
312
 
301
313
  const bindingKeys = [
302
314
  "commands.validateRfc",
@@ -312,21 +324,23 @@ export async function runAgentsGenerate(
312
324
  "paths.sessionsDir",
313
325
  ];
314
326
 
315
- for (const key of bindingKeys) {
327
+ const capabilityRows: string[][] = bindingKeys.map((key) => {
316
328
  const value = resolveBinding(config, key);
317
329
  const status = value === null ? "absent" : "resolved";
318
330
  const display = value === null ? "—" : typeof value === "string" ? `\`${value}\`` : String(value);
319
- dynamicLines.push(`| ${key} | ${status} | ${display} |`);
320
- }
331
+ return [key, status, display];
332
+ });
321
333
 
322
334
  // compassDocs array
323
335
  const compassDocs = resolveBinding(config, "paths.compassDocs");
324
336
  if (Array.isArray(compassDocs) && compassDocs.length > 0) {
325
- dynamicLines.push(`| paths.compassDocs | resolved | ${compassDocs.map((d) => `\`${d}\``).join(", ")} |`);
337
+ capabilityRows.push(["paths.compassDocs", "resolved", compassDocs.map((d) => `\`${d}\``).join(", ")]);
326
338
  } else {
327
- dynamicLines.push(`| paths.compassDocs | absent | — |`);
339
+ capabilityRows.push(["paths.compassDocs", "absent", "—"]);
328
340
  }
329
341
 
342
+ dynamicLines.push(alignMarkdownTable(["Key", "Status", "Value"], capabilityRows));
343
+
330
344
  // terminology
331
345
  if (config.bindings.terminology && Object.keys(config.bindings.terminology).length > 0) {
332
346
  dynamicLines.push("");
@@ -382,10 +396,37 @@ export async function runAgentsGenerate(
382
396
  } else if (rootSkipped) {
383
397
  skipped.push("AGENTS.md (hand-written)");
384
398
  } else {
385
- await writeFileIfChanged(agentsMdPath, content);
386
- generated.push("AGENTS.md");
387
- if (outputFormat === "pretty") {
388
- logger.success(`Generated ${path.relative(workspaceRoot, agentsMdPath)}`);
399
+ // RFC-1153: merge instead of overwrite — preserve the custom tail below
400
+ // the forge:custom boundary; fail-closed skip when no boundary resolves.
401
+ let existing: string | null = null;
402
+ if (await fio.exists(agentsMdPath)) {
403
+ try {
404
+ existing = await fio.readFile(agentsMdPath);
405
+ } catch {
406
+ // Unreadable — treat as absent; merge will emit a fresh file.
407
+ }
408
+ }
409
+ let merged = mergeEditableGenerated(content, existing, "AGENTS.md");
410
+ if (merged === null) {
411
+ if (existing !== null && !hasEditableGeneratedMarker(existing)) {
412
+ // RFC-0081/RFC-1153: restrictive-marker file is fully generator-owned —
413
+ // upgrade it to the editable boundary contract (fresh render + marker).
414
+ merged = mergeEditableGenerated(content, null, "AGENTS.md");
415
+ } else {
416
+ skipped.push("AGENTS.md (unmapped-customization)");
417
+ if (outputFormat === "pretty") {
418
+ logger.warn(
419
+ "AGENTS.md has custom content but no resolvable boundary — skipping root file (unmapped-customization). Add <!-- forge:custom --> to set the boundary.",
420
+ );
421
+ }
422
+ }
423
+ }
424
+ if (merged !== null) {
425
+ await writeFileIfChanged(agentsMdPath, merged, fio);
426
+ generated.push("AGENTS.md");
427
+ if (outputFormat === "pretty") {
428
+ logger.success(`Generated ${path.relative(workspaceRoot, agentsMdPath)}`);
429
+ }
389
430
  }
390
431
  }
391
432
 
@@ -410,7 +451,7 @@ export async function runAgentsGenerate(
410
451
  // forge root not resolvable — fallback to hardcoded detection
411
452
  }
412
453
  }
413
- const nestedResult = await generateNestedAgentsMd(workspaceRoot, config, dryRun, workspaceTypes);
454
+ const nestedResult = await generateNestedAgentsMd(workspaceRoot, config, dryRun, workspaceTypes, fio);
414
455
  generated.push(...nestedResult.generated);
415
456
  skipped.push(...nestedResult.skipped);
416
457
  Object.assign(renderedFiles, nestedResult.renderedFiles);