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,66 @@
1
+ ---
2
+ name: shepherd
3
+ description: >
4
+ Monitor an already-reviewed OPEN pull request toward merge: read the CI/check rollup and the
5
+ branch-protection required-check set, take at most one idempotent action (re-run a flaky
6
+ required check, or post a status reply to a thread), then declare MERGE_READY, PENDING, or
7
+ escalate. Use when the user says "is PR #123 ready to merge yet?", "poll/watch the checks on
8
+ my PR", "the required CI job is flaky — kick off a re-run", "keep an eye on this PR until
9
+ it's green", "babysit the checks after /review", "shepherd PR 45", or "monitor the PR toward
10
+ merge (rebase if behind, --auto-rebase)". NEVER merges (the human merges in the GitHub UI),
11
+ edits code, or resolves review threads. Do NOT use to fix or reply-and-resolve PR feedback
12
+ from Greptile/CodeRabbit/SonarCloud — that is `review`; nor to open/push the PR — that is
13
+ `ship`; nor for the post-merge "CI green on master + close issues" check — that is `verify`;
14
+ nor for a general "where am I / what's in flight" report — that is `status`.
15
+ allowed-tools: Bash, Read, Grep, Glob
16
+ ---
17
+
18
+ Run one bounded monitor pass over a pull request: read CI and check state, take at most one idempotent action, then hand off. Never merges and never resolves review threads.
19
+
20
+ # Shepherd
21
+
22
+ `shepherd` is a **utility command, not a workflow stage.** It automates the polling / rerun / escalation loop that today is done by hand after `/review`. It does **not** replace `/review` (which still owns semantic review and its stage transition) and does **not** perform the pre-merge doc gate (embedded in `/ship` and `/review`).
23
+
24
+ ## Usage
25
+
26
+ ```bash
27
+ forge shepherd <pr-number>
28
+ forge shepherd <pr-number> --auto-rebase # opt-in, default OFF
29
+ ```
30
+
31
+ ## Bounded-pass model (one pass = one invocation)
32
+
33
+ Each `forge shepherd <pr>` invocation is **ONE discrete bounded pass**: it reads PR state, takes at most the allowed Tier-A action, then **exits**. It never sits in-process polling "until merge-ready."
34
+
35
+ This mirrors the project's documented ergonomic from `/review`, the pre-merge gate, and the Greptile process: **poll briefly, then stop and hand off.** Any pass that finds checks still pending exits as `PENDING`, and the next scheduled pass picks up where it left off.
36
+
37
+ A `--watch` affordance, if you want one, lives in an **external scheduler** (e.g. cron or a `/loop`) that re-invokes the bounded pass on an interval with debounce (>= 60s between passes, cancel-in-progress). There is no in-process infinite loop.
38
+
39
+ ## What it never does
40
+
41
+ - **Never merges.** There is no merge action and no server-side auto-merge latch. The shepherd terminates at `MERGE_READY` and hands off to the human, who merges in the GitHub UI (mirroring the pre-merge gate's merge handoff).
42
+ - **Never resolves review threads.** It may post a status **reply** to a thread (via the existing `.claude/scripts/review-resolve.sh reply` helper), but thread **resolution** is semantic and stays with `/review`.
43
+
44
+ ## Action ladder
45
+
46
+ - **Tier-A (autonomous, idempotent, reversible):** re-run a flaky **required** check via `gh run rerun --failed` (capped by a rerun budget). Post status replies to threads (reply only).
47
+ - **Tier-B (opt-in per-flag, default OFF):** `--auto-rebase` rebases onto the base and force-pushes with lease. Preconditions: clean working tree, HEAD unchanged during the pass. A lease rejection is a **hard-stop + escalate** — the shepherd never re-arms the lease, because doing so would clobber the concurrent human push the lease exists to protect.
48
+ - **Tier-C (human escalation):** merge conflicts, required-check failures a rerun did not fix, an unreadable required-check set, unknown mergeability, auth/scope failures, oscillation, and budget exhaustion all stop and escalate with context posted to the PR.
49
+
50
+ ## Merge-readiness gate
51
+
52
+ Merge-ready is declared **only** when the branch-protection required-check set is **known** AND all of it is green AND the branch is not behind base. The required set is read from `gh api repos/{owner}/{repo}/branches/{base}/protection/required_status_checks`. If branch protection is unreadable (insufficient token scope, or the branch is not protected), the shepherd does **not** guess — it escalates with the readable rollup attached.
53
+
54
+ ## Concurrency & safety
55
+
56
+ - The advisory `shepherd:active` marker is **not** mutual exclusion. The real guard is a per-action HEAD-SHA re-read: before any mutating action the shepherd re-reads the head SHA, and if HEAD moved since the pass started it **aborts** the action.
57
+ - Auth taxonomy: token expiry (401) pauses and surfaces; insufficient scope (403) is a permanent **hard-stop**; a secondary rate limit (403 + `Retry-After`) honors the delay and resumes on the next pass.
58
+
59
+ ## Per-harness behavior
60
+
61
+ - **Claude Code / Codex:** invoke `forge shepherd <pr>` directly; an external scheduler may drive repeated bounded passes.
62
+ - **Cursor:** manually-invoked only. Run `forge shepherd <pr>` from a terminal — there is no polling-loop affordance and no hook reliance on this surface.
63
+
64
+ ## State
65
+
66
+ Progress is durable in GitHub: PR **comments** and **labels** plus `git`. There is no separate local state store.
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "query": "Is PR #212 ready to merge yet?",
4
+ "should_trigger": true
5
+ },
6
+ {
7
+ "query": "The lint check on my PR keeps failing intermittently — kick off a re-run of the failed jobs.",
8
+ "should_trigger": true
9
+ },
10
+ {
11
+ "query": "Keep an eye on pull request 88 and tell me when all the required checks pass.",
12
+ "should_trigger": true
13
+ },
14
+ {
15
+ "query": "I just wrapped up /review on this PR — babysit the checks and escalate if it isn't mergeable.",
16
+ "should_trigger": true
17
+ },
18
+ {
19
+ "query": "Shepherd PR 300 and rebase it onto master if it's behind.",
20
+ "should_trigger": true
21
+ },
22
+ {
23
+ "query": "Fix all the CodeRabbit and Greptile comments on my PR and resolve each review thread.",
24
+ "should_trigger": false
25
+ },
26
+ {
27
+ "query": "The PR just merged to master — confirm CI is green there and close the linked issue.",
28
+ "should_trigger": false
29
+ },
30
+ {
31
+ "query": "Push my validated feature branch and open a pull request from the template.",
32
+ "should_trigger": false
33
+ },
34
+ {
35
+ "query": "Where am I in the workflow and what work is still in flight right now?",
36
+ "should_trigger": false
37
+ },
38
+ {
39
+ "query": "Show me the SonarCloud issues flagged on this PR.",
40
+ "should_trigger": false
41
+ }
42
+ ]
@@ -1,14 +1,26 @@
1
1
  ---
