@cluesmith/codev 2.0.0-rc.9 → 2.0.1

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 (537) hide show
  1. package/bin/af.js +2 -2
  2. package/bin/consult.js +1 -1
  3. package/dashboard/dist/assets/index-4n9zpWLY.css +32 -0
  4. package/dashboard/dist/assets/index-b38SaXk5.js +136 -0
  5. package/dashboard/dist/assets/index-b38SaXk5.js.map +1 -0
  6. package/dashboard/dist/index.html +14 -0
  7. package/dist/agent-farm/cli.d.ts.map +1 -1
  8. package/dist/agent-farm/cli.js +179 -104
  9. package/dist/agent-farm/cli.js.map +1 -1
  10. package/dist/agent-farm/commands/architect.d.ts +3 -3
  11. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  12. package/dist/agent-farm/commands/architect.js +20 -147
  13. package/dist/agent-farm/commands/architect.js.map +1 -1
  14. package/dist/agent-farm/commands/attach.d.ts +13 -0
  15. package/dist/agent-farm/commands/attach.d.ts.map +1 -0
  16. package/dist/agent-farm/commands/attach.js +144 -0
  17. package/dist/agent-farm/commands/attach.js.map +1 -0
  18. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  19. package/dist/agent-farm/commands/cleanup.js +35 -19
  20. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  21. package/dist/agent-farm/commands/consult.d.ts +3 -4
  22. package/dist/agent-farm/commands/consult.d.ts.map +1 -1
  23. package/dist/agent-farm/commands/consult.js +27 -37
  24. package/dist/agent-farm/commands/consult.js.map +1 -1
  25. package/dist/agent-farm/commands/index.d.ts +2 -2
  26. package/dist/agent-farm/commands/index.d.ts.map +1 -1
  27. package/dist/agent-farm/commands/index.js +2 -2
  28. package/dist/agent-farm/commands/index.js.map +1 -1
  29. package/dist/agent-farm/commands/open.d.ts +4 -2
  30. package/dist/agent-farm/commands/open.d.ts.map +1 -1
  31. package/dist/agent-farm/commands/open.js +33 -83
  32. package/dist/agent-farm/commands/open.js.map +1 -1
  33. package/dist/agent-farm/commands/send.d.ts +1 -1
  34. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  35. package/dist/agent-farm/commands/send.js +70 -79
  36. package/dist/agent-farm/commands/send.js.map +1 -1
  37. package/dist/agent-farm/commands/shell.d.ts +15 -0
  38. package/dist/agent-farm/commands/shell.d.ts.map +1 -0
  39. package/dist/agent-farm/commands/shell.js +50 -0
  40. package/dist/agent-farm/commands/shell.js.map +1 -0
  41. package/dist/agent-farm/commands/spawn-roles.d.ts +80 -0
  42. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -0
  43. package/dist/agent-farm/commands/spawn-roles.js +278 -0
  44. package/dist/agent-farm/commands/spawn-roles.js.map +1 -0
  45. package/dist/agent-farm/commands/spawn-worktree.d.ts +96 -0
  46. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -0
  47. package/dist/agent-farm/commands/spawn-worktree.js +305 -0
  48. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -0
  49. package/dist/agent-farm/commands/spawn.d.ts +5 -1
  50. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  51. package/dist/agent-farm/commands/spawn.js +241 -561
  52. package/dist/agent-farm/commands/spawn.js.map +1 -1
  53. package/dist/agent-farm/commands/start.d.ts +10 -20
  54. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  55. package/dist/agent-farm/commands/start.js +45 -449
  56. package/dist/agent-farm/commands/start.js.map +1 -1
  57. package/dist/agent-farm/commands/status.d.ts +2 -0
  58. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  59. package/dist/agent-farm/commands/status.js +75 -24
  60. package/dist/agent-farm/commands/status.js.map +1 -1
  61. package/dist/agent-farm/commands/stop.d.ts +6 -0
  62. package/dist/agent-farm/commands/stop.d.ts.map +1 -1
  63. package/dist/agent-farm/commands/stop.js +49 -109
  64. package/dist/agent-farm/commands/stop.js.map +1 -1
  65. package/dist/agent-farm/commands/tower-cloud.d.ts +48 -0
  66. package/dist/agent-farm/commands/tower-cloud.d.ts.map +1 -0
  67. package/dist/agent-farm/commands/tower-cloud.js +293 -0
  68. package/dist/agent-farm/commands/tower-cloud.js.map +1 -0
  69. package/dist/agent-farm/commands/tower.d.ts +9 -0
  70. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  71. package/dist/agent-farm/commands/tower.js +59 -19
  72. package/dist/agent-farm/commands/tower.js.map +1 -1
  73. package/dist/agent-farm/db/index.d.ts +6 -2
  74. package/dist/agent-farm/db/index.d.ts.map +1 -1
  75. package/dist/agent-farm/db/index.js +301 -19
  76. package/dist/agent-farm/db/index.js.map +1 -1
  77. package/dist/agent-farm/db/migrate.d.ts +0 -4
  78. package/dist/agent-farm/db/migrate.d.ts.map +1 -1
  79. package/dist/agent-farm/db/migrate.js +6 -55
  80. package/dist/agent-farm/db/migrate.js.map +1 -1
  81. package/dist/agent-farm/db/schema.d.ts +3 -3
  82. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  83. package/dist/agent-farm/db/schema.js +25 -19
  84. package/dist/agent-farm/db/schema.js.map +1 -1
  85. package/dist/agent-farm/db/types.d.ts +3 -13
  86. package/dist/agent-farm/db/types.d.ts.map +1 -1
  87. package/dist/agent-farm/db/types.js +3 -11
  88. package/dist/agent-farm/db/types.js.map +1 -1
  89. package/dist/agent-farm/hq-connector.d.ts +2 -6
  90. package/dist/agent-farm/hq-connector.d.ts.map +1 -1
  91. package/dist/agent-farm/hq-connector.js +2 -17
  92. package/dist/agent-farm/hq-connector.js.map +1 -1
  93. package/dist/agent-farm/lib/cloud-config.d.ts +59 -0
  94. package/dist/agent-farm/lib/cloud-config.d.ts.map +1 -0
  95. package/dist/agent-farm/lib/cloud-config.js +143 -0
  96. package/dist/agent-farm/lib/cloud-config.js.map +1 -0
  97. package/dist/agent-farm/lib/device-name.d.ts +25 -0
  98. package/dist/agent-farm/lib/device-name.d.ts.map +1 -0
  99. package/dist/agent-farm/lib/device-name.js +46 -0
  100. package/dist/agent-farm/lib/device-name.js.map +1 -0
  101. package/dist/agent-farm/lib/nonce-store.d.ts +28 -0
  102. package/dist/agent-farm/lib/nonce-store.d.ts.map +1 -0
  103. package/dist/agent-farm/lib/nonce-store.js +60 -0
  104. package/dist/agent-farm/lib/nonce-store.js.map +1 -0
  105. package/dist/agent-farm/lib/token-exchange.d.ts +18 -0
  106. package/dist/agent-farm/lib/token-exchange.d.ts.map +1 -0
  107. package/dist/agent-farm/lib/token-exchange.js +48 -0
  108. package/dist/agent-farm/lib/token-exchange.js.map +1 -0
  109. package/dist/agent-farm/lib/tower-client.d.ts +163 -0
  110. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -0
  111. package/dist/agent-farm/lib/tower-client.js +233 -0
  112. package/dist/agent-farm/lib/tower-client.js.map +1 -0
  113. package/dist/agent-farm/lib/tunnel-client.d.ts +117 -0
  114. package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -0
  115. package/dist/agent-farm/lib/tunnel-client.js +504 -0
  116. package/dist/agent-farm/lib/tunnel-client.js.map +1 -0
  117. package/dist/agent-farm/servers/tower-instances.d.ts +82 -0
  118. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -0
  119. package/dist/agent-farm/servers/tower-instances.js +454 -0
  120. package/dist/agent-farm/servers/tower-instances.js.map +1 -0
  121. package/dist/agent-farm/servers/tower-routes.d.ts +34 -0
  122. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -0
  123. package/dist/agent-farm/servers/tower-routes.js +1445 -0
  124. package/dist/agent-farm/servers/tower-routes.js.map +1 -0
  125. package/dist/agent-farm/servers/tower-server.d.ts +5 -2
  126. package/dist/agent-farm/servers/tower-server.d.ts.map +1 -1
  127. package/dist/agent-farm/servers/tower-server.js +157 -475
  128. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  129. package/dist/agent-farm/servers/tower-terminals.d.ts +119 -0
  130. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -0
  131. package/dist/agent-farm/servers/tower-terminals.js +629 -0
  132. package/dist/agent-farm/servers/tower-terminals.js.map +1 -0
  133. package/dist/agent-farm/servers/tower-tunnel.d.ts +34 -0
  134. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -0
  135. package/dist/agent-farm/servers/tower-tunnel.js +480 -0
  136. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -0
  137. package/dist/agent-farm/servers/tower-types.d.ts +86 -0
  138. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -0
  139. package/dist/agent-farm/servers/tower-types.js +6 -0
  140. package/dist/agent-farm/servers/tower-types.js.map +1 -0
  141. package/dist/agent-farm/servers/tower-utils.d.ts +58 -0
  142. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -0
  143. package/dist/agent-farm/servers/tower-utils.js +182 -0
  144. package/dist/agent-farm/servers/tower-utils.js.map +1 -0
  145. package/dist/agent-farm/servers/tower-websocket.d.ts +25 -0
  146. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -0
  147. package/dist/agent-farm/servers/tower-websocket.js +171 -0
  148. package/dist/agent-farm/servers/tower-websocket.js.map +1 -0
  149. package/dist/agent-farm/state.d.ts +6 -2
  150. package/dist/agent-farm/state.d.ts.map +1 -1
  151. package/dist/agent-farm/state.js +34 -25
  152. package/dist/agent-farm/state.js.map +1 -1
  153. package/dist/agent-farm/types.d.ts +49 -26
  154. package/dist/agent-farm/types.d.ts.map +1 -1
  155. package/dist/agent-farm/utils/config.d.ts +0 -5
  156. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  157. package/dist/agent-farm/utils/config.js +12 -44
  158. package/dist/agent-farm/utils/config.js.map +1 -1
  159. package/dist/agent-farm/utils/deps.d.ts.map +1 -1
  160. package/dist/agent-farm/utils/deps.js +0 -32
  161. package/dist/agent-farm/utils/deps.js.map +1 -1
  162. package/dist/agent-farm/utils/file-tabs.d.ts +27 -0
  163. package/dist/agent-farm/utils/file-tabs.d.ts.map +1 -0
  164. package/dist/agent-farm/utils/file-tabs.js +46 -0
  165. package/dist/agent-farm/utils/file-tabs.js.map +1 -0
  166. package/dist/agent-farm/utils/gate-status.d.ts +16 -0
  167. package/dist/agent-farm/utils/gate-status.d.ts.map +1 -0
  168. package/dist/agent-farm/utils/gate-status.js +79 -0
  169. package/dist/agent-farm/utils/gate-status.js.map +1 -0
  170. package/dist/agent-farm/utils/gate-watcher.d.ts +38 -0
  171. package/dist/agent-farm/utils/gate-watcher.d.ts.map +1 -0
  172. package/dist/agent-farm/utils/gate-watcher.js +122 -0
  173. package/dist/agent-farm/utils/gate-watcher.js.map +1 -0
  174. package/dist/agent-farm/utils/index.d.ts +0 -1
  175. package/dist/agent-farm/utils/index.d.ts.map +1 -1
  176. package/dist/agent-farm/utils/index.js +0 -1
  177. package/dist/agent-farm/utils/index.js.map +1 -1
  178. package/dist/agent-farm/utils/notifications.d.ts +30 -0
  179. package/dist/agent-farm/utils/notifications.d.ts.map +1 -0
  180. package/dist/agent-farm/utils/notifications.js +121 -0
  181. package/dist/agent-farm/utils/notifications.js.map +1 -0
  182. package/dist/agent-farm/utils/server-utils.d.ts +5 -5
  183. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  184. package/dist/agent-farm/utils/server-utils.js +5 -16
  185. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  186. package/dist/agent-farm/utils/session.d.ts +32 -0
  187. package/dist/agent-farm/utils/session.d.ts.map +1 -0
  188. package/dist/agent-farm/utils/session.js +57 -0
  189. package/dist/agent-farm/utils/session.js.map +1 -0
  190. package/dist/agent-farm/utils/shell.d.ts +9 -22
  191. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  192. package/dist/agent-farm/utils/shell.js +34 -34
  193. package/dist/agent-farm/utils/shell.js.map +1 -1
  194. package/dist/cli.d.ts.map +1 -1
  195. package/dist/cli.js +6 -37
  196. package/dist/cli.js.map +1 -1
  197. package/dist/commands/adopt.d.ts.map +1 -1
  198. package/dist/commands/adopt.js +33 -4
  199. package/dist/commands/adopt.js.map +1 -1
  200. package/dist/commands/consult/index.d.ts +13 -2
  201. package/dist/commands/consult/index.d.ts.map +1 -1
  202. package/dist/commands/consult/index.js +244 -29
  203. package/dist/commands/consult/index.js.map +1 -1
  204. package/dist/commands/doctor.d.ts.map +1 -1
  205. package/dist/commands/doctor.js +96 -79
  206. package/dist/commands/doctor.js.map +1 -1
  207. package/dist/commands/init.d.ts.map +1 -1
  208. package/dist/commands/init.js +36 -3
  209. package/dist/commands/init.js.map +1 -1
  210. package/dist/commands/porch/build-counter.d.ts +5 -0
  211. package/dist/commands/porch/build-counter.d.ts.map +1 -0
  212. package/dist/commands/porch/build-counter.js +5 -0
  213. package/dist/commands/porch/build-counter.js.map +1 -0
  214. package/dist/commands/porch/checks.d.ts +3 -2
  215. package/dist/commands/porch/checks.d.ts.map +1 -1
  216. package/dist/commands/porch/checks.js +8 -2
  217. package/dist/commands/porch/checks.js.map +1 -1
  218. package/dist/commands/porch/index.d.ts +4 -0
  219. package/dist/commands/porch/index.d.ts.map +1 -1
  220. package/dist/commands/porch/index.js +109 -70
  221. package/dist/commands/porch/index.js.map +1 -1
  222. package/dist/commands/porch/next.d.ts +22 -0
  223. package/dist/commands/porch/next.d.ts.map +1 -0
  224. package/dist/commands/porch/next.js +571 -0
  225. package/dist/commands/porch/next.js.map +1 -0
  226. package/dist/commands/porch/plan.d.ts +11 -1
  227. package/dist/commands/porch/plan.d.ts.map +1 -1
  228. package/dist/commands/porch/plan.js +33 -5
  229. package/dist/commands/porch/plan.js.map +1 -1
  230. package/dist/commands/porch/prompts.d.ts.map +1 -1
  231. package/dist/commands/porch/prompts.js +44 -26
  232. package/dist/commands/porch/prompts.js.map +1 -1
  233. package/dist/commands/porch/protocol.d.ts +6 -4
  234. package/dist/commands/porch/protocol.d.ts.map +1 -1
  235. package/dist/commands/porch/protocol.js +59 -15
  236. package/dist/commands/porch/protocol.js.map +1 -1
  237. package/dist/commands/porch/state.d.ts +29 -2
  238. package/dist/commands/porch/state.d.ts.map +1 -1
  239. package/dist/commands/porch/state.js +71 -3
  240. package/dist/commands/porch/state.js.map +1 -1
  241. package/dist/commands/porch/types.d.ts +45 -2
  242. package/dist/commands/porch/types.d.ts.map +1 -1
  243. package/dist/commands/porch/verdict.d.ts +31 -0
  244. package/dist/commands/porch/verdict.d.ts.map +1 -0
  245. package/dist/commands/porch/verdict.js +59 -0
  246. package/dist/commands/porch/verdict.js.map +1 -0
  247. package/dist/commands/update.d.ts.map +1 -1
  248. package/dist/commands/update.js +18 -6
  249. package/dist/commands/update.js.map +1 -1
  250. package/dist/lib/scaffold.d.ts +13 -0
  251. package/dist/lib/scaffold.d.ts.map +1 -1
  252. package/dist/lib/scaffold.js +36 -0
  253. package/dist/lib/scaffold.js.map +1 -1
  254. package/dist/terminal/index.d.ts +8 -0
  255. package/dist/terminal/index.d.ts.map +1 -0
  256. package/dist/terminal/index.js +5 -0
  257. package/dist/terminal/index.js.map +1 -0
  258. package/dist/terminal/pty-manager.d.ts +69 -0
  259. package/dist/terminal/pty-manager.d.ts.map +1 -0
  260. package/dist/terminal/pty-manager.js +377 -0
  261. package/dist/terminal/pty-manager.js.map +1 -0
  262. package/dist/terminal/pty-session.d.ts +104 -0
  263. package/dist/terminal/pty-session.d.ts.map +1 -0
  264. package/dist/terminal/pty-session.js +327 -0
  265. package/dist/terminal/pty-session.js.map +1 -0
  266. package/dist/terminal/ring-buffer.d.ts +34 -0
  267. package/dist/terminal/ring-buffer.d.ts.map +1 -0
  268. package/dist/terminal/ring-buffer.js +94 -0
  269. package/dist/terminal/ring-buffer.js.map +1 -0
  270. package/dist/terminal/session-manager.d.ts +115 -0
  271. package/dist/terminal/session-manager.d.ts.map +1 -0
  272. package/dist/terminal/session-manager.js +582 -0
  273. package/dist/terminal/session-manager.js.map +1 -0
  274. package/dist/terminal/shellper-client.d.ts +66 -0
  275. package/dist/terminal/shellper-client.d.ts.map +1 -0
  276. package/dist/terminal/shellper-client.js +234 -0
  277. package/dist/terminal/shellper-client.js.map +1 -0
  278. package/dist/terminal/shellper-main.d.ts +19 -0
  279. package/dist/terminal/shellper-main.d.ts.map +1 -0
  280. package/dist/terminal/shellper-main.js +153 -0
  281. package/dist/terminal/shellper-main.js.map +1 -0
  282. package/dist/terminal/shellper-process.d.ts +75 -0
  283. package/dist/terminal/shellper-process.d.ts.map +1 -0
  284. package/dist/terminal/shellper-process.js +279 -0
  285. package/dist/terminal/shellper-process.js.map +1 -0
  286. package/dist/terminal/shellper-protocol.d.ts +115 -0
  287. package/dist/terminal/shellper-protocol.d.ts.map +1 -0
  288. package/dist/terminal/shellper-protocol.js +214 -0
  289. package/dist/terminal/shellper-protocol.js.map +1 -0
  290. package/dist/terminal/shellper-replay-buffer.d.ts +38 -0
  291. package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -0
  292. package/dist/terminal/shellper-replay-buffer.js +94 -0
  293. package/dist/terminal/shellper-replay-buffer.js.map +1 -0
  294. package/dist/terminal/ws-protocol.d.ts +27 -0
  295. package/dist/terminal/ws-protocol.d.ts.map +1 -0
  296. package/dist/terminal/ws-protocol.js +44 -0
  297. package/dist/terminal/ws-protocol.js.map +1 -0
  298. package/package.json +17 -5
  299. package/skeleton/.claude/skills/af/SKILL.md +89 -0
  300. package/skeleton/.claude/skills/codev/SKILL.md +41 -0
  301. package/skeleton/.claude/skills/consult/SKILL.md +81 -0
  302. package/skeleton/.claude/skills/generate-image/SKILL.md +56 -0
  303. package/skeleton/DEPENDENCIES.md +4 -62
  304. package/skeleton/builders.md +1 -1
  305. package/skeleton/consult-types/impl-review.md +18 -9
  306. package/skeleton/consult-types/integration-review.md +1 -1
  307. package/skeleton/consult-types/plan-review.md +1 -1
  308. package/skeleton/consult-types/pr-ready.md +1 -1
  309. package/skeleton/consult-types/spec-review.md +1 -1
  310. package/skeleton/porch/prompts/defend.md +1 -1
  311. package/skeleton/porch/prompts/evaluate.md +2 -2
  312. package/skeleton/porch/prompts/implement.md +1 -1
  313. package/skeleton/porch/prompts/plan.md +1 -1
  314. package/skeleton/porch/prompts/review.md +4 -4
  315. package/skeleton/porch/prompts/specify.md +1 -1
  316. package/skeleton/porch/prompts/understand.md +2 -2
  317. package/skeleton/protocol-schema.json +282 -0
  318. package/skeleton/protocols/bugfix/builder-prompt.md +60 -0
  319. package/skeleton/protocols/bugfix/prompts/fix.md +77 -0
  320. package/skeleton/protocols/bugfix/prompts/investigate.md +77 -0
  321. package/skeleton/protocols/bugfix/prompts/pr.md +84 -0
  322. package/skeleton/protocols/bugfix/protocol.json +20 -33
  323. package/skeleton/protocols/experiment/builder-prompt.md +52 -0
  324. package/skeleton/protocols/experiment/protocol.json +101 -0
  325. package/skeleton/protocols/experiment/protocol.md +3 -3
  326. package/skeleton/protocols/experiment/templates/notes.md +1 -1
  327. package/skeleton/protocols/maintain/builder-prompt.md +46 -0
  328. package/skeleton/protocols/maintain/prompts/audit.md +111 -0
  329. package/skeleton/protocols/maintain/prompts/clean.md +91 -0
  330. package/skeleton/protocols/maintain/prompts/sync.md +113 -0
  331. package/skeleton/protocols/maintain/prompts/verify.md +110 -0
  332. package/skeleton/protocols/maintain/protocol.json +141 -0
  333. package/skeleton/protocols/maintain/protocol.md +17 -11
  334. package/skeleton/protocols/protocol-schema.json +54 -1
  335. package/skeleton/protocols/spir/builder-prompt.md +66 -0
  336. package/skeleton/protocols/spir/prompts/implement.md +208 -0
  337. package/skeleton/protocols/{spider → spir}/prompts/plan.md +6 -70
  338. package/skeleton/protocols/{spider → spir}/prompts/review.md +20 -39
  339. package/skeleton/protocols/{spider → spir}/prompts/specify.md +24 -59
  340. package/skeleton/protocols/{spider → spir}/protocol.json +30 -10
  341. package/skeleton/protocols/{spider → spir}/protocol.md +35 -21
  342. package/skeleton/protocols/spir/templates/review.md +89 -0
  343. package/skeleton/protocols/tick/builder-prompt.md +56 -0
  344. package/skeleton/protocols/tick/protocol.json +7 -2
  345. package/skeleton/protocols/tick/protocol.md +18 -18
  346. package/skeleton/protocols/tick/templates/review.md +1 -1
  347. package/skeleton/resources/commands/agent-farm.md +63 -46
  348. package/skeleton/resources/commands/codev.md +0 -2
  349. package/skeleton/resources/commands/overview.md +7 -17
  350. package/skeleton/resources/workflow-reference.md +4 -4
  351. package/skeleton/roles/architect.md +151 -306
  352. package/skeleton/roles/builder.md +115 -332
  353. package/skeleton/roles/consultant.md +6 -6
  354. package/skeleton/templates/AGENTS.md +2 -2
  355. package/skeleton/templates/CLAUDE.md +2 -2
  356. package/skeleton/templates/cheatsheet.md +7 -5
  357. package/skeleton/templates/projectlist.md +1 -1
  358. package/templates/dashboard/index.html +17 -16
  359. package/templates/dashboard/js/dialogs.js +7 -7
  360. package/templates/dashboard/js/files.js +2 -2
  361. package/templates/dashboard/js/main.js +4 -4
  362. package/templates/dashboard/js/projects.js +3 -3
  363. package/templates/dashboard/js/tabs.js +1 -1
  364. package/templates/dashboard/js/utils.js +22 -1
  365. package/templates/open.html +26 -0
  366. package/templates/tower.html +731 -91
  367. package/dist/agent-farm/commands/kickoff.d.ts +0 -20
  368. package/dist/agent-farm/commands/kickoff.d.ts.map +0 -1
  369. package/dist/agent-farm/commands/kickoff.js +0 -273
  370. package/dist/agent-farm/commands/kickoff.js.map +0 -1
  371. package/dist/agent-farm/commands/rename.d.ts +0 -13
  372. package/dist/agent-farm/commands/rename.d.ts.map +0 -1
  373. package/dist/agent-farm/commands/rename.js +0 -33
  374. package/dist/agent-farm/commands/rename.js.map +0 -1
  375. package/dist/agent-farm/commands/tutorial.d.ts +0 -10
  376. package/dist/agent-farm/commands/tutorial.d.ts.map +0 -1
  377. package/dist/agent-farm/commands/tutorial.js +0 -49
  378. package/dist/agent-farm/commands/tutorial.js.map +0 -1
  379. package/dist/agent-farm/commands/util.d.ts +0 -15
  380. package/dist/agent-farm/commands/util.d.ts.map +0 -1
  381. package/dist/agent-farm/commands/util.js +0 -108
  382. package/dist/agent-farm/commands/util.js.map +0 -1
  383. package/dist/agent-farm/servers/dashboard-server.d.ts +0 -7
  384. package/dist/agent-farm/servers/dashboard-server.d.ts.map +0 -1
  385. package/dist/agent-farm/servers/dashboard-server.js +0 -1858
  386. package/dist/agent-farm/servers/dashboard-server.js.map +0 -1
  387. package/dist/agent-farm/servers/open-server.d.ts +0 -7
  388. package/dist/agent-farm/servers/open-server.d.ts.map +0 -1
  389. package/dist/agent-farm/servers/open-server.js +0 -315
  390. package/dist/agent-farm/servers/open-server.js.map +0 -1
  391. package/dist/agent-farm/tutorial/index.d.ts +0 -8
  392. package/dist/agent-farm/tutorial/index.d.ts.map +0 -1
  393. package/dist/agent-farm/tutorial/index.js +0 -8
  394. package/dist/agent-farm/tutorial/index.js.map +0 -1
  395. package/dist/agent-farm/tutorial/prompts.d.ts +0 -57
  396. package/dist/agent-farm/tutorial/prompts.d.ts.map +0 -1
  397. package/dist/agent-farm/tutorial/prompts.js +0 -147
  398. package/dist/agent-farm/tutorial/prompts.js.map +0 -1
  399. package/dist/agent-farm/tutorial/runner.d.ts +0 -52
  400. package/dist/agent-farm/tutorial/runner.d.ts.map +0 -1
  401. package/dist/agent-farm/tutorial/runner.js +0 -204
  402. package/dist/agent-farm/tutorial/runner.js.map +0 -1
  403. package/dist/agent-farm/tutorial/state.d.ts +0 -26
  404. package/dist/agent-farm/tutorial/state.d.ts.map +0 -1
  405. package/dist/agent-farm/tutorial/state.js +0 -89
  406. package/dist/agent-farm/tutorial/state.js.map +0 -1
  407. package/dist/agent-farm/tutorial/steps/first-spec.d.ts +0 -7
  408. package/dist/agent-farm/tutorial/steps/first-spec.d.ts.map +0 -1
  409. package/dist/agent-farm/tutorial/steps/first-spec.js +0 -136
  410. package/dist/agent-farm/tutorial/steps/first-spec.js.map +0 -1
  411. package/dist/agent-farm/tutorial/steps/implementation.d.ts +0 -7
  412. package/dist/agent-farm/tutorial/steps/implementation.d.ts.map +0 -1
  413. package/dist/agent-farm/tutorial/steps/implementation.js +0 -76
  414. package/dist/agent-farm/tutorial/steps/implementation.js.map +0 -1
  415. package/dist/agent-farm/tutorial/steps/index.d.ts +0 -10
  416. package/dist/agent-farm/tutorial/steps/index.d.ts.map +0 -1
  417. package/dist/agent-farm/tutorial/steps/index.js +0 -10
  418. package/dist/agent-farm/tutorial/steps/index.js.map +0 -1
  419. package/dist/agent-farm/tutorial/steps/planning.d.ts +0 -7
  420. package/dist/agent-farm/tutorial/steps/planning.d.ts.map +0 -1
  421. package/dist/agent-farm/tutorial/steps/planning.js +0 -143
  422. package/dist/agent-farm/tutorial/steps/planning.js.map +0 -1
  423. package/dist/agent-farm/tutorial/steps/review.d.ts +0 -7
  424. package/dist/agent-farm/tutorial/steps/review.d.ts.map +0 -1
  425. package/dist/agent-farm/tutorial/steps/review.js +0 -78
  426. package/dist/agent-farm/tutorial/steps/review.js.map +0 -1
  427. package/dist/agent-farm/tutorial/steps/setup.d.ts +0 -7
  428. package/dist/agent-farm/tutorial/steps/setup.d.ts.map +0 -1
  429. package/dist/agent-farm/tutorial/steps/setup.js +0 -126
  430. package/dist/agent-farm/tutorial/steps/setup.js.map +0 -1
  431. package/dist/agent-farm/tutorial/steps/welcome.d.ts +0 -7
  432. package/dist/agent-farm/tutorial/steps/welcome.d.ts.map +0 -1
  433. package/dist/agent-farm/tutorial/steps/welcome.js +0 -50
  434. package/dist/agent-farm/tutorial/steps/welcome.js.map +0 -1
  435. package/dist/agent-farm/utils/orphan-handler.d.ts +0 -27
  436. package/dist/agent-farm/utils/orphan-handler.d.ts.map +0 -1
  437. package/dist/agent-farm/utils/orphan-handler.js +0 -149
  438. package/dist/agent-farm/utils/orphan-handler.js.map +0 -1
  439. package/dist/agent-farm/utils/port-registry.d.ts +0 -58
  440. package/dist/agent-farm/utils/port-registry.d.ts.map +0 -1
  441. package/dist/agent-farm/utils/port-registry.js +0 -166
  442. package/dist/agent-farm/utils/port-registry.js.map +0 -1
  443. package/dist/agent-farm/utils/terminal-ports.d.ts +0 -18
  444. package/dist/agent-farm/utils/terminal-ports.d.ts.map +0 -1
  445. package/dist/agent-farm/utils/terminal-ports.js +0 -35
  446. package/dist/agent-farm/utils/terminal-ports.js.map +0 -1
  447. package/dist/commands/pcheck/cache.d.ts +0 -48
  448. package/dist/commands/pcheck/cache.d.ts.map +0 -1
  449. package/dist/commands/pcheck/cache.js +0 -170
  450. package/dist/commands/pcheck/cache.js.map +0 -1
  451. package/dist/commands/pcheck/evaluator.d.ts +0 -15
  452. package/dist/commands/pcheck/evaluator.d.ts.map +0 -1
  453. package/dist/commands/pcheck/evaluator.js +0 -246
  454. package/dist/commands/pcheck/evaluator.js.map +0 -1
  455. package/dist/commands/pcheck/index.d.ts +0 -12
  456. package/dist/commands/pcheck/index.d.ts.map +0 -1
  457. package/dist/commands/pcheck/index.js +0 -249
  458. package/dist/commands/pcheck/index.js.map +0 -1
  459. package/dist/commands/pcheck/parser.d.ts +0 -39
  460. package/dist/commands/pcheck/parser.d.ts.map +0 -1
  461. package/dist/commands/pcheck/parser.js +0 -155
  462. package/dist/commands/pcheck/parser.js.map +0 -1
  463. package/dist/commands/pcheck/types.d.ts +0 -82
  464. package/dist/commands/pcheck/types.d.ts.map +0 -1
  465. package/dist/commands/pcheck/types.js +0 -5
  466. package/dist/commands/pcheck/types.js.map +0 -1
  467. package/dist/commands/porch/claude.d.ts +0 -29
  468. package/dist/commands/porch/claude.d.ts.map +0 -1
  469. package/dist/commands/porch/claude.js +0 -79
  470. package/dist/commands/porch/claude.js.map +0 -1
  471. package/dist/commands/porch/consultation.d.ts +0 -56
  472. package/dist/commands/porch/consultation.d.ts.map +0 -1
  473. package/dist/commands/porch/consultation.js +0 -330
  474. package/dist/commands/porch/consultation.js.map +0 -1
  475. package/dist/commands/porch/notifications.d.ts +0 -99
  476. package/dist/commands/porch/notifications.d.ts.map +0 -1
  477. package/dist/commands/porch/notifications.js +0 -223
  478. package/dist/commands/porch/notifications.js.map +0 -1
  479. package/dist/commands/porch/plan-parser.d.ts +0 -38
  480. package/dist/commands/porch/plan-parser.d.ts.map +0 -1
  481. package/dist/commands/porch/plan-parser.js +0 -166
  482. package/dist/commands/porch/plan-parser.js.map +0 -1
  483. package/dist/commands/porch/protocol-loader.d.ts +0 -46
  484. package/dist/commands/porch/protocol-loader.d.ts.map +0 -1
  485. package/dist/commands/porch/protocol-loader.js +0 -262
  486. package/dist/commands/porch/protocol-loader.js.map +0 -1
  487. package/dist/commands/porch/repl.d.ts +0 -33
  488. package/dist/commands/porch/repl.d.ts.map +0 -1
  489. package/dist/commands/porch/repl.js +0 -206
  490. package/dist/commands/porch/repl.js.map +0 -1
  491. package/dist/commands/porch/run.d.ts +0 -15
  492. package/dist/commands/porch/run.d.ts.map +0 -1
  493. package/dist/commands/porch/run.js +0 -551
  494. package/dist/commands/porch/run.js.map +0 -1
  495. package/dist/commands/porch/signal-parser.d.ts +0 -102
  496. package/dist/commands/porch/signal-parser.d.ts.map +0 -1
  497. package/dist/commands/porch/signal-parser.js +0 -199
  498. package/dist/commands/porch/signal-parser.js.map +0 -1
  499. package/dist/commands/porch/signals.d.ts +0 -35
  500. package/dist/commands/porch/signals.d.ts.map +0 -1
  501. package/dist/commands/porch/signals.js +0 -76
  502. package/dist/commands/porch/signals.js.map +0 -1
  503. package/dist/commands/porch2/checks.d.ts +0 -29
  504. package/dist/commands/porch2/checks.d.ts.map +0 -1
  505. package/dist/commands/porch2/checks.js +0 -141
  506. package/dist/commands/porch2/checks.js.map +0 -1
  507. package/dist/commands/porch2/index.d.ts +0 -38
  508. package/dist/commands/porch2/index.d.ts.map +0 -1
  509. package/dist/commands/porch2/index.js +0 -483
  510. package/dist/commands/porch2/index.js.map +0 -1
  511. package/dist/commands/porch2/plan.d.ts +0 -70
  512. package/dist/commands/porch2/plan.d.ts.map +0 -1
  513. package/dist/commands/porch2/plan.js +0 -227
  514. package/dist/commands/porch2/plan.js.map +0 -1
  515. package/dist/commands/porch2/protocol.d.ts +0 -37
  516. package/dist/commands/porch2/protocol.d.ts.map +0 -1
  517. package/dist/commands/porch2/protocol.js +0 -183
  518. package/dist/commands/porch2/protocol.js.map +0 -1
  519. package/dist/commands/porch2/state.d.ts +0 -35
  520. package/dist/commands/porch2/state.d.ts.map +0 -1
  521. package/dist/commands/porch2/state.js +0 -124
  522. package/dist/commands/porch2/state.js.map +0 -1
  523. package/dist/commands/porch2/types.d.ts +0 -79
  524. package/dist/commands/porch2/types.d.ts.map +0 -1
  525. package/dist/commands/porch2/types.js +0 -8
  526. package/dist/commands/porch2/types.js.map +0 -1
  527. package/dist/commands/tower.d.ts +0 -16
  528. package/dist/commands/tower.d.ts.map +0 -1
  529. package/dist/commands/tower.js +0 -21
  530. package/dist/commands/tower.js.map +0 -1
  531. package/skeleton/config.json +0 -7
  532. package/skeleton/protocols/spider/prompts/defend.md +0 -215
  533. package/skeleton/protocols/spider/prompts/evaluate.md +0 -241
  534. package/skeleton/protocols/spider/prompts/implement.md +0 -149
  535. package/skeleton/protocols/spider/templates/review.md +0 -207
  536. /package/skeleton/protocols/{spider → spir}/templates/plan.md +0 -0
  537. /package/skeleton/protocols/{spider → spir}/templates/spec.md +0 -0
