@cluesmith/codev 2.0.0-rc.8 → 2.0.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 (507) hide show
  1. package/bin/af.js +2 -2
  2. package/bin/consult.js +1 -1
  3. package/bin/porch.js +6 -35
  4. package/dashboard/dist/assets/index-4n9zpWLY.css +32 -0
  5. package/dashboard/dist/assets/index-b38SaXk5.js +136 -0
  6. package/dashboard/dist/assets/index-b38SaXk5.js.map +1 -0
  7. package/dashboard/dist/index.html +14 -0
  8. package/dist/agent-farm/cli.d.ts.map +1 -1
  9. package/dist/agent-farm/cli.js +179 -118
  10. package/dist/agent-farm/cli.js.map +1 -1
  11. package/dist/agent-farm/commands/architect.d.ts +3 -3
  12. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  13. package/dist/agent-farm/commands/architect.js +20 -147
  14. package/dist/agent-farm/commands/architect.js.map +1 -1
  15. package/dist/agent-farm/commands/attach.d.ts +13 -0
  16. package/dist/agent-farm/commands/attach.d.ts.map +1 -0
  17. package/dist/agent-farm/commands/attach.js +144 -0
  18. package/dist/agent-farm/commands/attach.js.map +1 -0
  19. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  20. package/dist/agent-farm/commands/cleanup.js +35 -19
  21. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  22. package/dist/agent-farm/commands/consult.d.ts +3 -4
  23. package/dist/agent-farm/commands/consult.d.ts.map +1 -1
  24. package/dist/agent-farm/commands/consult.js +27 -37
  25. package/dist/agent-farm/commands/consult.js.map +1 -1
  26. package/dist/agent-farm/commands/index.d.ts +2 -2
  27. package/dist/agent-farm/commands/index.d.ts.map +1 -1
  28. package/dist/agent-farm/commands/index.js +2 -2
  29. package/dist/agent-farm/commands/index.js.map +1 -1
  30. package/dist/agent-farm/commands/open.d.ts +4 -2
  31. package/dist/agent-farm/commands/open.d.ts.map +1 -1
  32. package/dist/agent-farm/commands/open.js +33 -83
  33. package/dist/agent-farm/commands/open.js.map +1 -1
  34. package/dist/agent-farm/commands/send.d.ts +1 -1
  35. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  36. package/dist/agent-farm/commands/send.js +70 -79
  37. package/dist/agent-farm/commands/send.js.map +1 -1
  38. package/dist/agent-farm/commands/shell.d.ts +15 -0
  39. package/dist/agent-farm/commands/shell.d.ts.map +1 -0
  40. package/dist/agent-farm/commands/shell.js +50 -0
  41. package/dist/agent-farm/commands/shell.js.map +1 -0
  42. package/dist/agent-farm/commands/spawn-roles.d.ts +80 -0
  43. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -0
  44. package/dist/agent-farm/commands/spawn-roles.js +278 -0
  45. package/dist/agent-farm/commands/spawn-roles.js.map +1 -0
  46. package/dist/agent-farm/commands/spawn-worktree.d.ts +96 -0
  47. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -0
  48. package/dist/agent-farm/commands/spawn-worktree.js +305 -0
  49. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -0
  50. package/dist/agent-farm/commands/spawn.d.ts +5 -1
  51. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  52. package/dist/agent-farm/commands/spawn.js +242 -586
  53. package/dist/agent-farm/commands/spawn.js.map +1 -1
  54. package/dist/agent-farm/commands/start.d.ts +10 -20
  55. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  56. package/dist/agent-farm/commands/start.js +45 -491
  57. package/dist/agent-farm/commands/start.js.map +1 -1
  58. package/dist/agent-farm/commands/status.d.ts +2 -0
  59. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  60. package/dist/agent-farm/commands/status.js +75 -24
  61. package/dist/agent-farm/commands/status.js.map +1 -1
  62. package/dist/agent-farm/commands/stop.d.ts +6 -0
  63. package/dist/agent-farm/commands/stop.d.ts.map +1 -1
  64. package/dist/agent-farm/commands/stop.js +49 -109
  65. package/dist/agent-farm/commands/stop.js.map +1 -1
  66. package/dist/agent-farm/commands/tower-cloud.d.ts +48 -0
  67. package/dist/agent-farm/commands/tower-cloud.d.ts.map +1 -0
  68. package/dist/agent-farm/commands/tower-cloud.js +293 -0
  69. package/dist/agent-farm/commands/tower-cloud.js.map +1 -0
  70. package/dist/agent-farm/commands/tower.d.ts +9 -0
  71. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  72. package/dist/agent-farm/commands/tower.js +59 -19
  73. package/dist/agent-farm/commands/tower.js.map +1 -1
  74. package/dist/agent-farm/db/index.d.ts +6 -2
  75. package/dist/agent-farm/db/index.d.ts.map +1 -1
  76. package/dist/agent-farm/db/index.js +301 -19
  77. package/dist/agent-farm/db/index.js.map +1 -1
  78. package/dist/agent-farm/db/migrate.d.ts +0 -4
  79. package/dist/agent-farm/db/migrate.d.ts.map +1 -1
  80. package/dist/agent-farm/db/migrate.js +6 -55
  81. package/dist/agent-farm/db/migrate.js.map +1 -1
  82. package/dist/agent-farm/db/schema.d.ts +3 -3
  83. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  84. package/dist/agent-farm/db/schema.js +25 -19
  85. package/dist/agent-farm/db/schema.js.map +1 -1
  86. package/dist/agent-farm/db/types.d.ts +3 -13
  87. package/dist/agent-farm/db/types.d.ts.map +1 -1
  88. package/dist/agent-farm/db/types.js +3 -11
  89. package/dist/agent-farm/db/types.js.map +1 -1
  90. package/dist/agent-farm/hq-connector.d.ts +2 -6
  91. package/dist/agent-farm/hq-connector.d.ts.map +1 -1
  92. package/dist/agent-farm/hq-connector.js +2 -17
  93. package/dist/agent-farm/hq-connector.js.map +1 -1
  94. package/dist/agent-farm/lib/cloud-config.d.ts +59 -0
  95. package/dist/agent-farm/lib/cloud-config.d.ts.map +1 -0
  96. package/dist/agent-farm/lib/cloud-config.js +143 -0
  97. package/dist/agent-farm/lib/cloud-config.js.map +1 -0
  98. package/dist/agent-farm/lib/device-name.d.ts +25 -0
  99. package/dist/agent-farm/lib/device-name.d.ts.map +1 -0
  100. package/dist/agent-farm/lib/device-name.js +46 -0
  101. package/dist/agent-farm/lib/device-name.js.map +1 -0
  102. package/dist/agent-farm/lib/nonce-store.d.ts +28 -0
  103. package/dist/agent-farm/lib/nonce-store.d.ts.map +1 -0
  104. package/dist/agent-farm/lib/nonce-store.js +60 -0
  105. package/dist/agent-farm/lib/nonce-store.js.map +1 -0
  106. package/dist/agent-farm/lib/token-exchange.d.ts +18 -0
  107. package/dist/agent-farm/lib/token-exchange.d.ts.map +1 -0
  108. package/dist/agent-farm/lib/token-exchange.js +48 -0
  109. package/dist/agent-farm/lib/token-exchange.js.map +1 -0
  110. package/dist/agent-farm/lib/tower-client.d.ts +163 -0
  111. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -0
  112. package/dist/agent-farm/lib/tower-client.js +233 -0
  113. package/dist/agent-farm/lib/tower-client.js.map +1 -0
  114. package/dist/agent-farm/lib/tunnel-client.d.ts +117 -0
  115. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -0
  116. package/dist/agent-farm/lib/tunnel-client.js +504 -0
  117. package/dist/agent-farm/lib/tunnel-client.js.map +1 -0
  118. package/dist/agent-farm/servers/tower-instances.d.ts +82 -0
  119. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -0
  120. package/dist/agent-farm/servers/tower-instances.js +454 -0
  121. package/dist/agent-farm/servers/tower-instances.js.map +1 -0
  122. package/dist/agent-farm/servers/tower-routes.d.ts +34 -0
  123. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -0
  124. package/dist/agent-farm/servers/tower-routes.js +1445 -0
  125. package/dist/agent-farm/servers/tower-routes.js.map +1 -0
  126. package/dist/agent-farm/servers/tower-server.d.ts +5 -2
  127. package/dist/agent-farm/servers/tower-server.d.ts.map +1 -1
  128. package/dist/agent-farm/servers/tower-server.js +157 -475
  129. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  130. package/dist/agent-farm/servers/tower-terminals.d.ts +119 -0
  131. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -0
  132. package/dist/agent-farm/servers/tower-terminals.js +629 -0
  133. package/dist/agent-farm/servers/tower-terminals.js.map +1 -0
  134. package/dist/agent-farm/servers/tower-tunnel.d.ts +34 -0
  135. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -0
  136. package/dist/agent-farm/servers/tower-tunnel.js +473 -0
  137. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -0
  138. package/dist/agent-farm/servers/tower-types.d.ts +86 -0
  139. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -0
  140. package/dist/agent-farm/servers/tower-types.js +6 -0
  141. package/dist/agent-farm/servers/tower-types.js.map +1 -0
  142. package/dist/agent-farm/servers/tower-utils.d.ts +58 -0
  143. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -0
  144. package/dist/agent-farm/servers/tower-utils.js +182 -0
  145. package/dist/agent-farm/servers/tower-utils.js.map +1 -0
  146. package/dist/agent-farm/servers/tower-websocket.d.ts +25 -0
  147. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -0
  148. package/dist/agent-farm/servers/tower-websocket.js +171 -0
  149. package/dist/agent-farm/servers/tower-websocket.js.map +1 -0
  150. package/dist/agent-farm/state.d.ts +6 -12
  151. package/dist/agent-farm/state.d.ts.map +1 -1
  152. package/dist/agent-farm/state.js +34 -49
  153. package/dist/agent-farm/state.js.map +1 -1
  154. package/dist/agent-farm/types.d.ts +49 -26
  155. package/dist/agent-farm/types.d.ts.map +1 -1
  156. package/dist/agent-farm/utils/config.d.ts +0 -5
  157. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  158. package/dist/agent-farm/utils/config.js +12 -44
  159. package/dist/agent-farm/utils/config.js.map +1 -1
  160. package/dist/agent-farm/utils/deps.d.ts.map +1 -1
  161. package/dist/agent-farm/utils/deps.js +0 -32
  162. package/dist/agent-farm/utils/deps.js.map +1 -1
  163. package/dist/agent-farm/utils/file-tabs.d.ts +27 -0
  164. package/dist/agent-farm/utils/file-tabs.d.ts.map +1 -0
  165. package/dist/agent-farm/utils/file-tabs.js +46 -0
  166. package/dist/agent-farm/utils/file-tabs.js.map +1 -0
  167. package/dist/agent-farm/utils/gate-status.d.ts +16 -0
  168. package/dist/agent-farm/utils/gate-status.d.ts.map +1 -0
  169. package/dist/agent-farm/utils/gate-status.js +79 -0
  170. package/dist/agent-farm/utils/gate-status.js.map +1 -0
  171. package/dist/agent-farm/utils/gate-watcher.d.ts +38 -0
  172. package/dist/agent-farm/utils/gate-watcher.d.ts.map +1 -0
  173. package/dist/agent-farm/utils/gate-watcher.js +122 -0
  174. package/dist/agent-farm/utils/gate-watcher.js.map +1 -0
  175. package/dist/agent-farm/utils/index.d.ts +0 -1
  176. package/dist/agent-farm/utils/index.d.ts.map +1 -1
  177. package/dist/agent-farm/utils/index.js +0 -1
  178. package/dist/agent-farm/utils/index.js.map +1 -1
  179. package/dist/agent-farm/utils/notifications.d.ts +30 -0
  180. package/dist/agent-farm/utils/notifications.d.ts.map +1 -0
  181. package/dist/agent-farm/utils/notifications.js +121 -0
  182. package/dist/agent-farm/utils/notifications.js.map +1 -0
  183. package/dist/agent-farm/utils/server-utils.d.ts +5 -5
  184. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  185. package/dist/agent-farm/utils/server-utils.js +5 -16
  186. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  187. package/dist/agent-farm/utils/session.d.ts +32 -0
  188. package/dist/agent-farm/utils/session.d.ts.map +1 -0
  189. package/dist/agent-farm/utils/session.js +57 -0
  190. package/dist/agent-farm/utils/session.js.map +1 -0
  191. package/dist/agent-farm/utils/shell.d.ts +9 -22
  192. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  193. package/dist/agent-farm/utils/shell.js +34 -34
  194. package/dist/agent-farm/utils/shell.js.map +1 -1
  195. package/dist/cli.d.ts.map +1 -1
  196. package/dist/cli.js +11 -54
  197. package/dist/cli.js.map +1 -1
  198. package/dist/commands/adopt.d.ts.map +1 -1
  199. package/dist/commands/adopt.js +49 -4
  200. package/dist/commands/adopt.js.map +1 -1
  201. package/dist/commands/consult/index.d.ts +13 -2
  202. package/dist/commands/consult/index.d.ts.map +1 -1
  203. package/dist/commands/consult/index.js +245 -29
  204. package/dist/commands/consult/index.js.map +1 -1
  205. package/dist/commands/doctor.d.ts.map +1 -1
  206. package/dist/commands/doctor.js +96 -79
  207. package/dist/commands/doctor.js.map +1 -1
  208. package/dist/commands/init.d.ts.map +1 -1
  209. package/dist/commands/init.js +52 -3
  210. package/dist/commands/init.js.map +1 -1
  211. package/dist/commands/porch/build-counter.d.ts +5 -0
  212. package/dist/commands/porch/build-counter.d.ts.map +1 -0
  213. package/dist/commands/porch/build-counter.js +5 -0
  214. package/dist/commands/porch/build-counter.js.map +1 -0
  215. package/dist/commands/porch/checks.d.ts +17 -29
  216. package/dist/commands/porch/checks.d.ts.map +1 -1
  217. package/dist/commands/porch/checks.js +96 -144
  218. package/dist/commands/porch/checks.js.map +1 -1
  219. package/dist/commands/porch/index.d.ts +25 -43
  220. package/dist/commands/porch/index.d.ts.map +1 -1
  221. package/dist/commands/porch/index.js +466 -1238
  222. package/dist/commands/porch/index.js.map +1 -1
  223. package/dist/commands/porch/next.d.ts +22 -0
  224. package/dist/commands/porch/next.d.ts.map +1 -0
  225. package/dist/commands/porch/next.js +571 -0
  226. package/dist/commands/porch/next.js.map +1 -0
  227. package/dist/commands/porch/plan.d.ts +70 -0
  228. package/dist/commands/porch/plan.d.ts.map +1 -0
  229. package/dist/commands/porch/plan.js +190 -0
  230. package/dist/commands/porch/plan.js.map +1 -0
  231. package/dist/commands/porch/prompts.d.ts +19 -0
  232. package/dist/commands/porch/prompts.d.ts.map +1 -0
  233. package/dist/commands/porch/prompts.js +277 -0
  234. package/dist/commands/porch/prompts.js.map +1 -0
  235. package/dist/commands/porch/protocol.d.ts +59 -0
  236. package/dist/commands/porch/protocol.d.ts.map +1 -0
  237. package/dist/commands/porch/protocol.js +294 -0
  238. package/dist/commands/porch/protocol.js.map +1 -0
  239. package/dist/commands/porch/state.d.ts +36 -107
  240. package/dist/commands/porch/state.d.ts.map +1 -1
  241. package/dist/commands/porch/state.js +120 -699
  242. package/dist/commands/porch/state.js.map +1 -1
  243. package/dist/commands/porch/types.d.ts +99 -164
  244. package/dist/commands/porch/types.d.ts.map +1 -1
  245. package/dist/commands/porch/types.js +2 -1
  246. package/dist/commands/porch/types.js.map +1 -1
  247. package/dist/commands/porch/verdict.d.ts +31 -0
  248. package/dist/commands/porch/verdict.d.ts.map +1 -0
  249. package/dist/commands/porch/verdict.js +59 -0
  250. package/dist/commands/porch/verdict.js.map +1 -0
  251. package/dist/commands/update.d.ts.map +1 -1
  252. package/dist/commands/update.js +31 -0
  253. package/dist/commands/update.js.map +1 -1
  254. package/dist/lib/scaffold.d.ts +37 -0
  255. package/dist/lib/scaffold.d.ts.map +1 -1
  256. package/dist/lib/scaffold.js +114 -0
  257. package/dist/lib/scaffold.js.map +1 -1
  258. package/dist/terminal/index.d.ts +8 -0
  259. package/dist/terminal/index.d.ts.map +1 -0
  260. package/dist/terminal/index.js +5 -0
  261. package/dist/terminal/index.js.map +1 -0
  262. package/dist/terminal/pty-manager.d.ts +69 -0
  263. package/dist/terminal/pty-manager.d.ts.map +1 -0
  264. package/dist/terminal/pty-manager.js +377 -0
  265. package/dist/terminal/pty-manager.js.map +1 -0
  266. package/dist/terminal/pty-session.d.ts +104 -0
  267. package/dist/terminal/pty-session.d.ts.map +1 -0
  268. package/dist/terminal/pty-session.js +327 -0
  269. package/dist/terminal/pty-session.js.map +1 -0
  270. package/dist/terminal/ring-buffer.d.ts +34 -0
  271. package/dist/terminal/ring-buffer.d.ts.map +1 -0
  272. package/dist/terminal/ring-buffer.js +94 -0
  273. package/dist/terminal/ring-buffer.js.map +1 -0
  274. package/dist/terminal/session-manager.d.ts +115 -0
  275. package/dist/terminal/session-manager.d.ts.map +1 -0
  276. package/dist/terminal/session-manager.js +582 -0
  277. package/dist/terminal/session-manager.js.map +1 -0
  278. package/dist/terminal/shellper-client.d.ts +66 -0
  279. package/dist/terminal/shellper-client.d.ts.map +1 -0
  280. package/dist/terminal/shellper-client.js +234 -0
  281. package/dist/terminal/shellper-client.js.map +1 -0
  282. package/dist/terminal/shellper-main.d.ts +19 -0
  283. package/dist/terminal/shellper-main.d.ts.map +1 -0
  284. package/dist/terminal/shellper-main.js +153 -0
  285. package/dist/terminal/shellper-main.js.map +1 -0
  286. package/dist/terminal/shellper-process.d.ts +75 -0
  287. package/dist/terminal/shellper-process.d.ts.map +1 -0
  288. package/dist/terminal/shellper-process.js +279 -0
  289. package/dist/terminal/shellper-process.js.map +1 -0
  290. package/dist/terminal/shellper-protocol.d.ts +115 -0
  291. package/dist/terminal/shellper-protocol.d.ts.map +1 -0
  292. package/dist/terminal/shellper-protocol.js +214 -0
  293. package/dist/terminal/shellper-protocol.js.map +1 -0
  294. package/dist/terminal/shellper-replay-buffer.d.ts +38 -0
  295. package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -0
  296. package/dist/terminal/shellper-replay-buffer.js +94 -0
  297. package/dist/terminal/shellper-replay-buffer.js.map +1 -0
  298. package/dist/terminal/ws-protocol.d.ts +27 -0
  299. package/dist/terminal/ws-protocol.d.ts.map +1 -0
  300. package/dist/terminal/ws-protocol.js +44 -0
  301. package/dist/terminal/ws-protocol.js.map +1 -0
  302. package/package.json +19 -5
  303. package/skeleton/.claude/skills/af/SKILL.md +89 -0
  304. package/skeleton/.claude/skills/codev/SKILL.md +41 -0
  305. package/skeleton/.claude/skills/consult/SKILL.md +81 -0
  306. package/skeleton/.claude/skills/generate-image/SKILL.md +56 -0
  307. package/skeleton/DEPENDENCIES.md +4 -62
  308. package/skeleton/builders.md +1 -1
  309. package/skeleton/consult-types/impl-review.md +18 -9
  310. package/skeleton/consult-types/integration-review.md +1 -1
  311. package/skeleton/consult-types/plan-review.md +1 -1
  312. package/skeleton/consult-types/pr-ready.md +1 -1
  313. package/skeleton/consult-types/spec-review.md +1 -1
  314. package/skeleton/porch/prompts/defend.md +1 -1
  315. package/skeleton/porch/prompts/evaluate.md +2 -2
  316. package/skeleton/porch/prompts/implement.md +1 -1
  317. package/skeleton/porch/prompts/plan.md +1 -1
  318. package/skeleton/porch/prompts/review.md +4 -4
  319. package/skeleton/porch/prompts/specify.md +1 -1
  320. package/skeleton/porch/prompts/understand.md +2 -2
  321. package/skeleton/protocol-schema.json +282 -0
  322. package/skeleton/protocols/bugfix/builder-prompt.md +60 -0
  323. package/skeleton/protocols/bugfix/prompts/fix.md +77 -0
  324. package/skeleton/protocols/bugfix/prompts/investigate.md +77 -0
  325. package/skeleton/protocols/bugfix/prompts/pr.md +84 -0
  326. package/skeleton/protocols/bugfix/protocol.json +20 -33
  327. package/skeleton/protocols/experiment/builder-prompt.md +52 -0
  328. package/skeleton/protocols/experiment/protocol.json +101 -0
  329. package/skeleton/protocols/experiment/protocol.md +3 -3
  330. package/skeleton/protocols/experiment/templates/notes.md +1 -1
  331. package/skeleton/protocols/maintain/builder-prompt.md +46 -0
  332. package/skeleton/protocols/maintain/prompts/audit.md +111 -0
  333. package/skeleton/protocols/maintain/prompts/clean.md +91 -0
  334. package/skeleton/protocols/maintain/prompts/sync.md +113 -0
  335. package/skeleton/protocols/maintain/prompts/verify.md +110 -0
  336. package/skeleton/protocols/maintain/protocol.json +141 -0
  337. package/skeleton/protocols/maintain/protocol.md +17 -11
  338. package/skeleton/protocols/protocol-schema.json +54 -1
  339. package/skeleton/protocols/spir/builder-prompt.md +66 -0
  340. package/skeleton/protocols/spir/prompts/implement.md +208 -0
  341. package/skeleton/protocols/{spider → spir}/prompts/plan.md +6 -70
  342. package/skeleton/protocols/{spider → spir}/prompts/review.md +20 -39
  343. package/skeleton/protocols/{spider → spir}/prompts/specify.md +33 -61
  344. package/skeleton/protocols/spir/protocol.json +156 -0
  345. package/skeleton/protocols/{spider → spir}/protocol.md +35 -21
  346. package/skeleton/protocols/{spider → spir}/templates/plan.md +14 -0
  347. package/skeleton/protocols/spir/templates/review.md +89 -0
  348. package/skeleton/protocols/tick/builder-prompt.md +56 -0
  349. package/skeleton/protocols/tick/protocol.json +7 -2
  350. package/skeleton/protocols/tick/protocol.md +18 -18
  351. package/skeleton/protocols/tick/templates/review.md +1 -1
  352. package/skeleton/resources/commands/agent-farm.md +63 -46
  353. package/skeleton/resources/commands/codev.md +0 -2
  354. package/skeleton/resources/commands/overview.md +7 -17
  355. package/skeleton/resources/workflow-reference.md +4 -4
  356. package/skeleton/roles/architect.md +152 -315
  357. package/skeleton/roles/builder.md +120 -214
  358. package/skeleton/roles/consultant.md +6 -6
  359. package/skeleton/templates/AGENTS.md +2 -2
  360. package/skeleton/templates/CLAUDE.md +2 -2
  361. package/skeleton/templates/cheatsheet.md +7 -5
  362. package/skeleton/templates/projectlist.md +1 -1
  363. package/templates/dashboard/index.html +17 -43
  364. package/templates/dashboard/js/dialogs.js +7 -7
  365. package/templates/dashboard/js/files.js +2 -2
  366. package/templates/dashboard/js/main.js +4 -4
  367. package/templates/dashboard/js/projects.js +3 -3
  368. package/templates/dashboard/js/tabs.js +1 -1
  369. package/templates/dashboard/js/utils.js +22 -87
  370. package/templates/open.html +26 -0
  371. package/templates/tower.html +731 -91
  372. package/dist/agent-farm/commands/kickoff.d.ts +0 -20
  373. package/dist/agent-farm/commands/kickoff.d.ts.map +0 -1
  374. package/dist/agent-farm/commands/kickoff.js +0 -337
  375. package/dist/agent-farm/commands/kickoff.js.map +0 -1
  376. package/dist/agent-farm/commands/rename.d.ts +0 -13
  377. package/dist/agent-farm/commands/rename.d.ts.map +0 -1
  378. package/dist/agent-farm/commands/rename.js +0 -33
  379. package/dist/agent-farm/commands/rename.js.map +0 -1
  380. package/dist/agent-farm/commands/tutorial.d.ts +0 -10
  381. package/dist/agent-farm/commands/tutorial.d.ts.map +0 -1
  382. package/dist/agent-farm/commands/tutorial.js +0 -49
  383. package/dist/agent-farm/commands/tutorial.js.map +0 -1
  384. package/dist/agent-farm/commands/util.d.ts +0 -15
  385. package/dist/agent-farm/commands/util.d.ts.map +0 -1
  386. package/dist/agent-farm/commands/util.js +0 -108
  387. package/dist/agent-farm/commands/util.js.map +0 -1
  388. package/dist/agent-farm/servers/dashboard-server.d.ts +0 -7
  389. package/dist/agent-farm/servers/dashboard-server.d.ts.map +0 -1
  390. package/dist/agent-farm/servers/dashboard-server.js +0 -1872
  391. package/dist/agent-farm/servers/dashboard-server.js.map +0 -1
  392. package/dist/agent-farm/servers/open-server.d.ts +0 -7
  393. package/dist/agent-farm/servers/open-server.d.ts.map +0 -1
  394. package/dist/agent-farm/servers/open-server.js +0 -315
  395. package/dist/agent-farm/servers/open-server.js.map +0 -1
  396. package/dist/agent-farm/tutorial/index.d.ts +0 -8
  397. package/dist/agent-farm/tutorial/index.d.ts.map +0 -1
  398. package/dist/agent-farm/tutorial/index.js +0 -8
  399. package/dist/agent-farm/tutorial/index.js.map +0 -1
  400. package/dist/agent-farm/tutorial/prompts.d.ts +0 -57
  401. package/dist/agent-farm/tutorial/prompts.d.ts.map +0 -1
  402. package/dist/agent-farm/tutorial/prompts.js +0 -147
  403. package/dist/agent-farm/tutorial/prompts.js.map +0 -1
  404. package/dist/agent-farm/tutorial/runner.d.ts +0 -52
  405. package/dist/agent-farm/tutorial/runner.d.ts.map +0 -1
  406. package/dist/agent-farm/tutorial/runner.js +0 -204
  407. package/dist/agent-farm/tutorial/runner.js.map +0 -1
  408. package/dist/agent-farm/tutorial/state.d.ts +0 -26
  409. package/dist/agent-farm/tutorial/state.d.ts.map +0 -1
  410. package/dist/agent-farm/tutorial/state.js +0 -89
  411. package/dist/agent-farm/tutorial/state.js.map +0 -1
  412. package/dist/agent-farm/tutorial/steps/first-spec.d.ts +0 -7
  413. package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +0 -1
  414. package/dist/agent-farm/tutorial/steps/first-spec.js +0 -136
  415. package/dist/agent-farm/tutorial/steps/first-spec.js.map +0 -1
  416. package/dist/agent-farm/tutorial/steps/implementation.d.ts +0 -7
  417. package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +0 -1
  418. package/dist/agent-farm/tutorial/steps/implementation.js +0 -76
  419. package/dist/agent-farm/tutorial/steps/implementation.js.map +0 -1
  420. package/dist/agent-farm/tutorial/steps/index.d.ts +0 -10
  421. package/dist/agent-farm/tutorial/steps/index.d.ts.map +0 -1
  422. package/dist/agent-farm/tutorial/steps/index.js +0 -10
  423. package/dist/agent-farm/tutorial/steps/index.js.map +0 -1
  424. package/dist/agent-farm/tutorial/steps/planning.d.ts +0 -7
  425. package/dist/agent-farm/tutorial/steps/planning.d.ts.map +0 -1
  426. package/dist/agent-farm/tutorial/steps/planning.js +0 -143
  427. package/dist/agent-farm/tutorial/steps/planning.js.map +0 -1
  428. package/dist/agent-farm/tutorial/steps/review.d.ts +0 -7
  429. package/dist/agent-farm/tutorial/steps/review.d.ts.map +0 -1
  430. package/dist/agent-farm/tutorial/steps/review.js +0 -78
  431. package/dist/agent-farm/tutorial/steps/review.js.map +0 -1
  432. package/dist/agent-farm/tutorial/steps/setup.d.ts +0 -7
  433. package/dist/agent-farm/tutorial/steps/setup.d.ts.map +0 -1
  434. package/dist/agent-farm/tutorial/steps/setup.js +0 -126
  435. package/dist/agent-farm/tutorial/steps/setup.js.map +0 -1
  436. package/dist/agent-farm/tutorial/steps/welcome.d.ts +0 -7
  437. package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +0 -1
  438. package/dist/agent-farm/tutorial/steps/welcome.js +0 -50
  439. package/dist/agent-farm/tutorial/steps/welcome.js.map +0 -1
  440. package/dist/agent-farm/utils/orphan-handler.d.ts +0 -27
  441. package/dist/agent-farm/utils/orphan-handler.d.ts.map +0 -1
  442. package/dist/agent-farm/utils/orphan-handler.js +0 -149
  443. package/dist/agent-farm/utils/orphan-handler.js.map +0 -1
  444. package/dist/agent-farm/utils/port-registry.d.ts +0 -58
  445. package/dist/agent-farm/utils/port-registry.d.ts.map +0 -1
  446. package/dist/agent-farm/utils/port-registry.js +0 -166
  447. package/dist/agent-farm/utils/port-registry.js.map +0 -1
  448. package/dist/agent-farm/utils/terminal-ports.d.ts +0 -18
  449. package/dist/agent-farm/utils/terminal-ports.d.ts.map +0 -1
  450. package/dist/agent-farm/utils/terminal-ports.js +0 -35
  451. package/dist/agent-farm/utils/terminal-ports.js.map +0 -1
  452. package/dist/commands/pcheck/cache.d.ts +0 -48
  453. package/dist/commands/pcheck/cache.d.ts.map +0 -1
  454. package/dist/commands/pcheck/cache.js +0 -170
  455. package/dist/commands/pcheck/cache.js.map +0 -1
  456. package/dist/commands/pcheck/evaluator.d.ts +0 -15
  457. package/dist/commands/pcheck/evaluator.d.ts.map +0 -1
  458. package/dist/commands/pcheck/evaluator.js +0 -246
  459. package/dist/commands/pcheck/evaluator.js.map +0 -1
  460. package/dist/commands/pcheck/index.d.ts +0 -12
  461. package/dist/commands/pcheck/index.d.ts.map +0 -1
  462. package/dist/commands/pcheck/index.js +0 -249
  463. package/dist/commands/pcheck/index.js.map +0 -1
  464. package/dist/commands/pcheck/parser.d.ts +0 -39
  465. package/dist/commands/pcheck/parser.d.ts.map +0 -1
  466. package/dist/commands/pcheck/parser.js +0 -155
  467. package/dist/commands/pcheck/parser.js.map +0 -1
  468. package/dist/commands/pcheck/types.d.ts +0 -82
  469. package/dist/commands/pcheck/types.d.ts.map +0 -1
  470. package/dist/commands/pcheck/types.js +0 -5
  471. package/dist/commands/pcheck/types.js.map +0 -1
  472. package/dist/commands/porch/consultation.d.ts +0 -56
  473. package/dist/commands/porch/consultation.d.ts.map +0 -1
  474. package/dist/commands/porch/consultation.js +0 -330
  475. package/dist/commands/porch/consultation.js.map +0 -1
  476. package/dist/commands/porch/notifications.d.ts +0 -99
  477. package/dist/commands/porch/notifications.d.ts.map +0 -1
  478. package/dist/commands/porch/notifications.js +0 -223
  479. package/dist/commands/porch/notifications.js.map +0 -1
  480. package/dist/commands/porch/plan-parser.d.ts +0 -38
  481. package/dist/commands/porch/plan-parser.d.ts.map +0 -1
  482. package/dist/commands/porch/plan-parser.js +0 -166
  483. package/dist/commands/porch/plan-parser.js.map +0 -1
  484. package/dist/commands/porch/protocol-loader.d.ts +0 -46
  485. package/dist/commands/porch/protocol-loader.d.ts.map +0 -1
  486. package/dist/commands/porch/protocol-loader.js +0 -253
  487. package/dist/commands/porch/protocol-loader.js.map +0 -1
  488. package/dist/commands/porch/signal-parser.d.ts +0 -88
  489. package/dist/commands/porch/signal-parser.d.ts.map +0 -1
  490. package/dist/commands/porch/signal-parser.js +0 -148
  491. package/dist/commands/porch/signal-parser.js.map +0 -1
  492. package/dist/commands/tower.d.ts +0 -16
  493. package/dist/commands/tower.d.ts.map +0 -1
  494. package/dist/commands/tower.js +0 -21
  495. package/dist/commands/tower.js.map +0 -1
  496. package/skeleton/config.json +0 -7
  497. package/skeleton/porch/protocols/bugfix.json +0 -85
  498. package/skeleton/porch/protocols/spider.json +0 -135
  499. package/skeleton/porch/protocols/tick.json +0 -76
  500. package/skeleton/protocols/spider/prompts/defend.md +0 -215
  501. package/skeleton/protocols/spider/prompts/evaluate.md +0 -241
  502. package/skeleton/protocols/spider/prompts/implement.md +0 -149
  503. package/skeleton/protocols/spider/protocol.json +0 -210
  504. package/skeleton/protocols/spider/templates/review.md +0 -207
  505. package/templates/dashboard/css/activity.css +0 -151
  506. package/templates/dashboard/js/activity.js +0 -112
  507. /package/skeleton/protocols/{spider → spir}/templates/spec.md +0 -0
