@cluesmith/codev 3.0.0-rc.1 → 3.0.0-rc.11

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 (328) hide show
  1. package/LICENSE +201 -0
  2. package/bin/af.js +2 -2
  3. package/bin/afx.js +8 -0
  4. package/bin/consult.js +2 -1
  5. package/bin/team.js +2 -1
  6. package/{dashboard/dist/assets/index-nr0cXxtf.css → dashboard-dist/assets/index-Bs8I7N2s.css} +1 -1
  7. package/dashboard-dist/assets/index-CkNo2z6t.js +195 -0
  8. package/dashboard-dist/assets/index-CkNo2z6t.js.map +1 -0
  9. package/dashboard-dist/dist/assets/index-Bs8I7N2s.css +32 -0
  10. package/dashboard-dist/dist/assets/index-CkNo2z6t.js +195 -0
  11. package/dashboard-dist/dist/assets/index-CkNo2z6t.js.map +1 -0
  12. package/{dashboard → dashboard-dist}/dist/index.html +2 -2
  13. package/dashboard-dist/index.html +14 -0
  14. package/dist/agent-farm/cli.d.ts.map +1 -1
  15. package/dist/agent-farm/cli.js +17 -14
  16. package/dist/agent-farm/cli.js.map +1 -1
  17. package/dist/agent-farm/commands/architect.d.ts +4 -4
  18. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  19. package/dist/agent-farm/commands/architect.js +23 -12
  20. package/dist/agent-farm/commands/architect.js.map +1 -1
  21. package/dist/agent-farm/commands/attach.js +8 -8
  22. package/dist/agent-farm/commands/attach.js.map +1 -1
  23. package/dist/agent-farm/commands/bench.d.ts +1 -1
  24. package/dist/agent-farm/commands/bench.js +1 -1
  25. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  26. package/dist/agent-farm/commands/cleanup.js +10 -5
  27. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  28. package/dist/agent-farm/commands/cron.js +1 -1
  29. package/dist/agent-farm/commands/cron.js.map +1 -1
  30. package/dist/agent-farm/commands/db.d.ts +3 -3
  31. package/dist/agent-farm/commands/db.js +4 -4
  32. package/dist/agent-farm/commands/db.js.map +1 -1
  33. package/dist/agent-farm/commands/open.js +2 -2
  34. package/dist/agent-farm/commands/open.js.map +1 -1
  35. package/dist/agent-farm/commands/rename.js +1 -1
  36. package/dist/agent-farm/commands/rename.js.map +1 -1
  37. package/dist/agent-farm/commands/send.d.ts +4 -1
  38. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  39. package/dist/agent-farm/commands/send.js +8 -5
  40. package/dist/agent-farm/commands/send.js.map +1 -1
  41. package/dist/agent-farm/commands/shell.js +3 -3
  42. package/dist/agent-farm/commands/shell.js.map +1 -1
  43. package/dist/agent-farm/commands/spawn-roles.d.ts +2 -1
  44. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
  45. package/dist/agent-farm/commands/spawn-roles.js +1 -1
  46. package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
  47. package/dist/agent-farm/commands/spawn-worktree.d.ts +49 -10
  48. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  49. package/dist/agent-farm/commands/spawn-worktree.js +356 -51
  50. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  51. package/dist/agent-farm/commands/spawn.d.ts +6 -6
  52. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  53. package/dist/agent-farm/commands/spawn.js +182 -74
  54. package/dist/agent-farm/commands/spawn.js.map +1 -1
  55. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  56. package/dist/agent-farm/commands/status.js +48 -3
  57. package/dist/agent-farm/commands/status.js.map +1 -1
  58. package/dist/agent-farm/commands/team-update.d.ts +1 -1
  59. package/dist/agent-farm/commands/team-update.d.ts.map +1 -1
  60. package/dist/agent-farm/commands/team-update.js +8 -5
  61. package/dist/agent-farm/commands/team-update.js.map +1 -1
  62. package/dist/agent-farm/commands/team.d.ts +1 -1
  63. package/dist/agent-farm/commands/team.d.ts.map +1 -1
  64. package/dist/agent-farm/commands/team.js +7 -3
  65. package/dist/agent-farm/commands/team.js.map +1 -1
  66. package/dist/agent-farm/commands/tower-cloud.d.ts +2 -2
  67. package/dist/agent-farm/commands/tower-cloud.js +3 -3
  68. package/dist/agent-farm/commands/tower-cloud.js.map +1 -1
  69. package/dist/agent-farm/commands/tower.js +2 -2
  70. package/dist/agent-farm/commands/tower.js.map +1 -1
  71. package/dist/agent-farm/lib/cloud-config.js +2 -2
  72. package/dist/agent-farm/lib/cloud-config.js.map +1 -1
  73. package/dist/agent-farm/lib/tower-client.d.ts +6 -230
  74. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  75. package/dist/agent-farm/lib/tower-client.js +6 -293
  76. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  77. package/dist/agent-farm/lib/tunnel-client.js +1 -1
  78. package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
  79. package/dist/agent-farm/servers/message-write.d.ts +24 -0
  80. package/dist/agent-farm/servers/message-write.d.ts.map +1 -0
  81. package/dist/agent-farm/servers/message-write.js +63 -0
  82. package/dist/agent-farm/servers/message-write.js.map +1 -0
  83. package/dist/agent-farm/servers/overview.d.ts +10 -8
  84. package/dist/agent-farm/servers/overview.d.ts.map +1 -1
  85. package/dist/agent-farm/servers/overview.js +78 -38
  86. package/dist/agent-farm/servers/overview.js.map +1 -1
  87. package/dist/agent-farm/servers/send-buffer.d.ts +4 -3
  88. package/dist/agent-farm/servers/send-buffer.d.ts.map +1 -1
  89. package/dist/agent-farm/servers/send-buffer.js +7 -4
  90. package/dist/agent-farm/servers/send-buffer.js.map +1 -1
  91. package/dist/agent-farm/servers/tower-cron-parser.js +1 -1
  92. package/dist/agent-farm/servers/tower-cron-parser.js.map +1 -1
  93. package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
  94. package/dist/agent-farm/servers/tower-cron.js +4 -5
  95. package/dist/agent-farm/servers/tower-cron.js.map +1 -1
  96. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  97. package/dist/agent-farm/servers/tower-instances.js +15 -13
  98. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  99. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  100. package/dist/agent-farm/servers/tower-routes.js +9 -16
  101. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  102. package/dist/agent-farm/servers/tower-server.js +1 -1
  103. package/dist/agent-farm/servers/tower-terminals.d.ts +2 -2
  104. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  105. package/dist/agent-farm/servers/tower-terminals.js +64 -36
  106. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  107. package/dist/agent-farm/servers/tower-tunnel.js +2 -2
  108. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  109. package/dist/agent-farm/servers/tower-utils.d.ts +9 -6
  110. package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
  111. package/dist/agent-farm/servers/tower-utils.js +13 -7
  112. package/dist/agent-farm/servers/tower-utils.js.map +1 -1
  113. package/dist/agent-farm/types.d.ts +13 -0
  114. package/dist/agent-farm/types.d.ts.map +1 -1
  115. package/dist/agent-farm/utils/config.d.ts +11 -0
  116. package/dist/agent-farm/utils/config.d.ts.map +1 -1
  117. package/dist/agent-farm/utils/config.js +39 -17
  118. package/dist/agent-farm/utils/config.js.map +1 -1
  119. package/dist/agent-farm/utils/harness.d.ts +85 -0
  120. package/dist/agent-farm/utils/harness.d.ts.map +1 -0
  121. package/dist/agent-farm/utils/harness.js +212 -0
  122. package/dist/agent-farm/utils/harness.js.map +1 -0
  123. package/dist/agent-farm/utils/roles.d.ts +11 -4
  124. package/dist/agent-farm/utils/roles.d.ts.map +1 -1
  125. package/dist/agent-farm/utils/roles.js +21 -6
  126. package/dist/agent-farm/utils/roles.js.map +1 -1
  127. package/dist/cli.d.ts +1 -1
  128. package/dist/cli.d.ts.map +1 -1
  129. package/dist/cli.js +40 -5
  130. package/dist/cli.js.map +1 -1
  131. package/dist/commands/adopt.d.ts.map +1 -1
  132. package/dist/commands/adopt.js +16 -45
  133. package/dist/commands/adopt.js.map +1 -1
  134. package/dist/commands/consult/index.d.ts +37 -3
  135. package/dist/commands/consult/index.d.ts.map +1 -1
  136. package/dist/commands/consult/index.js +281 -194
  137. package/dist/commands/consult/index.js.map +1 -1
  138. package/dist/commands/doctor.d.ts.map +1 -1
  139. package/dist/commands/doctor.js +121 -31
  140. package/dist/commands/doctor.js.map +1 -1
  141. package/dist/commands/init.d.ts.map +1 -1
  142. package/dist/commands/init.js +13 -43
  143. package/dist/commands/init.js.map +1 -1
  144. package/dist/commands/porch/artifacts.d.ts +69 -0
  145. package/dist/commands/porch/artifacts.d.ts.map +1 -0
  146. package/dist/commands/porch/artifacts.js +368 -0
  147. package/dist/commands/porch/artifacts.js.map +1 -0
  148. package/dist/commands/porch/checks.d.ts +14 -3
  149. package/dist/commands/porch/checks.d.ts.map +1 -1
  150. package/dist/commands/porch/checks.js +150 -4
  151. package/dist/commands/porch/checks.js.map +1 -1
  152. package/dist/commands/porch/config.d.ts +6 -9
  153. package/dist/commands/porch/config.d.ts.map +1 -1
  154. package/dist/commands/porch/config.js +12 -37
  155. package/dist/commands/porch/config.js.map +1 -1
  156. package/dist/commands/porch/index.d.ts +12 -7
  157. package/dist/commands/porch/index.d.ts.map +1 -1
  158. package/dist/commands/porch/index.js +273 -82
  159. package/dist/commands/porch/index.js.map +1 -1
  160. package/dist/commands/porch/next.d.ts.map +1 -1
  161. package/dist/commands/porch/next.js +142 -75
  162. package/dist/commands/porch/next.js.map +1 -1
  163. package/dist/commands/porch/notify.d.ts +2 -2
  164. package/dist/commands/porch/notify.js +5 -5
  165. package/dist/commands/porch/notify.js.map +1 -1
  166. package/dist/commands/porch/prompts.d.ts +2 -1
  167. package/dist/commands/porch/prompts.d.ts.map +1 -1
  168. package/dist/commands/porch/prompts.js +34 -38
  169. package/dist/commands/porch/prompts.js.map +1 -1
  170. package/dist/commands/porch/protocol.d.ts +4 -3
  171. package/dist/commands/porch/protocol.d.ts.map +1 -1
  172. package/dist/commands/porch/protocol.js +21 -21
  173. package/dist/commands/porch/protocol.js.map +1 -1
  174. package/dist/commands/porch/state.d.ts +27 -2
  175. package/dist/commands/porch/state.d.ts.map +1 -1
  176. package/dist/commands/porch/state.js +100 -9
  177. package/dist/commands/porch/state.js.map +1 -1
  178. package/dist/commands/porch/types.d.ts +10 -2
  179. package/dist/commands/porch/types.d.ts.map +1 -1
  180. package/dist/commands/sync.d.ts +26 -0
  181. package/dist/commands/sync.d.ts.map +1 -0
  182. package/dist/commands/sync.js +207 -0
  183. package/dist/commands/sync.js.map +1 -0
  184. package/dist/commands/update.d.ts +15 -2
  185. package/dist/commands/update.d.ts.map +1 -1
  186. package/dist/commands/update.js +159 -202
  187. package/dist/commands/update.js.map +1 -1
  188. package/dist/lib/config.d.ts +96 -0
  189. package/dist/lib/config.d.ts.map +1 -0
  190. package/dist/lib/config.js +165 -0
  191. package/dist/lib/config.js.map +1 -0
  192. package/dist/lib/forge-contracts.d.ts +100 -0
  193. package/dist/lib/forge-contracts.d.ts.map +1 -0
  194. package/dist/lib/forge-contracts.js +35 -0
  195. package/dist/lib/forge-contracts.js.map +1 -0
  196. package/dist/lib/forge.d.ts +102 -0
  197. package/dist/lib/forge.d.ts.map +1 -0
  198. package/dist/lib/forge.js +376 -0
  199. package/dist/lib/forge.js.map +1 -0
  200. package/dist/lib/github.d.ts +68 -60
  201. package/dist/lib/github.d.ts.map +1 -1
  202. package/dist/lib/github.js +160 -169
  203. package/dist/lib/github.js.map +1 -1
  204. package/dist/lib/skeleton.d.ts +15 -5
  205. package/dist/lib/skeleton.d.ts.map +1 -1
  206. package/dist/lib/skeleton.js +82 -7
  207. package/dist/lib/skeleton.js.map +1 -1
  208. package/dist/lib/team-github.d.ts +7 -3
  209. package/dist/lib/team-github.d.ts.map +1 -1
  210. package/dist/lib/team-github.js +29 -19
  211. package/dist/lib/team-github.js.map +1 -1
  212. package/dist/terminal/pty-manager.d.ts.map +1 -1
  213. package/dist/terminal/pty-manager.js +2 -0
  214. package/dist/terminal/pty-manager.js.map +1 -1
  215. package/dist/terminal/ws-protocol.d.ts +10 -8
  216. package/dist/terminal/ws-protocol.d.ts.map +1 -1
  217. package/dist/terminal/ws-protocol.js +3 -0
  218. package/dist/terminal/ws-protocol.js.map +1 -1
  219. package/package.json +27 -24
  220. package/scripts/forge/gitea/auth-status.sh +3 -0
  221. package/scripts/forge/gitea/issue-comment.sh +3 -0
  222. package/scripts/forge/gitea/issue-list.sh +3 -0
  223. package/scripts/forge/gitea/issue-view.sh +3 -0
  224. package/scripts/forge/gitea/pr-exists.sh +6 -0
  225. package/scripts/forge/gitea/pr-list.sh +3 -0
  226. package/scripts/forge/gitea/pr-merge.sh +3 -0
  227. package/scripts/forge/gitea/pr-view.sh +3 -0
  228. package/scripts/forge/gitea/recently-closed.sh +3 -0
  229. package/scripts/forge/gitea/recently-merged.sh +3 -0
  230. package/scripts/forge/gitea/repo-archive.sh +11 -0
  231. package/scripts/forge/gitea/user-identity.sh +3 -0
  232. package/scripts/forge/github/auth-status.sh +4 -0
  233. package/scripts/forge/github/issue-comment.sh +5 -0
  234. package/scripts/forge/github/issue-list.sh +4 -0
  235. package/scripts/forge/github/issue-view.sh +5 -0
  236. package/scripts/forge/github/on-it-timestamps.sh +8 -0
  237. package/scripts/forge/github/pr-diff.sh +10 -0
  238. package/scripts/forge/github/pr-exists.sh +7 -0
  239. package/scripts/forge/github/pr-list.sh +4 -0
  240. package/scripts/forge/github/pr-merge.sh +5 -0
  241. package/scripts/forge/github/pr-search.sh +5 -0
  242. package/scripts/forge/github/pr-view.sh +11 -0
  243. package/scripts/forge/github/recently-closed.sh +15 -0
  244. package/scripts/forge/github/recently-merged.sh +15 -0
  245. package/scripts/forge/github/repo-archive.sh +10 -0
  246. package/scripts/forge/github/team-activity.sh +5 -0
  247. package/scripts/forge/github/user-identity.sh +4 -0
  248. package/scripts/forge/gitlab/auth-status.sh +3 -0
  249. package/scripts/forge/gitlab/issue-comment.sh +3 -0
  250. package/scripts/forge/gitlab/issue-list.sh +3 -0
  251. package/scripts/forge/gitlab/issue-view.sh +3 -0
  252. package/scripts/forge/gitlab/pr-diff.sh +3 -0
  253. package/scripts/forge/gitlab/pr-exists.sh +5 -0
  254. package/scripts/forge/gitlab/pr-list.sh +3 -0
  255. package/scripts/forge/gitlab/pr-merge.sh +3 -0
  256. package/scripts/forge/gitlab/pr-search.sh +3 -0
  257. package/scripts/forge/gitlab/pr-view.sh +3 -0
  258. package/scripts/forge/gitlab/recently-closed.sh +3 -0
  259. package/scripts/forge/gitlab/recently-merged.sh +3 -0
  260. package/scripts/forge/gitlab/repo-archive.sh +12 -0
  261. package/scripts/forge/gitlab/user-identity.sh +3 -0
  262. package/skeleton/.claude/skills/afx/SKILL.md +144 -0
  263. package/skeleton/.claude/skills/codev/SKILL.md +3 -3
  264. package/skeleton/.claude/skills/consult/SKILL.md +1 -1
  265. package/skeleton/.claude/skills/porch/SKILL.md +2 -2
  266. package/skeleton/DEPENDENCIES.md +1 -1
  267. package/skeleton/builders.md +4 -4
  268. package/skeleton/protocol-schema.json +2 -2
  269. package/skeleton/protocols/air/builder-prompt.md +6 -6
  270. package/skeleton/protocols/air/prompts/pr.md +17 -5
  271. package/skeleton/protocols/air/protocol.md +1 -2
  272. package/skeleton/protocols/aspir/builder-prompt.md +28 -6
  273. package/skeleton/protocols/aspir/prompts/review.md +11 -0
  274. package/skeleton/protocols/aspir/protocol.json +9 -1
  275. package/skeleton/protocols/aspir/protocol.md +1 -1
  276. package/skeleton/protocols/aspir/templates/plan.md +0 -20
  277. package/skeleton/protocols/aspir/templates/spec.md +0 -28
  278. package/skeleton/protocols/bugfix/builder-prompt.md +6 -6
  279. package/skeleton/protocols/bugfix/prompts/pr.md +16 -4
  280. package/skeleton/protocols/experiment/builder-prompt.md +15 -0
  281. package/skeleton/protocols/experiment/protocol.md +1 -6
  282. package/skeleton/protocols/maintain/builder-prompt.md +12 -11
  283. package/skeleton/protocols/maintain/prompts/maintain.md +88 -0
  284. package/skeleton/protocols/maintain/prompts/review.md +84 -0
  285. package/skeleton/protocols/maintain/protocol.json +14 -68
  286. package/skeleton/protocols/maintain/protocol.md +111 -409
  287. package/skeleton/protocols/maintain/templates/maintenance-run.md +18 -49
  288. package/skeleton/protocols/protocol-schema.json +1 -1
  289. package/skeleton/protocols/spike/builder-prompt.md +1 -1
  290. package/skeleton/protocols/spike/protocol.md +4 -4
  291. package/skeleton/protocols/spir/builder-prompt.md +28 -5
  292. package/skeleton/protocols/spir/prompts/review.md +11 -0
  293. package/skeleton/protocols/spir/protocol.json +9 -1
  294. package/skeleton/protocols/spir/protocol.md +2 -2
  295. package/skeleton/protocols/spir/templates/plan.md +0 -20
  296. package/skeleton/protocols/spir/templates/spec.md +0 -28
  297. package/skeleton/resources/commands/agent-farm.md +84 -84
  298. package/skeleton/resources/commands/codev.md +1 -1
  299. package/skeleton/resources/commands/consult.md +16 -7
  300. package/skeleton/resources/commands/overview.md +14 -15
  301. package/skeleton/resources/risk-triage.md +1 -1
  302. package/skeleton/resources/workflow-reference.md +14 -14
  303. package/skeleton/roles/architect.md +55 -43
  304. package/skeleton/roles/builder.md +22 -14
  305. package/skeleton/templates/AGENTS.md +4 -3
  306. package/skeleton/templates/CLAUDE.md +4 -3
  307. package/skeleton/templates/cheatsheet.md +11 -12
  308. package/templates/3d-viewer.html +16 -18
  309. package/templates/tower.html +1 -1
  310. package/dashboard/dist/assets/index-CiIBsixF.js +0 -194
  311. package/dashboard/dist/assets/index-CiIBsixF.js.map +0 -1
  312. package/skeleton/.claude/skills/af/SKILL.md +0 -146
  313. package/skeleton/porch/prompts/understand.md +0 -61
  314. package/skeleton/porch/prompts/verify.md +0 -58
  315. package/skeleton/protocols/maintain/prompts/audit.md +0 -111
  316. package/skeleton/protocols/maintain/prompts/clean.md +0 -91
  317. package/skeleton/protocols/maintain/prompts/sync.md +0 -113
  318. package/skeleton/protocols/maintain/prompts/verify.md +0 -110
  319. package/skeleton/protocols/tick/builder-prompt.md +0 -65
  320. package/skeleton/protocols/tick/consult-types/impl-review.md +0 -72
  321. package/skeleton/protocols/tick/consult-types/plan-review.md +0 -59
  322. package/skeleton/protocols/tick/consult-types/pr-review.md +0 -72
  323. package/skeleton/protocols/tick/consult-types/spec-review.md +0 -55
  324. package/skeleton/protocols/tick/protocol.json +0 -151
  325. package/skeleton/protocols/tick/protocol.md +0 -277
  326. package/skeleton/protocols/tick/templates/plan.md +0 -67
  327. package/skeleton/protocols/tick/templates/review.md +0 -89
  328. package/skeleton/protocols/tick/templates/spec.md +0 -61