@@ -21,7 +21,7 @@ codev adopt
21
21
  codev doctor
22
22
 
23
23
  # Start the architect dashboard
24
- af start
24
+ af dash start
25
25
 
26
26
  # Consult an AI model about a spec
27
27
  consult -m gemini spec 42
@@ -46,7 +46,6 @@ This installs all three commands globally: `codev`, `af`, and `consult`.
46
46
  | `codev doctor` | Check system dependencies |
47
47
  | `codev update` | Update codev templates and protocols |
48
48
  | `codev import <source>` | AI-assisted protocol import from other projects |
49
- | `codev tower` | Cross-project dashboard |
50
49
 
51
50
  See [codev.md](codev.md) for full documentation.
52
51
 
@@ -54,14 +53,15 @@ See [codev.md](codev.md) for full documentation.
54
53
 
55
54
  | Command | Description |
56
55
  |---------|-------------|
57
- | `af start` | Start the architect dashboard |
58
- | `af stop` | Stop all agent farm processes |
56
+ | `af dash start` | Start the architect dashboard |
57
+ | `af dash stop` | Stop all agent farm processes |
59
58
  | `af spawn` | Spawn a new builder |
60
59
  | `af status` | Show status of all agents |
61
60
  | `af cleanup` | Clean up a builder worktree |