@@ -1,38 +1,38 @@
1
1
  # Implementation Review Prompt
2
2
 
3
3
  ## Context
4
- You are reviewing implementation work at Stage 4 (IMPLEMENTING) of the workflow. A builder has completed a phase (Implement + Defend) and needs feedback before proceeding. Your job is to verify the implementation matches the spec and plan.
4
+ You are reviewing implementation work during the Implement phase. A builder has completed a plan phase and needs feedback before proceeding. Your job is to verify the implementation matches the spec and plan.
5
+
6
+ ## CRITICAL: Verify Before Flagging
7
+
8
+ Before requesting changes for missing configuration, incorrect patterns, or framework issues:
9
+ 1. **Check `package.json`** for actual dependency versions — framework conventions change between major versions
10
+ 2. **Read the actual config files** (or confirm their deliberate absence) before flagging missing configs
11
+ 3. **Do not assume** your training data reflects the version in use — verify against project files
12
+ 4. If "Previous Iteration Context" is provided, read it carefully before re-raising concerns that were already disputed
5
13
 
6
14
  ## Focus Areas
7
15
 
8
16
  1. **Spec Adherence**
9
17
  - Does the implementation fulfill the spec requirements for this phase?
10
18
  - Are acceptance criteria met?
11
- - Are there deviations from the spec that need explanation?
12
19
 
