@cluesmith/codev 3.2.4 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
  2. package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-JCbkpAcV.js} +33 -33
  3. package/dashboard-dist/assets/index-JCbkpAcV.js.map +1 -0
  4. package/dashboard-dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +142 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  9. package/dist/agent-farm/commands/cleanup.js +16 -0
  10. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  11. package/dist/agent-farm/commands/inbox.d.ts +42 -0
  12. package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
  13. package/dist/agent-farm/commands/inbox.js +129 -0
  14. package/dist/agent-farm/commands/inbox.js.map +1 -0
  15. package/dist/agent-farm/commands/interrupt.d.ts +20 -0
  16. package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
  17. package/dist/agent-farm/commands/interrupt.js +65 -0
  18. package/dist/agent-farm/commands/interrupt.js.map +1 -0
  19. package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
  20. package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
  21. package/dist/agent-farm/commands/reset/constants.js +52 -0
  22. package/dist/agent-farm/commands/reset/constants.js.map +1 -0
  23. package/dist/agent-farm/commands/reset/context.d.ts +230 -0
  24. package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
  25. package/dist/agent-farm/commands/reset/context.js +428 -0
  26. package/dist/agent-farm/commands/reset/context.js.map +1 -0
  27. package/dist/agent-farm/commands/reset/index.d.ts +192 -0
  28. package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
  29. package/dist/agent-farm/commands/reset/index.js +488 -0
  30. package/dist/agent-farm/commands/reset/index.js.map +1 -0
  31. package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
  32. package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
  33. package/dist/agent-farm/commands/reset/receipt.js +149 -0
  34. package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
  35. package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
  36. package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
  37. package/dist/agent-farm/commands/reset/reorient.js +313 -0
  38. package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
  39. package/dist/agent-farm/commands/reset.d.ts +19 -0
  40. package/dist/agent-farm/commands/reset.d.ts.map +1 -0
  41. package/dist/agent-farm/commands/reset.js +292 -0
  42. package/dist/agent-farm/commands/reset.js.map +1 -0
  43. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  44. package/dist/agent-farm/commands/send.js +49 -8
  45. package/dist/agent-farm/commands/send.js.map +1 -1
  46. package/dist/agent-farm/commands/spawn-worktree.d.ts +105 -6
  47. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  48. package/dist/agent-farm/commands/spawn-worktree.js +289 -66
  49. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  50. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  51. package/dist/agent-farm/commands/spawn.js +13 -1
  52. package/dist/agent-farm/commands/spawn.js.map +1 -1
  53. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  54. package/dist/agent-farm/commands/status.js +80 -8
  55. package/dist/agent-farm/commands/status.js.map +1 -1
  56. package/dist/agent-farm/db/index.d.ts +1 -1
  57. package/dist/agent-farm/db/index.d.ts.map +1 -1
  58. package/dist/agent-farm/db/index.js +80 -1
  59. package/dist/agent-farm/db/index.js.map +1 -1
  60. package/dist/agent-farm/db/mailbox.d.ts +222 -0
  61. package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
  62. package/dist/agent-farm/db/mailbox.js +304 -0
  63. package/dist/agent-farm/db/mailbox.js.map +1 -0
  64. package/dist/agent-farm/db/schema.d.ts +1 -1
  65. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  66. package/dist/agent-farm/db/schema.js +35 -0
  67. package/dist/agent-farm/db/schema.js.map +1 -1
  68. package/dist/agent-farm/db/types.d.ts +45 -0
  69. package/dist/agent-farm/db/types.d.ts.map +1 -1
  70. package/dist/agent-farm/db/types.js.map +1 -1
  71. package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
  72. package/dist/agent-farm/lib/builder-lookup.js +2 -2
  73. package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
  74. package/dist/agent-farm/lib/reconnect-backoff.d.ts +54 -0
  75. package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
  76. package/dist/agent-farm/lib/reconnect-backoff.js +47 -0
  77. package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
  78. package/dist/agent-farm/lib/tower-client.d.ts +16 -6
  79. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  80. package/dist/agent-farm/lib/tower-client.js +37 -6
  81. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  82. package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
  83. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
  84. package/dist/agent-farm/lib/tunnel-client.js +218 -27
  85. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  86. package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
  87. package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
  88. package/dist/agent-farm/servers/cron-delivery.js +80 -0
  89. package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
  90. package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
  91. package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
  92. package/dist/agent-farm/servers/delayed-send.js +165 -0
  93. package/dist/agent-farm/servers/delayed-send.js.map +1 -0
  94. package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
  95. package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
  96. package/dist/agent-farm/servers/gate-profiles.js +113 -0
  97. package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
  98. package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
  99. package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
  100. package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
  101. package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
  102. package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
  103. package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
  104. package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
  105. package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
  106. package/dist/agent-farm/servers/message-write.d.ts +53 -1
  107. package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
  108. package/dist/agent-farm/servers/message-write.js +63 -0
  109. package/dist/agent-farm/servers/message-write.js.map +1 -1
  110. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  111. package/dist/agent-farm/servers/overview.js +23 -4
  112. package/dist/agent-farm/servers/overview.js.map +1 -1
  113. package/dist/agent-farm/servers/render-gate.d.ts +141 -0
  114. package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
  115. package/dist/agent-farm/servers/render-gate.js +251 -0
  116. package/dist/agent-farm/servers/render-gate.js.map +1 -0
  117. package/dist/agent-farm/servers/session-submit.d.ts +90 -0
  118. package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
  119. package/dist/agent-farm/servers/session-submit.js +127 -0
  120. package/dist/agent-farm/servers/session-submit.js.map +1 -0
  121. package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
  122. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  123. package/dist/agent-farm/servers/tower-cron.js +58 -53
  124. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  125. package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
  126. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  127. package/dist/agent-farm/servers/tower-instances.js +78 -16
  128. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  129. package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
  130. package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
  131. package/dist/agent-farm/servers/tower-messages.js +106 -1
  132. package/dist/agent-farm/servers/tower-messages.js.map +1 -1
  133. package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
  134. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  135. package/dist/agent-farm/servers/tower-routes.js +670 -105
  136. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  137. package/dist/agent-farm/servers/tower-server.js +163 -31
  138. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  139. package/dist/agent-farm/servers/tower-terminals.d.ts +17 -2
  140. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  141. package/dist/agent-farm/servers/tower-terminals.js +104 -122
  142. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  143. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
  144. package/dist/agent-farm/servers/tower-tunnel.js +63 -4
  145. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  146. package/dist/agent-farm/servers/tower-types.d.ts +2 -1
  147. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  148. package/dist/agent-farm/servers/tower-utils.d.ts +64 -1
  149. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  150. package/dist/agent-farm/servers/tower-utils.js +168 -1
  151. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  152. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  153. package/dist/agent-farm/servers/tower-websocket.js +6 -21
  154. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  155. package/dist/agent-farm/servers/write-queue.d.ts +35 -0
  156. package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
  157. package/dist/agent-farm/servers/write-queue.js +56 -0
  158. package/dist/agent-farm/servers/write-queue.js.map +1 -0
  159. package/dist/agent-farm/types.d.ts +39 -0
  160. package/dist/agent-farm/types.d.ts.map +1 -1
  161. package/dist/agent-farm/utils/agent-names.d.ts +2 -2
  162. package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
  163. package/dist/agent-farm/utils/agent-names.js +3 -3
  164. package/dist/agent-farm/utils/agent-names.js.map +1 -1
  165. package/dist/agent-farm/utils/architect-name.d.ts +2 -2
  166. package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
  167. package/dist/agent-farm/utils/architect-name.js +3 -3
  168. package/dist/agent-farm/utils/architect-name.js.map +1 -1
  169. package/dist/agent-farm/utils/config.d.ts +13 -0
  170. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  171. package/dist/agent-farm/utils/config.js +33 -1
  172. package/dist/agent-farm/utils/config.js.map +1 -1
  173. package/dist/agent-farm/utils/harness.d.ts +103 -7
  174. package/dist/agent-farm/utils/harness.d.ts.map +1 -1
  175. package/dist/agent-farm/utils/harness.js +126 -19
  176. package/dist/agent-farm/utils/harness.js.map +1 -1
  177. package/dist/cli.d.ts.map +1 -1
  178. package/dist/cli.js +6 -32
  179. package/dist/cli.js.map +1 -1
  180. package/dist/commands/consult/cli-options.d.ts +34 -0
  181. package/dist/commands/consult/cli-options.d.ts.map +1 -0
  182. package/dist/commands/consult/cli-options.js +67 -0
  183. package/dist/commands/consult/cli-options.js.map +1 -0
  184. package/dist/commands/consult/index.d.ts +56 -2
  185. package/dist/commands/consult/index.d.ts.map +1 -1
  186. package/dist/commands/consult/index.js +272 -28
  187. package/dist/commands/consult/index.js.map +1 -1
  188. package/dist/commands/consult/metrics.d.ts +42 -0
  189. package/dist/commands/consult/metrics.d.ts.map +1 -1
  190. package/dist/commands/consult/metrics.js +129 -9
  191. package/dist/commands/consult/metrics.js.map +1 -1
  192. package/dist/commands/doctor.d.ts.map +1 -1
  193. package/dist/commands/doctor.js +71 -19
  194. package/dist/commands/doctor.js.map +1 -1
  195. package/dist/commands/porch/checks.d.ts +23 -0
  196. package/dist/commands/porch/checks.d.ts.map +1 -1
  197. package/dist/commands/porch/checks.js +60 -0
  198. package/dist/commands/porch/checks.js.map +1 -1
  199. package/dist/commands/porch/config.d.ts +20 -0
  200. package/dist/commands/porch/config.d.ts.map +1 -1
  201. package/dist/commands/porch/config.js +20 -0
  202. package/dist/commands/porch/config.js.map +1 -1
  203. package/dist/commands/porch/index.js +21 -28
  204. package/dist/commands/porch/index.js.map +1 -1
  205. package/dist/commands/porch/next.d.ts.map +1 -1
  206. package/dist/commands/porch/next.js +2 -41
  207. package/dist/commands/porch/next.js.map +1 -1
  208. package/dist/lib/config.d.ts +69 -3
  209. package/dist/lib/config.d.ts.map +1 -1
  210. package/dist/lib/config.js +67 -3
  211. package/dist/lib/config.js.map +1 -1
  212. package/dist/lib/consult-lanes.d.ts +149 -0
  213. package/dist/lib/consult-lanes.d.ts.map +1 -0
  214. package/dist/lib/consult-lanes.js +360 -0
  215. package/dist/lib/consult-lanes.js.map +1 -0
  216. package/dist/lib/github.js +1 -1
  217. package/dist/lib/github.js.map +1 -1
  218. package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
  219. package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
  220. package/dist/lib/prompt-behavior-metrics.js +290 -0
  221. package/dist/lib/prompt-behavior-metrics.js.map +1 -0
  222. package/dist/lib/skeleton.d.ts +22 -1
  223. package/dist/lib/skeleton.d.ts.map +1 -1
  224. package/dist/lib/skeleton.js +120 -0
  225. package/dist/lib/skeleton.js.map +1 -1
  226. package/dist/lib/test-env.d.ts +74 -0
  227. package/dist/lib/test-env.d.ts.map +1 -0
  228. package/dist/lib/test-env.js +92 -0
  229. package/dist/lib/test-env.js.map +1 -0
  230. package/dist/terminal/pty-manager.d.ts +2 -0
  231. package/dist/terminal/pty-manager.d.ts.map +1 -1
  232. package/dist/terminal/pty-manager.js +16 -6
  233. package/dist/terminal/pty-manager.js.map +1 -1
  234. package/dist/terminal/pty-session.d.ts +131 -0
  235. package/dist/terminal/pty-session.d.ts.map +1 -1
  236. package/dist/terminal/pty-session.js +232 -39
  237. package/dist/terminal/pty-session.js.map +1 -1
  238. package/dist/terminal/ring-buffer.d.ts +39 -6
  239. package/dist/terminal/ring-buffer.d.ts.map +1 -1
  240. package/dist/terminal/ring-buffer.js +74 -6
  241. package/dist/terminal/ring-buffer.js.map +1 -1
  242. package/dist/terminal/session-manager.d.ts +53 -0
  243. package/dist/terminal/session-manager.d.ts.map +1 -1
  244. package/dist/terminal/session-manager.js +94 -9
  245. package/dist/terminal/session-manager.js.map +1 -1
  246. package/dist/terminal/session-screen.d.ts +91 -0
  247. package/dist/terminal/session-screen.d.ts.map +1 -0
  248. package/dist/terminal/session-screen.js +135 -0
  249. package/dist/terminal/session-screen.js.map +1 -0
  250. package/dist/terminal/shellper-main.js +2 -1
  251. package/dist/terminal/shellper-main.js.map +1 -1
  252. package/dist/terminal/shellper-process.d.ts +1 -1
  253. package/dist/terminal/shellper-process.d.ts.map +1 -1
  254. package/dist/terminal/shellper-process.js +17 -8
  255. package/dist/terminal/shellper-process.js.map +1 -1
  256. package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
  257. package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
  258. package/dist/terminal/shellper-replay-buffer.js +167 -31
  259. package/dist/terminal/shellper-replay-buffer.js.map +1 -1
  260. package/package.json +8 -6
  261. package/skeleton/.claude/skills/afx/SKILL.md +14 -1
  262. package/skeleton/.claude/skills/arch-init/SKILL.md +22 -9
  263. package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
  264. package/skeleton/.claude/skills/codev/SKILL.md +31 -0
  265. package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
  266. package/skeleton/.codex/skills/afx/SKILL.md +14 -1
  267. package/skeleton/.codex/skills/arch-init/SKILL.md +22 -9
  268. package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
  269. package/skeleton/.codex/skills/codev/SKILL.md +31 -0
  270. package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
  271. package/skeleton/protocols/air/builder-prompt.md +28 -47
  272. package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
  273. package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
  274. package/skeleton/protocols/air/prompts/implement.md +20 -73
  275. package/skeleton/protocols/air/prompts/pr.md +22 -54
  276. package/skeleton/protocols/air/protocol.md +40 -71
  277. package/skeleton/protocols/aspir/builder-prompt.md +29 -66
  278. package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
  279. package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
  280. package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
  281. package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
  282. package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
  283. package/skeleton/protocols/aspir/prompts/implement.md +27 -196
  284. package/skeleton/protocols/aspir/prompts/plan.md +21 -85
  285. package/skeleton/protocols/aspir/prompts/review.md +29 -228
  286. package/skeleton/protocols/aspir/prompts/specify.md +25 -111
  287. package/skeleton/protocols/aspir/protocol.json +10 -0
  288. package/skeleton/protocols/aspir/protocol.md +36 -82
  289. package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
  290. package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
  291. package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
  292. package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
  293. package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
  294. package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
  295. package/skeleton/protocols/bugfix/protocol.md +44 -50
  296. package/skeleton/protocols/experiment/builder-prompt.md +25 -58
  297. package/skeleton/protocols/experiment/protocol.md +22 -188
  298. package/skeleton/protocols/experiment/templates/notes.md +11 -71
  299. package/skeleton/protocols/maintain/builder-prompt.md +24 -45
  300. package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
  301. package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
  302. package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
  303. package/skeleton/protocols/maintain/protocol.md +32 -266
  304. package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
  305. package/skeleton/protocols/pir/builder-prompt.md +30 -64
  306. package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
  307. package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
  308. package/skeleton/protocols/pir/prompts/implement.md +1 -2
  309. package/skeleton/protocols/pir/prompts/plan.md +0 -3
  310. package/skeleton/protocols/pir/prompts/review.md +1 -1
  311. package/skeleton/protocols/pir/protocol.md +54 -177
  312. package/skeleton/protocols/research/builder-prompt.md +27 -58
  313. package/skeleton/protocols/research/protocol.md +28 -153
  314. package/skeleton/protocols/spike/builder-prompt.md +30 -48
  315. package/skeleton/protocols/spike/protocol.md +24 -107
  316. package/skeleton/protocols/spike/templates/findings.md +9 -39
  317. package/skeleton/protocols/spir/builder-prompt.md +33 -62
  318. package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
  319. package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
  320. package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
  321. package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
  322. package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
  323. package/skeleton/protocols/spir/prompts/implement.md +26 -195
  324. package/skeleton/protocols/spir/prompts/plan.md +20 -84
  325. package/skeleton/protocols/spir/prompts/review.md +28 -227
  326. package/skeleton/protocols/spir/prompts/specify.md +24 -110
  327. package/skeleton/protocols/spir/protocol.json +10 -0
  328. package/skeleton/protocols/spir/protocol.md +84 -633
  329. package/skeleton/protocols/spir/templates/plan.md +28 -147
  330. package/skeleton/protocols/spir/templates/review.md +21 -80
  331. package/skeleton/protocols/spir/templates/spec.md +24 -118
  332. package/skeleton/resources/commands/agent-farm.md +259 -0
  333. package/skeleton/resources/commands/consult.md +236 -8
  334. package/skeleton/resources/commands/overview.md +1 -0
  335. package/skeleton/roles/architect.md +67 -317
  336. package/skeleton/roles/builder.md +77 -191
  337. package/skeleton/templates/AGENTS.md +2 -0
  338. package/skeleton/templates/CLAUDE.md +2 -0
  339. package/templates/tower.html +39 -2
  340. package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
  341. package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
  342. package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
  343. package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
  344. package/dist/agent-farm/servers/send-buffer.js +0 -116
  345. package/dist/agent-farm/servers/send-buffer.js.map +0 -1
  346. package/skeleton/porch/prompts/defend.md +0 -108
  347. package/skeleton/porch/prompts/diagnose.md +0 -70
  348. package/skeleton/porch/prompts/evaluate.md +0 -132
  349. package/skeleton/porch/prompts/fix.md +0 -59
  350. package/skeleton/porch/prompts/implement.md +0 -88
  351. package/skeleton/porch/prompts/plan.md +0 -74
  352. package/skeleton/porch/prompts/pr.md +0 -84
  353. package/skeleton/porch/prompts/review.md +0 -249
  354. package/skeleton/porch/prompts/specify.md +0 -53
  355. package/skeleton/porch/prompts/test.md +0 -63
  356. package/skeleton/protocols/aspir/templates/plan.md +0 -184
  357. package/skeleton/protocols/aspir/templates/review.md +0 -120
  358. package/skeleton/protocols/aspir/templates/spec.md +0 -154