62
61
  | `af send` | Send instructions to a builder |
63
62
  | `af open` | Open file annotation viewer |
64
- | `af util` | Spawn a utility shell |
63
+ | `af shell` | Spawn a utility shell |
64
+ | `af tower` | Cross-project dashboard |
65
65
 
66
66
  See [agent-farm.md](agent-farm.md) for full documentation.
67
67
 
@@ -87,21 +87,11 @@ All codev commands support:
87
87
 
88
88
  ## Configuration
89
89
 
90
- Customize agent-farm commands via `codev/config.json`:
91
-
92
- ```json
93
- {
94
- "shell": {
95
- "architect": "claude --model opus",
96
- "builder": "claude --model sonnet",
97
- "shell": "bash"
98
- }
99
- }
100
- ```
90
+ Agent Farm is configured via `af-config.json` at the project root. Created during `codev init` or `codev adopt`. Override via CLI flags: `--architect-cmd`, `--builder-cmd`, `--shell-cmd`.
101
91
 
102
92
  ## Related Documentation
103
93
 
104
- - [SPIDER Protocol](../protocols/spider/protocol.md) - Multi-phase development workflow
94
+ - [SPIR Protocol](../protocols/spir/protocol.md) - Multi-phase development workflow
105
95
  - [TICK Protocol](../protocols/tick/protocol.md) - Fast amendment workflow