@@ -0,0 +1,11 @@
1
+ #!/bin/sh
2
+ # Forge concept: repo-archive (Gitea via tea CLI)
3
+ # Input: CODEV_REPO (owner/repo), CODEV_REF (tag/branch/sha, empty for default), CODEV_OUTPUT_DIR
4
+ # Output: Extracts repository archive into CODEV_OUTPUT_DIR
5
+ REF_PART="${CODEV_REF:-main}"
6
+ # Gitea API: GET /repos/:owner/:repo/archive/:ref.tar.gz
7
+ tea api "repos/${CODEV_REPO}/archive/${REF_PART}.tar.gz" > /tmp/codev-archive-$$.tar.gz
8
+ mkdir -p "${CODEV_OUTPUT_DIR}"
9
+ tar xzf /tmp/codev-archive-$$.tar.gz -C "${CODEV_OUTPUT_DIR}" --strip-components=1
10
+ rm -f /tmp/codev-archive-$$.tar.gz
11
+ echo '{"status":"ok"}'
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: user-identity (Gitea via tea CLI)
3
+ tea whoami --output json | jq -r ".login"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Forge concept: auth-status (GitHub via gh CLI)
3
+ # Output: text + exit code (0 = authenticated)
4
+ exec gh auth status
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-comment (GitHub via gh CLI)
3
+ # Input: CODEV_ISSUE_ID, CODEV_COMMENT_BODY
4
+ # Output: exit code only
5
+ exec gh issue comment "$CODEV_ISSUE_ID" --body "$CODEV_COMMENT_BODY"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-list (GitHub via gh CLI)
3
+ # Output: JSON [{number, title, url, labels, createdAt, author}]
4
+ exec gh issue list --limit 200 --json number,title,url,labels,createdAt,author
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-view (GitHub via gh CLI)
3
+ # Input: CODEV_ISSUE_ID
4
+ # Output: JSON {title, body, state, comments[]}
5
+ exec gh issue view "$CODEV_ISSUE_ID" --json title,body,state,comments
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ # Forge concept: on-it-timestamps (GitHub via gh CLI)
3
+ # Input: CODEV_GRAPHQL_QUERY, CODEV_REPO_OWNER, CODEV_REPO_NAME
4
+ # Output: raw GraphQL JSON response
5
+ exec gh api graphql \
6
+ -f query="$CODEV_GRAPHQL_QUERY" \
7
+ -f owner="$CODEV_REPO_OWNER" \
8
+ -f name="$CODEV_REPO_NAME"
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-diff (GitHub via gh CLI)
3
+ # Input: CODEV_PR_NUMBER, CODEV_DIFF_NAME_ONLY (optional, "1" for name-only)
4
+ # Output: raw diff text
5
+
6
+ if [ "$CODEV_DIFF_NAME_ONLY" = "1" ]; then
7
+ exec gh pr diff "$CODEV_PR_NUMBER" --name-only
8
+ else
9
+ exec gh pr diff "$CODEV_PR_NUMBER"
10
+ fi
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-exists (GitHub via gh CLI)
3
+ # Input: CODEV_BRANCH_NAME
4
+ # Output: "true" or "false"
5
+ # Returns true for OPEN or MERGED PRs only. CLOSED-not-merged PRs are excluded.
6
+ # (bugfix #568: --state all is needed to catch merged PRs; #653: filter out CLOSED)
7
+ exec gh pr list --state all --head "$CODEV_BRANCH_NAME" --json number,state --jq '[.[] | select(.state == "OPEN" or .state == "MERGED")] | length > 0'
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-list (GitHub via gh CLI)
3
+ # Output: JSON [{number, title, url, reviewDecision, body, createdAt, author}]
4
+ exec gh pr list --json number,title,url,reviewDecision,body,createdAt,author
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-merge (GitHub via gh CLI)
3
+ # Input: CODEV_PR_NUMBER
4
+ # Output: exit code only
5
+ exec gh pr merge "$CODEV_PR_NUMBER" --merge
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-search (GitHub via gh CLI)
3
+ # Input: CODEV_SEARCH_QUERY
4
+ # Output: JSON [{number, headRefName}]
5
+ exec gh pr list --search "$CODEV_SEARCH_QUERY" --json number,headRefName
@@ -0,0 +1,11 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-view (GitHub via gh CLI)
3
+ # Input: CODEV_PR_NUMBER, CODEV_INCLUDE_COMMENTS (optional, "1" to include)
4
+ # Output: JSON or text (with comments)
5
+
6
+ if [ "$CODEV_INCLUDE_COMMENTS" = "1" ]; then
7
+ exec gh pr view "$CODEV_PR_NUMBER" --comments
8
+ else
9
+ exec gh pr view "$CODEV_PR_NUMBER" \
10
+ --json title,body,state,author,baseRefName,headRefName,additions,deletions
11
+ fi
@@ -0,0 +1,15 @@
1
+ #!/bin/sh
2
+ # Forge concept: recently-closed (GitHub via gh CLI)
3
+ # Input: CODEV_SINCE_DATE (optional, ISO date)
4
+ # Output: JSON [{number, title, url, labels, createdAt, closedAt}]
5
+
6
+ if [ -n "$CODEV_SINCE_DATE" ]; then
7
+ exec gh issue list --state closed \
8
+ --search "closed:>$CODEV_SINCE_DATE" \
9
+ --json number,title,url,labels,createdAt,closedAt \
10
+ --limit 1000
11
+ else
12
+ exec gh issue list --state closed \
13
+ --json number,title,url,labels,createdAt,closedAt \
14
+ --limit 1000
15
+ fi
@@ -0,0 +1,15 @@
1
+ #!/bin/sh
2
+ # Forge concept: recently-merged (GitHub via gh CLI)
3
+ # Input: CODEV_SINCE_DATE (optional, ISO date)
4
+ # Output: JSON [{number, title, url, body, createdAt, mergedAt, headRefName}]
5
+
6
+ if [ -n "$CODEV_SINCE_DATE" ]; then
7
+ exec gh pr list --state merged \
8
+ --search "merged:>$CODEV_SINCE_DATE" \
9
+ --json number,title,url,body,createdAt,mergedAt,headRefName \
10
+ --limit 1000
11
+ else
12
+ exec gh pr list --state merged \
13
+ --json number,title,url,body,createdAt,mergedAt,headRefName \
14
+ --limit 1000
15
+ fi
@@ -0,0 +1,10 @@
1
+ #!/bin/sh
2
+ # Forge concept: repo-archive (GitHub via gh CLI)
3
+ # Input: CODEV_REPO (owner/repo), CODEV_REF (tag/branch/sha, empty for default), CODEV_OUTPUT_DIR
4
+ # Output: Extracts repository archive into CODEV_OUTPUT_DIR
5
+ REF_PART="${CODEV_REF:-HEAD}"
6
+ gh api "repos/${CODEV_REPO}/tarball/${REF_PART}" > /tmp/codev-archive-$$.tar.gz
7
+ mkdir -p "${CODEV_OUTPUT_DIR}"
8
+ tar xzf /tmp/codev-archive-$$.tar.gz -C "${CODEV_OUTPUT_DIR}" --strip-components=1
9
+ rm -f /tmp/codev-archive-$$.tar.gz
10
+ echo '{"status":"ok"}'
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Forge concept: team-activity (GitHub via gh CLI)
3
+ # Input: CODEV_GRAPHQL_QUERY
4
+ # Output: raw GraphQL JSON response
5
+ exec gh api graphql -f query="$CODEV_GRAPHQL_QUERY"
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ # Forge concept: user-identity (GitHub via gh CLI)
3
+ # Output: plain text username
4
+ exec gh api user --jq .login
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: auth-status (GitLab via glab CLI)
3
+ exec glab auth status
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-comment (GitLab via glab CLI)
3
+ exec glab issue note "$CODEV_ISSUE_ID" --message "$CODEV_COMMENT_BODY"
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-list (GitLab via glab CLI)
3
+ exec glab issue list --per-page 200 --output json
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: issue-view (GitLab via glab CLI)
3
+ exec glab issue view "$CODEV_ISSUE_ID" --output json
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-diff (GitLab via glab CLI)
3
+ exec glab mr diff "$CODEV_PR_NUMBER"
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-exists (GitLab via glab CLI)
3
+ # Returns true for open or merged MRs only. Closed-not-merged MRs are excluded.
4
+ # --all fetches MRs in all states (open, merged, closed); without it, only open MRs are returned.
5
+ glab mr list --all --source-branch "$CODEV_BRANCH_NAME" --output json | jq '[.[] | select(.state == "opened" or .state == "merged")] | length > 0'
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-list (GitLab via glab CLI — merge requests)
3
+ exec glab mr list --output json
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-merge (GitLab via glab CLI)
3
+ exec glab mr merge "$CODEV_PR_NUMBER" --yes
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-search (GitLab via glab CLI)
3
+ exec glab mr list --search "$CODEV_SEARCH_QUERY" --output json
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: pr-view (GitLab via glab CLI)
3
+ exec glab mr view "$CODEV_PR_NUMBER" --output json
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: recently-closed (GitLab via glab CLI)
3
+ exec glab issue list --state closed --per-page 1000 --output json
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: recently-merged (GitLab via glab CLI)
3
+ exec glab mr list --state merged --per-page 1000 --output json
@@ -0,0 +1,12 @@
1
+ #!/bin/sh
2
+ # Forge concept: repo-archive (GitLab via lab/glab CLI)
3
+ # Input: CODEV_REPO (owner/repo), CODEV_REF (tag/branch/sha, empty for default), CODEV_OUTPUT_DIR
4
+ # Output: Extracts repository archive into CODEV_OUTPUT_DIR
5
+ REF_PART="${CODEV_REF:-main}"
6
+ # GitLab API: GET /projects/:id/repository/archive
7
+ PROJECT_ENCODED=$(echo "${CODEV_REPO}" | sed 's/\//%2F/g')
8
+ glab api "projects/${PROJECT_ENCODED}/repository/archive?sha=${REF_PART}" > /tmp/codev-archive-$$.tar.gz
9
+ mkdir -p "${CODEV_OUTPUT_DIR}"
10
+ tar xzf /tmp/codev-archive-$$.tar.gz -C "${CODEV_OUTPUT_DIR}" --strip-components=1
11
+ rm -f /tmp/codev-archive-$$.tar.gz
12
+ echo '{"status":"ok"}'
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ # Forge concept: user-identity (GitLab via glab CLI)
3
+ glab auth status --show-token 2>&1 | grep "Logged in" | sed "s/.*as //" | sed "s/ .*//"
@@ -0,0 +1,144 @@
1
+ ---
2
+ name: afx
3
+ description: Agent Farm CLI — the tool for spawning builders, managing Tower, workspaces, and cron tasks. ALWAYS consult this skill BEFORE running any `afx` command to get the exact syntax. This prevents wasting time guessing flags that don't exist. Use this whenever you need to spawn a builder, check status, send messages, clean up worktrees, manage Tower, or run cron tasks. If you're about to type `afx` followed by anything, check here first.
4
+ ---
5
+
6
+ # Agent Farm CLI
7
+
8
+ ## afx spawn
9
+
10
+ Spawns a new builder in an isolated git worktree.
11
+
12
+ ```
13
+ afx spawn [number] [options]
14
+ ```
15
+
16
+ **The ONLY flags that exist:**
17
+
18
+ | Flag | Description |
19
+ |------|-------------|
20
+ | `--protocol <name>` | Protocol: spir, aspir, air, bugfix, maintain, experiment. **Required for numbered spawns.** |
21
+ | `--task <text>` | Ad-hoc task (no issue number needed) |
22
+ | `--shell` | Bare Claude session |
23
+ | `--worktree` | Bare worktree session |
24
+ | `--files <files>` | Context files, comma-separated. **Requires `--task`.** |
25
+ | `--no-comment` | Skip commenting on the GitHub issue |
26
+ | `--force` | Skip dirty-worktree and collision checks |
27
+ | `--soft` | Soft mode (AI follows protocol, you verify) |
28
+ | `--strict` | Strict mode (porch orchestrates) — this is the default |
29
+ | `--resume` | Resume builder in existing worktree |
30
+ | `--no-role` | Skip loading role prompt |
31
+
32
+ **There is NO `-t`, `--title`, `--name`, or `--branch` flag.** The branch name is auto-generated from the issue title.
33
+
34
+ **Examples:**
35
+ ```bash
36
+ afx spawn 42 --protocol spir # SPIR builder for issue #42
37
+ afx spawn 42 --protocol aspir # ASPIR (autonomous, no human gates)
38
+ afx spawn 42 --protocol air # AIR (small features)
39
+ afx spawn 42 --protocol bugfix # Bugfix
40
+ afx spawn 42 --protocol spir --soft # Soft mode
41
+ afx spawn 42 --resume # Resume existing builder
42
+ afx spawn --task "fix the flaky test" # Ad-hoc task (no issue)
43
+ afx spawn 42 --protocol spir --force # Skip dirty-worktree check
44
+ ```
45
+
46
+ **Pre-spawn checklist:**
47
+ 1. `git status` — worktree must be clean (or use `--force`)
48
+ 2. Commit specs/plans first — builders branch from HEAD and can't see uncommitted files
49
+ 3. `--protocol` is required for numbered spawns
50
+
51
+ ## afx send
52
+
53
+ Sends a message to a running builder.
54
+
55
+ ```
56
+ afx send [builder] [message]
57
+ ```
58
+
59
+ | Flag | Description |
60
+ |------|-------------|
61
+ | `--all` | Send to all builders |
62
+ | `--file <path>` | Include file content |
63
+ | `--interrupt` | Send Ctrl+C first |
64
+ | `--raw` | Skip structured formatting |
65
+ | `--no-enter` | Don't press Enter after message |
66
+
67
+ ```bash
68
+ afx send 0042 "PR approved, please merge"
69
+ afx send 0585 "check the test output" --file /tmp/test-results.txt
70
+ ```
71
+
72
+ ## afx cleanup
73
+
74
+ Removes a builder's worktree and branch after work is done.
75
+
76
+ ```
77
+ afx cleanup [options]
78
+ ```
79
+
80
+ | Flag | Description |
81
+ |------|-------------|
82
+ | `-p, --project <id>` | Builder project ID (no leading zeros: `585` not `0585`) |
83
+ | `-i, --issue <number>` | Cleanup bugfix builder by issue number |
84
+ | `-t, --task <id>` | Cleanup task builder (e.g., `task-bEPd`) |
85
+ | `-f, --force` | Force cleanup even if branch not merged |
86
+
87
+ ```bash
88
+ afx cleanup -p 585 # Clean up project 585
89
+ afx cleanup -p 585 -f # Force (unmerged branch)
90
+ ```
91
+
92
+ **Note:** `afx cleanup` uses plain numbers (`585`), not zero-padded (`0585`). But `afx send` uses zero-padded IDs (`0585`).
93
+
94
+ ## afx status
95
+
96
+ ```bash
97
+ afx status # Show all builders and workspace status
98
+ ```
99
+
100
+ No flags needed. Shows Tower status, workspace, and all active builders.
101
+
102
+ ## afx tower
103
+
104
+ ```bash
105
+ afx tower start # Start Tower on port 4100
106
+ afx tower stop # Stop Tower
107
+ afx tower log # Tail Tower logs
108
+ afx tower status # Check daemon and cloud connection status
109
+ afx tower connect # Connect to Codev Cloud
110
+ afx tower disconnect # Disconnect from Codev Cloud
111
+ ```
112
+
113
+ There is NO `afx tower restart` — use `afx tower stop && afx tower start`.
114
+
115
+ ## afx workspace
116
+
117
+ ```bash
118
+ afx workspace start # Start workspace for current project
119
+ afx workspace stop # Stop workspace processes
120
+ ```
121
+
122
+ `afx dash` is a deprecated alias — use `afx workspace` instead.
123
+
124
+ ## afx cron
125
+
126
+ ```bash
127
+ afx cron list # List all cron tasks
128
+ afx cron status <name> # Check task status
129
+ afx cron run <name> # Run immediately
130
+ afx cron enable <name> # Enable
131
+ afx cron disable <name> # Disable
132
+ ```
133
+
134
+ There is NO `afx cron add` — create YAML files in `.af-cron/` directly.
135
+
136
+ ## Other commands
137
+
138
+ ```bash
139
+ afx open <file> # Open file in annotation viewer (NOT system open)
140
+ afx shell # Spawn utility shell
141
+ afx attach # Attach to running builder terminal
142
+ afx rename <name> # Rename current shell session
143
+ afx architect # Start architect session in current terminal
144
+ ```
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: codev
3
- description: Codev project management CLI — init, adopt, update, and doctor commands. Check this skill before running any `codev` command (except `consult`, `porch`, or `af` which have their own skills). Use when setting up new projects, adding codev to existing repos, updating framework files, or diagnosing missing dependencies.
3
+ description: Codev project management CLI — init, adopt, update, and doctor commands. Check this skill before running any `codev` command (except `consult`, `porch`, or `afx` which have their own skills). Use when setting up new projects, adding codev to existing repos, updating framework files, or diagnosing missing dependencies.
4
4
  ---