2
2
  name: ship
3
- description: Create PR with comprehensive documentation
4
- tools: []
3
+ description: >
4
+ Forge SHIP stage: push the validated feature branch and open a PR populated from the
5
+ project's OWN PR template (design-doc link, Forge issue IDs, real test/commit data), then
6
+ hand off for MANUAL merge; never merges or auto-merges. Use once /validate passes and you
7
+ want a PR on the board. Triggers: "ship it", "ship this branch", "open the PR", "push and
8
+ open a PR", "gh pr create", "checks passed, now cut the PR". Runs branch-freshness +
9
+ parallel-PR merge-sim checks, force-with-lease push, records the ship->review handoff, then
10
+ stops. One stage only; not for: the whole plan->dev->validate->ship->review pipeline or
11
+ drive-to-done (smith); type-check/lint/tests/security first (validate); addressing PR
12
+ comments or resolving Greptile/SonarCloud/CodeRabbit threads on an existing PR (review);
13
+ babysitting an open PR toward merge (shepherd); post-merge CI health check + closing issues
14
+ (verify); reverting an already-shipped change (rollback). If the PR already exists, this is
15
+ not the skill.
16
+ allowed-tools: Bash, Read, Edit, Grep, Glob
5
17
  ---
6
18
 
7
19
  Push code and create a pull request with full context and documentation links.
8
20
 
9
21
  # Ship
10
22
 
11
- This command creates a PR after validation passes.
23
+ This skill creates a PR after validation passes.
12
24
 
13
25
  ## Usage
14
26
 
@@ -21,12 +33,12 @@ This command creates a PR after validation passes.
21
33
  Do NOT create PR until:
22
34
  1. /validate was run in this session with all four outputs shown (type, lint, tests, security)
23
35
  2. All checks confirmed passing — not assumed, not "was passing earlier"
24
- 3. Beads issue is in_progress
36
+ 3. Forge issue is in_progress (`forge issue show <id>` confirms status)
25
37
  4. git branch --show-current output is NOT main or master
26
38
  </HARD-GATE>
