forge-workflow 0.0.10 → 0.1.0-beta.2

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 (454) hide show
  1. package/.claude/rules/{greptile-review-process.md → review-process.md} +56 -41
  2. package/.claude/scripts/{greptile-resolve.sh → review-resolve.sh} +13 -3
  3. package/.cursor/rules/permissions-guidance.mdc +2 -2
  4. package/.forge/hooks/check-tdd.js +3 -0
  5. package/.forge/hooks/forge-native-hook.js +245 -0
  6. package/.forge/protected-paths.yaml +157 -0
  7. package/AGENTS.md +150 -61
  8. package/CHANGELOG.md +681 -0
  9. package/CLAUDE.md +9 -118
  10. package/QUICKSTART.md +171 -0
  11. package/README.md +271 -363
  12. package/bin/forge-cmd.js +120 -9
  13. package/bin/forge-preflight.js +26 -5
  14. package/bin/forge.js +461 -489
  15. package/docs/INDEX.md +93 -0
  16. package/docs/PROJECT_DESIGN.md +685 -0
  17. package/docs/architecture/index.md +66 -0
  18. package/docs/architecture/notes/README.md +35 -0
  19. package/docs/architecture/subsystems/README.md +46 -0
  20. package/docs/forge/TOOLCHAIN.md +670 -0
  21. package/docs/forge/VALIDATION.md +82 -0
  22. package/docs/{AGENT_INSTALL_PROMPT.md → guides/AGENT_INSTALL_PROMPT.md} +3 -3
  23. package/docs/guides/BEADS_GITHUB_SYNC.md +32 -0
  24. package/docs/{ENHANCED_ONBOARDING.md → guides/ENHANCED_ONBOARDING.md} +16 -12
  25. package/docs/guides/GREPTILE_SETUP.md +46 -0
  26. package/docs/guides/MANUAL_REVIEW_GUIDE.md +58 -0
  27. package/docs/guides/MIGRATION.md +56 -0
  28. package/docs/guides/SETUP.md +118 -0
  29. package/docs/guides/SUPPORT.md +185 -0
  30. package/docs/guides/WORKFLOW_TEMPLATES.md +74 -0
  31. package/docs/guides/memory-backends.md +183 -0
  32. package/docs/reference/ADAPTERS.md +128 -0
  33. package/docs/reference/AGENT_SKILL_PARITY.md +175 -0
  34. package/docs/reference/COMMANDS.md +205 -0
  35. package/docs/reference/DECISION_DRIFT_GUARDS.md +97 -0
  36. package/docs/{EXAMPLES.md → reference/EXAMPLES.md} +7 -5
  37. package/docs/reference/FORGE_KERNEL_STORAGE_MODEL.md +135 -0
  38. package/docs/reference/HERMES_INTEGRATION.md +118 -0
  39. package/docs/reference/INSIGHTS_RECAP.md +63 -0
  40. package/docs/reference/INSTALL.md +164 -0
  41. package/docs/reference/KERNEL_TAXONOMY_VALIDATION.md +161 -0
  42. package/docs/reference/PROTECTED_PATH_MANIFEST.md +25 -0
  43. package/docs/reference/RELEASE.md +68 -0
  44. package/docs/reference/RESEARCH_TEMPLATE.md +292 -0
  45. package/docs/{ROADMAP.md → reference/ROADMAP.md} +12 -9
  46. package/docs/reference/SKILLS.md +35 -0
  47. package/docs/reference/STATUS_BOARD.md +80 -0
  48. package/docs/reference/TEMPLATES.md +106 -0
  49. package/docs/{TOOLCHAIN.md → reference/TOOLCHAIN.md} +62 -47
  50. package/docs/reference/VALIDATION.md +82 -0
  51. package/docs/reference/agent-permissions.md +169 -0
  52. package/docs/reference/beads-to-kernel-migration-ux.md +61 -0
  53. package/docs/reference/control-plane-guarantees.md +125 -0
  54. package/docs/reference/dependency-chain.md +331 -0
  55. package/docs/reference/forge-kernel-issue-command-contract.md +161 -0
  56. package/docs/reference/forge-kernel-schema.md +72 -0
  57. package/docs/reference/kernel-conflict-evaluators.md +27 -0
  58. package/docs/reference/patch-md-format.md +77 -0
  59. package/docs/reference/protected-state-surfaces.md +59 -0
  60. package/docs/reference/shepherd.md +115 -0
  61. package/docs/reference/superpowers-analysis.md +320 -0
  62. package/docs/reference/superpowers-integration-options.md +404 -0
  63. package/docs/reference/test-environment.md +519 -0
  64. package/docs/reference/upgrade-safety.md +59 -0
  65. package/lefthook.yml +18 -0
  66. package/lib/adapter-cli.js +307 -0
  67. package/lib/adapters/beads-issue-adapter.js +127 -0
  68. package/lib/adapters/beads-kernel-compat.js +1042 -0
  69. package/lib/adapters/greptile-review-adapter.js +141 -0
  70. package/lib/adapters/kernel-issue-adapter.js +101 -0
  71. package/lib/adapters/pr-state-adapter.js +484 -0
  72. package/lib/adoption-profiles.js +126 -0
  73. package/lib/agents/README.md +2 -6
  74. package/lib/agents/claude.plugin.json +3 -8
  75. package/lib/agents/codex.plugin.json +9 -1
  76. package/lib/agents/cursor.plugin.json +2 -6
  77. package/lib/agents/hermes.plugin.json +22 -0
  78. package/lib/agents-config.js +39 -1236
  79. package/lib/audit-evidence.js +282 -0
  80. package/lib/beads-setup.js +121 -0
  81. package/lib/beads-sync-scaffold.js +25 -101
  82. package/lib/codex-skills.js +51 -1
  83. package/lib/commands/_issue.js +741 -77
  84. package/lib/commands/_manifest.js +91 -0
  85. package/lib/commands/_registry.js +85 -34
  86. package/lib/commands/_resolve-command-opts.js +261 -0
  87. package/lib/commands/_serve-security.js +270 -0
  88. package/lib/commands/adapter.js +12 -0
  89. package/lib/commands/add.js +118 -0
  90. package/lib/commands/audit.js +70 -0
  91. package/lib/commands/blocked.js +5 -0
  92. package/lib/commands/board.js +64 -0
  93. package/lib/commands/claim.js +21 -2
  94. package/lib/commands/claims.js +7 -0
  95. package/lib/commands/clean.js +485 -75
  96. package/lib/commands/close.js +2 -2
  97. package/lib/commands/comment.js +5 -0
  98. package/lib/commands/control.js +148 -0
  99. package/lib/commands/create.js +2 -2
  100. package/lib/commands/dev.js +185 -7
  101. package/lib/commands/doc-gate.js +336 -0
  102. package/lib/commands/doctor.js +156 -0
  103. package/lib/commands/explain.js +15 -0
  104. package/lib/commands/export.js +237 -0
  105. package/lib/commands/gate.js +192 -0
  106. package/lib/commands/hooks.js +242 -0
  107. package/lib/commands/inbox.js +118 -0
  108. package/lib/commands/init.js +598 -0
  109. package/lib/commands/insights.js +79 -0
  110. package/lib/commands/issue.js +12 -1
  111. package/lib/commands/issues.js +17 -0
  112. package/lib/commands/lint.js +5 -0
  113. package/lib/commands/list.js +2 -2
  114. package/lib/commands/merge.js +312 -0
  115. package/lib/commands/migrate.js +523 -0
  116. package/lib/commands/new.js +12 -0
  117. package/lib/commands/options.js +241 -0
  118. package/lib/commands/orient.js +13 -0
  119. package/lib/commands/orphans.js +5 -0
  120. package/lib/commands/patch.js +67 -0
  121. package/lib/commands/plan.js +436 -24
  122. package/lib/commands/preflight.js +211 -0
  123. package/lib/commands/prime.js +13 -0
  124. package/lib/commands/push.js +69 -2
  125. package/lib/commands/ready.js +2 -2
  126. package/lib/commands/recall.js +116 -0
  127. package/lib/commands/recap.js +61 -0
  128. package/lib/commands/recommend.js +0 -1
  129. package/lib/commands/release.js +91 -0
  130. package/lib/commands/remember.js +74 -0
  131. package/lib/commands/role.js +99 -0
  132. package/lib/commands/serve.js +581 -0
  133. package/lib/commands/setup.js +838 -972
  134. package/lib/commands/shepherd.js +436 -0
  135. package/lib/commands/ship.js +23 -1
  136. package/lib/commands/show.js +2 -2
  137. package/lib/commands/stage.js +192 -0
  138. package/lib/commands/stale.js +5 -0
  139. package/lib/commands/status.js +158 -21
  140. package/lib/commands/sync.js +34 -46
  141. package/lib/commands/team.js +4 -1
  142. package/lib/commands/test.js +43 -27
  143. package/lib/commands/update.js +2 -2
  144. package/lib/commands/upgrade.js +47 -0
  145. package/lib/commands/validate.js +43 -18
  146. package/lib/commands/worktree.js +307 -100
  147. package/lib/config-writer.js +202 -0
  148. package/lib/control-plane.js +236 -0
  149. package/lib/core/runtime-graph.js +946 -0
  150. package/lib/dep-guard/keyword-ripple.js +2 -2
  151. package/lib/deprecated-sync-cleanup.js +362 -0
  152. package/lib/detect-agent.js +2 -28
  153. package/lib/detect-worktree.js +35 -9
  154. package/lib/doc-gate/declaration.js +177 -0
  155. package/lib/doc-gate/detect.js +289 -0
  156. package/lib/doc-gate/gate.js +375 -0
  157. package/lib/doc-gate/okf-config.js +128 -0
  158. package/lib/doc-gate/okf.js +429 -0
  159. package/lib/docs-command.js +1161 -6
  160. package/lib/forge-issues.js +382 -11
  161. package/lib/forge-lock.js +262 -0
  162. package/lib/gate-events.js +193 -0
  163. package/lib/global-flags.js +74 -0
  164. package/lib/greptile-match.js +7 -63
  165. package/lib/harness-capability-matrix.js +380 -0
  166. package/lib/hook-global-installer.js +347 -0
  167. package/lib/hook-renderer.js +451 -0
  168. package/lib/inbox.js +391 -0
  169. package/lib/insights.js +397 -0
  170. package/lib/issue-adapter.js +156 -0
  171. package/lib/issue-backend.js +145 -0
  172. package/lib/issue-render.js +220 -0
  173. package/lib/kernel/backing-issue.js +305 -0
  174. package/lib/kernel/broker.js +1218 -0
  175. package/lib/kernel/cli-broker-factory.js +130 -0
  176. package/lib/kernel/conflict-signal.js +82 -0
  177. package/lib/kernel/evaluators.js +195 -0
  178. package/lib/kernel/fs-class.js +495 -0
  179. package/lib/kernel/issue-command-contract.js +559 -0
  180. package/lib/kernel/issue-id-resolver.js +186 -0
  181. package/lib/kernel/lease-enforcer.js +158 -0
  182. package/lib/kernel/migrations.js +333 -0
  183. package/lib/kernel/planning-buckets-schema.js +109 -0
  184. package/lib/kernel/projection-jsonl-writer.js +450 -0
  185. package/lib/kernel/readiness-model.js +329 -0
  186. package/lib/kernel/schema.js +356 -0
  187. package/lib/kernel/sqlite-driver.js +2504 -0
  188. package/lib/kernel/taxonomy-validator.js +394 -0
  189. package/lib/lefthook-check.js +3 -2
  190. package/lib/lefthook-wiring.js +413 -0
  191. package/lib/mcp-config-renderer.js +288 -0
  192. package/lib/memory/graphiti-mcp.js +106 -0
  193. package/lib/memory/router.js +387 -0
  194. package/lib/memory/typed-api.js +102 -0
  195. package/lib/memory-digest.js +195 -0
  196. package/lib/merge-rules.js +395 -0
  197. package/lib/migrate-dry-run.js +466 -0
  198. package/lib/orientation.js +863 -0
  199. package/lib/package-manager-remediation.js +103 -0
  200. package/lib/package-root.js +381 -0
  201. package/lib/patch-intent.js +890 -0
  202. package/lib/plugin-catalog.js +3 -4
  203. package/lib/plugin-manager.js +0 -5
  204. package/lib/pr-bundle.js +186 -0
  205. package/lib/pr-monitor/differ.js +195 -0
  206. package/lib/pr-monitor/events.js +0 -0
  207. package/lib/pr-monitor/gather.js +124 -0
  208. package/lib/pr-monitor/journal.js +299 -0
  209. package/lib/pr-monitor/monitor.js +146 -0
  210. package/lib/pr-monitor/render-sticky.js +157 -0
  211. package/lib/pr-monitor/watch-lifecycle.js +95 -0
  212. package/lib/pr-monitor/watch.js +247 -0
  213. package/lib/pr-pull.js +1273 -0
  214. package/lib/pr-shepherd.js +494 -0
  215. package/lib/pr-state-validator.js +59 -0
  216. package/lib/preflight/gates.js +237 -0
  217. package/lib/preflight/runner.js +116 -0
  218. package/lib/project-discovery.js +0 -53
  219. package/lib/project-memory.js +99 -497
  220. package/lib/protected-path-manifest.js +281 -0
  221. package/lib/protected-state-surfaces.js +387 -0
  222. package/lib/release-readiness.js +2089 -0
  223. package/lib/reset.js +59 -45
  224. package/lib/review-adapter.js +68 -0
  225. package/lib/rules-sync.js +260 -0
  226. package/lib/runtime-health.js +241 -20
  227. package/lib/safety-config-renderer.js +268 -0
  228. package/lib/setup-action-log.js +1 -7
  229. package/lib/setup.js +27 -65
  230. package/lib/shell-utils.js +76 -6
  231. package/lib/skills-sync.js +330 -0
  232. package/lib/smart-status/scoring.js +17 -3
  233. package/lib/status/beads-snapshot.js +45 -2
  234. package/lib/status/presenter.js +169 -18
  235. package/lib/status/snapshot.js +186 -0
  236. package/lib/sync-backend.js +202 -0
  237. package/lib/untrusted-content.js +52 -0
  238. package/lib/upgrade-safety.js +199 -0
  239. package/lib/workflow/enforce-stage.js +296 -47
  240. package/lib/workflow/stage-transition.js +115 -0
  241. package/lib/workflow/stages.js +30 -6
  242. package/lib/workflow/state-manager.js +11 -22
  243. package/lib/workflow/state.js +23 -1
  244. package/lib/workflow-profiles.js +17 -5
  245. package/package.json +37 -35
  246. package/rules/documentation.md +19 -0
  247. package/rules/kernel-tracking.md +26 -0
  248. package/rules/security.md +22 -0
  249. package/rules/tdd.md +20 -0
  250. package/rules/workflow.md +27 -0
  251. package/scripts/auto-backing-issue.js +47 -0
  252. package/scripts/beads-context.sh +81 -57
  253. package/scripts/beads-upgrade-smoke.sh +24 -3
  254. package/scripts/bootstrap-windows-tools.sh +78 -0
  255. package/scripts/branch-protection.js +2 -3
  256. package/scripts/check-agents.js +34 -137
  257. package/scripts/commitlint.js +3 -1
  258. package/scripts/conflict-detect.sh +3 -0
  259. package/scripts/dep-guard.sh +22 -3
  260. package/scripts/file-index.sh +3 -0
  261. package/scripts/forge-team/lib/claim.sh +34 -18
  262. package/scripts/forge-team/lib/dashboard.sh +61 -86
  263. package/scripts/forge-team/lib/epic.sh +99 -263
  264. package/scripts/forge-team/lib/hooks.sh +26 -28
  265. package/scripts/forge-team/lib/identity.sh +4 -4
  266. package/scripts/forge-team/lib/sync-github.sh +49 -84
  267. package/scripts/forge-team/lib/verify.sh +93 -83
  268. package/scripts/forge-team/lib/workload.sh +41 -65
  269. package/scripts/forge-team/tests/claim.test.sh +25 -19
  270. package/scripts/forge-team/tests/dashboard.test.sh +31 -46
  271. package/scripts/forge-team/tests/epic.test.sh +52 -71
  272. package/scripts/forge-team/tests/hooks.test.sh +38 -50
  273. package/scripts/forge-team/tests/identity.test.sh +3 -3
  274. package/scripts/forge-team/tests/integration.test.sh +44 -66
  275. package/scripts/forge-team/tests/sync-github.test.sh +50 -83
  276. package/scripts/forge-team/tests/verify.test.sh +37 -46
  277. package/scripts/forge-team/tests/workflow-integration.test.sh +4 -4
  278. package/scripts/forge-team/tests/workload.test.sh +32 -66
  279. package/scripts/gen-command-manifest.js +153 -0
  280. package/scripts/gen-embedded-assets.mjs +129 -0
  281. package/scripts/install.ps1 +139 -0
  282. package/scripts/install.sh +268 -0
  283. package/scripts/lib/release-asset.mjs +84 -0
  284. package/scripts/parity-check.mjs +145 -0
  285. package/scripts/parity-check.test.mjs +58 -0
  286. package/scripts/pin-agentic-workflow-images.js +112 -0
  287. package/scripts/pr-coordinator.sh +3 -0
  288. package/scripts/preflight-sonar.eslint.config.mjs +44 -0
  289. package/scripts/preflight.sh +21 -94
  290. package/scripts/protected-state-check.js +104 -0
  291. package/scripts/smart-status.sh +60 -57
  292. package/scripts/spikes/config-race-bench.js +111 -0
  293. package/scripts/spikes/harness-capability-matrix.js +13 -0
  294. package/scripts/spikes/patch-anchor-stability-bench.js +125 -0
  295. package/scripts/spikes/protected-path-manifest.js +20 -0
  296. package/scripts/spikes/skill-auto-invoke-parity.js +292 -0
  297. package/scripts/sync-agent-skills.js +62 -0
  298. package/scripts/sync-utils.sh +3 -0
  299. package/scripts/test-ci-shard.js +13 -6
  300. package/scripts/test.js +95 -12
  301. package/skills/claim-safety/SKILL.md +102 -0
  302. package/skills/claim-safety/evals/evals.json +46 -0
  303. package/{.github/prompts/dev.prompt.md → skills/dev/SKILL.md} +44 -50
  304. package/skills/dev/evals/evals.json +50 -0
  305. package/skills/hermes-forge/SKILL.md +185 -0
  306. package/skills/hermes-forge/evals/evals.json +46 -0
  307. package/skills/issue-basics/SKILL.md +111 -0
  308. package/skills/issue-basics/evals/evals.json +46 -0
  309. package/skills/kernel/SKILL.md +166 -0
  310. package/skills/kernel/evals/evals.json +50 -0
  311. package/skills/memory/SKILL.md +102 -0
  312. package/skills/parallel-deep-research/SKILL.md +14 -11
  313. package/skills/parallel-deep-research/evals/evals.json +11 -27
  314. package/{.github/prompts/plan.prompt.md → skills/plan/SKILL.md} +132 -157
  315. package/skills/plan/evals/evals.json +42 -0
  316. package/skills/research/SKILL.md +195 -0
  317. package/skills/research/evals/evals.json +42 -0
  318. package/{.github/prompts/review.prompt.md → skills/review/SKILL.md} +98 -62
  319. package/skills/review/evals/evals.json +42 -0
  320. package/skills/rollback/SKILL.md +110 -0
  321. package/skills/rollback/evals/evals.json +46 -0
  322. package/skills/rollback/references/methods.md +204 -0
  323. package/{.cursor/commands/rollback.md → skills/rollback/references/workflow-integration.md} +10 -284
  324. package/skills/shepherd/SKILL.md +66 -0
  325. package/skills/shepherd/evals/evals.json +42 -0
  326. package/{.github/prompts/ship.prompt.md → skills/ship/SKILL.md} +81 -45
  327. package/skills/ship/evals/evals.json +42 -0
  328. package/skills/smith/SKILL.md +142 -0
  329. package/skills/smith/evals/evals.json +46 -0
  330. package/skills/smith/references/autonomy-and-gates.md +94 -0
  331. package/{.github/prompts/sonarcloud.prompt.md → skills/sonarcloud/SKILL.md} +14 -3
  332. package/skills/sonarcloud/evals/evals.json +46 -0
  333. package/skills/sonarcloud-analysis/SKILL.md +18 -13
  334. package/skills/sonarcloud-analysis/evals/evals.json +11 -15
  335. package/{.github/prompts/status.prompt.md → skills/status/SKILL.md} +20 -10
  336. package/skills/status/evals/evals.json +50 -0
  337. package/skills/triage-ready/SKILL.md +121 -0
  338. package/skills/triage-ready/evals/evals.json +42 -0
  339. package/{.github/prompts/validate.prompt.md → skills/validate/SKILL.md} +52 -29
  340. package/skills/validate/evals/evals.json +42 -0
  341. package/skills/verify/SKILL.md +299 -0
  342. package/skills/verify/evals/evals.json +50 -0
  343. package/.claude/commands/dev.md +0 -345
  344. package/.claude/commands/plan.md +0 -566
  345. package/.claude/commands/premerge.md +0 -186
  346. package/.claude/commands/research.md +0 -42
  347. package/.claude/commands/review.md +0 -451
  348. package/.claude/commands/rollback.md +0 -721
  349. package/.claude/commands/ship.md +0 -213
  350. package/.claude/commands/sonarcloud.md +0 -152
  351. package/.claude/commands/status.md +0 -90
  352. package/.claude/commands/validate.md +0 -288
  353. package/.claude/commands/verify.md +0 -269
  354. package/.claude/rules/workflow.md +0 -121
  355. package/.cline/workflows/dev.md +0 -342
  356. package/.cline/workflows/plan.md +0 -563
  357. package/.cline/workflows/premerge.md +0 -183
  358. package/.cline/workflows/research.md +0 -39
  359. package/.cline/workflows/review.md +0 -448
  360. package/.cline/workflows/rollback.md +0 -718
  361. package/.cline/workflows/ship.md +0 -210
  362. package/.cline/workflows/sonarcloud.md +0 -146
  363. package/.cline/workflows/status.md +0 -87
  364. package/.cline/workflows/validate.md +0 -285
  365. package/.cline/workflows/verify.md +0 -266
  366. package/.codex/config.toml +0 -11
  367. package/.codex/skills/dev/SKILL.md +0 -345
  368. package/.codex/skills/plan/SKILL.md +0 -566
  369. package/.codex/skills/premerge/SKILL.md +0 -186
  370. package/.codex/skills/research/SKILL.md +0 -42
  371. package/.codex/skills/review/SKILL.md +0 -451
  372. package/.codex/skills/rollback/SKILL.md +0 -721
  373. package/.codex/skills/ship/SKILL.md +0 -213
  374. package/.codex/skills/sonarcloud/SKILL.md +0 -149
  375. package/.codex/skills/status/SKILL.md +0 -90
  376. package/.codex/skills/validate/SKILL.md +0 -288
  377. package/.codex/skills/verify/SKILL.md +0 -269
  378. package/.cursor/commands/dev.md +0 -342
  379. package/.cursor/commands/plan.md +0 -563
  380. package/.cursor/commands/premerge.md +0 -183
  381. package/.cursor/commands/research.md +0 -39
  382. package/.cursor/commands/review.md +0 -448
  383. package/.cursor/commands/ship.md +0 -210
  384. package/.cursor/commands/sonarcloud.md +0 -146
  385. package/.cursor/commands/status.md +0 -87
  386. package/.cursor/commands/validate.md +0 -285
  387. package/.cursor/commands/verify.md +0 -266
  388. package/.cursorrules +0 -149
  389. package/.github/prompts/premerge.prompt.md +0 -188
  390. package/.github/prompts/research.prompt.md +0 -44
  391. package/.github/prompts/rollback.prompt.md +0 -723
  392. package/.github/prompts/verify.prompt.md +0 -271
  393. package/.github/workflows/beads-to-github.yml +0 -89
  394. package/.github/workflows/github-to-beads.yml +0 -100
  395. package/.kilocode/workflows/dev.md +0 -346
  396. package/.kilocode/workflows/plan.md +0 -567
  397. package/.kilocode/workflows/premerge.md +0 -187
  398. package/.kilocode/workflows/research.md +0 -43
  399. package/.kilocode/workflows/review.md +0 -452
  400. package/.kilocode/workflows/rollback.md +0 -722
  401. package/.kilocode/workflows/ship.md +0 -214
  402. package/.kilocode/workflows/sonarcloud.md +0 -150
  403. package/.kilocode/workflows/status.md +0 -91
  404. package/.kilocode/workflows/validate.md +0 -289
  405. package/.kilocode/workflows/verify.md +0 -270
  406. package/.opencode/commands/dev.md +0 -345
  407. package/.opencode/commands/plan.md +0 -566
  408. package/.opencode/commands/premerge.md +0 -186
  409. package/.opencode/commands/research.md +0 -42
  410. package/.opencode/commands/review.md +0 -451
  411. package/.opencode/commands/rollback.md +0 -721
  412. package/.opencode/commands/ship.md +0 -213
  413. package/.opencode/commands/sonarcloud.md +0 -149
  414. package/.opencode/commands/status.md +0 -90
  415. package/.opencode/commands/validate.md +0 -288
  416. package/.opencode/commands/verify.md +0 -269
  417. package/.roo/commands/dev.md +0 -346
  418. package/.roo/commands/plan.md +0 -567
  419. package/.roo/commands/premerge.md +0 -187
  420. package/.roo/commands/research.md +0 -43
  421. package/.roo/commands/review.md +0 -452
  422. package/.roo/commands/rollback.md +0 -722
  423. package/.roo/commands/ship.md +0 -214
  424. package/.roo/commands/sonarcloud.md +0 -150
  425. package/.roo/commands/status.md +0 -91
  426. package/.roo/commands/validate.md +0 -289
  427. package/.roo/commands/verify.md +0 -270
  428. package/docs/BEADS_GITHUB_SYNC.md +0 -281
  429. package/docs/GREPTILE_SETUP.md +0 -400
  430. package/docs/MANUAL_REVIEW_GUIDE.md +0 -106
  431. package/docs/SETUP.md +0 -663
  432. package/docs/VALIDATION.md +0 -363
  433. package/lib/agents/cline.plugin.json +0 -29
  434. package/lib/agents/copilot.plugin.json +0 -24
  435. package/lib/agents/kilocode.plugin.json +0 -22
  436. package/lib/agents/opencode.plugin.json +0 -23
  437. package/lib/agents/roo.plugin.json +0 -30
  438. package/lib/beads-bootstrap.js +0 -225
  439. package/lib/beads-health-check.js +0 -188
  440. package/lib/commands/commands-reset.js +0 -147
  441. package/opencode.json +0 -67
  442. package/scripts/beads-context.test.js +0 -584
  443. package/scripts/github-beads-sync/comment.mjs +0 -64
  444. package/scripts/github-beads-sync/config.mjs +0 -148
  445. package/scripts/github-beads-sync/github-api.mjs +0 -131
  446. package/scripts/github-beads-sync/index.mjs +0 -356
  447. package/scripts/github-beads-sync/label-mapper.mjs +0 -54
  448. package/scripts/github-beads-sync/mapping.mjs +0 -132
  449. package/scripts/github-beads-sync/reverse-sync-cli.mjs +0 -31
  450. package/scripts/github-beads-sync/reverse-sync.mjs +0 -162
  451. package/scripts/github-beads-sync/run-bd.mjs +0 -161
  452. package/scripts/github-beads-sync/sanitize.mjs +0 -121
  453. package/scripts/github-beads-sync.config.json +0 -26
  454. package/scripts/sync-commands.js +0 -600