@@ -1,10 +1,10 @@
1
1
  # REVIEW Phase Prompt
2
2
 
3
- You are executing the **REVIEW** phase of the SPIR protocol.
3
+ You are executing the **REVIEW** phase of the ASPIR protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Perform a comprehensive review, document lessons learned, and prepare for PR submission.
7
+ Review the whole implementation, write the retrospective at `codev/reviews/{{artifact_name}}.md`, and open the PR — so porch's consultation and the architect both review a real PR.
8
8
 
9
9
  ## Context
10
10
 
@@ -15,264 +15,65 @@ Perform a comprehensive review, document lessons learned, and prepare for PR sub
15
15
  - **Plan File**: `codev/plans/{{artifact_name}}.md`
16
16
  - **Review File**: `codev/reviews/{{artifact_name}}.md`
17
17
 
18
- ## Prerequisites
18
+ ## What must be true when you finish
19
19
 
20
- Before review, verify:
21
- 1. All implementation phases are committed
22
- 2. All tests are passing
23
- 3. Build is passing
24
- 4. Spec compliance verified for all phases
20
+ - **The work is done and green.** All phases committed (`git log --oneline | grep "[Spec {{project_id}}]"`), build and tests passing, no uncommitted changes.
21
+ - **The implementation has been reviewed against the spec** — code quality, architecture fit, and security considered; deviations from the spec noted with their reasons; every success criterion accounted for.
22
+ - **The review document exists** at `codev/reviews/{{artifact_name}}.md`, following the template below (its headings, its order — do not pattern-match an older review that predates it).
23
+ - **Consultation feedback is captured.** The review carries a `## Consultation Feedback` section that, per phase / round / model, records each concern and its disposition — **Addressed** (changed), **Rebutted** (why it does not apply), or **N/A** (out of scope / handled elsewhere). "No concerns raised — all consultations approved" is the right line when that is true; note COMMENT verdicts and any `CONSULT_ERROR`. Read the consult outputs from `codev/projects/{{project_id}}-*/`.
24
+ - **Governance facts are routed by tier** (see below).
25
+ - **The PR exists before you signal**, with a close-keyword so merging auto-closes the issue (see below).
25
26
 