13
20
  2. **Code Quality**
14
21
  - Is the code readable and maintainable?
15
22
  - Are there obvious bugs or issues?
16
23
  - Are error cases handled appropriately?
17
- - Does it follow project conventions?
18
24
 
19
25
  3. **Test Coverage**
20
26
  - Are the tests adequate for this phase?
21
27
  - Do tests cover the main paths AND edge cases?
22
- - Are tests testing the right things (behavior, not implementation)?
23
- - Would the tests catch regressions?
24
28
 
25
29
  4. **Plan Alignment**
26
30
  - Does the implementation follow the plan?
27
- - Are there deviations that make sense?
28
31
  - Are there plan items skipped or partially completed?
29
32
 
30
33
  5. **UX Verification** (if spec has UX requirements)
31
34
  - Does the actual user experience match what the spec describes?
32
35
  - If spec says "async" or "non-blocking", is it actually async?
33
- - If spec says "immediate response", does user get one quickly?
34
- - Do any flow diagrams in the spec match the actual behavior?
35
- - **CRITICAL:** A synchronous implementation that passes tests can completely fail UX requirements
36
36
 
37
37
  ## Verdict Format
38
38
 
@@ -55,6 +55,15 @@ KEY_ISSUES:
55
55
  - `REQUEST_CHANGES`: Issues that must be fixed before proceeding