106
96
  - [Architect Role](../roles/architect.md) - Architect responsibilities
107
97
  - [Builder Role](../roles/builder.md) - Builder responsibilities
@@ -1,6 +1,6 @@
1
1
  # Architect-Builder Workflow Reference
2
2
 
3
- Quick reference for the 7-stage project workflow. For protocol details, see `codev/protocols/spider/protocol.md`.
3
+ Quick reference for the 7-stage project workflow. For protocol details, see `codev/protocols/spir/protocol.md`.
4
4
 
5
5
  ## Workflow Overview
6
6
 
@@ -77,7 +77,7 @@ AI agents must stop and wait for human action at these gates.
77
77
 
78
78
  ```bash
79
79
  # Start the dashboard
80
- af start
80
+ af dash start
81
81
 
82
82
  # Spawn a builder for a project
83
83
  af spawn -p 0044
@@ -95,7 +95,7 @@ af open codev/specs/0044-name.md
95
95
  af cleanup -p 0044
96
96
 
97
97
  # Stop everything
98
- af stop
98
+ af dash stop
99
99
  ```
100
100
 
101
101
  ### Builder Commands
@@ -236,7 +236,7 @@ af cleanup -p XXXX --force
236
236
 
237
237
  ## Related Documentation
238
238
 
239
- - Full SPIDER protocol: `codev/protocols/spider/protocol.md`
239
+ - Full SPIR protocol: `codev/protocols/spir/protocol.md`
240
240
  - Builder role: `codev/roles/builder.md`