26
- Verify commits: `git log --oneline | grep "[Spec {{project_id}}]"`
27
-
28
- ## Process
29
-
30
- ### 1. Comprehensive Review
31
-
32
- Review the entire implementation:
33
-
34
- **Code Quality**:
35
- - Is the code readable and maintainable?
36
- - Are there any code smells?
37
- - Is error handling consistent?
38
- - Are there any security concerns?
39
-
40
- **Architecture**:
41
- - Does the implementation fit well with existing code?
42
- - Are there any architectural concerns?
43
- - Is the design scalable if needed?
44
-
45
- **Documentation**:
46
- - Is code adequately commented where needed?
47
- - Are public APIs documented?
48
- - Is README updated if needed?
49
-
50
- ### 2. Spec Comparison
51
-
52
- Compare final implementation to original specification:
53
-
54
- - What was delivered vs what was specified?
55
- - Any deviations? Document why.
56
- - All success criteria met?
57
-
58
- ### 3. Create Review Document
59
-
60
- Create `codev/reviews/{{artifact_name}}.md`:
61
-
62
- ```markdown
63
- # Review: {{title}}
64
-
65
- ## Summary
66
- Brief description of what was implemented.
67
-
68
- ## Spec Compliance
69
- - [x] Requirement 1: Implemented as specified
70
- - [x] Requirement 2: Implemented with deviation (see below)
71
- - [x] Requirement 3: Implemented as specified
72
-
73
- ## Deviations from Plan
74
- - **Phase X**: [What changed and why]
75
-
76
- ## Lessons Learned
77
-
78
- ### What Went Well
79
- - [Positive observation 1]
80
- - [Positive observation 2]
81
-
82
- ### Challenges Encountered
83
- - [Challenge 1]: [How it was resolved]
84
- - [Challenge 2]: [How it was resolved]
85
-
86
- ### What Would Be Done Differently
87
- - [Insight 1]
88
- - [Insight 2]
89
-
90
- ### Methodology Improvements
91
- - [Suggested improvement to SPIR protocol]
92
- - [Suggested improvement to tooling]
93
-
94
- ## Technical Debt
95
- - [Any shortcuts taken that should be addressed later]
96
-
97
- ## Consultation Feedback
98
-
99
- [See instructions below]
100
-
101
- ## Flaky Tests
102
- - [Any pre-existing tests that were skipped as flaky during this project]
103
- - [Include test name, file path, and observed failure mode]
104
- - [If none: "No flaky tests encountered"]
105
-
106
- ## Follow-up Items
107
- - [Any items identified for future work]
108
- ```
109
-
110
- ### 3b. Include Consultation Feedback
111
-
112
- **IMPORTANT**: The review document MUST include a `## Consultation Feedback` section that summarizes all consultation concerns raised during every phase of the project and how the builder responded.
113
-
114
- Read the consultation output files from the project directory (`codev/projects/{project-id}-*/`). For each phase that had consultation, create a subsection organized by phase, round, and model:
115
-
116
- ```markdown
117
- ## Consultation Feedback
118
-
119
- ### Specify Phase (Round 1)
120
-
121
- #### Gemini
122
- - **Concern**: [Summary of the concern]
123
- - **Addressed**: [What was changed to resolve it]
124
-
125
- #### Codex
126
- - **Concern**: [Summary]
127
- - **Rebutted**: [Why the current approach is correct]
128
-
129
- #### Claude
130
- - No concerns raised (APPROVE)
131
-
132
- ### Plan Phase (Round 1)
133
- ...
134
- ```
135
-
136
- **Response types** — each concern gets exactly one:
137
- - **Addressed**: Builder made a change to resolve the concern
138
- - **Rebutted**: Builder explains why the concern doesn't apply
139
- - **N/A**: Concern is out of scope, already handled elsewhere, or moot
140
-
141
- **Edge cases**:
142
- - If all reviewers approved with no concerns: "No concerns raised — all consultations approved"
143
- - For COMMENT verdicts: include their feedback (non-blocking but useful context)
144
- - For CONSULT_ERROR (model failure): note "Consultation failed for [model]"
145
- - If a phase had multiple rounds, give each round its own subsection
146
-
147
- ### 4. Update Architecture and Lessons Learned Documentation
148
-
149
- **MANDATORY**: The review document MUST include `## Architecture Updates` and `## Lessons Learned Updates` sections. Porch will block advancement if these are missing.
150
-
151
- Each governance doc has **two tiers** (Spec 987) — **route** each new fact/lesson to the right tier; do **not** just append to the cold archive:
152
- - **HOT** — `codev/resources/arch-critical.md` / `lessons-critical.md`: tiny, **hard-capped**, **always injected** into every prompt and into CLAUDE.md/AGENTS.md. The behavior-changer.
153
- - **COLD** — `codev/resources/arch.md` / `lessons-learned.md`: full, on-demand reference.
154
-
155
- **Architecture Updates**:
156
- 1. Read `arch-critical.md` (hot) and skim `arch.md` (cold).
157
- 2. If this project produced a system-shape fact, route it:
158
- - **Behavior-changing + cross-cutting** (an invariant/decision a future builder must know up front) → add to **`arch-critical.md`**. Respect the cap: if the hot file is full, **demote** a weaker entry into `arch.md` to make room. If you add/rename a top-level `arch.md` section, keep the hot file's cold-doc map accurate.
159
- - **Reference detail** (subsystem mechanism, file location, one-off) → add to **`arch.md`** (cold).
160
- 3. Describe what you routed where in the `## Architecture Updates` section. If nothing qualifies: write "No architecture updates needed" with a brief reason.
161
-
162
- **Lessons Learned Updates**:
163
- 1. Read `lessons-critical.md` (hot) and skim `lessons-learned.md` (cold).
164
- 2. If this project produced a durable lesson, route it:
165
- - **Behavior-changing + cross-cutting** (a rule that should change how the next project is built) → add to **`lessons-critical.md`**, respecting the cap (demote a weaker entry into `lessons-learned.md` if full).
166
- - **Spec-narrow recipe / reference tip** → add to **`lessons-learned.md`** (cold). Spec-narrow recipes belong in the cold archive, never the always-on hot file.
167
- 3. Describe what you routed where in the `## Lessons Learned Updates` section. If nothing qualifies: write "No lessons learned updates needed" with a brief reason.
168
-
169
- **Never** grow a hot file past its cap by appending — route to cold or displace. The cap is what keeps the hot tier cheap enough to always inject.
27
+ ## Output
170
28
 