56
56
  - `COMMENT`: Minor suggestions, can proceed but note feedback
57
57
 
58
+ ## Scoping (Multi-Phase Plans)
59
+
60
+ When the implementation plan has multiple phases (e.g., scaffolding, landing, media_rtl):
61
+ - **ONLY review work belonging to the current plan phase**
62
+ - The query will specify which phase you are reviewing
63
+ - Do NOT request changes for functionality scheduled in later phases
64
+ - Do NOT flag missing features that are out of scope for this phase
65
+ - If unsure whether something belongs to this phase, check the plan file
66
+
58
67
  ## Notes
59
68
 
60
69
  - This is a phase-level review, not the final PR review
@@ -1,7 +1,7 @@
1
1
  # Integration Review Prompt
2
2
 
3
3
  ## Context
4
- You are performing an integration review at Stage 6 (COMMITTED) of the workflow. The builder has created a PR and you are evaluating whether this change fits well into the broader system. This is the architect's review, focusing on how the change integrates rather than whether it works.
4
+ You are performing an integration review of a pull request. The builder has created a PR and you are evaluating whether this change fits well into the broader system. This is the architect's review, focusing on how the change integrates rather than whether it works.
5
5
 
6
6
  ## Focus Areas
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Plan Review Prompt
2
2
 