241
241
  - Architect role: `codev/roles/architect.md`
242
242
  - Consultant role: `codev/roles/consultant.md`
@@ -1,383 +1,228 @@
1
1
  # Role: Architect
2
2
 
3
- The Architect is the orchestrating agent that manages the overall development process, breaks down work into discrete tasks, spawns Builder agents, and integrates their output.
3
+ The Architect is the **project manager and gatekeeper** who decides what to build, spawns builders, approves gates, and ensures integration quality.
4
4
 
5
5
  > **Quick Reference**: See `codev/resources/workflow-reference.md` for stage diagrams and common commands.
6
6
 
7
- ## Key Tools
7
+ ## Key Concept: Spawning Builders
8
8
 
9
- The Architect relies on two primary tools:
9
+ Builders work autonomously in isolated git worktrees. The Architect:
10
+ 1. **Decides** what to build
11
+ 2. **Spawns** builders via `af spawn`
12
+ 3. **Approves** gates (spec-approval, plan-approval) when in strict mode
13
+ 4. **Reviews** PRs for integration concerns
10
14
 
11
- ### Agent Farm CLI (`af`)
15
+ ### Two Builder Modes
12
16
 
13
- The `af` command orchestrates builders, manages worktrees, and coordinates development. Key commands:
14
- - `af start/stop` - Dashboard management
15
- - `af spawn -p XXXX` - Spawn a builder for a spec
16
- - `af send` - Send short messages to builders
17
- - `af cleanup` - Remove completed builders
18
- - `af status` - Check builder status
19
- - `af open <file>` - Open file for human review
17
+ | Mode | Command | Use When |
18
+ |------|---------|----------|
19
+ | **Strict** (default) | `af spawn -p XXXX` | Porch orchestrates - runs autonomously to completion |
20
+ | **Soft** | `af spawn --soft -p XXXX` | AI follows protocol - you verify compliance |
20
21
 