171
- ### 4b. Update Other Documentation
29
+ Write the review to `codev/reviews/{{artifact_name}}.md` using the template below as its interface. Steps below expand its `## Consultation Feedback`, `## Architecture Updates`, and `## Lessons Learned Updates` sections; porch greps the produced file for the last two by exact heading.
172
30
 
173
- If needed, also update:
174
- - README.md (new features, changed behavior)
175
- - API documentation
31
+ {{> protocols/spir/templates/review.md}}
176
32
 
177
- ### 5. Final Verification
33
+ ## Route governance facts by tier (Spec 987)
178
34
 
179
- Before PR:
180
- - [ ] All tests pass (use project-specific test command)
181
- - [ ] Build passes (use project-specific build command)
182
- - [ ] Lint passes (if configured)
183
- - [ ] No uncommitted changes: `git status`
184
- - [ ] Review document complete
35
+ Each governance doc has two tiers. **Route** each new fact; do not simply append to the cold archive.
185
36
 
186
- ### 6. Create Pull Request
37
+ - **HOT** — `codev/resources/arch-critical.md` and `lessons-critical.md`: tiny, hard-capped, always injected into every prompt and into CLAUDE.md/AGENTS.md. Add here only a **behavior-changing, cross-cutting** fact a future builder must know up front. The hot files are capped: if one is full, **demote** a weaker entry into its cold counterpart to make room, and keep the hot file's cold-doc map accurate.
38
+ - **COLD** — `codev/resources/arch.md` and `lessons-learned.md`: full, on-demand reference for subsystem detail, file locations, one-offs, and spec-narrow recipes.
187
39
 