3
3
  ## Context
4
- You are reviewing an implementation plan at Stage 2 (SPECIFIED) of the workflow. The spec has been approved - now you must evaluate whether the plan adequately describes HOW to implement it.
4
+ You are reviewing an implementation plan during the Plan phase. The spec has been approved - now you must evaluate whether the plan adequately describes HOW to implement it.
5
5
 
6
6
  ## Focus Areas
7
7
 
@@ -1,7 +1,7 @@
1
1
  # PR Ready Review Prompt
2
2
 
3
3
  ## Context
4
- You are performing a final self-check at Stage 5 (IMPLEMENTED) of the workflow. The builder has completed all implementation phases and is about to create a PR. This is the last check before the work goes to the architect for integration review.
4
+ You are performing a final self-check during the Review phase. The builder has completed all implementation phases and is about to create a PR. This is the last check before the work goes to the architect for integration review.
5
5
 
6
6
  ## Focus Areas
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Specification Review Prompt
2
2
 
3
3
  ## Context
4
- You are reviewing a feature specification at Stage 1 (CONCEIVED) of the workflow. Your role is to ensure the spec is complete, correct, and feasible before it moves to human approval.
4
+ You are reviewing a feature specification during the Specify phase. Your role is to ensure the spec is complete, correct, and feasible before it moves to human approval.
5
5
 