27
39
  ```
28
40
 
29
- ## What This Command Does
41
+ ## What This Skill Does
30
42
 
31
43
  ### Step 1: Verify /validate Passed
32
44
  Ensure all four validation checks completed successfully with fresh output in this session.
@@ -67,7 +79,7 @@ If merge simulation finds conflicts:
67
79
  - Display conflicted files
68
80
  - Ask: "Merge conflicts detected with base branch. These PRs should merge first: [list]. Proceed with PR creation anyway? (y/n)"
69
81
  - If `n`: exit cleanly
70
- - If `y`: log override via `bd comments add <id> "Ship override: creating PR despite merge conflicts"`, then continue
82
+ - If `y`: log override via `forge comment <id> "Ship override: creating PR despite merge conflicts"`, then continue
71
83
 
72
84
  After PR creation completes:
73
85
  ```bash
@@ -78,12 +90,14 @@ bash scripts/pr-coordinator.sh auto-label <issue-id>
78
90
  bash scripts/pr-coordinator.sh stale-worktrees 2>&1 || true
79
91
  ```
80
92
 
81
- ### Step 3: Update Beads
93
+ ### Step 3: Record PR Handoff
82
94
  ```bash
83
- bd update <id> --status done
84
- bd sync
95
+ forge comment <id> "PR created: <pr-url>. Awaiting review and merge verification."
96
+ forge sync
85
97
  ```
86
98
 
99
+ Do not mark the Forge issue done during `/ship`. Completion happens only after merge and post-merge verification.
100
+
87
101
  ### Step 4: Push Branch
88
102
 
89
103
  Use `--force-with-lease` because `/validate` may have rebased the branch, rewriting history. This is safe: it only forces the push if the remote branch hasn't been updated by someone else since the last fetch.
@@ -117,9 +131,9 @@ If a PR template exists:
117
131
  2. **Fill in every section** with actual data from the current PR context:
118
132
  - Replace HTML comments (`<!-- ... -->`) with real content
119
133
  - Check applicable checkboxes (`- [x]`)
120
- - Fill in beads issue IDs (replace `beads-xxx` with actual ID)
134
+ - Fill in Forge issue IDs (replace `forge-xxx` with actual ID)
121
135
  - Fill in test results, validation status, and other concrete data
122
- - Reference the design doc: `docs/plans/YYYY-MM-DD-<slug>-design.md`
136
+ - Reference the design doc: `docs/work/YYYY-MM-DD-<slug>/plan.md`
123
137
  3. **Do NOT remove any sections** — fill them all, even if "N/A"
124
138
  4. **Do NOT restructure the template** — keep the project's chosen format
125
139
 
@@ -134,8 +148,8 @@ If no PR template exists, use this minimal fallback:
134
148
  ## Testing
135
149
  [How it was tested, test results]
136
150
 
137
- ## Beads
138
- Closes beads-xxx
151
+ ## Issue
152
+ Closes forge-xxx
139
153
 
140
154
  🤖 Generated with [Claude Code](https://claude.com/claude-code)
141
155
  ```
@@ -148,18 +162,35 @@ gh pr create --title "<type>: <concise description>" --body "<populated-template
148
162
 
149
163
  Rules for the PR body:
150
164
  - **Use the project's template structure** — never substitute your own format
151
- - **Fill in concrete data** — commit counts, test results, actual file paths, real beads IDs
165
+ - **Fill in concrete data** — commit counts, test results, actual file paths, real Forge IDs
152
166
  - **Check applicable checkboxes** — `[x]` for items that apply, `[ ]` for items that don't
153
- - **Include "Closes beads-xxx"** in the Beads section (required for auto-close in /verify)
167
+ - **Include "Closes forge-xxx"** in the Issue section (required for auto-close in /verify)
154
168
 
155
- ### Step 6: Validate Context and Record Stage Transition
169
+ ### Step 6: Confirm Context and Record Stage Transition
156
170
  ```bash
157
- bash scripts/beads-context.sh validate <id>
158
- bash scripts/beads-context.sh stage-transition <id> ship review \
159
- --summary "<PR created, checks pending>" \
160
- --decisions "<template sections filled, beads linked>" \
161
- --artifacts "<PR URL, branch name>" \
162
- --next "<review focus areas>"
171
+ # Confirm the issue carries design + acceptance context (helper when present; otherwise inspect the issue).
172
+ # Only falls back to `forge issue show` when the helper is absent — a real validate failure stays visible.
173
+ if [ -f scripts/beads-context.sh ]; then
174
+ bash scripts/beads-context.sh validate <id>
175
+ else
176
+ forge issue show <id>
177
+ fi
178
+
179
+ # Record the ship→review transition (structured helper when present; kernel-native comment otherwise).
180
+ # The fallback comment mirrors the same envelope the helper emits (Stage:/Summary:/Decisions:/Artifacts:/Next:).
181
+ if [ -f scripts/beads-context.sh ]; then
182
+ bash scripts/beads-context.sh stage-transition <id> ship review \
183
+ --summary "<PR created, checks pending>" \
184
+ --decisions "<template sections filled, issue linked>" \
185
+ --artifacts "<PR URL, branch name>" \
186
+ --next "<review focus areas>"
187
+ else
188
+ forge comment <id> "Stage: ship complete → ready for review
189
+ Summary: <PR created, checks pending>
190
+ Decisions: <template sections filled, issue linked>
191
+ Artifacts: <PR URL, branch name>
192
+ Next: <review focus areas>"
193
+ fi
163
194
  ```