188
- **IMPORTANT: Create the PR BEFORE signaling completion.** The PR must exist so that
189
- porch consultation reviews the actual PR, and the architect can review a real PR
190
- when the pr gate fires.
40
+ The review's `## Architecture Updates` and `## Lessons Learned Updates` sections state what you routed where; if nothing qualifies, keep the heading with a one-line reason. Never grow a hot file past its cap by appending — route to cold or displace. The `update-arch-docs` skill encodes this discipline.
191
41
 
192
- **PR body requirements**: The PR body MUST include `Closes #<N>` (for feature issues)
193
- or `Fixes #<N>` (for bug issues) for the driving GitHub issue. If the PR closes
194
- multiple issues (e.g. duplicates consolidated), include one keyword per issue.
195
- Without this, GitHub will not auto-close the issue on merge.
42
+ ## Create the PR (before signaling)
196
43
 
197
- **Exception**: if this PR only partially addresses the issue (e.g. one phase of a
198
- multi-PR effort), DO NOT use `Closes`/`Fixes` — reference the issue with `Refs #<N>`
199
- or `Part of #<N>` instead. The issue stays open until the follow-up PR closes it.
44
+ The PR body must carry `Closes #<N>` (feature) or `Fixes #<N>` (bug) for the driving issue — one keyword per issue if several — so GitHub auto-closes on merge. **Exception:** a PR that only partially addresses its issue uses `Refs #<N>` or `Part of #<N>` instead, leaving the issue open for the follow-up.
200
45
 
201
46
  ```bash
202
47
  gh pr create --title "[Spec {{project_id}}] {{title}}" --body "$(cat <<'EOF'
203
48
  ## Summary
204
- [Brief description of the implementation]
49
+ [what was implemented]
205
50
 
206
- Closes #<N> <!-- Replace <N> with the driving issue number, or use "Refs #<N>" for partial fixes -->
51
+ Closes #<N> <!-- driving issue; use "Refs #<N>" for a partial fix -->
207
52
 
208
53
  ## Changes
209
- - [Change 1]
210
- - [Change 2]
54
+ - ...
211
55
 
212
56
  ## Testing
213
- - All unit tests passing
214
- - Integration tests added for [X]
215
- - Manual testing completed for [Y]
57
+ - ...
216
58
 
217
59
  ## Spec
218
- Link: codev/specs/{{artifact_name}}.md
60
+ codev/specs/{{artifact_name}}.md
219
61
 
220
62
  ## Review
221
- Link: codev/reviews/{{artifact_name}}.md
63
+ codev/reviews/{{artifact_name}}.md
222
64
  EOF
223
65
  )"
224
66
  ```
225
67
 
226
- ### 7. Signal Completion
227
-
228
- After the PR is created, signal completion. Porch will run 3-way consultation
229
- (Gemini, Codex, Claude) automatically via the verify step. If reviewers request
230
- changes, you'll be respawned with their feedback.
231
-
232
- ## Output
233
-
234
- - Review document at `codev/reviews/{{artifact_name}}.md`
235
- - Updated documentation (if needed)
236
- - Pull request created and ready for review
237
-
238
68
  ## Signals
239
69
 