6
6
  ## Focus Areas
7
7
 
@@ -1,6 +1,6 @@
1
1
  # Defend Phase Prompt
2
2
 
3
- You are the **Tester** hat in a Ralph-SPIDER loop.
3
+ You are the **Tester** hat in a Ralph-SPIR loop.
4
4
 
5
5
  ## Your Mission
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Evaluate Phase Prompt
2
2
 
3
- You are the **Verifier** hat in a Ralph-SPIDER loop.
3
+ You are the **Verifier** hat in a Ralph-SPIR loop.
4
4
 
5
5
  ## Your Mission
6
6
 
@@ -66,7 +66,7 @@ Create or update evaluation notes in the status file:
66
66
  ```markdown
67
67
  ## Evaluation Report
68
68
 
69
- **Evaluator**: Ralph-SPIDER Verifier
69
+ **Evaluator**: Ralph-SPIR Verifier
70
70
  **Date**: {date}
71
71
  **Phase**: {phase-name}
72
72
 
@@ -1,6 +1,6 @@
1
1
  # Implement Phase Prompt
2
2
 
3
- You are the **Implementer** hat in a Ralph-SPIDER loop.
3
+ You are the **Implementer** hat in a Ralph-SPIR loop.
4
4
 
5
5
  ## Your Mission
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Plan Phase Prompt
2
2
 
3
- You are the **Planner** hat in a Ralph-SPIDER loop.
3
+ You are the **Planner** hat in a Ralph-SPIR loop.
4
4
 
5
5
  ## Your Mission
6
6
 
@@ -1,10 +1,10 @@
1
1
  # Review Phase Prompt
2
2
 
3
- You are the **Reviewer** hat in a Ralph-SPIDER loop.
3
+ You are the **Reviewer** hat in a Ralph-SPIR loop.
4
4
 
5
5
  ## Your Mission
6
6
 
7
- Create the final deliverables: PR and review document. This is the capstone of the SPIDER protocol.
7
+ Create the final deliverables: PR and review document. This is the capstone of the SPIR protocol.
8
8
 
9
9
  ## Input Context
10
10
 
@@ -27,7 +27,7 @@ Create `codev/reviews/{project-id}-{name}.md` with:
27
27
  - **ID**: {project-id}
28
28
  - **Spec**: `codev/specs/{project-id}-{name}.md`
29
29
  - **Plan**: `codev/plans/{project-id}-{name}.md`
30
- - **Protocol**: ralph-spider
30
+ - **Protocol**: ralph-spir
31
31
  - **Completed**: {date}
32
32
 
33
33
  ## Summary
@@ -78,7 +78,7 @@ One paragraph summarizing what was built and why.
78
78
  2. Pattern that worked well
79
79
 
80
80
  ### Process Insights
81
- 1. What worked well in the SPIDER process
81
+ 1. What worked well in the SPIR process
82
82
  2. What could be improved
83
83
 
84
84
  ## Recommendations
@@ -1,6 +1,6 @@
1
1
  # Specify Phase Prompt
2
2
 
3
- You are the **Spec Writer** hat in a Ralph-SPIDER loop.
3
+ You are the **Spec Writer** hat in a Ralph-SPIR loop.
4
4
 
5
5
  ## Your Mission
6
6
 
@@ -30,7 +30,7 @@ TICK is appropriate when:
30
30
  - [ ] Requirements are clear
31
31
  - [ ] No architectural changes needed
32
32
 
33
- If NOT appropriate, signal: `<signal>NEEDS_SPIDER</signal>`
33
+ If NOT appropriate, signal: `<signal>NEEDS_SPIR</signal>`
34
34
 
35
35
  ### 3. Document Understanding
36
36
 
@@ -58,4 +58,4 @@ When understanding is complete:
58
58
 
59
59
  - DO NOT start implementing
60
60
  - DO NOT create new spec files (amend existing)
61
- - Keep scope small - if > 300 LOC, recommend SPIDER instead
61
+ - Keep scope small - if > 300 LOC, recommend SPIR instead
@@ -0,0 +1,282 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://codev.dev/protocol-schema.json",
4
+ "title": "Codev Protocol Definition",
5
+ "description": "Schema for porch protocol definitions (SPIR, TICK, BUGFIX, etc.)",
6
+ "type": "object",
7
+ "required": ["name", "phases"],
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string",
11
+ "description": "JSON Schema reference"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "description": "Protocol name (e.g., 'spir', 'tick', 'bugfix')",
16
+ "pattern": "^[a-z][a-z0-9-]*$"
17
+ },
18
+ "alias": {
19
+ "type": "string",
20
+ "description": "Alternative name for the protocol (e.g., 'spider' for spir)"
21
+ },
22
+ "version": {
23
+ "type": "string",
24
+ "description": "Semantic version of the protocol",
25
+ "pattern": "^\\d+\\.\\d+\\.\\d+(-[a-z0-9.]+)?$"
26
+ },
27
+ "description": {
28
+ "type": "string",
29
+ "description": "Human-readable description of the protocol"
30
+ },
31
+ "phases": {
32
+ "type": "array",
33
+ "description": "Ordered list of protocol phases",
34
+ "minItems": 1,
35
+ "items": { "$ref": "#/$defs/phase" }
36
+ },
37
+ "signals": {
38
+ "type": "object",
39
+ "description": "Signals that can be emitted during protocol execution",
40
+ "additionalProperties": { "$ref": "#/$defs/signal" }
41
+ },
42
+ "phase_completion": {
43
+ "type": "object",
44
+ "description": "Checks run when a plan phase completes",
45
+ "additionalProperties": {
46
+ "type": "string",
47
+ "description": "Shell command to run"
48
+ }
49
+ },
50
+ "defaults": {
51
+ "type": "object",
52
+ "description": "Default values for phase properties",
53
+ "properties": {
54
+ "max_iterations": {
55
+ "type": "integer",
56
+ "minimum": 1,
57
+ "maximum": 20,
58
+ "default": 7
59
+ },
60
+ "verify": { "$ref": "#/$defs/verifyConfig" }
61
+ }
62
+ }
63
+ },
64
+ "$defs": {
65
+ "phase": {
66
+ "type": "object",
67
+ "required": ["id", "name"],
68
+ "properties": {
69
+ "id": {
70
+ "type": "string",
71
+ "description": "Unique phase identifier",
72
+ "pattern": "^[a-z][a-z0-9_-]*$"
73
+ },
74
+ "name": {
75
+ "type": "string",
76
+ "description": "Human-readable phase name"
77
+ },
78
+ "description": {
79
+ "type": "string",
80
+ "description": "What this phase does"
81
+ },
82
+ "type": {
83
+ "type": "string",
84
+ "enum": ["once", "build_verify", "per_plan_phase"],
85
+ "description": "Phase execution type",
86
+ "default": "build_verify"
87
+ },
88
+ "build": { "$ref": "#/$defs/buildConfig" },
89
+ "verify": { "$ref": "#/$defs/verifyConfig" },
90
+ "max_iterations": {
91
+ "type": "integer",
92
+ "description": "Maximum build-verify iterations before failing",
93
+ "minimum": 1,
94
+ "maximum": 20,
95
+ "default": 7
96
+ },
97
+ "on_complete": { "$ref": "#/$defs/onCompleteConfig" },
98
+ "checks": {
99
+ "type": "object",
100
+ "description": "Named checks to run during this phase",
101
+ "additionalProperties": { "$ref": "#/$defs/check" }
102
+ },
103
+ "gate": {
104
+ "oneOf": [
105
+ {
106
+ "type": "string",
107
+ "description": "Gate name (simple format)",
108
+ "pattern": "^[a-z][a-z0-9-]*$"
109
+ },
110
+ {
111
+ "$ref": "#/$defs/gateConfig",
112
+ "description": "Gate with options (extended format)"
113
+ }
114
+ ]
115
+ },
116
+ "transition": { "$ref": "#/$defs/transitionConfig" },
117
+ "next": {
118
+ "oneOf": [
119
+ { "type": "string", "description": "Next phase id" },
120
+ { "type": "null", "description": "Terminal phase" }
121
+ ]
122
+ }
123
+ }
124
+ },
125
+ "buildConfig": {
126
+ "type": "object",
127
+ "description": "Configuration for the build step",
128
+ "required": ["prompt", "artifact"],
129
+ "properties": {
130
+ "prompt": {
131
+ "type": "string",
132
+ "description": "Prompt file name (e.g., 'specify.md')"
133
+ },
134
+ "artifact": {
135
+ "type": "string",
136
+ "description": "Artifact path pattern with ${PROJECT_ID} variable"
137
+ }
138
+ }
139
+ },
140
+ "verifyConfig": {
141
+ "type": "object",
142
+ "description": "Configuration for 3-way verification",
143
+ "required": ["type", "models"],
144
+ "properties": {
145
+ "type": {
146
+ "type": "string",
147
+ "description": "Review type (maps to consult --type)",
148
+ "enum": ["spec-review", "plan-review", "impl-review", "pr-ready", "integration-review"]
149
+ },
150
+ "models": {
151
+ "type": "array",
152
+ "description": "Models to consult",
153
+ "items": {
154
+ "type": "string",
155
+ "enum": ["gemini", "codex", "claude"]
156
+ },
157
+ "minItems": 1
158
+ },
159
+ "parallel": {
160
+ "type": "boolean",
161
+ "description": "Run consultations in parallel",
162
+ "default": true
163
+ }
164
+ }
165
+ },
166
+ "onCompleteConfig": {
167
+ "type": "object",
168
+ "description": "Actions to perform after successful verification",
169
+ "properties": {
170
+ "commit": {
171
+ "type": "boolean",
172
+ "description": "Commit artifact to git",
173
+ "default": false
174
+ },
175
+ "push": {
176
+ "type": "boolean",
177
+ "description": "Push commit to remote",
178
+ "default": false
179
+ }
180
+ }
181
+ },
182
+ "check": {
183
+ "oneOf": [
184
+ {
185
+ "type": "string",
186
+ "description": "Simple shell command"
187
+ },
188
+ {
189
+ "type": "object",
190
+ "description": "Check with options",
191
+ "required": ["command"],
192
+ "properties": {
193
+ "command": {
194
+ "type": "string",
195
+ "description": "Shell command to run"
196
+ },
197
+ "description": {
198
+ "type": "string",
199
+ "description": "Human-readable description"
200
+ },
201
+ "on_fail": {
202
+ "type": "string",
203
+ "enum": ["fail", "retry", "warn"],
204
+ "description": "Action on failure",
205
+ "default": "fail"
206
+ },
207
+ "max_retries": {
208
+ "type": "integer",
209
+ "description": "Maximum retry attempts",
210
+ "minimum": 0,
211
+ "maximum": 10,
212
+ "default": 0
213
+ },
214
+ "optional": {
215
+ "type": "boolean",
216
+ "description": "Don't fail protocol if check fails",
217
+ "default": false
218
+ }
219
+ }
220
+ }
221
+ ]
222
+ },
223
+ "transitionConfig": {
224
+ "type": "object",
225
+ "description": "Transition rules for per_plan_phase types",
226
+ "properties": {
227
+ "on_complete": {
228
+ "type": "string",
229
+ "description": "Phase to transition to after each plan phase"
230
+ },
231
+ "on_all_phases_complete": {
232
+ "type": "string",
233
+ "description": "Phase to transition to when all plan phases complete"
234
+ }
235
+ }
236
+ },
237
+ "signal": {
238
+ "type": "object",
239
+ "description": "Signal definition",
240
+ "properties": {
241
+ "description": {
242
+ "type": "string"
243
+ },
244
+ "transitions_to": {
245
+ "type": "string",
246
+ "description": "State to transition to when signal received"
247
+ },
248
+ "requires": {
249
+ "type": "string",
250
+ "description": "Required parameter name"
251
+ }
252
+ }
253
+ },
254
+ "gateConfig": {
255
+ "type": "object",
256
+ "description": "Gate with extended configuration",
257
+ "required": ["name"],
258
+ "properties": {
259
+ "name": {
260
+ "type": "string",
261
+ "description": "Gate identifier",
262
+ "pattern": "^[a-z][a-z0-9-]*$"
263
+ },
264
+ "description": {
265
+ "type": "string",
266
+ "description": "Human-readable description"
267
+ },
268
+ "requires": {
269
+ "type": "array",
270
+ "description": "Check names that must pass before gate can be approved",
271
+ "items": { "type": "string" }
272
+ },
273
+ "next": {
274
+ "oneOf": [
275
+ { "type": "string", "description": "Next phase after gate approval" },
276
+ { "type": "null", "description": "Terminal gate" }
277
+ ]
278
+ }
279
+ }
280
+ }
281
+ }
282
+ }
@@ -0,0 +1,60 @@
1
+ # {{protocol_name}} Builder ({{mode}} mode)
2
+
3
+ You are implementing {{input_description}}.
4
+
5
+ {{#if mode_soft}}
6
+ ## Mode: SOFT
7
+ You are running in SOFT mode. This means:
8
+ - You follow the BUGFIX protocol yourself (no porch orchestration)
9
+ - The architect monitors your work and verifies you're adhering to the protocol
10
+ - Run consultations manually when the protocol calls for them
11
+ - You have flexibility in execution, but must stay compliant with the protocol
12
+ {{/if}}
13
+
14
+ {{#if mode_strict}}
15
+ ## Mode: STRICT
16
+ You are running in STRICT mode. This means:
17
+ - Porch orchestrates your work
18
+ - Run: `porch next` to get your next tasks
19
+ - Follow porch signals and gate approvals
20
+
21
+ ### ABSOLUTE RESTRICTIONS (STRICT MODE)
22
+ - **NEVER edit `status.yaml` directly** — only porch commands may modify project state
23
+ - **NEVER call `porch approve` without explicit human approval** — only run it after the architect says to
24
+ - **NEVER skip the 3-way review** — always follow porch next → porch done cycle
25
+ {{/if}}
26
+
27
+ ## Protocol
28
+ Follow the BUGFIX protocol: `codev/protocols/bugfix/protocol.md`
29
+
30
+ {{#if issue}}
31
+ ## Issue #{{issue.number}}
32
+ **Title**: {{issue.title}}
33
+
34
+ **Description**:
35
+ {{issue.body}}
36
+
37
+ ## Your Mission
38
+ 1. Reproduce the bug
39
+ 2. Identify root cause
40
+ 3. Implement fix (< 300 LOC)
41
+ 4. Add regression test
42
+ 5. Create PR with "Fixes #{{issue.number}}" in body
43
+ 6. Notify architect via `af send architect "PR #N ready for review (fixes #{{issue.number}})"`
44
+
45
+ If the fix is too complex (> 300 LOC or architectural changes), notify the Architect via:
46
+ ```bash
47
+ af send architect "Issue #{{issue.number}} is more complex than expected. [Reason]. Recommend escalating to SPIR/TICK."
48
+ ```
49
+
50
+ ## Notifications
51
+ Always use `af send architect "..."` to notify the architect at key moments:
52
+ - **PR ready**: `af send architect "PR #N ready for review (fixes #{{issue.number}})"`
53
+ - **PR merged**: `af send architect "PR #N merged for issue #{{issue.number}}. Ready for cleanup."`
54
+ - **Blocked**: `af send architect "Blocked on issue #{{issue.number}}: [reason]"`
55
+ {{/if}}
56
+
57
+ ## Getting Started
58
+ 1. Read the BUGFIX protocol
59
+ 2. Review the issue details
60
+ 3. Reproduce the bug before fixing
@@ -0,0 +1,77 @@
1
+ # FIX Phase Prompt
2
+
3
+ You are executing the **FIX** phase of the BUGFIX protocol.
4
+
5
+ ## Your Goal
6
+
7
+ Implement the bug fix and add a regression test. Keep it minimal and focused.
8
+
9
+ ## Context
10
+
11
+ - **Issue**: #{{issue.number}} — {{issue.title}}
12
+ - **Current State**: {{current_state}}
13
+
14
+ ## Process
15
+
16
+ ### 1. Implement the Fix
17
+
18
+ Apply the minimum change needed to resolve the bug:
19
+ - Fix the root cause identified in the INVESTIGATE phase
20
+ - Do NOT refactor surrounding code
21
+ - Do NOT add features beyond what's needed
22
+ - Do NOT fix other bugs you happen to notice (file separate issues)
23
+
24
+ **Code Quality**:
25
+ - Self-documenting code (clear names, obvious structure)
26
+ - No commented-out code or debug prints
27
+ - Follow existing project conventions
28
+
29
+ ### 2. Add a Regression Test
30
+
31
+ **A regression test is MANDATORY.** Every bugfix MUST include a test unless you provide explicit justification for why a test is impossible (e.g., pure CSS-only change with no testable behavior). If you skip the test, you MUST explain why in your commit message and PR description.
32
+
33
+ Write a test that:
34
+ - Fails without the fix (demonstrates the bug)
35
+ - Passes with the fix (demonstrates the fix works)
36
+ - Covers the specific scenario from the issue
37
+ - Is deterministic (not flaky)
38
+
39
+ Place tests following project conventions (`__tests__/`, `*.test.ts`, etc.).
40
+
41
+ ### 3. Verify the Fix
42
+
43
+ Run build and tests:
44
+
45
+ ```bash
46
+ npm run build # Must pass
47
+ npm test # Must pass
48
+ ```
49
+
50
+ Fix any failures before proceeding. If build/test commands don't exist, check `package.json`.
51
+
52
+ ### 4. Commit
53
+
54
+ Stage and commit your changes:
55
+ - Use explicit file paths (never `git add -A` or `git add .`)
56
+ - Commit message: `Fix #{{issue.number}}: <brief description>`
57
+
58
+ ## Signals
59
+
60
+ When fix and tests are complete and passing:
61
+
62
+ ```
63
+ <signal>PHASE_COMPLETE</signal>
64
+ ```
65
+
66
+ If you encounter a blocker:
67
+
68
+ ```
69
+ <signal>BLOCKED:reason goes here</signal>
70
+ ```
71
+
72
+ ## Important Notes
73
+
74
+ 1. **Minimal changes only** — Fix the bug, nothing else
75
+ 2. **Regression test is MANDATORY** — No fix without a test. If truly untestable, justify in writing.
76
+ 3. **Build AND tests must pass** — Don't signal complete until both pass
77
+ 4. **Stay under 300 LOC** — If the fix grows beyond this, signal `TOO_COMPLEX`