164
195
 
165
196
  ### Team sync after PR
@@ -174,42 +205,47 @@ forge team sync 2>&1 || true
174
205
  forge team verify 2>&1 || true
175
206
  ```
176
207
 
177
- ## Example Output
208
+ ## Output
178
209
 
179
- ```
180
- ✓ Validation: /validate passed (all 4 checks — fresh output confirmed)
181
- ✓ Freshness: Branch is up-to-date with master
182
- ✓ Beads: Marked done & synced (forge-xyz)
183
- ✓ Pushed: feat/stripe-billing
184
- ✓ PR created: https://github.com/.../pull/123
185
- - PR body: Problem → Root Cause → Fix → Value (narrative format)
186
- - Beads linked: forge-xyz
187
- - Implementation details in collapsible section
210
+ `/ship` reports live validation status, branch freshness, Forge issue PR handoff state, push status, PR URL, template sections, linked issue IDs, and CI polling state. Values come from the current branch, issue tracker, and GitHub response; do not copy static IDs, URLs, or branch names into this skill file.
188
211
 
189
- ⏸️ PR created, checks started (Greptile, SonarCloud, GitHub Actions)
190
- Poll for up to 60 seconds. If checks are still pending, stop here.
212
+ When checks are still pending after the polling window, stop after reporting the PR number and direct the next session to `/review <pr-number>` once automated checks complete or new feedback appears.
191
213
 
192
- Next: /review <pr-number> (when automated checks complete or new feedback appears)
193
- ```
214
+ ## Pre-merge gate (before merge)
215
+
216
+ Pre-merge is a doc-update **gate/checkpoint**, not a separate stage — run it here, before the PR is handed off for merge, whenever the change touches anything documented:
217
+
218
+ 1. **Finish the docs on the feature branch** (update only what genuinely changed):
219
+ - `CHANGELOG.md` (always) — entry under `## [Unreleased]` using Keep a Changelog categories, with PR number + issue ID.
220
+ - `README.md` (user-facing), `docs/reference/API_REFERENCE.md` (API), architecture docs (structural).
221
+ - `CLAUDE.md` — **USER section only** (between the USER markers); never touch other managed blocks.
222
+ - `AGENTS.md` (agent config, skills, or cross-agent workflow changes).
223
+ Commit the doc updates to the feature branch and push.
224
+ 2. **Confirm CI is green** — doc commits re-trigger CI; poll briefly (~60s), then hand off if still pending. New review feedback → run `/review` again.
225
+ 3. **Sync the issue store** — `forge sync`.
226
+ 4. **Hand off for MANUAL merge** — present the PR and stop. **Never run `gh pr merge`; never auto-merge.** The user merges in the GitHub UI, then runs `/verify`.
194
227
 
195
228
  ## Integration with Workflow
196
229
 
197
230
  ```
198
- Utility: /status Understand current context before starting
199
- Stage 1: /plan → Design intent → research → branch + worktree + task list
200
- Stage 2: /dev → Implement each task with subagent-driven TDD
201
- Stage 3: /validate Type check, lint, tests, security all fresh output
202
- Stage 4: /ship Push + create PR (you are here)
203
- Stage 5: /review → Address GitHub Actions, Greptile, SonarCloud
204
- Stage 6: /premerge → Update docs, hand off PR to user
205
- Stage 7: /verify → Post-merge CI check on main
231
+ Utility: /status -> Understand current context before starting
232
+
233
+ Default template:
234
+ /plan -> Optional default planner; external planners may satisfy /dev entry
235
+ /dev -> Implement each task with subagent-driven TDD
236
+ /validate -> Type check, lint, tests, security
237
+ /ship -> Push + create PR
238
+ /review -> Address PR feedback
239
+ /verify -> Post-merge health check
240
+
241
+ Pre-merge gate: doc updates + CI-green checkpoint embedded in /ship and /review (not a separate stage).
206
242
  ```
207
243
 
208
244
  ## Tips
209
245
 
210
246
  - **Use the project's PR template**: Always read `.github/pull_request_template.md` (or equivalent) and populate it — never substitute your own format
211
247
  - **Fill every section**: Even if "N/A" — empty/missing sections cause review friction