240
- - After review document is complete:
70
+ - Review document complete:
241
71
  ```
242
72
  <signal>REVIEW_COMPLETE</signal>
243
73
  ```
244
-
245
- - After PR is created — signal completion so porch runs consultation:
74
+ - PR created — signal so porch runs the 3-way consultation:
246
75
  ```
247
76
  <signal>PR_READY</signal>
248
77
  ```
249
78
 
250
- ## Important Notes
251
-
252
- 1. **Be honest in lessons learned** - Future you will thank present you
253
- 3. **Document deviations** - They're not failures, they're learnings
254
- 4. **Update methodology** - If you found a better way, document it
255
- 5. **Don't skip the checklist** - It catches last-minute issues
256
- 6. **Clean PR description** - Makes review easier
257
-
258
- ## What NOT to Do
259
-
260
- - Don't run `consult` commands yourself (porch handles consultations)
261
- - Don't skip lessons learned ("nothing to report")
262
- - Don't merge your own PR (Architect handles integration)
263
- - Don't leave uncommitted changes
264
- - Don't forget to update documentation
265
- - Don't rush this phase - it's valuable for learning
266
- - Don't use `git add .` or `git add -A` (security risk)
267
-
268
- ## Review Prompts for Reflection
269
-
270
- Ask yourself:
271
- - What surprised me during implementation?
272
- - Where did I spend the most time? Was it avoidable?
273
- - What would have helped me go faster?
274
- - Did the spec adequately describe what was needed?
275
- - Did the plan phases make sense in hindsight?
276
- - What tests caught issues? What tests were unnecessary?
277
-
278
- Capture these reflections in the lessons learned section.
79
+ Do not run `consult` (porch handles it) and merge your own PR only after the human approves the `pr` gate — never before.
@@ -1,10 +1,10 @@
1
1
  # SPECIFY Phase Prompt
2
2
 
3
- You are executing the **SPECIFY** phase of the SPIR protocol.
3
+ You are executing the **SPECIFY** phase of the ASPIR protocol.
4
4
 
5
- ## Your Goal
5
+ ## Goal
6
6
 
7
- Create a comprehensive specification document that thoroughly explores the problem space and proposed solution.
7
+ Produce a specification at `codev/specs/{{artifact_name}}.md` that explores the problem space and the proposed solution well enough that the plan and implementation can follow without re-deciding anything.
8
8
 
9
9
  ## Context
10
10
 
@@ -13,133 +13,47 @@ Create a comprehensive specification document that thoroughly explores the probl
13
13
  - **Current State**: {{current_state}}
14
14
  - **Spec File**: `codev/specs/{{artifact_name}}.md`
15
15
 
16
- ## Process
16
+ ## What must be true when you finish
17
17
 
18
- ### 0. Check for Existing Spec (ALWAYS DO THIS FIRST)
19
-
20
- **Before asking ANY questions**, check if a spec already exists:
21
-
22
- ```bash
23
- ls codev/specs/{{project_id}}-*.md
24
- ```
25
-
26
- **If a spec file exists:**
27
- 1. READ IT COMPLETELY - the answers to your questions are already there
28
- 2. The spec author has already made the key decisions
29
- 3. DO NOT ask clarifying questions - proceed directly to consultation
30
- 4. Your job is to REVIEW and IMPROVE the existing spec, not rewrite it from scratch
31
-
32
- **If no spec exists:** Proceed to Step 1 below.
33
-
34
- ### 0.5 Baked Decisions
35
-
36
- Before exploring solution approaches, check the issue body for a section named "Baked Decisions" (any heading level, case-insensitive). If present, copy its content verbatim into the spec's Constraints section and treat each item as fixed. Do not autonomously relitigate the architect's choices in your Solution Exploration. If you discover a serious problem with a baked decision, raise it via `afx send architect` rather than overriding it in the spec.
37
-
38
- If two baked decisions contradict each other (e.g., two different language choices), do not pick one — pause, flag the contradiction via `afx send`, and wait for resolution before drafting.
39
-
40
- ### 1. Clarifying Questions (ONLY IF NO SPEC EXISTS)
41
-
42
- Before writing anything, ask clarifying questions to understand:
43
- - What problem is being solved?
44
- - Who are the stakeholders?
45
- - What are the constraints?
46
- - What's in scope vs out of scope?
47
- - What does success look like?
48
-
49
- If this is your first iteration AND no spec exists, ask these questions now and wait for answers.
50
-
51
- **CRITICAL**: Do NOT ask questions if a spec already exists. The spec IS the answer.
52
-
53
- **On subsequent iterations**: If questions were already answered, acknowledge the answers and proceed to the next step.
54
-
55
- ### 2. Problem Analysis
56
-
57
- Once you have answers, document:
58
- - The problem being solved (clearly articulated)
59
- - Current state vs desired state
60
- - Stakeholders and their needs
61
- - Assumptions and constraints
62
-
63
- ### 3. Solution Exploration
64
-
65
- Generate multiple solution approaches. For each:
66
- - Technical design overview
67
- - Trade-offs (pros/cons)
68
- - Complexity assessment
69
- - Risk assessment
70
-
71
- ### 4. Open Questions
72
-
73
- List uncertainties categorized as:
74
- - **Critical** - blocks progress
75
- - **Important** - affects design
76
- - **Nice-to-know** - optimization
77
-
78
- ### 5. Success Criteria
79
-
80
- Define measurable acceptance criteria:
81
- - Functional requirements (MUST, SHOULD, COULD)
82
- - Non-functional requirements (performance, security)
83
- - Test scenarios
84
-
85
- ### 6. Finalize
86
-
87
- After completing the spec draft, signal completion. Porch will run 3-way consultation (Gemini, Codex, Claude) automatically via the verify step. If reviewers request changes, you'll be respawned with their feedback.
18
+ - **An existing spec is honored, not rewritten.** If `codev/specs/{{project_id}}-*.md` already exists, it carries the architect's decisions — read it fully and refine it in place. Clarifying questions are for the case where no spec exists yet; when one does, the spec is the answer.
19
+ - **Baked Decisions are fixed.** If the issue body has a "Baked Decisions" section (any heading level, case-insensitive), copy it verbatim into the spec's Constraints and treat each item as settled — **do not autonomously override** the architect's choices in Solution Exploration. Raise a genuine problem with a baked decision via `afx send architect` rather than overriding it. If two baked decisions contradict each other, do not choose — **pause**, **flag** the contradiction via `afx send`, and wait for resolution.
20
+ - **The problem is characterized before solutions are.** Current state vs desired state, stakeholders, assumptions, and constraints are explicit.
21
+ - **Solutions are explored, not assumed.** More than one approach is considered, each with its trade-offs and risks, before one is recommended.
22
+ - **Open questions are surfaced and ranked** by whether they block progress, shape the design, or are merely nice to know.
23
+ - **Success is measurable.** Acceptance criteria are concrete enough to test against.
88
24
 