21
- **Full reference:** See [codev/resources/agent-farm.md](../resources/agent-farm.md)
22
+ **Strict mode** (default): Porch orchestrates the builder with automated gates, 3-way consultations, and enforced phase transitions. More likely to complete autonomously without intervention.
22
23
 
23
- **Note:** `af`, `consult`, and `codev` are global commands installed via npm. They work from any directory - no aliases or paths needed.
24
+ **Soft mode**: Builder reads and follows the protocol document, but you monitor progress and verify the AI is adhering to the protocol correctly. Use when you want more hands-on oversight.
24
25
 
25
- ### Consult Tool
26
+ ## Key Tools
26
27
 
27
- The `consult` command is used **frequently** to get external review from Gemini and Codex. The Architect uses this tool:
28
- - After completing a spec (before presenting to human)
29
- - After completing a plan (before presenting to human)
30
- - When reviewing builder PRs (3-way parallel review)
28
+ ### Agent Farm CLI (`af`)
31
29
 
32
30
  ```bash
33
- # Single consultation with review type
34
- consult --model gemini --type spec-review spec 44
35
- consult --model codex --type plan-review plan 44
36
-
37
- # Parallel 3-way review for PRs
38
- consult --model gemini --type integration-review pr 83 &
39
- consult --model codex --type integration-review pr 83 &
40
- consult --model claude --type integration-review pr 83 &
41
- wait
31
+ af spawn -p 0001 # Strict mode (default) - porch-driven
32
+ af spawn -p 0001 -t "feature" # Strict mode with title (no spec yet)
33
+ af spawn -p 0001 --resume # Resume existing porch state
34
+ af spawn --soft -p 0001 # Soft mode - protocol-guided
35
+ af spawn --task "fix the bug" # Ad-hoc task builder (soft mode)
36
+ af spawn --worktree # Worktree with no initial prompt
37
+ af status # Check all builders
38
+ af cleanup -p 0001 # Remove completed builder
39
+ af dash start/stop # Dashboard management
40
+ af send 0001 "message" # Short message to builder
42
41
  ```
43
42
 
44
- **Review types**: `spec-review`, `plan-review`, `impl-review`, `pr-ready`, `integration-review`
45
-
46
- **Full reference:** See `consult --help`
47
-
48
- ## Output Formatting
49
-
50
- **Dashboard Port: {PORT}**
51
-
52
- When referencing files that the user may want to review, format them as clickable URLs using the dashboard's open-file endpoint:
43
+ **Note:** `af`, `consult`, `porch`, and `codev` are global commands. They work from any directory.
53
44
 
54
- ```
55
- # Instead of:
56
- See codev/specs/0022-consult-tool-stateless.md for details.
45
+ ### Porch CLI (for strict mode)
57
46
 
58
- # Use:
59
- See http://localhost:{PORT}/open-file?path=codev/specs/0022-consult-tool-stateless.md for details.
47
+ ```bash
48
+ porch status 0001 # Check project state
49
+ porch approve 0001 spec-approval # Approve a gate
50
+ porch pending # List pending gates
60
51
  ```
61
52
 
62
- This opens files in the agent-farm annotation viewer when clicked in the dashboard terminal.
63
-
64
- **Finding the dashboard port**: Run `af status` to see the dashboard URL. The default is 4200, but varies when multiple projects are running.
65
-
66
- ## Critical Rules
67
-
68
- These rules are **non-negotiable** and must be followed at all times:
69
-
70
- ### 🚫 NEVER Do These:
71
- 1. **DO NOT use `af send` or `tmux send-keys` for review feedback** - Large messages get corrupted by tmux paste buffers. Always use GitHub PR comments for review feedback.
72
- 2. **DO NOT merge PRs yourself** - Let the builders merge their own PRs after addressing feedback. The builder owns the merge process.
73
- 3. **DO NOT commit directly to main** - All changes go through PRs.
74
- 4. **DO NOT spawn builders before committing specs/plans** - The builder's worktree is created from the current branch. If specs/plans aren't committed, the builder won't have access to them.
53
+ ### Consult Tool (for integration reviews)
75
54
 
76
- ### ✅ ALWAYS Do These:
77
- 1. **Leave PR comments for reviews** - Use `gh pr comment` to post review feedback.
78
- 2. **Notify builders with short messages** - After posting PR comments, use `af send` like "Check PR #N comments" (not the full review).
79
- 3. **Let builders merge their PRs** - After approving, tell the builder to merge. Don't do it yourself.
80
- 4. **Commit specs and plans BEFORE spawning** - Run `git add` and `git commit` for the spec and plan files before `af spawn`. The builder needs these files in the worktree.
55
+ ```bash
56
+ # 3-way parallel integration review of builder's PR
57
+ consult --model gemini --type integration-review pr 35 &
58
+ consult --model codex --type integration-review pr 35 &
59
+ consult --model claude --type integration-review pr 35 &
60
+ wait
61
+ ```
81
62
 
82
63
  ## Responsibilities
83
64
 
84
- 1. **Understand the big picture** - Maintain context of the entire project/epic
85
- 2. **Maintain the project list** - Track all projects in `codev/projectlist.md`
86
- 3. **Manage releases** - Group projects into releases, track release lifecycle
87
- 4. **Specify** - Write specifications for features
88
- 5. **Plan** - Convert specs into implementation plans for builders
89
- 6. **Spawn Builders** - Create isolated worktrees and assign tasks
90
- 7. **Monitor progress** - Track Builder status, unblock when needed
91
- 8. **Review and integrate** - Review Builder PRs, let builders merge them
92
- 9. **Maintain quality** - Ensure consistency across Builder outputs
93
- 10. **Enforce spec compliance** - Verify implementations match specs exactly
65
+ 1. **Decide what to build** - Identify features, prioritize work
66
+ 2. **Maintain project list** - Track all projects in `codev/projectlist.md`
67
+ 3. **Spawn builders** - Choose soft or strict mode based on needs
68
+ 4. **Approve gates** - (Strict mode) Review specs and plans, approve to continue
69
+ 5. **Monitor progress** - Track builder status, unblock when stuck
70
+ 6. **Integration review** - Review PRs for architectural fit
71
+ 7. **Manage releases** - Group projects into releases
94
72
 
95
- ## Spec Compliance Enforcement (CRITICAL)
73
+ ## Workflow
96
74
 
97
- **The spec is the source of truth. Code that doesn't match the spec is wrong, even if it "works".**
75
+ ### 1. Starting a New Feature
98
76
 
99
- ### When Resuming Work or Starting a New Phase
77
+ ```bash
78
+ # 1. Reserve project number in projectlist.md
79
+ # 2. Spawn the builder
100
80
 
101
- 1. **ALWAYS re-read the spec** before writing ANY code
102
- 2. **If the spec has a "Traps to Avoid" section**, read it EVERY time - not just once
103
- 3. **Compare existing code against spec architecture** - Do NOT assume existing code is correct
104
- 4. **If you find drift between code and spec**, STOP and flag it before building on top
81
+ # Default: Strict mode (porch-driven with gates)
82
+ af spawn -p 0042
105
83
 
106
- ### The Trust Hierarchy
84
+ # With project title (if no spec exists yet)
85
+ af spawn -p 0042 -t "user-authentication"
107
86
 