5
5
 
6
6
  # codev - Project Management CLI
@@ -16,7 +16,7 @@ codev doctor Check system dependencies
16
16
 
17
17
  ## codev init
18
18
 
19
- Creates a **new directory** with the full codev structure: specs/, plans/, reviews/, protocols, CLAUDE.md, AGENTS.md, .claude/skills/, af-config.json, .gitignore.
19
+ Creates a **new directory** with the full codev structure: specs/, plans/, reviews/, protocols, CLAUDE.md, AGENTS.md, .claude/skills/, .codev/config.json, .gitignore.
20
20
 
21
21
  ```bash
22
22
  codev init my-app # Interactive setup
@@ -53,7 +53,7 @@ codev doctor
53
53
 
54
54
  ## Common mistakes
55
55
 
56
- - There is NO `codev tower` command — use `af tower start/stop`
56
+ - There is NO `codev tower` command — use `afx tower start/stop`
57
57
  - `codev init` creates a new directory — use `codev adopt` for existing projects
58
58
  - Always run `codev adopt` and `codev update` from the project root
59
59
  - `codev update` only updates framework files — it never touches specs/plans/reviews
@@ -30,7 +30,7 @@ The `-m` / `--model` flag is **always required** except for `consult stats`.
30
30
  -m, --model <model> Model to use (required except stats)
31
31
  --prompt <text> Inline prompt (general mode)
32
32
  --prompt-file <path> Prompt file path (general mode)
33
- --protocol <name> Protocol: spir, aspir, air, bugfix, tick, maintain
33
+ --protocol <name> Protocol: spir, aspir, air, bugfix, maintain
34
34
  -t, --type <type> Review type (see below)
35
35
  --issue <number> Issue number (required in architect context)
36
36
  --output <path> Save result to file
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: porch
3
- description: Protocol orchestrator CLI — drives SPIR, ASPIR, AIR, TICK, and BUGFIX protocols via a state machine. ALWAYS check this skill before running any `porch` command. Use when you need to check project status, approve gates, signal phase completion, or manage protocol state. Also use when a builder asks about gate approvals or phase transitions.
3
+ description: Protocol orchestrator CLI — drives SPIR, ASPIR, AIR, and BUGFIX protocols via a state machine. ALWAYS check this skill before running any `porch` command. Use when you need to check project status, approve gates, signal phase completion, or manage protocol state. Also use when a builder asks about gate approvals or phase transitions.
4
4
  ---
5
5
 
6
6
  # porch - Protocol Orchestrator
@@ -31,7 +31,7 @@ Gates are human-only approval checkpoints. The `--a-human-explicitly-approved-th
31
31
  |------|----------|------|