89
25
  ## Output
90
26
 
91
- Create or update the specification file at `codev/specs/{{artifact_name}}.md`.
27
+ Write the spec to `codev/specs/{{artifact_name}}.md` using the template below as its interface — these headings, in this order. A section that genuinely does not apply keeps its heading with a one-line `N/A — [reason]` rather than being deleted. Do not pattern-match an older spec in `codev/specs/` that predates this template.
92
28
 
93
- **IMPORTANT**: Keep spec/plan/review filenames in sync:
94
- - Spec: `codev/specs/{{artifact_name}}.md`
95
- - Plan: `codev/plans/{{artifact_name}}.md`
96
- - Review: `codev/reviews/{{artifact_name}}.md`
29
+ {{> protocols/spir/templates/spec.md}}
97
30
 
98
- ## Signals
31
+ Keep the three artifact filenames in sync: spec `codev/specs/{{artifact_name}}.md`, plan `codev/plans/{{artifact_name}}.md`, review `codev/reviews/{{artifact_name}}.md`.
99
32
 
100
- Emit appropriate signals based on your progress:
33
+ ## Signals
101
34
 
102
- - When waiting for clarifying question answers, **include your questions in the signal**:
35
+ - Waiting on clarifying-question answers — **put the questions inside the signal**, which is displayed prominently to the user:
103
36
  ```
104
37
  <signal type=AWAITING_INPUT>
105
- Please answer these questions:
106
- 1. What should the primary use case be - internal tooling or customer-facing?
107
- 2. What are the key constraints we should consider?
108
- 3. Who are the main stakeholders?
38
+ Please answer:
39
+ 1. ...
40
+ 2. ...
109
41
  </signal>
110
42
  ```
111
-
112
- The content inside the signal tag is displayed prominently to the user.
113
-
114
- - After completing the initial spec draft:
43
+ - Initial draft done:
115
44
  ```
116
45
  <signal>SPEC_DRAFTED</signal>
117
46
  ```
118
47
 
48
+ ## Commit cadence
119
49
 
120
- ## Commit Cadence
121
-
122
- Make commits at these milestones:
50
+ Commit at each milestone, staging the spec file explicitly:
51
+ ```bash
52
+ git add codev/specs/{{artifact_name}}.md
53
+ ```
123
54
  1. `[Spec {{project_id}}] Initial specification draft`
124
55
  2. `[Spec {{project_id}}] Specification with multi-agent review`
125
56
  3. `[Spec {{project_id}}] Specification with user feedback`
126
57
  4. `[Spec {{project_id}}] Final approved specification`
127
58
 
128
- **CRITICAL**: Never use `git add .` or `git add -A`. Always stage specific files:
129
- ```bash
130
- git add codev/specs/{{artifact_name}}.md
131
- ```
132
-
133
- ## Important Notes
134
-
135
- 1. **Be thorough** - A good spec prevents implementation problems
136
- 3. **Be specific** - Vague specs lead to wrong implementations
137
- 4. **Include examples** - Concrete examples clarify intent
138
-
139
- ## What NOT to Do
140
-
141
- - Don't run `consult` commands yourself (porch handles consultations)
142
- - Don't include implementation details (that's for the Plan phase)
143
- - Don't estimate time (AI makes time estimates meaningless)
144
- - Don't start coding (you're in Specify, not Implement)
145
- - Don't use `git add .` or `git add -A` (security risk)
59
+ Porch runs the 3-way consultation itself after you signal — do not run `consult`. This is the Specify phase: no implementation detail (that is the plan), no code, no time estimates.
@@ -23,6 +23,16 @@
23
23
  "models": ["gemini", "codex", "claude"],
24
24
  "parallel": true
25
25
  },
26
+ "checks": {
27
+ "spec_exists": {
28
+ "command": "test -f codev/specs/${PROJECT_TITLE}.md",
29
+ "description": "Spec file must exist before the spec-approval gate"
30
+ },
31
+ "spec_has_required_sections": {
32
+ "command": "grep -qF '## Problem Statement' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Current State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Desired State' codev/specs/${PROJECT_TITLE}.md && grep -qF '## Success Criteria' codev/specs/${PROJECT_TITLE}.md",
33
+ "description": "Spec must follow the canonical template delivered by the specify prompt (protocols/spir/templates/spec.md). Required headings: ## Problem Statement, ## Current State, ## Desired State, ## Success Criteria"
34
+ }
35
+ },
26
36
  "max_iterations": 3,