87
+ # Or: Soft mode (builder follows protocol independently)
88
+ af spawn --soft -p 0042
108
89
  ```
109
- SPEC (source of truth)
110
-
111
- PLAN (implementation guide derived from spec)
112
-
113
- EXISTING CODE (NOT TRUSTED - must be validated against spec)
114
- ```
115
-
116
- **Never trust existing code over the spec.** Previous phases may have drifted. The spec is always authoritative.
117
-
118
- ### Before Each Implementation Phase
119
-
120
- Ask yourself:
121
- 1. "Have I read the spec in the last 30 minutes?"
122
- 2. "Does my planned approach match the spec's Technical Implementation section?"
123
- 3. "If the spec has code examples, am I following them?"
124
- 4. "If the spec has 'Traps to Avoid', have I checked each one?"
125
- 5. "Does the existing code I'm building on match the spec?"
126
-
127
- If ANY answer is "no" or "I'm not sure" → STOP and verify before proceeding.
128
-
129
- ### Why This Exists
130
-
131
- On 2025-01-02, the Architect implemented Phase 4 of Spec 0063 by adding LLM calls to existing code structure. The spec explicitly warned against this pattern in "Trap 4: Simplifying Async to Sync" with the statement:
132
-
133
- > **Enforcement:** There is ONE facilitator function that handles ALL events. If you find yourself creating a "synthesis" function, STOP.
134
-
135
- The Architect did not re-read the spec before Phase 4. The existing code had separate `processUserMessage` and `processExpertResult` functions (which the spec warned against), and the Architect built LLM calls on top of this broken structure.
136
-
137
- **Result:** Hours of wasted work. Complete rewrite required.
138
-
139
- **The fix:** ALWAYS re-read the spec. NEVER trust existing code. The spec is the only source of truth.
140
-
141
- ### Recognizing and Breaking "Fixing Mode"
142
90
 
143
- A dangerous pattern: The agent starts looking at symptoms in code, making incremental fixes, copying existing patterns - without going back to the source of truth (spec). Signs include:
144
- - Making multiple small fixes that don't resolve the issue
145
- - Copying patterns from existing code without verifying they match the spec
146
- - Building on top of code that may already be wrong
147
- - Focusing on "what the code does" instead of "what the spec says it should do"
91
+ ### 2. Approving Gates (Strict Mode Only)
148
92
 
149
- **Intervention phrases that work** (use these when you see the pattern):
150
- 1. **"What does the spec say about X?"** - Forces spec lookup
151
- 2. **"Check the spec's Traps to Avoid section"** - Targets specific guidance
152
- 3. **"Does this match the spec?"** - Creates verification checkpoint
153
- 4. **"ARE YOU SURE?"** - Triggers doubt and re-verification
154
- 5. **"You're cargo-culting existing patterns"** - Calls out copying without thinking
155
- 6. **"We've been through this cycle"** - Highlights the pattern of undoing/redoing
93
+ The builder stops at gates requiring approval:
156
94
 
157
- When reviewing builder work or your own work, actively look for signs of "fixing mode" and intervene early with these phrases.
158
-
159
- ## Project Tracking
160
-
161
- **`codev/projectlist.md` is the canonical source of truth for all projects.**
162
-
163
- The Architect is responsible for maintaining this file:
164
-
165
- 1. **Reserve numbers first** - Add entry to projectlist.md BEFORE creating spec files
166
- 2. **Track status** - Update status as projects move through lifecycle:
167
- - `conceived` → `specified` → `planned` → `implementing` → `implemented` → `committed` → `integrated`
168
- 3. **Set priorities** - Assign high/medium/low based on business value and dependencies
169
- 4. **Note dependencies** - Track which projects depend on others
170
- 5. **Document decisions** - Use notes field for context, blockers, or reasons for abandonment
171
-
172
- When asked "what should we work on next?" or "what's incomplete?":
95
+ **spec-approval** - After builder writes the spec
173
96
  ```bash
174
- # Read the project list
175
- cat codev/projectlist.md
97
+ # Review the spec in the builder's worktree
98
+ cat worktrees/spir_0042_user-authentication/codev/specs/0042-user-authentication.md
176
99
 
177
- # Look for high-priority items not yet integrated
178
- grep -A5 "priority: high" codev/projectlist.md
100
+ # Approve if satisfactory
101
+ porch approve 0042 spec-approval
179
102
  ```
180
103
 
181
- ## Release Management
182
-
183
- The Architect manages releases - deployable units that group related projects.
184
-
185
- ### Release Lifecycle
104
+ **plan-approval** - After builder writes the plan
105
+ ```bash
106
+ # Review the plan
107
+ cat worktrees/spir_0042_user-authentication/codev/plans/0042-user-authentication.md
186
108
 
109
+ # Approve if satisfactory
110
+ porch approve 0042 plan-approval
187
111
  ```
188
- planning → active → released → archived
189
- ```
190
-
191
- - **planning**: Defining scope, assigning projects to the release
192
- - **active**: The current development focus (only one release should be active)
193
- - **released**: All projects integrated and deployed
194
- - **archived**: Historical, no longer maintained
195
-
196
- ### Release Responsibilities
197
112
 
198
- 1. **Create releases** - Define new releases with semantic versions (v1.0.0, v1.1.0, v2.0.0)
199
- 2. **Assign projects** - Set each project's `release` field when scope is determined
200
- 3. **Track progress** - Monitor which projects are complete within a release
201
- 4. **Transition status** - Move releases through the lifecycle as work progresses
202
- 5. **Document releases** - Add release notes summarizing the release goals
203
-
204
- ### Release Guidelines
205
-
206
- - Only **one release** should be `active` at a time
207
- - Projects should be assigned to a release before reaching `implementing` status
208
- - All projects in a release must be `integrated` before the release can be marked `released`
209
- - **Unassigned integrated projects** - Some work (ad-hoc fixes, documentation, minor improvements) may not belong to any release. These go in the "Integrated (Unassigned)" section with `release: null`
210
- - Use semantic versioning:
211
- - **Major** (v2.0.0): Breaking changes or major new capabilities
212
- - **Minor** (v1.1.0): New features, backward compatible
213
- - **Patch** (v1.0.1): Bug fixes only
214
-
215
- ## Development Protocols
216
-
217
- The Architect uses SPIDER or TICK protocols. **The Builder executes the full SPIDER protocol** (Specify → Plan → Implement → Defend → Evaluate → Review). The Architect's role is to spawn builders, approve gates, and integrate their work.
218
-
219
- ### Spawning a Builder
220
-
221
- When a new feature is needed:
113
+ ### 3. Monitoring Progress
222
114
 
223
115
  ```bash
224
- af spawn -p 0034
116
+ af status # Overview of all builders
117
+ porch status 0042 # Detailed state for one project (strict mode)
225
118
  ```
226
119
 
227
- The builder will:
228
- 1. **Specify** - Write the spec, run 3-way consultation, then hit `spec-approval` gate
229
- 2. **Plan** - Write the plan, run 3-way consultation, then hit `plan-approval` gate
230
- 3. **Implement/Defend/Evaluate** - Complete I→D→E cycles for each plan phase
231
- 4. **Review** - Create review document and PR
232
-
233
- ### Approving Gates
234
-
235
- The builder stops at two gates that require human approval:
120
+ ### 4. Integration Review
236
121
 
237
- 1. **spec-approval** - After the builder writes the spec
238
- - Review the spec at `codev/specs/XXXX-name.md`
239
- - Verify it captures requirements correctly
240
- - Approve: `porch approve XXXX spec-approval --a-human-explicitly-approved-this`
241
-
242
- 2. **plan-approval** - After the builder writes the plan
243
- - Review the plan at `codev/plans/XXXX-name.md`
244
- - Verify phases are logical and complete
245
- - Approve: `porch approve XXXX plan-approval --a-human-explicitly-approved-this`
246
-
247
- **Important:** Update the project status in `codev/projectlist.md` as gates are approved.
248
-
249
- ### Monitoring Progress
122
+ When the builder creates a PR:
250
123
 
251
124
  ```bash