32
32
  | `spec-approval` | SPIR | After spec is written |
33
33
  | `plan-approval` | SPIR | After plan is written |
34
- | `pr` | SPIR, TICK, AIR | After PR is created |
34
+ | `pr` | SPIR, AIR | After PR is created |
35
35
 
36
36
  ```bash
37
37
  porch approve 42 spec-approval --a-human-explicitly-approved-this
@@ -218,7 +218,7 @@ Ensure no firewall is blocking the ports (default: 4200-4299):
218
218
  lsof -i :4200
219
219
 
220
220
  # Clean up stale port allocations
221
- af ports cleanup
221
+ afx ports cleanup
222
222
  ```
223
223
 
224
224
  ### gh authentication issues
@@ -1,6 +1,6 @@
1
1
  # Active Builders
2
2
 
3
- > **Note**: Builder status is now tracked automatically via SQLite database and the Tower dashboard. Use `af status` to check all builders. This file is retained as a reference for status values only.
3
+ > **Note**: Builder status is now tracked automatically via SQLite database and the Tower dashboard. Use `afx status` to check all builders. This file is retained as a reference for status values only.
4
4
 
5
5
  ## Status Values
6
6
 
@@ -13,7 +13,7 @@
13
13
  ## Commands
14
14
 
15
15
  ```bash
16
- af status # Check all builder statuses
17
- af spawn <id> # Spawn a new builder
18
- af cleanup -p <id> # Clean up a completed builder
16
+ afx status # Check all builder statuses
17
+ afx spawn <id> # Spawn a new builder
18
+ afx cleanup -p <id> # Clean up a completed builder
19
19
  ```
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://codev.dev/protocol-schema.json",
4
4
  "title": "Codev Protocol Definition",