27
37
  "on_complete": {
28
38
  "commit": true,
@@ -1,98 +1,52 @@
1
1
  # ASPIR Protocol
2
2
 
3
- > **ASPIR** = **A**utonomous **S**pecify → **P**lan → **I**mplement → **R**eview
4
- >
5
- > Identical to SPIR but without human approval gates on spec and plan phases.
6
- > Each phase has one build-verify cycle with 3-way consultation.
3
+ Autonomous SPIR: the same phases, artifacts, consultations and checks, with the **spec and plan
4
+ human gates absent**. The builder runs Specify → Plan → Implement without stopping, and a human
5
+ still reviews everything at the `pr` gate before merge.
7
6
 
8
- ## What is ASPIR?
7
+ Use ASPIR for trusted, low-risk work where reviewing the approach up front would cost more than
8
+ it saves, and deferring that review to the PR is acceptable. When getting the shape wrong would
9
+ be expensive to unwind, use SPIR and take the gates.
9
10
 
10
- ASPIR is an autonomous variant of the SPIR protocol. It follows the exact same phases (Specify → Plan → Implement → Review) with the same 3-way consultations, checks, and PR flow — but removes the `spec-approval` and `plan-approval` human gates.
11
+ ## The state machine
11
12
 
12
- This means the builder proceeds automatically from Specify → Plan → Implement without waiting for human approval at each gate. The `pr` gate in the Review phase is preserved — a human still reviews all code before merge.
13
+ Phases, gates and checks — note that `specify` and `plan` carry **no gate at all**; they are not
14
+ auto-approved, they are ungated:
13
15
 
14
- ### Differences from SPIR
15
-
16
- | Aspect | SPIR | ASPIR |
17
- |--------|------|-------|
18
- | Spec gate (`spec-approval`) | Human must approve | Auto-approved |
19
- | Plan gate (`plan-approval`) | Human must approve | Auto-approved |
20
- | PR gate (`pr`) | Human must approve | Human must approve |
21
- | Phases | Specify → Plan → Implement → Review | Same |
22
- | 3-way consultations | Yes, every phase | Same |
23
- | Checks (build, tests, PR) | Yes | Same |
24
- | Prompts / templates | Full set | Same (copied from SPIR) |
25
-
26
- ### When to Use ASPIR
27
-
28
- Use ASPIR instead of SPIR when:
29
-
30
- - The work is **trusted and low-risk** — internal tooling, protocol additions, well-understood features
31
- - The architect has **pre-written and approved** the spec before spawning
32
- - The scope is **self-contained** with low blast radius
33
- - You want **full SPIR discipline** (consultations, phased implementation, review) without waiting at gates
34
-
35
- ### When NOT to Use ASPIR
36
-
37
- Use SPIR instead when:
38
-
39
- - The feature involves **novel architecture** or unclear requirements
40
- - The spec needs **iterative human feedback** during drafting
41
- - The work is **high-risk** — security-sensitive, user-facing, or broadly impactful
42
- - You want to **review and adjust** the plan before implementation starts
43
-
44
- ## Baked Decisions (Optional)
45
-
46
- When filing an issue for ASPIR, you can pin architectural decisions you don't want the builder or CMAP reviewers to re-litigate. Include a `## Baked Decisions` section (any heading level is fine) anywhere in the issue body. Useful categories: language, framework, deployment shape, key dependencies, decisions deferred to a later spec. The builder will copy the section verbatim into the spec's Constraints and treat each item as fixed; CMAP reviewers will not propose alternatives unless the spec itself fails to honor a stated decision. Leave the section out for issues where you want the builder to explore freely — absence is the no-op default. You can amend or rescind a baked decision at any time by updating the issue and respawning, or by sending the builder a direct instruction via `afx send`.
47
-
48
- ## Protocol Phases
16
+ ```json
17
+ {{> protocols/aspir/protocol.json}}
18
+ ```
49
19
 
50
- ASPIR follows the same four phases as SPIR. For full phase documentation, see the [SPIR protocol](../spir/protocol.md).
20
+ ## Everything else is SPIR
51
21
 
52
- ### S - Specify
53
- Write specification with 3-way review (Gemini, Codex, Claude). **No human gate** — proceeds directly to Plan after verification.
22
+ Artifacts (`codev/specs/`, `codev/plans/`, `codev/reviews/`, same base filename), the
23
+ build-verify cycle per plan phase, mandatory 3-way consultation at each verify step, the
24
+ machine-readable `phases` block in the plan, commit and branch conventions, and Baked Decisions
25
+ handling are all identical to SPIR. ASPIR includes SPIR's templates rather than copying them, so
26
+ there is one set to keep correct.
54
27
 
55
- ### P - Plan
56
- Write implementation plan with 3-way review. **No human gate** — proceeds directly to Implement after verification and checks pass.
28
+ See `protocols/spir/protocol.md` for that shared substance.
57
29
 
58
- ### I - Implement
59
- Execute each plan phase with build-verify cycle. Same as SPIR — no gate between phases (SPIR also has no gate here).
30
+ ## Baked Decisions
60
31
 
61
- ### R - Review
62
- Final review, PR preparation, and 3-way review. **PR gate preserved** — builder stops and waits for human approval before merge.
32
+ An issue may carry a `## Baked Decisions` section pinning architectural choices the architect
33
+ does not want re-litigated — typically **language**, **framework**, deployment shape, key
34
+ **dependencies**, or decisions deferred to a later spec.
63
35
 
64
- ## Usage
36
+ Every item in it is fixed. Copy the section verbatim into the spec's Constraints and do not
37
+ re-open it in the spec, plan, or review; CMAP reviewers will not propose alternatives unless the
38
+ spec fails to honour one. If two items contradict each other, do not choose — surface the
39
+ contradiction and wait.
65
40
 
66
- ```bash
67
- # Spawn a builder using ASPIR
68
- afx spawn 42 --protocol aspir
41
+ **Absence is the no-op default**: an issue with no such section is an invitation to explore
42
+ freely, not an omission to be filled in.
69
43
 
70
- # The builder runs autonomously through Specify → Plan → Implement
71
- # and stops only at the PR gate in the Review phase
72
- ```
44
+ The architect can **amend or rescind** a baked decision at any time by updating the issue and
45
+ respawning, or by sending the builder a direct instruction via `afx send`.
73
46
 
74
- ## File Structure
75
-
76
- ```
77
- codev/protocols/aspir/
78
- ├── protocol.json # Protocol definition (SPIR minus gates)
79
- ├── protocol.md # This file
80
- ├── builder-prompt.md # Builder instructions (same as SPIR)
81
- ├── prompts/
82
- │ ├── specify.md # Specify phase prompt (same as SPIR)
83
- │ ├── plan.md # Plan phase prompt (same as SPIR)
84
- │ ├── implement.md # Implement phase prompt (same as SPIR)
85
- │ └── review.md # Review phase prompt (same as SPIR)
86
- ├── consult-types/
87
- │ ├── spec-review.md # Spec consultation guide (same as SPIR)
88
- │ ├── plan-review.md # Plan consultation guide (same as SPIR)
89
- │ ├── impl-review.md # Impl consultation guide (same as SPIR)
90
- │ ├── phase-review.md # Phase consultation guide (same as SPIR)
91
- │ └── pr-review.md # PR consultation guide (same as SPIR)
92
- └── templates/
93
- ├── spec.md # Spec template (same as SPIR)
94
- ├── plan.md # Plan template (same as SPIR)
95
- └── review.md # Review template (same as SPIR)
96
- ```
47
+ ## The one thing to be careful about
97
48
 
98
- All files except `protocol.json` and `protocol.md` are identical to their SPIR counterparts.
49
+ Without the spec and plan gates, nothing external catches a misread of the issue until the PR.
50
+ If the spec you write surprises you — if it turns out larger, or more architectural, than the
51
+ issue implied — that is the signal ASPIR was the wrong choice. Say so early rather than
52
+ carrying the misfit through to review.