212
- - **Include "Closes beads-xxx"**: Required for auto-close in /verify
248
+ - **Include "Closes forge-xxx"**: Required for auto-close in /verify
213
249
  - **Concrete data only**: Test counts, file paths, commit SHAs — not placeholder text
214
250
  - **Poll briefly, then stop**: Check PR status for up to 60 seconds, then hand off if checks are still pending
215
251
  - **NO auto-merge**: Always wait for /review phase
@@ -0,0 +1,42 @@
1
+ [
2
+ {
3
+ "query": "Validation came back clean — go ahead and open the pull request for this branch.",
4
+ "should_trigger": true
5
+ },
6
+ {
7
+ "query": "Push my feature branch and raise a PR, and fill in our PR template with the issue and design-doc links.",
8
+ "should_trigger": true
9
+ },
10
+ {
11
+ "query": "Dev's done and all the checks passed, cut me a PR.",
12
+ "should_trigger": true
13
+ },
14
+ {
15
+ "query": "Do a gh pr create for feat/rate-limit using the repo's template, not a hand-written body.",
16
+ "should_trigger": true
17
+ },
18
+ {
19
+ "query": "Everything's green after validate — ship it, but hand it off for me to merge, don't merge it yourself.",
20
+ "should_trigger": true
21
+ },
22
+ {
23
+ "query": "Take forge-42 from planning all the way to a merge-ready PR — plan it, build it TDD, validate, then ship, checking with me at the gates.",
24
+ "should_trigger": false
25
+ },
26
+ {
27
+ "query": "The PR's picked up Greptile and CodeRabbit comments — fix them and resolve the threads.",
28
+ "should_trigger": false
29
+ },
30
+ {
31
+ "query": "Run the type-check, lint, tests and security scan before I push anything.",
32
+ "should_trigger": false
33
+ },
34
+ {
35
+ "query": "Keep watching PR #128 and ping me the moment its checks go green so I can merge.",
36
+ "should_trigger": false
37
+ },
38
+ {
39
+ "query": "The PR merged to master — confirm CI is green there and close the linked issue.",
40
+ "should_trigger": false
41
+ }
42
+ ]
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: smith
3
+ description: >
4
+ The flagship Forge orchestrator: given a goal or a ready issue, it composes the
5
+ stage skills (triage-ready · claim-safety · plan · dev · validate · ship · review
6
+ · verify) into the right path for the work, running autonomously between human
7
+ gates and pausing at them. Use this whenever the user wants to work the next ready
8
+ issue, drive a feature or fix end-to-end, "take this through to a PR", orchestrate
9
+ the whole workflow with human checkpoints, or asks some form of "what should I
10
+ work on and get it done" — even if they never say "smith" or "orchestrate". Reach
11
+ for it especially when the request spans multiple stages (plan → build → ship) or
12
+ asks to keep a human in the loop at intent, plan, or merge. Prefer a single stage
13
+ skill only when the user explicitly wants just that one step (e.g. "just open the
14
+ PR").
15
+ allowed-tools: Read, Bash(forge:*)
16
+ ---
17
+
18
+ # Smith — the orchestrator super-skill
19
+
20
+ Smith is a thin orchestrator. It adds no stage behaviour of its own; every step
21
+ below is an existing skill or `forge` verb. What smith contributes is *judgement*:
22
+ which path to take for this piece of work, and how densely to involve the human.
23
+ It is maximally driving between gates and deliberately stops at them — the goal is
24
+ conversational autonomy, not unattended autonomy.
25
+
26
+ Keep the word "kernel" internal — it is the event store under the hood, not a
27
+ term users should see.
28
+
29
+ Deeper lookup tables live in
30
+ [references/autonomy-and-gates.md](references/autonomy-and-gates.md): read that
31
+ when you calibrate a specific issue or need the exact gate IDs and commands.
32
+
33
+ ## The orchestration procedure
34
+
35
+ 1. **Pick the work with `triage-ready`.** Rank the ready queue
36
+ (`forge issue ready --json`) and explain why the top pick is genuinely
37
+ workable. Readiness is a *derived* model, so recompute it each time rather than
38
+ trusting a remembered "ready" — you want the item that is actually unblocked
39
+ now, not a stale guess. Hand off one issue.
40
+
41
+ 2. **Claim it, then prove you own it, with `claim-safety`.**
42
+ `FORGE_ACTOR=<actor> forge claim <id>`, then `forge issue owns <id>` (exit 0 =
43
+ owned). A claim returning `ok:true` is not proof — a duplicate replay returns
44
+ `ok:true` too, and a live lease can be reclaimed once it expires. Proving
45
+ ownership is what stops two agents from quietly working the same issue. If you
46
+ are not the owner, don't work it; reselect via `triage-ready`.
47
+
48
+ 3. **Calibrate autonomy during planning.** Read the issue's size × importance ×
49
+ complexity, map it to a tier (lean / standard / high), and *propose that tier
50
+ directly to the human* — a short "here's how much oversight I think this needs."
51
+ This proposal is a plain conversational checkpoint at the start of planning; it
52
+ is deliberately **not** itself one of the enforcement gates, so it stays reachable
53
+ even for the Lean tier (which may require no intent gate at all). The human
54
+ confirms or overrides, and the chosen tier decides **which enforcement gates you
55
+ require approval for on this issue** (step 5). Keep the two mechanisms distinct:
56
+ `forge gate enable|disable <gate>` is the **repo-wide default** (a gate the user
57
+ turned off is always skipped), whereas the per-issue tier is *your* runtime
58
+ decision about which of the still-enabled gates to actually require for this one
59
+ issue. Matching checkpoint density to stakes is the whole point: a docs typo
60
+ should not drag through a full brainstorm, and a risky refactor should not run
61
+ unattended. When your read is uncertain, lean toward *more* gates — an extra
62
+ approval costs seconds, a missing one can cost a lot of rework. See the
63
+ reference for the tier → gate mapping.
64
+
65
+ 4. **Drive the stages along the path that fits.** Sequence
66
+ `plan → dev → validate → ship → review → verify`, invoking each stage skill as
67
+ its step arrives. The stage skills already encode the TDD, validation, and
68
+ review discipline, so smith's job is only to pick the path by change
69
+ classification (critical / standard / simple / hotfix / docs / refactor): a docs
70
+ typo skips brainstorming and most of the ladder; a critical feature runs the
71
+ full ladder.
72
+
73
+ 5. **Stop at every enabled human gate.** Before advancing past a gate, run:
74
+
75
+ ```bash
76
+ forge gate check <issue> <gate> # exit 0 iff the gate is disabled or approved
77
+ ```
78
+
79
+ On exit 0, proceed. On non-zero, stop and ask the human to
80
+ `forge gate approve <issue> <gate> [--reason "…"]` (or
81
+ `forge gate reject <issue> <gate> --reason "…"` to send it back); inspect
82
+ history any time with `forge gate status <issue>`. Approvals are recorded as
83
+ durable events, which is what lets smith re-check and continue after a crash or
84
+ compaction instead of re-asking. The three human gates are `gate.intent`,
85
+ `gate.plan-approval`, and `gate.merge` (details in the reference).
86
+
87
+ 6. **Re-prove ownership and check readiness before closing.** A lease can expire
88
+ and be reclaimed while you work, so run `forge issue owns <id>` again before you
89
+ close — you don't want to close someone else's issue. Then confirm the tree is
90
+ actually shippable:
91
+
92
+ ```bash
93
+ forge release check --target <version> --json # success:true ⇒ healthy
94
+ ```
95
+
96
+ Close only when ownership holds and readiness is healthy
97
+ (`forge close <id> --reason "…"`), then `forge sync`.
98
+
99
+ ## Autonomy tiers at a glance
100
+
101
+ Full table and the reasoning are in the reference; the short version:
102
+
103
+ - **Lean** — small · simple · low-importance work: enforce just `gate.merge`, or
104
+ run under CI with the human gates disabled.
105
+ - **Standard** (default) — an ordinary feature/bug: enforce `gate.intent`,
106
+ `gate.plan-approval`, and `gate.merge`.
107
+ - **High** — large · important · or complex work: enforce all three, plus
108
+ per-milestone check-ins and a pre-ship pass.
109
+
110
+ The tier is a **per-issue** decision: smith requires `check`/approval only for the
111
+ gates its tier calls for on *this* issue and simply skips the rest — it does not
112
+ toggle repo config per issue. Separately, `forge gate disable <gate-id>` is the
113
+ **repo-wide** off switch (a disabled gate makes `check` fall through for *every*
114
+ issue) — use it when the user never wants that checkpoint at all. So a lean run
115
+ skips a checkpoint by not requiring it for this issue; disabling a gate removes it
116
+ everywhere.
117
+
118
+ ## Reliability
119
+
120
+ - **The human always wins, and uncertainty adds oversight.** Smith proposes a
121
+ tier; it never lowers the human-loop density on its own, and a rejected gate
122
+ sends the work back rather than proceeding.
123
+ - **Re-check gates on resume.** After any interruption, trust the recorded events
124
+ (`check` / `status`), not your memory of what was approved.
125
+ - **Prove ownership twice** — after claiming and again before close/release.
126
+ - **Never bypass a gate or a hook.** A failed gate or failing hook is a stop to
127
+ resolve, not an obstacle to route around (no `LEFTHOOK=0`, no `--no-verify`).
128
+
129
+ ## Fork points
130
+
131
+ Smith is a default assembly, not a fixed ladder — re-carve it:
132
+
133
+ | Knob | Default | How to change |
134
+ |------|---------|---------------|
135
+ | **Stakes heuristic** | size × importance × complexity → tier | Re-weight it (e.g. weight blast-radius or reversibility higher), or map your own change-classes to tiers. |
136
+ | **Tier → gate set** | lean / standard / high (see reference) | Change which human gates each tier enforces; enact per repo with `forge gate enable\|disable <gate-id>`. |
137
+ | **Gate density** | intent · plan-approval · merge | Add a checkpoint (enable a gate or add a per-milestone pause) or drop one (disable it); the human overrides smith's proposal at `gate.intent`. |
138
+ | **Composed flow** | triage → claim → plan → dev → validate → ship → review → verify | Skip stages by change class (docs typo → doc-only path), reorder, or swap in your own `plan`/`dev`/`review` adapter. |
139
+ | **Release target** | `forge release check` default | Pass `--target <version>` for the release you are certifying. |
140
+
141
+ Smith is the assembled hammer; the sub-skills are the head and handle; the gates
142
+ are the grip adjustments. Ship a good default, then let users re-carve it.
@@ -0,0 +1,46 @@
1
+ [
2
+ {
3
+ "query": "Grab the next ready issue off the board and take it all the way through to a PR for me — plan it, build it TDD, validate, and open the PR, but stop and check with me before it actually merges.",
4
+ "should_trigger": true
5
+ },
6
+ {
7
+ "query": "I want you to orchestrate the whole workflow for the payments-webhook feature end to end: design the plan, do the dev, run validation, ship it, handle the review comments — just keep me in the loop at the plan-approval and merge points.",
8
+ "should_trigger": true
9
+ },
10
+ {
11
+ "query": "What should I pick up next? Whatever's highest-priority and ready, claim it and drive it to done with the usual human checkpoints — I don't want to babysit every step but I do want to approve the design and the merge.",
12
+ "should_trigger": true
13
+ },
14
+ {
15
+ "query": "Take issue forge-9k2 from planning through a merged PR. It's a big risky refactor so keep me involved — I want to sign off at intent, at the plan, and per milestone before you push.",
16
+ "should_trigger": true
17
+ },
18
+ {
19
+ "query": "Run the full plan through ship flow on the login-rate-limit bug, but it's a tiny fix so don't over-gate it — just let me approve the merge and go.",
20
+ "should_trigger": true
21
+ },
22
+ {
23
+ "query": "Autonomously work through the ready queue and get each task to a PR, pausing for my approval before any merge.",
24
+ "should_trigger": true
25
+ },
26
+ {
27
+ "query": "Just open the PR for my current branch, it's already validated and I've written the description.",
28
+ "should_trigger": false
29
+ },
30
+ {
31
+ "query": "What stage am I in and what's my active work right now? Anything gone stale?",
32
+ "should_trigger": false
33
+ },
34
+ {
35
+ "query": "Go through the CodeRabbit and SonarCloud comments on PR #288 and address them, then re-request review.",
36
+ "should_trigger": false
37
+ },
38
+ {
39
+ "query": "Create a feature issue for adding dark mode to the settings page, priority 2, and link it under the theming epic.",
40
+ "should_trigger": false
41
+ },
42
+ {
43
+ "query": "Just claim forge-abc for me so nobody else picks it up while I look at it.",
44
+ "should_trigger": false
45
+ }
46
+ ]
@@ -0,0 +1,94 @@
1
+ # Autonomy calibration & human gates — reference
2
+
3
+ Read this when you are calibrating how much to involve the human on a specific
4
+ issue, or when you need the exact gate commands and IDs. `SKILL.md` carries the
5
+ procedure; this file carries the lookup tables and the reasoning behind them.
6
+
7
+ ## The three human gates
8
+
9
+ Forge registers three human gates in the runtime graph as **approval-satisfied
10
+ events** (`requires: []`), additive to the evidence exit-gates. They are the
11
+ points where smith pauses and hands control to the human.
12
+
13
+ | Gate | Fires | What the human is deciding |
14
+ |------|-------|----------------------------|
15
+ | `gate.intent` | before planning / brainstorm | Do we agree on the goal, and on the autonomy tier smith proposed, before any design work? |
16
+ | `gate.plan-approval` | after the design doc + task DAG exist, before `dev` | Is this plan the right one (approve), or should it be redirected? |
17
+ | `gate.merge` | after `review`, before merge | Is the PR good to merge? |
18
+
19
+ The evidence exit-gates — `gate.plan-exit`, `gate.dev-exit`,
20
+ `gate.validate-exit`, `gate.ship-entry` — are a different kind: they are
21
+ satisfied by artifacts *inside* the stage skills (a design doc, TDD tests,
22
+ validation output), not by a human. Smith relies on each stage skill's own exit
23
+ checks for those and does not gate on them itself.
24
+
25
+ ### Why gates are events, not prose
26
+
27
+ Each approval is written to the issue's event stream as a durable
28
+ `gate.approved` / `gate.rejected` record. That is what makes a gated run
29
+ **resume-safe**: if smith is interrupted by a crash or a context compaction, it
30
+ re-reads the event with `check` / `status` on resume and knows whether it may
31
+ proceed — instead of re-asking the human or guessing from memory. Prose in a
32
+ transcript cannot survive a compaction; an event can.
33
+
34
+ ### Gate commands
35
+
36
+ ```bash
37
+ forge gate check <issue> <gate> # exit 0 iff the gate is DISABLED or APPROVED
38
+ forge gate approve <issue> <gate> [--reason] # human records approval (durable event)
39
+ forge gate reject <issue> <gate> --reason # human sends the work back
40
+ forge gate status <issue> [--json] # list this issue's gate events (who/when)
41
+ forge gate enable|disable <gate-id> # repo default toggle: workflow.gates.<id>.enabled
42
+ ```
43
+
44
+ `check` is the enforcement primitive smith calls before advancing past a gate. It
45
+ exits 0 when the gate is disabled for the repo *or* an approval event exists, so a
46
+ disabled gate simply falls through — that is how a lean tier skips a checkpoint.
47
+
48
+ ## Autonomy calibration — stakes → gate density
49
+
50
+ Match checkpoint density to what is at stake. A one-line docs fix and a risky
51
+ refactor need very different amounts of oversight: forcing the docs fix through a
52
+ full brainstorm wastes everyone's time, while letting the refactor run unattended
53
+ risks a large wrong turn. Smith reads the issue's **size × importance ×
54
+ complexity**, proposes a tier at `gate.intent`, and the human confirms or
55
+ overrides.
56
+
57
+ | Tier | Stakes read | Enforced human gates | Extra checkpoints |
58
+ |------|-------------|----------------------|-------------------|
59
+ | **Lean** | small · simple · low-importance (docs typo, one-line fix) | just `gate.merge`, or none under CI | skip the intent brainstorm; lean on CI + the evidence exit-gates |
60
+ | **Standard** (default) | an ordinary feature or bug | `gate.intent` · `gate.plan-approval` · `gate.merge` | the evidence exit-gates as configured |
61
+ | **High** | large · important · or complex (critical feature, risky refactor) | all three human gates, enabled | per-milestone / per-task human check-ins (pause + `forge comment`), an explicit pre-ship review pass |
62
+
63
+ ### How a tier is enacted
64
+
65
+ The tier maps to *which gate events are required* for this issue. The human enacts
66
+ add/drop with `forge gate enable|disable <gate-id>` (the repo default), and smith
67
+ enforces every *enabled* gate via `check`. Because approvals are per-issue events,
68
+ the human can add or drop a checkpoint mid-flight and smith re-reads it on the next
69
+ step — the calibration is not frozen at planning time.
70
+
71
+ ### Why uncertainty adds gates rather than removing them
72
+
73
+ Smith only *proposes* a tier; it never lowers oversight on its own. When its read
74
+ of size/importance/complexity is low-confidence, it defaults to **more**
75
+ checkpoints, because an unwanted extra approval is a few seconds of the human's
76
+ time, while a missed one can mean a large amount of wasted or wrong work. The
77
+ human always wins the final say.
78
+
79
+ ## Composition map — smith invents nothing
80
+
81
+ Every step is an existing skill or `forge` verb; smith only sequences them.
82
+
83
+ | Step | Composed skill / verb |
84
+ |------|-----------------------|
85
+ | Pick work | `triage-ready` (`forge issue ready` / `blocked` / `stats`) |
86
+ | Claim + prove ownership | `claim-safety` (`forge claim` → `forge issue owns`) |
87
+ | Human gates | `forge gate check` / `approve` / `reject` / `status` |
88
+ | Plan | `plan` (intent brainstorm → design doc → task DAG) |
89
+ | Build | `dev` (per-task implementer → spec → quality TDD) |
90
+ | Validate | `validate` (types · lint · security · tests) |
91
+ | Ship | `ship` (push + PR) |
92
+ | Review | `review` (address CI / bot feedback) |
93
+ | Verify | `verify` (post-merge health) |
94
+ | Release readiness | `forge release check --target <version> --json` |