@@ -0,0 +1,175 @@
1
+ # Agent Skill Parity
2
+
3
+ Forge treats cross-agent skill compatibility as one canonical capability rendered into each harness's native activation surface.
4
+
5
+ This page documents the W0 metadata fixture only. It is not the full Forge extension parity model.
6
+
7
+ For Week 3 planning, see [Week 3 Runtime Capability Packs](../work/2026-04-28-skeleton-pivot/week-3-runtime-capability-packs.md). That plan defines replaceable workflow packs, on-demand skill loading through MCP, runtime-enforced required skill policies, and per-project workflow composition.
8
+
9
+ ## Supported Surfaces
10
+
11
+ Forge supports Claude Code, Codex, Cursor, and Hermes. Hermes is a **CLI-consumed**
12
+ harness: it reads Forge project state through `forge orient` / `forge recap` and
13
+ ships the `hermes-forge` skill (`.hermes/skills`), rather than consuming generated
14
+ rule/MCP/hook files. The W0 metadata fixture below proves the file-surface metadata
15
+ for Claude Code, Cursor, and Codex; Hermes is modeled in the capability matrix
16
+ (`lib/harness-capability-matrix.js`) as CLI-consumed.
17
+
18
+ | Harness | Forge fixture path | Activation metadata | Proof status |
19
+ | --- | --- | --- | --- |
20
+ | Claude Code | `.claude/skills/<name>/SKILL.md` | `description` in `SKILL.md` frontmatter | Proven by metadata fixture |
21
+ | Cursor | `.cursor/rules/<name>.mdc` | `description`, blank `globs`, `alwaysApply: false` | Proven by metadata fixture |
22
+ | Codex CLI | `.codex/skills/<name>/SKILL.md` | `name` and `description` in `SKILL.md` frontmatter | Proven by metadata fixture and Forge packaging helper |
23
+ | Hermes | `.hermes/skills/<name>/SKILL.md` | `name` and `description` in `SKILL.md` frontmatter | CLI-consumed (forge orient/recap); not part of the W0 file-metadata fixture |
24
+
25
+ The shared rule is: keep the skill name, description, and task body canonical, then generate the smallest native wrapper each harness needs.
26
+
27
+ For Codex, this W0 fixture validates Forge's repository packaging surface (`.codex/skills`) plus the metadata needed for installed Codex skills. Codex's documented repo-scope discovery path is `.agents/skills` (scanned cwd → repo root); Forge now generates that mirror at setup and commits it, so a teammate who clones the repo WITHOUT running `forge setup` still gets Forge skills/stages auto-discovered.
28
+
29
+ Cursor rules are included here because `forge-2si5` explicitly asked for `.cursor/rules/*.mdc` evidence. They are not the final Cursor skill target. The broader parity model must treat Cursor Agent Skills as the primary on-demand workflow surface and Cursor rules as the always-on or scoped-policy surface.
30
+
31
+ ## Required Follow-Up: Skills-First Stage Graph
32
+
33
+ Tracked as `forge-wj36`.
34
+
35
+ This follow-up now has a machine-readable contract in `lib/harness-capability-matrix.js`.
36
+ Generate the current evidence artifact with:
37
+
38
+ ```bash
39
+ node scripts/spikes/harness-capability-matrix.js
40
+ ```
41
+
42
+ The output is JSON with three top-level contracts:
43
+
44
+ - `harnesses[]`: Claude, Cursor, Codex, and Hermes capability support across instructions, skills, rules, MCP, hooks, commands, agents/subagents, stages, Beads, typed memory, patch overrides, marketplace trust, extension packs, and the native safety surfaces (tool permissions, AI read/index ignore boundary, execution sandbox).
45
+ - `stageGraph`: canonical Forge workflow stages as skills-first super skills with addressable subskills, plus utility skills such as `status` outside workflow transitions.
46
+ - `rendererContract`: the evidence a renderer must provide before Forge emits broad harness files.
47
+
48
+ Forge stage parity is skills-first across all harnesses. Claude stage skills have
49
+ **no command shim** — the legacy `.claude/commands/` surface was removed (A0d), so
50
+ the stage skill is the authority. Cursor stage skill files are **generated** by
51
+ Forge, though live auto-invocation is not yet proven. Hermes is CLI-consumed and
52
+ reads the stage graph through `forge orient` / `forge recap` (no per-stage file).
53
+
54
+ | Forge stage | Canonical surface | Claude render | Cursor render | Codex render |
55
+ | --- | --- | --- | --- | --- |
56
+ | `plan` | super skill with phases | `.claude/skills/plan/SKILL.md` | `.cursor/skills/plan/SKILL.md` (generated) | `.codex/skills/plan/SKILL.md` |
57
+ | `dev` | super skill with TDD subskills | `.claude/skills/dev/SKILL.md` | `.cursor/skills/dev/SKILL.md` (generated) | `.codex/skills/dev/SKILL.md` |
58
+ | `validate` | super skill with check subskills | `.claude/skills/validate/SKILL.md` | `.cursor/skills/validate/SKILL.md` (generated) | `.codex/skills/validate/SKILL.md` |
59
+ | `ship` | super skill with PR subskills | `.claude/skills/ship/SKILL.md` | `.cursor/skills/ship/SKILL.md` (generated) | `.codex/skills/ship/SKILL.md` |
60
+ | `review` | super skill with feedback subskills | `.claude/skills/review/SKILL.md` | `.cursor/skills/review/SKILL.md` (generated) | `.codex/skills/review/SKILL.md` |
61
+ | `verify` | super skill with post-merge subskills | `.claude/skills/verify/SKILL.md` | `.cursor/skills/verify/SKILL.md` (generated) | `.codex/skills/verify/SKILL.md` |
62
+
63
+ Pre-merge is not a skill or a workflow stage — it is a documentation-and-handoff gate embedded in the `ship` and `review` skills, so it has no parity row.
64
+
65
+ `status` remains a utility skill, not a workflow stage. The stage graph exposes it in `utilitySkills[]` so renderers can still generate status affordances without adding invalid workflow transitions.
66
+
67
+ The legacy `.claude/commands/` surface was removed (A0d): the canonical workflow lives in stage skills and subskills, and the stage skill — not a command shim — is the workflow authority.
68
+
69
+ The super-skill structure should follow the same pattern as rich local skills such as `impeccable`: one top-level skill handles routing and context, while individual subskills or references handle specific phases. For Forge, that means examples like:
70
+
71
+ ```text
72
+ plan/
73
+ SKILL.md
74
+ phases/
75
+ intent_capture/SKILL.md
76
+ research/SKILL.md
77
+ critics/SKILL.md
78
+ synthesis/SKILL.md
79
+ final_lock/SKILL.md
80
+ ```
81
+
82
+ ## Full Extension Parity Scope
83
+
84
+ The full Forge extension parity model must cover more than skills:
85
+
86
+ | Capability | Canonical Forge source | Claude | Cursor | Codex | Required evidence |
87
+ | --- | --- | --- | --- | --- | --- |
88
+ | Project instructions | structured `AGENTS.md` sections | `CLAUDE.md` shim or generated file | `AGENTS.md` (native) + `.cursor/rules/*.mdc` for scoped policy | `AGENTS.md` | semantic section comparison |
89
+ | Skills/playbooks | agentskills.io-compatible `SKILL.md` | `.claude/skills` | `.cursor/skills` | `.codex/skills` packaging source (global `$CODEX_HOME` install) + committed `.agents/skills` repo-local discovery | generated file and trigger metadata |
90
+ | Rules/policies | Forge rule manifest (`rules/<name>.md`) | `AGENTS.md` instruction projection (no always-on `.claude/rules/*` policy bloat) | `.cursor/rules/*.mdc` (rendered from `rules/`) | `AGENTS.md` section | rule target and unsupported-surface notes |
91
+ | MCP tools/resources | Forge MCP manifest | Claude MCP config | `.cursor/mcp.json` | Codex MCP config | config render and server probe |
92
+ | Hooks | Forge hook manifest | Claude hook adapter if supported | unsupported unless verified | Codex hook adapter if supported | supported/unsupported matrix |
93
+ | Commands | Forge stage-skill manifest | `.claude/skills/<stage>` (legacy `.claude/commands` removed in A0d) | stage skills if supported | CLI docs or skill backstop | stage skill is the authority |
94
+ | Agents/subagents | Forge agent role spec | Claude subagents | Cursor agent/subagent config if supported | Codex skill/agent backstop | role mapping or known issue |
95
+ | Marketplace/extensions | `extension.yaml` plus lock metadata | plugin/skills/commands/hooks | skills/rules/`.cursor/mcp.json` config | skills/MCP/hooks | lockfile, SHA, trust, generated targets |
96
+
97
+ The machine-readable matrix intentionally separates similar-looking surfaces:
98
+
99
+ - Skills are on-demand workflows: `.claude/skills/<skill>/SKILL.md`, `.cursor/skills/<skill>/SKILL.md`, and for Codex the `.agents/skills/<skill>/SKILL.md` repo-local discovery mirror (Codex scans it cwd → repo root). All are generated from the canonical `skills/` source; the `.claude`/`.cursor`/`.codex`/`.hermes` mirrors are gitignored and populated at `forge setup`, while `.agents/skills` is committed (kept byte-identical to `skills/` by a pre-commit hook + drift gate) so a fresh clone gets discovery without setup. The global `$CODEX_HOME/skills` install is likewise generated from `skills/`; no committed `.codex/skills` mirror is kept.
100
+ - Rules are policy/context projections rendered from one canonical `rules/<name>.md` source: only Cursor has a first-class native rule surface (`.cursor/rules/<rule>.mdc`); Claude, Codex, and Hermes receive the same policy through their `AGENTS.md` instruction projection (adding always-on `.claude/rules/*` policy files would triple-deliver the same context as token bloat).
101
+ - Commands are removed, not shims: the legacy `.claude/commands/` and `.cursor/commands/` surfaces were removed in A0d. The canonical workflow lives in stage skills (`.claude/skills/<stage>`, `.codex/skills/<stage>`); Codex/Hermes fall back to the stage skill, not a command file.
102
+ - MCP is config plumbing: each harness gets native MCP config only when the matrix records a target path and probe evidence.
103
+ - Hooks are lifecycle adapters: Claude and Codex have native hook targets; Cursor remains a known issue until a hook surface is proven.
104
+ - Distribution is not a skill directory dump: Codex can use plugins and marketplaces; Forge extension packs must carry lock/trust metadata before installation.
105
+
106
+ No broad renderer should be added until its capability has a matrix entry, target path contract, activation metadata contract, machine-readable evidence, and a known-issue record for any unproven harness.
107
+
108
+ ## External Compatibility Pattern
109
+
110
+ The current ecosystem pattern is a canonical payload with native harness renderers:
111
+
112
+ - Claude Code documents skills as `SKILL.md` files whose `description` controls automatic loading, and notes that commands and skills can both expose slash affordances.
113
+ - Cursor documents `.cursor/rules/*.mdc` as persistent scoped context with `description`, `globs`, and `alwaysApply`; Cursor skills are treated by Forge as the on-demand workflow target, while rules remain the policy target.
114
+ - Codex documents skills as reusable workflow packages under `.agents/skills` for repository scope (checked in for the team, scanned cwd → repo root), uses description-based implicit invocation, and uses plugins/marketplaces to distribute reusable skills, MCP servers, hooks, and apps. Forge emits `.codex/skills` packages for the global `$CODEX_HOME` install and now also generates + commits the repo-local `.agents/skills` mirror at setup.
115
+ - AGENTS.md remains the shared instruction projection for agents that read repository instructions directly.
116
+
117
+ Forge adopts that pattern by keeping one canonical Forge capability and rendering the smallest verified native wrapper per harness. It does not duplicate every feature blindly into every directory.
118
+
119
+ Week 3 expands that into a runtime capability registry. The registry must cover skills, commands, hooks, MCPs, ACPs, books/docs, agents, memory policies, protected paths, marketplace metadata, and workflow stages. Harness files should be generated projections from the active project workflow, not the authority.
120
+
121
+ Invocation policy is part of parity. Required skills must be loaded by Forge runtime at stage or gate boundaries; expensive, dangerous, or long-running skills must remain gated, hidden, or execution-only until the user or runtime explicitly requests them.
122
+
123
+ Parity is not accepted until an evaluator cross-checks the resolved workflow graph against generated harness projections and either passes, blocks, or records a known issue with evidence. The evaluator must also propose minimal repair diffs when a customer-installed workflow pack changes the active stage implementation.
124
+
125
+ ## Evidence Command
126
+
127
+ Run the W0 parity fixture from the repository root:
128
+
129
+ ```bash
130
+ node scripts/spikes/skill-auto-invoke-parity.js --json
131
+ ```
132
+
133
+ The JSON output includes:
134
+
135
+ - `harnesses[].passed`
136
+ - `harnesses[].target`
137
+ - `harnesses[].sourceLabel`
138
+ - `sources[]`
139
+ - `proofBoundary`
140
+ - `knownIssues[]`
141
+
142
+ Run the broader capability matrix evidence from the repository root:
143
+
144
+ ```bash
145
+ node scripts/spikes/harness-capability-matrix.js
146
+ ```
147
+
148
+ The JSON output includes:
149
+
150
+ - `harnesses[].capabilities`
151
+ - `stageGraph.stages[].subskills`
152
+ - `stageGraph.stages[].renderTargets`
153
+ - `rendererContract.rendererFamilies`
154
+ - `sources[]`
155
+
156
+ ## Proof Boundary
157
+
158
+ This fixture proves deterministic metadata-surface parity. It does not launch closed-source agent sessions or claim that a live model selected a skill in a proprietary runtime. For Codex specifically, it validates the Forge canonical skill source and metadata (and the committed `.agents/skills` repo-local discovery mirror), not live auto-invocation inside the Codex runtime.
159
+
160
+ If a future release needs live invocation proof, add a separate transcript-producing eval for Claude Code, Cursor, and Codex and keep this fixture as the fast CI gate.
161
+
162
+ ## Known Issues
163
+
164
+ No harness-specific metadata issue is known for this fixture. Live proprietary-agent auto-invocation is intentionally outside this deterministic test and is reported in `proofBoundary`.
165
+
166
+ Known gaps intentionally left for follow-up. Tier-2 work is tracked under kernel epic `90f2f631` (Cross-agent parity Tier 2):
167
+
168
+ - Cursor Agent Skill files ARE generated by Forge at setup (`.cursor/skills`), so the matrix marks Cursor skills/stages `native`; live auto-invocation is simply not asserted by the W0 metadata fixture. `.cursor/rules` remains the policy target.
169
+ - Claude stage distribution is skills-first: the legacy `.claude/commands/` surface was removed (A0d) and the stage skill (`.claude/skills/<stage>`) is the authority — the stage graph no longer emits a command shim.
170
+ - **Hooks (`988ae187`)**: NO harness-native hook file is rendered for ANY harness — all lifecycle enforcement is delivered via Lefthook git hooks. The matrix marks Claude/Codex hooks `contract-only` and Cursor hooks `not-delivered` (Cursor 1.7+ exposes `.cursor/hooks.json`, not yet rendered). Native hook renderers are the deliverable.
171
+ - **Agents/subagents (`802aa4d8`)**: the whole domain is unimplemented — no renderer, manifest, wiring, or tests for any harness. The matrix marks every harness `not-delivered`/`unsupported`. A subagent renderer is the deliverable.
172
+ - **Typed memory (`dce9da46`)**: typed memory is WRITE-ONLY (`insights.js`); no generator projects a memory section into any instruction/rule file. All four typedMemory rows are marked `not-delivered`. A memory-projection renderer is the deliverable.
173
+ - **Codex paths (`55dfeccf`)**: `.codex/skills` is a setup-generated, gitignored local mirror; skills install to the global `$CODEX_HOME/skills`, generated at setup from the canonical `skills/` source. Codex's repo-local discovery path `.agents/skills` is generated from `skills/` and committed (kept byte-identical by a pre-commit hook + drift gate) so a fresh clone gets discovery without `forge setup` (this closes the skills/stages half of `55dfeccf`). Codex MCP remains global-config-only (`$CODEX_HOME/config.toml`), so `(mcp, codex)` is still `not-delivered` at project setup.
174
+ - **Safety domains (`1e68255c`)**: the native safety surfaces are now modeled as three capability rows (`permissions`, `ignore`, `sandbox`) rendered by the `safety` renderer family. `forge setup` auto-writes safe project-local defaults via the tested `lib/safety-config-renderer.js`: Claude tool permissions (`.claude/settings.json` `permissions` — allow the forge/dev workflow, deny `rm -rf`/force-push/secret reads, ask for history-rewrites) and Cursor `.cursorignore` (secrets/`.env`/`node_modules`/build artifacts). Both use read → merge → write, preserving user entries and backing up an unparseable file rather than clobbering it. Defaults are ON but opt-out-able with `FORGE_SKIP_SAFETY_DEFAULTS`. The Claude `ignore` row is `projection` (its read boundary is delivered as `permissions.deny Read(...)` rules; Claude has no `.claudeignore`). **Global-scope-deferred**: Codex `permissions`/`sandbox` are `not-delivered` — `approval_policy`/`sandbox_mode` live in `config.toml` but a project-local `.codex/config.toml` is honored only when the project is trusted in the GLOBAL `$CODEX_HOME/config.toml` (`projects.<path>.trust_level`), which Forge cannot grant during project-local setup (matches the Codex MCP finding, `#311`). Cursor `permissions` and Hermes safety surfaces are `unsupported` (IDE/global-only and CLI-consumed respectively).
175
+ - MCP is now auto-wired project-local for both Claude (`.mcp.json`) and Cursor (`.cursor/mcp.json`) via the tested `lib/mcp-config-renderer.js`. Beads/patch-override state, marketplace trust, and extension packs remain as the matrix records them.
@@ -0,0 +1,205 @@
1
+ # Command Reference
2
+
3
+ This reference documents commands verified against the current package and CLI surfaces. Stage names beginning with `/` are agent workflow stages, not automatically standalone `forge` CLI commands.
4
+
5
+ For stage skills, command projections, and the skills-first roadmap, see [Skills and command projections](SKILLS.md) and [Workflow templates](../guides/WORKFLOW_TEMPLATES.md).
6
+
7
+ ## Package Entrypoints
8
+
9
+ The package exposes:
10
+
11
+ ```text
12
+ forge
13
+ forge-workflow
14
+ forge-preflight
15
+ ```
16
+
17
+ Use `bunx forge ...` for first-run examples. Bare `forge ...` works when the package bin is available on PATH. Command-specific `--help` output is still uneven in the current CLI, so treat this reference as the canonical command list for v0.0.11 docs.
18
+
19
+ ## Setup And Adoption
20
+
21
+ ```bash
22
+ forge init [--profile minimal|standard|full] [--classification critical|standard|refactor] [--harness claude,cursor,codex] [--yes] [--force] [--dry-run]
23
+ forge setup --agents codex --yes
24
+ forge setup --agents claude,cursor
25
+ forge setup --agents claude cursor
26
+ forge setup --all --quick
27
+ forge setup --path ./repo --dry-run
28
+ forge setup --agents claude,cursor
29
+ ```
30
+
31
+ Use `--agents`, not `--agent`.
32
+
33
+ ## Local State
34
+
35
+ ```bash
36
+ forge board --json
37
+ forge options lint
38
+ forge options diff
39
+ forge options why <key>
40
+ forge options stages
41
+ ```
42
+
43
+ `forge options` inspects the runtime graph and `.forge/` adoption config created by `forge init`.
44
+
45
+ `forge status` (full flags below) also supports workflow-state and issue-state inputs used by tests and stage recovery.
46
+
47
+ ## Core Workflow Loop
48
+
49
+ These are the CLI commands behind the default agent workflow template (`/plan -> /dev -> /validate -> /ship`, then the `/review` skill) plus the session-orientation and memory commands agents run alongside it. Verified against `lib/commands/<name>.js` and `forge <cmd> --help`.
50
+
51
+ ```bash
52
+ forge plan "<feature description>"
53
+ forge dev [--issue-id <id>] [--phase red|green|refactor]
54
+ forge validate
55
+ forge ship <feature-slug> [<title>] [--dry-run]
56
+ forge status [--full] [--json]
57
+ forge prime [--budget N] [--json]
58
+ forge orient [--budget N] [--json]
59
+ forge recap <issue> [--budget N] [--json]
60
+ forge recall [query] [--limit N] [--all] [--json]
61
+ forge remember <note> [--tag <label>]... [--json]
62
+ ```
63
+
64
+ - `forge plan` creates the implementation plan, kernel issue, and feature branch/worktree from a researched feature description; it prints the created issue id, branch name, and the suggested next command.
65
+ - `forge dev` runs the TDD development stage with RED/GREEN/REFACTOR phase guidance; `--issue-id` scopes it to a specific kernel issue and `--phase` overrides auto-detection.
66
+ - `forge validate` runs the validation orchestration pipeline (conflict markers, type check, lint, security, tests) with no arguments — see also `bun run check` under Validation And Packaging.
67
+ - `forge ship` creates the pull request from validated feature work (wraps `gh pr create`); `--dry-run` previews without creating a PR.
68
+ - `forge status` is the one-glance orientation command: where you are, what to run next, and your active work; `--full` also shows blocked/stale/recently-completed issues.
69
+ - `forge prime` emits the bounded session-entry orientation envelope agents read at the start of a session.
70
+ - `forge orient` emits bounded project orientation from deterministic source files (broader than `prime`, still token-budgeted via `--budget`).
71
+ - `forge recap <issue>` is the issue-scoped counterpart to `forge orient`/`forge prime` — it summarizes a single issue from the same deterministic file assembly instead of the whole project. Requires an issue id; running it with no id (or `--help`) prints usage only.
72
+ - `forge recall` retrieves project-memory notes from the kernel-backed memory store; omit `query` to list recent notes.
73
+ - `forge remember` persists a project-memory note to the kernel-backed memory store; repeat `--tag` to attach multiple labels.
74
+
75
+ ## Issue Wrappers
76
+
77
+ These commands delegate to the Kernel by default. Beads is used only when explicitly selected — precedence (highest first): the `--issue-backend beads` flag, then `FORGE_ISSUE_BACKEND=beads`, then the `.forge/config.yaml` key `issueBackend: beads`, otherwise the Kernel default. The stable Kernel-era JSON contract is defined in [Forge Kernel issue command contract](forge-kernel-issue-command-contract.md).
78
+
79
+ ```bash
80
+ forge ready
81
+ forge list
82
+ forge show <id>
83
+ forge issue ready --json
84
+ forge issue list --json
85
+ forge issue show <id> --json
86
+ forge issue search <query> --json
87
+ forge issue stats --json
88
+ forge create --title "Title"
89
+ forge update <id>
90
+ forge claim <id>
91
+ forge release <id>
92
+ forge close <id>
93
+ forge issue dep add <issue-id> <blocks-issue-id>
94
+ forge issue dep remove <issue-id> <blocks-issue-id>
95
+ forge issue ...
96
+ forge issues ...
97
+ forge sync
98
+ ```
99
+
100
+ `forge release <id>` is a Kernel command contract and does not have a verified Beads passthrough in this slice.
101
+
102
+ `forge sync` runs Beads/Dolt pull and push behavior when configured. `forge setup --sync` is deprecated and removes old generated GitHub-Beads sync files; future GitHub issue sync belongs to Forge Kernel/server authority.
103
+
104
+ ## Worktrees
105
+
106
+ ```bash
107
+ forge worktree create <slug> --branch <branch-name>
108
+ forge worktree remove <slug>
109
+ forge clean --dry-run
110
+ ```
111
+
112
+ Slugs must not contain `..`, `/`, or `\`.
113
+
114
+ ## Adapters
115
+
116
+ ```bash
117
+ forge new adapter <name> --kind=review --template=greptile
118
+ forge adapter list
119
+ forge adapter test <name> --fixture=<path>
120
+ forge adapter enable <name>
121
+ forge adapter disable <name>
122
+ ```
123
+
124
+ Only review adapters and the Greptile-shaped starter template are currently safe to present as supported.
125
+
126
+ ## Validation And Packaging
127
+
128
+ ```bash
129
+ bun run typecheck
130
+ bun run lint
131
+ bun run check
132
+ bun test --timeout 15000
133
+ npm pack --dry-run
134
+ ```
135
+
136
+ `bun run check` is the project validation pipeline.
137
+
138
+ ## Other Registered CLI Surfaces
139
+
140
+ These commands exist as current CLI surfaces, but many are specialized and should be checked with source or tests before using them in public examples:
141
+
142
+ ```text
143
+ forge audit
144
+ forge explain
145
+ forge docs
146
+ forge doctor
147
+ forge test
148
+ forge push
149
+ forge upgrade
150
+ forge migrate
151
+ forge recommend
152
+ forge add
153
+ ```
154
+
155
+ `forge migrate` is dry-run oriented in the current public docs. Do not present it as a migration executor.
156
+
157
+ ## Doc Gate
158
+
159
+ `forge doc-gate` inspects a repository's documentation structure and enforces that code changes ship with a documentation update. It is a thin CLI wrapper over the validated doc-gate detector and gate.
160
+
161
+ ```bash
162
+ forge doc-gate detect [--json]
163
+ forge doc-gate check --base <ref> --head <ref> [--skip] [--json]
164
+ ```
165
+
166
+ - `detect` runs the repo-structure detector against the current working directory and prints a human-readable summary — detected source surface, toolchain, CI provider, CHANGELOG, and AGENTS.md, plus an overall verdict — or a structured object with `--json`. Any verdict, including `ESCALATE→agent` or `MANUAL-CONFIG`, exits 0; it exits non-zero only on a real error (not a git repository, or no commits yet).
167
+ - `check` compares the `--base` and `--head` refs and **fails when a code change lands without an accompanying documentation update**. A `pass` or `abstain` decision exits 0; a hard `fail` exits 1. Use `--skip` to record an explicit skip without supplying refs.
168
+
169
+ Both subcommands require a git working tree with at least one commit (`HEAD`). The related `forge doc-gate init` (scaffold a doc-gate declaration file) and `forge doc-gate okf` (OKF bundle generation) subcommands are also registered; run `forge doc-gate` with no arguments for full usage.
170
+
171
+ ## Kernel Filesystem Safety
172
+
173
+ The Forge Kernel stores its SQLite database under `.git/forge/kernel.sqlite`. SQLite WAL mode corrupts when a cloud-sync client (OneDrive, Dropbox, Google Drive, iCloud) or a network filesystem (UNC / SMB / NFS / mapped drive) rewrites the database mid-write. A default-on gate in `broker.initialize()` therefore **refuses** to initialize the kernel on those filesystems — the throw happens *before* any database file is created, so nothing is written to the unsafe location.
174
+
175
+ ```bash
176
+ forge doctor # human summary, exits non-zero on a refuse-class path
177
+ forge doctor --json # machine-readable report (schemaVersion 1)
178
+ ```
179
+
180
+ `forge doctor` resolves the exact kernel database path the gate guards and reports its filesystem class **without creating any file**:
181
+
182
+ | Class | Risk tier | Behavior |
183
+ |-------|-----------|----------|
184
+ | `local-ok` | safe | proceed silently |
185
+ | `wsl-cross`, `unknown` | warn | proceed with a warning (fail-open) |
186
+ | `onedrive`, `dropbox`, `gdrive`, `icloud`, `network-unc`, `mapped-network-drive` | refuse | block kernel init |
187
+
188
+ **Escape hatch:** set `FORGE_KERNEL_ALLOW_UNSAFE_FS=1` to downgrade every `refuse` to a warning and proceed at your own risk (intended for reliable network homes, CI sandboxes, and incident recovery). It does not affect `safe`/`warn` classes. On Windows, mapped-drive detection **fails safe**: any probe failure is treated as `unknown` (warn), never silently allowed.
189
+
190
+ ## Agent Workflow Stages
191
+
192
+ The default agent workflow template is:
193
+
194
+ ```text
195
+ /plan -> /dev -> /validate -> /ship -> /review -> /verify
196
+ ```
197
+
198
+ These are stage skills and installed agent workflows. They are intentionally documented separately from current `forge` CLI commands. The workflow is core to Forge, but it is packaged through agent harness files and skills rather than through one CLI command per stage. Pre-merge is not one of these numbered stages or a `/premerge` command; it is a documentation-and-handoff gate embedded in the `/ship` and `/review` stages that finishes docs and confirms CI before merge.
199
+
200
+ Do not document these as current CLI commands unless the matching `lib/commands/<name>.js` file exists:
201
+
202
+ ```text
203
+ forge review
204
+ forge verify
205
+ ```
@@ -0,0 +1,97 @@
1
+ # Decision Drift Guards
2
+
3
+ **Status**: Planning reference for the Forge Kernel authority reset.
4
+ **Canonical decision registry**: [Project design and decision registry](../PROJECT_DESIGN.md).
5
+ **Historical decision log**: [Locked decisions](../work/2026-04-28-skeleton-pivot/locked-decisions.md).
6
+
7
+ ## Purpose
8
+
9
+ Forge has moved from a Beads/Dolt-centered plan to a Forge Kernel authority plan. This document defines the checks that keep future PRs from accidentally drifting back to the old architecture. Current accepted direction is tracked in `docs/PROJECT_DESIGN.md`; historical work-folder decisions are evidence unless promoted there or accepted by Kernel decision event.
10
+
11
+ ## Non-Negotiable Rules
12
+
13
+ 1. Forge Kernel is the issue authority.
14
+ 2. Beads is import/export compatibility only.
15
+ 3. Local mode uses local SQLite WAL broker authority.
16
+ 4. Team mode requires server authority.
17
+ 5. GitHub/Linear are projections only.
18
+ 6. Harness files are generated projections only.
19
+ 7. Skills, MCPs, agents, commands, hooks, scripts, docs/context packs, and extensions are capability providers.
20
+ 8. Forge-owned check commands are the policy engine; agent hooks, Lefthook, and CI are adapters/enforcement surfaces.
21
+ 9. Users configure provider/stage bindings; Forge validates and records them.
22
+ 10. Conflicts are quarantined in Forge before projection.
23
+ 11. Raw prompts/tool logs remain local-only by default.
24
+
25
+ ## Required Doc Updates
26
+
27
+ Any PR changing authority, storage, workflow config, provider loading, issue commands, team sync, Beads migration, or external projections must update:
28
+
29
+ - [PROJECT_DESIGN.md](../PROJECT_DESIGN.md) when accepted/current project direction changes
30
+ - [Architecture index](../architecture/index.md) or scoped `docs/architecture/**` records when architecture-significant behavior is changed or discovered
31
+ - [forge-kernel-authority-control-plane.md](../work/2026-04-28-skeleton-pivot/forge-kernel-authority-control-plane.md)
32
+ - [locked-decisions.md](../work/2026-04-28-skeleton-pivot/locked-decisions.md)
33
+ - [release-plan.md](../work/2026-04-28-skeleton-pivot/release-plan.md)
34
+ - [FORGE_KERNEL_STORAGE_MODEL.md](./FORGE_KERNEL_STORAGE_MODEL.md)
35
+ - the implementation-specific guide/reference doc for the changed surface
36
+
37
+ ## Evaluator Checklist
38
+
39
+ Before a release PR can be considered ready, run or manually answer these checks:
40
+
41
+ ```text
42
+ Authority:
43
+ - Does any path make Beads, GitHub, Linear, D1, or a harness file authoritative?
44
+ - Do issue commands write through Forge Kernel?
45
+
46
+ Storage:
47
+ - Is each new field classified as authority, cache, projection, archive, or config?
48
+ - Is local-only sensitive data protected from server upload by default?
49
+
50
+ Team mode:
51
+ - Are claim/start/close/stage-transition writes blocked when server authority is unavailable?
52
+ - Are stale/reclaimable states visible and auditable?
53
+
54
+ Providers:
55
+ - Are external skills/MCPs/agents/commands/hooks declared as provider capabilities?
56
+ - Are required providers validated before stage execution?
57
+ - Are unknown providers prevented from becoming required without evidence/evaluator support?
58
+
59
+ Projections:
60
+ - Does projection failure leave Forge Kernel state intact?
61
+ - Are dead letters visible with repair actions?
62
+
63
+ Docs:
64
+ - Did the PR update the authority plan, storage model, and release gates if behavior changed?
65
+ - Did the PR update or explicitly leave unchanged docs/PROJECT_DESIGN.md for accepted decision changes?
66
+ - Did the PR answer architecture impact and add/update docs/architecture/** records for architecture-significant changes or discoveries?
67
+ ```
68
+
69
+ ## Forbidden Drift Patterns
70
+
71
+ - Direct `.beads/issues.jsonl` reads as current state authority.
72
+ - `bd` commands as the canonical write path after Kernel command routing lands.
73
+ - GitHub or Linear webhook payloads overwriting Forge-owned fields.
74
+ - D1 reads deciding claims or lease state.
75
+ - Generated Claude/Cursor/Codex files being edited as source of truth.
76
+ - Lefthook or any agent-specific hook treated as the policy source of truth instead of Forge-owned checks plus CI/Kernel gates.
77
+ - Agents using `git commit --no-verify`, `git push --no-verify`, `HUSKY=0`, `LEFTHOOK=0`, `git -c core.hooksPath=...`, script-mediated hook bypasses, or hook removal to bypass Forge workflow gates without explicit audited authorization recorded as Forge/Kernel-compatible evidence.
78
+ - Required skills loaded by prompt discretion instead of WorkflowGraph policy.
79
+ - Silent projection failures.
80
+ - Accepted project direction living only in a work folder, chat transcript, Beads memory, generated summary, or agent prompt without a `docs/PROJECT_DESIGN.md` entry.
81
+ - Architecture-significant behavior, domain rules, constraints, or subsystem facts discovered during work but not captured as an architecture record, ADR, work evidence, or KnowledgeStore proposal.
82
+ - Fixed heartbeat spam as the main liveness signal.
83
+
84
+ ## Release Gate
85
+
86
+ Each Kernel-era release must include a short evaluator note with:
87
+
88
+ ```text
89
+ Authority score:
90
+ Storage score:
91
+ Provider/config score:
92
+ Projection score:
93
+ Security/privacy score:
94
+ Known drift risks:
95
+ ```
96
+
97
+ Target score is 100/100. Anything below 100 needs a documented follow-up or a deliberate locked decision.
@@ -1,5 +1,7 @@
1
1
  # Forge Workflow Examples
2
2
 
3
+ > Historical examples. These transcripts are illustrative, not current setup or timing guarantees. Use [Quickstart](../../QUICKSTART.md), [Workflow templates](../guides/WORKFLOW_TEMPLATES.md), and [Command reference](COMMANDS.md) for current behavior.
4
+
3
5
  Real-world examples showing how to use Forge for different scenarios.
4
6
 
5
7
  ---
@@ -17,7 +19,7 @@ Real-world examples showing how to use Forge for different scenarios.
17
19
 
18
20
  **Task**: Add a health check endpoint
19
21
 
20
- **Estimated Time**: 15 minutes
22
+ **Estimated Time**: Historical example only; do not treat as a guarantee.
21
23
 
22
24
  **Workflow**: Tactical
23
25
 
@@ -88,7 +90,7 @@ git commit -m "feat: add health check endpoint"
88
90
  # URL: https://github.com/you/project/pull/42
89
91
  ```
90
92
 
91
- **Result**: Feature shipped in 15 minutes with tests and documentation.
93
+ **Result**: Historical transcript showing the intended flow with tests and documentation. Do not treat the timing or output as a current guarantee.
92
94
 
93
95
  ---
94
96
 
@@ -473,10 +475,10 @@ forge sync
473
475
 
474
476
  ## Next Steps
475
477
 
476
- 📚 **New to Forge?** → [QUICKSTART.md](../QUICKSTART.md)
478
+ 📚 **New to Forge?** → [QUICKSTART.md](../../QUICKSTART.md)
477
479
 
478
- 📖 **Learn workflow** → [AGENTS.md](../AGENTS.md)
480
+ 📖 **Learn workflow** → [AGENTS.md](../../AGENTS.md)
479
481
 
480
- 🛠️ **Setup tools** → [SETUP.md](SETUP.md)
482
+ 🛠️ **Setup tools** → [SETUP.md](../guides/SETUP.md)
481
483
 
482
484
  💬 **Questions?** → [GitHub Discussions](https://github.com/harshanandak/forge/discussions)
@@ -0,0 +1,135 @@
1
+ # Forge Kernel Storage Model
2
+
3
+ **Status**: Planning reference for the Forge Kernel authority reset.
4
+ **Canonical design**: [Forge Kernel authority control plane](../work/2026-04-28-skeleton-pivot/forge-kernel-authority-control-plane.md).
5
+
6
+ ## Purpose
7
+
8
+ This document defines where Forge Kernel state lives, what is authoritative, what is cached, what is projected, and what is archived. It exists to prevent future implementation work from drifting back into Beads-first, GitHub-first, or harness-first storage.
9
+
10
+ ## Storage Layers
11
+
12
+ ```text
13
+ Authority
14
+ Local mode: local SQLite WAL broker
15
+ Team mode: Cloudflare Durable Object per project
16
+
17
+ Read model
18
+ Local mode: SQLite query tables
19
+ Team mode: D1 query tables
20
+
21
+ Projection state
22
+ Beads export/import status
23
+ GitHub/Linear projection delivery status
24
+ dead letters and repair state
25
+
26
+ Repository exports
27
+ Explicit Kernel projection snapshots for clone/bootstrap/review only
28
+ Not the durability channel for routine local or team writes
29
+
30
+ Archive
31
+ Local evidence archive
32
+ R2 for server-side large evidence/log/artifact bundles
33
+
34
+ Configuration
35
+ .forge/workflow.yaml
36
+ .forge/providers/*.yaml
37
+ .forge/providers.lock later
38
+ generated harness files as projections only
39
+ ```
40
+
41
+ ## Authority Rules
42
+
43
+ 1. Forge Kernel owns issue, claim, stage, run, and projection state.
44
+ 2. Beads is import/export compatibility only.
45
+ 3. GitHub and Linear are server-side projections only.
46
+ 4. Harness files are generated projections only.
47
+ 5. D1 is a read model, not the claim authority.
48
+ 6. Queues retry projection work, not core issue mutations.
49
+ 7. R2 stores large evidence and archives, not hot authority fields.
50
+ 8. Routine close/verify state is never made durable by committing tracker metadata to the protected default branch.
51
+ 9. Repository exports are explicit projection artifacts, not the write-ahead log for normal work.
52
+
53
+ ## Local Mode
54
+
55
+ Local mode is for one user working across one or more local worktrees.
56
+
57
+ Local SQLite WAL broker stores:
58
+
59
+ - issue graph,
60
+ - dependencies and blockers,
61
+ - comments,
62
+ - priorities,
63
+ - claims and stale/reclaim state,
64
+ - stages and substages,
65
+ - worktrees,
66
+ - sessions,
67
+ - runs,
68
+ - event log,
69
+ - local outbox,
70
+ - projection/import/export status.
71
+
72
+ Local mode may work without a server. It must still prevent two local worktrees from double-claiming the same issue.
73
+
74
+ Local mode is intentionally local-only. Closing an issue, recording a run, updating a claim, or saving project knowledge in local mode must not require a Git commit or push. If the user wants another machine or teammate to see that state, Forge must use team mode server authority or an explicit export/import operation.
75
+
76
+ ### SQLite Runtime Driver
77
+
78
+ Forge Kernel local mode uses a builtin SQLite runtime driver. Driver selection must feature-detect `bun:sqlite` first and backup-capable `node:sqlite` second, and must not add a native-compile SQLite package as the default install path.
79
+
80
+ The selected driver must pass conformance checks for WAL mode, `busy_timeout`, transactions, WAL checkpointing, backup creation, and FTS5 before Forge claims real local SQLite authority behavior.
81
+
82
+ ## Team Mode
83
+
84
+ Team mode requires server authority.
85
+
86
+ Cloudflare components:
87
+
88
+ - Worker API validates auth, project membership, and routes requests.
89
+ - Durable Object serializes issue mutations and claims for a project.
90
+ - D1 stores queryable read models for dashboards and reports.
91
+ - Queues run retryable Beads/GitHub/Linear projections.
92
+ - R2 stores optional large evidence, validation artifacts, and archived session bundles.
93
+
94
+ Team mode must block claim/start/close/stage-transition writes when the server cannot accept them.
95
+
96
+ Team mode is the only shared write authority. Cross-machine and multi-user close/verify state must be accepted by the server before Forge reports it as shared truth. Projection workers may update GitHub, Linear, Beads, or explicit export artifacts after acceptance, but projection failure never rolls back the accepted server event.
97
+
98
+ ## Local Versus Server Matrix
99
+
100
+ | Data | Local mode | Team mode | Rule |
101
+ | --- | --- | --- | --- |
102
+ | Issue identity/title/body/type | SQLite authority | Durable Object authority + D1 read model | Server acceptance required in team mode. |
103
+ | Priority/order | SQLite authority | Durable Object authority + D1 read model | Deterministic reorder events. |
104
+ | Dependencies/blockers | SQLite authority | Durable Object authority + D1 read model | Ready queue depends on this. |
105
+ | Comments | SQLite authority | Durable Object authority + D1 read model | Sensitive local-only notes allowed only in local mode. |
106
+ | Claims/leases | SQLite authority | Durable Object authority | Team claims are never offline-authoritative. |
107
+ | Worktree path | SQLite full path | Redacted/normalized server record | Avoid leaking full local paths by default. |
108
+ | Session state | SQLite | Durable Object + D1 read model | Required for team visibility. |
109
+ | Stage/substage state | SQLite | Durable Object + D1 read model | Source for gates and workflow progress. |
110
+ | Run events | SQLite | Durable Object + D1 read model | Raw details may be summarized before upload. |
111
+ | Evidence metadata | SQLite | D1 metadata + optional R2 object | Store pointers and hashes. |
112
+ | Raw prompts/tool logs | Local only by default | Optional redacted R2 archive | Never push by default. |
113
+ | Provider manifests | Project files + local cache | Optional server hash/copy | Required providers need revision agreement. |
114
+ | Workflow config | Project files + local cache | Server copy/hash in team mode | Team writes require config revision agreement. |
115
+ | Beads import source | Local archive | Not uploaded by default | Upload only migration summary if needed. |
116
+ | Beads export output | Local projection | Projection status only | Export failure never rolls back Kernel state. |
117
+ | Kernel repository export | Explicit local export | Explicit server export/projection | Repository files are reviewable snapshots, not hot authority. |
118
+ | GitHub/Linear projection | Local status cache | Server outbox/projection table | Server workers own external projection. |
119
+ | Dead letters/conflicts | SQLite | Durable Object/D1 dead-letter state | Must be visible before release readiness. |
120
+
121
+ ## Drift Guard
122
+
123
+ Any PR that changes storage, authority, sync, projections, issue commands, workflow configuration, or provider loading must answer:
124
+
125
+ ```text
126
+ What is authoritative?
127
+ What is cached?
128
+ What is projected?
129
+ What is archived?
130
+ What remains local-only?
131
+ What requires server acceptance?
132
+ What happens when projection fails?
133
+ ```
134
+
135
+ If those answers change, update this document, the authority plan, and locked decisions.