252
- # Check builder status
253
- af status
254
-
255
- # Check porch state for a project
256
- porch status 0034
257
- ```
258
-
259
- The Architect monitors progress and provides guidance when builders are blocked.
260
-
261
- ## Spikes: De-risking Technical Unknowns
262
-
263
- When facing high-risk technical unknowns, use **spikes** - short, time-boxed experiments (1-2 hours max) that validate assumptions before full implementation.
125
+ # Run 3-way integration review
126
+ consult --model gemini --type integration-review pr 83 &
127
+ consult --model codex --type integration-review pr 83 &
128
+ consult --model claude --type integration-review pr 83 &
129
+ wait
264
130
 
265
- **Full guide:** See [codev/resources/spikes.md](../resources/spikes.md)
131
+ # Post findings as PR comment
132
+ gh pr comment 83 --body "## Architect Integration Review
266
133
 
267
- **Quick reference:**
268
- - Store in `codev/spikes/{spec-number}/`
269
- - Typically 1-2 hours; check in if taking longer
270
- - Output: PASS/FAIL + learnings (code is throwaway)
271
- - Use when: Untested APIs, architectural uncertainty, integration questions
134
+ **Verdict: APPROVE**
272
135
 
273
- ## Communication with Builders
136
+ Integration looks good. No conflicts with existing modules.
274
137
 
275
- ### Providing Context
138
+ ---
139
+ Architect integration review"
276
140
 
277
- When spawning a Builder, provide:
278
- - The project ID and name
279
- - High-level description of the feature
280
- - Any relevant architecture context
281
- - Constraints or patterns to follow
282
- - Which protocol to use (SPIDER/TICK)
141
+ # Notify builder
142
+ af send 0042 "PR approved, please merge"
143
+ ```
283
144
 
284
- The builder will create the spec and plan files themselves.
145
+ ### 5. Cleanup
285
146
 
286
- ### Handling Blocked Status
147
+ After builder merges and work is integrated:
287
148
 
288
- When a Builder reports `blocked`:
289
- 1. Read their question/blocker
290
- 2. Provide guidance via `af send` or the annotation system
291
- 3. The builder will continue once unblocked
149
+ ```bash
150
+ af cleanup -p 0042
151
+ ```
292
152
 
293
- ### Reviewing Builder PRs
153
+ ## Critical Rules
294
154
 
295
- Both Builder and Architect run 3-way reviews, but with **different focus**:
155
+ ### NEVER Do These:
156
+ 1. **DO NOT merge PRs yourself** - Let builders merge their own PRs
157
+ 2. **DO NOT commit directly to main** - All changes go through builder PRs
158
+ 3. **DO NOT use `af send` for long messages** - Use GitHub PR comments instead
296
159
 
297
- | Role | Focus |
298
- |------|-------|
299
- | Builder | Implementation quality, tests, spec adherence |
300
- | Architect | **Integration aspects** - how changes fit into the broader system |
160
+ ### ALWAYS Do These:
161
+ 1. **Reserve project numbers first** - Update projectlist.md before spawning
162
+ 2. **Review artifacts before approving gates** - (Strict mode) Read the spec/plan carefully
163
+ 3. **Use PR comments for feedback** - Not terminal send-keys
164
+ 4. **Let builders own their work** - Guide, don't take over
301
165
 
302
- **Step 1: Verify Builder completed their review**
303
- 1. Check PR description for builder's 3-way review summary
304
- 2. Confirm any REQUEST_CHANGES from their review were addressed
305
- 3. All SPIDER artifacts are present (especially the review document)
166
+ ## Project Tracking
306
167
 
307
- **Step 2: Run Architect's 3-way integration review**
168
+ **`codev/projectlist.md` is the canonical source of truth.**
308
169
 
309
170
  ```bash
310
- QUERY="Review PR 35 (Spec 0034) for INTEGRATION concerns. Branch: builder/0034-...
311
-
312
- Focus on:
313
- - How changes integrate with existing codebase
314
- - Impact on other modules/features
315
- - Architectural consistency
316
- - Potential side effects or regressions
317
- - API contract changes
318
-
319
- Give verdict: APPROVE or REQUEST_CHANGES with specific integration feedback."
171
+ # See what needs work
172
+ cat codev/projectlist.md
320
173
 
321
- consult --model gemini --type integration-review pr 35 &
322
- consult --model codex --type integration-review pr 35 &
323
- consult --model claude --type integration-review pr 35 &
324
- wait
174
+ # Find high-priority items
175
+ grep -A5 "priority: high" codev/projectlist.md
325
176
  ```
326
177
 
327
- **Step 3: Synthesize and communicate**
178
+ Update status as projects progress:
179
+ - `conceived` → `specified` → `planned` → `implementing` → `committed` → `integrated`
328
180
 
329
- ```bash
330
- # Post integration review findings as PR comment
331
- gh pr comment 35 --body "## Architect Integration Review (3-Way)
181
+ ## Handling Blocked Builders
332
182
 
333
- **Verdict: [APPROVE/REQUEST_CHANGES]**
183
+ When a builder reports blocked:
334
184
 
335
- ### Integration Concerns
336
- - [Issue 1]
337
- - [Issue 2]
185
+ 1. Check their status: `af status` or `porch status <id>`
186
+ 2. Read their output in the terminal: `http://localhost:<port>`
187
+ 3. Provide guidance via short `af send` message
188
+ 4. Or answer their question directly if they asked one
338
189
 
339
- ---
340
- 🏗️ Architect integration review"
190
+ ## Release Management
191
+
192
+ The Architect manages releases - deployable units grouping related projects.
341
193
 
342
- # Notify builder with short message
343
- af send 0034 "Check PR 35 comments"
194
+ ```
195
+ planning active released archived
344
196
  ```
345
197
 
346
- **Note:** Large messages via `af send` may have issues with tmux paste buffers. Keep direct messages short; put detailed feedback in PR comments.
198
+ - Only **one release** should be `active` at a time
199
+ - Projects should be assigned to a release before `implementing`
200
+ - All projects must be `integrated` before release is marked `released`
347
201
 
348
- ### UX Verification (Critical)
202
+ ## UX Verification (Critical)
349
203
 
350
- **CRITICAL:** Before approving ANY implementation with UX requirements:
204
+ Before approving implementations with UX requirements:
351
205
 
352
- 1. **Read the spec's "Goals" section** and any UX flow diagrams
206
+ 1. **Read the spec's Goals section**
353
207
  2. **Manually test** the actual user experience
354
- 3. For each UX requirement, verify:
355
- - Does the implementation actually do this?
356
- - Does it FEEL right to use?
357
- - Would a real user experience what the spec describes?
358
-
359
- **Automatic REJECT conditions:**
360
- - Spec says "async" but code is synchronous → **REJECT**
361
- - Spec says "immediate response" but user waits 30+ seconds → **REJECT**
362
- - Spec has a flow diagram but actual flow differs → **REJECT**
363
- - Spec describes "non-blocking" but implementation blocks → **REJECT**
364
-
365
- **UX Verification Checklist:**
366
- ```markdown
367
- Before marking implementation complete:
368
- - [ ] Each "Must Have" requirement verified manually
369
- - [ ] UX flow diagrams match actual behavior
370
- - [ ] User can perform all described interactions
371
- - [ ] Time-to-response matches spec expectations
372
- - [ ] Concurrent/async behaviors work as described
373
- ```
374
-
375
- **Why this matters:** Code reviews catch syntax and logic errors, but miss UX gaps. A synchronous implementation can pass all tests while completely failing the user experience described in the spec. The only way to catch this is to actually USE the feature as a user would.
376
-
377
- ### Testing Requirements
378
-
379
- Specs should explicitly require:
380
- 1. **Unit tests** - Core functionality
381
- 2. **Integration tests** - Full workflow
382
- 3. **Error handling tests** - Edge cases and failure modes
383
- 4. **UX tests** - For specs with UX requirements, verify timing and interaction patterns
208
+ 3. Verify each UX requirement is met
209
+
210
+ **Auto-reject if:**
211
+ - Spec says "async" but implementation is synchronous
212
+ - Spec says "immediate" but user waits 30+ seconds
213
+ - Spec has flow diagram that doesn't match reality
214
+
215
+ ## Quick Reference
216
+
217
+ | Task | Command |
218
+ |------|---------|
219
+ | Start feature (strict, default) | `af spawn -p <id>` |
220
+ | Start feature (soft) | `af spawn --soft -p <id>` |
221
+ | Check all builders | `af status` |
222
+ | Check one project | `porch status <id>` |
223
+ | Approve spec | `porch approve <id> spec-approval` |
224
+ | Approve plan | `porch approve <id> plan-approval` |
225
+ | See pending gates | `porch pending` |
226
+ | Integration review | `consult --model X --type integration-review pr N` |
227
+ | Message builder | `af send <id> "short message"` |
228
+ | Cleanup builder | `af cleanup -p <id>` |