5
- "description": "Schema for porch protocol definitions (SPIR, TICK, BUGFIX, etc.)",
5
+ "description": "Schema for porch protocol definitions (SPIR, BUGFIX, AIR, etc.)",
6
6
  "type": "object",
7
7
  "required": ["name", "phases"],
8
8
  "properties": {
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "name": {
14
14
  "type": "string",
15
- "description": "Protocol name (e.g., 'spir', 'tick', 'bugfix')",
15
+ "description": "Protocol name (e.g., 'spir', 'bugfix', 'air')",
16
16
  "pattern": "^[a-z][a-z0-9-]*$"
17
17
  },
18
18
  "alias": {
@@ -38,20 +38,20 @@ Follow the AIR protocol: `codev/protocols/air/protocol.md`
38
38
  2. Implement the feature (< 300 LOC)
39
39
  3. Write tests for the feature
40
40
  4. Create PR with review in the PR body (NOT as a separate file)
41
- 5. Notify architect via `af send architect "PR #N ready for review (implements #{{issue.number}})"`
41
+ 5. Notify architect via `afx send architect "PR #N ready for review (implements #{{issue.number}})"`
42
42
 
43
43
  **IMPORTANT**: AIR produces NO spec, plan, or review files. The review goes in the PR body.
44
44
 
45
45
  If the feature is too complex (> 300 LOC or architectural changes), notify the Architect via:
46
46
  ```bash
47
- af send architect "Issue #{{issue.number}} is more complex than expected. [Reason]. Recommend escalating to ASPIR."
47
+ afx send architect "Issue #{{issue.number}} is more complex than expected. [Reason]. Recommend escalating to ASPIR."
48
48
  ```
49
49
 
50
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 (implements #{{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]"`
51
+ Always use `afx send architect "..."` to notify the architect at key moments:
52
+ - **PR ready**: `afx send architect "PR #N ready for review (implements #{{issue.number}})"`
53
+ - **PR merged**: `afx send architect "PR #N merged for issue #{{issue.number}}. Ready for cleanup."`
54
+ - **Blocked**: `afx send architect "Blocked on issue #{{issue.number}}: [reason]"`
55
55
  {{/if}}
56
56
 
57
57
  ## Handling Flaky Tests
@@ -15,15 +15,27 @@ Create a pull request with the review embedded in the PR body, optionally run CM
15
15
 
16
16
  ### 1. Create the Pull Request
17
17
 
18
- Create a PR that links to the issue. The PR body IS the review — include a summary, key decisions, and test plan:
18
+ Create a PR that links to the issue. The PR body IS the review — include a summary, key decisions, and test plan.
19
+
20
+ **PR body requirements**: The PR body MUST include `Closes #<N>` (where `<N>` is
21
+ the driving issue number) so GitHub auto-closes the issue on merge. If the PR
22
+ closes multiple issues (e.g. duplicates consolidated), include one `Closes #<N>`
23
+ per issue. Without this, GitHub will not auto-close the issue.
24
+
25
+ **Exception**: if this PR only partially addresses the issue, use `Refs #<N>`
26
+ or `Part of #<N>` instead of `Closes` — the issue stays open until a
27
+ follow-up PR closes it.
28
+
29
+ **Note**: substitute the real issue number for `<N>` — do not leave the
30
+ placeholder or any `{{...}}` template tag in the committed PR body.
19
31
 
20
32
  ```bash
21
- gh pr create --title "[Air #{{issue.number}}] feat: <brief description>" --body "$(cat <<'EOF'
33
+ gh pr create --title "[Air #<N>] feat: <brief description>" --body "$(cat <<'EOF'
22
34
  ## Summary
23
35
 
24
36
  <1-2 sentence description of the feature>
25
37
 
26
- Implements #{{issue.number}}
38
+ Closes #<N> <!-- Substitute <N> with the real issue number -->
27
39
 
28
40
  ## What Changed
29
41
 
@@ -75,12 +87,12 @@ If you ran CMAP:
75
87
  Send notification with PR link:
76
88
 
77
89
  ```bash
78
- af send architect "PR #<number> ready for review (implements issue #{{issue.number}})"
90
+ afx send architect "PR #<number> ready for review (implements issue #{{issue.number}})"
79
91
  ```
80
92
 
81
93
  If CMAP was run, include verdicts:
82
94
  ```bash
83
- af send architect "PR #<number> ready for review (implements issue #{{issue.number}}). CMAP: gemini=<verdict>, codex=<verdict>, claude=<verdict>"
95
+ afx send architect "PR #<number> ready for review (implements issue #{{issue.number}}). CMAP: gemini=<verdict>, codex=<verdict>, claude=<verdict>"
84
96
  ```
85
97
 
86
98
  ## Signals
@@ -34,7 +34,6 @@ AIR is a minimal protocol for implementing small features (< 300 LOC) where the
34
34
 
35
35
  - Bug fixes → use **BUGFIX**
36
36
  - Features needing spec discussion → use **SPIR** or **ASPIR**
37
- - Amendments to existing specs → use **TICK**
38
37
  - Architectural changes → use **SPIR**
39
38
  - Complex features with multiple phases → use **SPIR** or **ASPIR**
40
39
 
@@ -67,7 +66,7 @@ The **PR gate** is preserved — a human reviews all code before merge.
67
66
 
68
67
  ```bash
69
68
  # Spawn a builder using AIR
70
- af spawn 42 --protocol air
69
+ afx spawn 42 --protocol air
71
70
 
72
71
  # The builder implements autonomously and stops at the PR gate
73
72
  ```
@@ -27,7 +27,7 @@ You are running in STRICT mode. This means:
27
27
  {{/if}}
28
28
 
29
29
  ## Protocol
30
- Follow the SPIR protocol: `codev/protocols/spir/protocol.md`
30
+ Follow the ASPIR protocol: `codev/protocols/aspir/protocol.md`
31
31
  Read and internalize the protocol before starting any work.
32
32
 
33
33
  {{#if spec}}
@@ -53,12 +53,34 @@ Follow the implementation plan at: `{{plan.path}}`
53
53
  {{task_text}}
54
54
  {{/if}}
55
55
 
56
+ ## Multi-PR Workflow
57
+
58
+ Your worktree is persistent — it survives across PR merges. You can produce multiple PRs sequentially:
59
+
60
+ 1. Cut a branch, open a PR, wait for merge
61
+ 2. After merge: `git fetch origin main && git checkout -b <next-branch> origin/main`
62
+ 3. Continue to the next phase, open another PR
63
+
64
+ **Important**: Do NOT run `git checkout main` — git worktrees cannot check out a branch that's checked out elsewhere. Always branch off `origin/main` via fetch.
65
+
66
+ Record PRs: `porch done {{project_id}} --pr <N> --branch <name>`
67
+ Record merges: `porch done {{project_id}} --merged <N>`
68
+
69
+ ## Verify Phase
70
+
71
+ After the final PR merges, the project enters the **verify** phase. You stay alive through verify:
72
+ 1. Pull main into your worktree
73
+ 2. Run `porch done {{project_id}}` to signal verification is ready
74
+ 3. The architect approves `verify-approval` when satisfied
75
+
76
+ If verification is not needed: `porch verify {{project_id}} --skip "reason"`
77
+
56
78
  ## Notifications
57
- Always use `af send architect "..."` to notify the architect at key moments:
58
- - **Gate reached**: `af send architect "Project {{project_id}}: <gate-name> ready for approval"`
59
- - **PR ready**: `af send architect "PR #N ready for review (project {{project_id}})"`
60
- - **PR merged**: `af send architect "Project {{project_id}} complete. PR merged. Ready for cleanup."`
61
- - **Blocked**: `af send architect "Blocked on project {{project_id}}: [reason]"`
79
+ Always use `afx send architect "..."` to notify the architect at key moments:
80
+ - **Gate reached**: `afx send architect "Project {{project_id}}: <gate-name> ready for approval"`
81
+ - **PR ready**: `afx send architect "PR #N ready for review (project {{project_id}})"`
82
+ - **PR merged**: `afx send architect "Project {{project_id}} PR merged. Entering verify phase."`
83
+ - **Blocked**: `afx send architect "Blocked on project {{project_id}}: [reason]"`
62
84
 
63
85
  ## Handling Flaky Tests
64
86