@cluesmith/codev 2.0.3 → 2.0.7

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 (271) hide show
  1. package/dashboard/dist/assets/index-BblS3DWL.js +135 -0
  2. package/dashboard/dist/assets/index-BblS3DWL.js.map +1 -0
  3. package/dashboard/dist/assets/index-Cr9PyjqX.css +32 -0
  4. package/dashboard/dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +54 -61
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/architect.d.ts +5 -5
  9. package/dist/agent-farm/commands/architect.d.ts.map +1 -1
  10. package/dist/agent-farm/commands/architect.js +37 -20
  11. package/dist/agent-farm/commands/architect.js.map +1 -1
  12. package/dist/agent-farm/commands/attach.d.ts +19 -0
  13. package/dist/agent-farm/commands/attach.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/attach.js +169 -29
  15. package/dist/agent-farm/commands/attach.js.map +1 -1
  16. package/dist/agent-farm/commands/cleanup.d.ts +12 -0
  17. package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
  18. package/dist/agent-farm/commands/cleanup.js +108 -7
  19. package/dist/agent-farm/commands/cleanup.js.map +1 -1
  20. package/dist/agent-farm/commands/send.d.ts +22 -2
  21. package/dist/agent-farm/commands/send.d.ts.map +1 -1
  22. package/dist/agent-farm/commands/send.js +97 -178
  23. package/dist/agent-farm/commands/send.js.map +1 -1
  24. package/dist/agent-farm/commands/spawn-roles.d.ts +3 -9
  25. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
  26. package/dist/agent-farm/commands/spawn-roles.js +14 -53
  27. package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
  28. package/dist/agent-farm/commands/spawn-worktree.d.ts +11 -18
  29. package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
  30. package/dist/agent-farm/commands/spawn-worktree.js +35 -22
  31. package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
  32. package/dist/agent-farm/commands/spawn.d.ts +8 -6
  33. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  34. package/dist/agent-farm/commands/spawn.js +207 -89
  35. package/dist/agent-farm/commands/spawn.js.map +1 -1
  36. package/dist/agent-farm/commands/start.d.ts.map +1 -1
  37. package/dist/agent-farm/commands/start.js +2 -6
  38. package/dist/agent-farm/commands/start.js.map +1 -1
  39. package/dist/agent-farm/commands/status.d.ts.map +1 -1
  40. package/dist/agent-farm/commands/status.js +5 -35
  41. package/dist/agent-farm/commands/status.js.map +1 -1
  42. package/dist/agent-farm/commands/stop.d.ts.map +1 -1
  43. package/dist/agent-farm/commands/stop.js +2 -6
  44. package/dist/agent-farm/commands/stop.js.map +1 -1
  45. package/dist/agent-farm/commands/tower-cloud.d.ts +2 -9
  46. package/dist/agent-farm/commands/tower-cloud.d.ts.map +1 -1
  47. package/dist/agent-farm/commands/tower-cloud.js +12 -47
  48. package/dist/agent-farm/commands/tower-cloud.js.map +1 -1
  49. package/dist/agent-farm/commands/tower.d.ts.map +1 -1
  50. package/dist/agent-farm/commands/tower.js +6 -23
  51. package/dist/agent-farm/commands/tower.js.map +1 -1
  52. package/dist/agent-farm/db/index.d.ts.map +1 -1
  53. package/dist/agent-farm/db/index.js +52 -2
  54. package/dist/agent-farm/db/index.js.map +1 -1
  55. package/dist/agent-farm/db/schema.d.ts +1 -1
  56. package/dist/agent-farm/db/schema.d.ts.map +1 -1
  57. package/dist/agent-farm/db/schema.js +1 -1
  58. package/dist/agent-farm/lib/cloud-config.d.ts +1 -0
  59. package/dist/agent-farm/lib/cloud-config.d.ts.map +1 -1
  60. package/dist/agent-farm/lib/cloud-config.js +2 -2
  61. package/dist/agent-farm/lib/cloud-config.js.map +1 -1
  62. package/dist/agent-farm/lib/tower-client.d.ts +65 -6
  63. package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
  64. package/dist/agent-farm/lib/tower-client.js +57 -2
  65. package/dist/agent-farm/lib/tower-client.js.map +1 -1
  66. package/dist/agent-farm/servers/overview.d.ts +157 -0
  67. package/dist/agent-farm/servers/overview.d.ts.map +1 -0
  68. package/dist/agent-farm/servers/overview.js +625 -0
  69. package/dist/agent-farm/servers/overview.js.map +1 -0
  70. package/dist/agent-farm/servers/tower-instances.d.ts +1 -3
  71. package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
  72. package/dist/agent-farm/servers/tower-instances.js +12 -14
  73. package/dist/agent-farm/servers/tower-instances.js.map +1 -1
  74. package/dist/agent-farm/servers/tower-messages.d.ts +87 -0
  75. package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -0
  76. package/dist/agent-farm/servers/tower-messages.js +202 -0
  77. package/dist/agent-farm/servers/tower-messages.js.map +1 -0
  78. package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
  79. package/dist/agent-farm/servers/tower-routes.js +182 -34
  80. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  81. package/dist/agent-farm/servers/tower-server.js +30 -6
  82. package/dist/agent-farm/servers/tower-server.js.map +1 -1
  83. package/dist/agent-farm/servers/tower-terminals.d.ts +9 -3
  84. package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
  85. package/dist/agent-farm/servers/tower-terminals.js +129 -84
  86. package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
  87. package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
  88. package/dist/agent-farm/servers/tower-tunnel.js +3 -19
  89. package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
  90. package/dist/agent-farm/servers/tower-types.d.ts +0 -2
  91. package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
  92. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  93. package/dist/agent-farm/servers/tower-websocket.js +27 -5
  94. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  95. package/dist/agent-farm/types.d.ts +4 -5
  96. package/dist/agent-farm/types.d.ts.map +1 -1
  97. package/dist/agent-farm/utils/agent-names.d.ts +85 -0
  98. package/dist/agent-farm/utils/agent-names.d.ts.map +1 -0
  99. package/dist/agent-farm/utils/agent-names.js +140 -0
  100. package/dist/agent-farm/utils/agent-names.js.map +1 -0
  101. package/dist/agent-farm/utils/display.d.ts +8 -0
  102. package/dist/agent-farm/utils/display.d.ts.map +1 -0
  103. package/dist/agent-farm/utils/display.js +26 -0
  104. package/dist/agent-farm/utils/display.js.map +1 -0
  105. package/dist/agent-farm/utils/message-format.d.ts +17 -0
  106. package/dist/agent-farm/utils/message-format.d.ts.map +1 -0
  107. package/dist/agent-farm/utils/message-format.js +41 -0
  108. package/dist/agent-farm/utils/message-format.js.map +1 -0
  109. package/dist/agent-farm/utils/notifications.d.ts.map +1 -1
  110. package/dist/agent-farm/utils/notifications.js +7 -16
  111. package/dist/agent-farm/utils/notifications.js.map +1 -1
  112. package/dist/agent-farm/utils/server-utils.d.ts +4 -0
  113. package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
  114. package/dist/agent-farm/utils/server-utils.js +20 -0
  115. package/dist/agent-farm/utils/server-utils.js.map +1 -1
  116. package/dist/agent-farm/utils/shell.d.ts +5 -0
  117. package/dist/agent-farm/utils/shell.d.ts.map +1 -1
  118. package/dist/agent-farm/utils/shell.js +15 -11
  119. package/dist/agent-farm/utils/shell.js.map +1 -1
  120. package/dist/cli.d.ts.map +1 -1
  121. package/dist/cli.js +46 -15
  122. package/dist/cli.js.map +1 -1
  123. package/dist/commands/adopt.d.ts.map +1 -1
  124. package/dist/commands/adopt.js +1 -13
  125. package/dist/commands/adopt.js.map +1 -1
  126. package/dist/commands/consult/index.d.ts +34 -9
  127. package/dist/commands/consult/index.d.ts.map +1 -1
  128. package/dist/commands/consult/index.js +617 -263
  129. package/dist/commands/consult/index.js.map +1 -1
  130. package/dist/commands/consult/metrics.d.ts +90 -0
  131. package/dist/commands/consult/metrics.d.ts.map +1 -0
  132. package/dist/commands/consult/metrics.js +203 -0
  133. package/dist/commands/consult/metrics.js.map +1 -0
  134. package/dist/commands/consult/stats.d.ts +18 -0
  135. package/dist/commands/consult/stats.d.ts.map +1 -0
  136. package/dist/commands/consult/stats.js +150 -0
  137. package/dist/commands/consult/stats.js.map +1 -0
  138. package/dist/commands/consult/usage-extractor.d.ts +41 -0
  139. package/dist/commands/consult/usage-extractor.d.ts.map +1 -0
  140. package/dist/commands/consult/usage-extractor.js +122 -0
  141. package/dist/commands/consult/usage-extractor.js.map +1 -0
  142. package/dist/commands/doctor.d.ts.map +1 -1
  143. package/dist/commands/doctor.js +5 -3
  144. package/dist/commands/doctor.js.map +1 -1
  145. package/dist/commands/init.d.ts.map +1 -1
  146. package/dist/commands/init.js +1 -13
  147. package/dist/commands/init.js.map +1 -1
  148. package/dist/commands/porch/index.d.ts.map +1 -1
  149. package/dist/commands/porch/index.js +13 -12
  150. package/dist/commands/porch/index.js.map +1 -1
  151. package/dist/commands/porch/next.d.ts.map +1 -1
  152. package/dist/commands/porch/next.js +57 -77
  153. package/dist/commands/porch/next.js.map +1 -1
  154. package/dist/commands/porch/plan.d.ts.map +1 -1
  155. package/dist/commands/porch/plan.js +17 -2
  156. package/dist/commands/porch/plan.js.map +1 -1
  157. package/dist/commands/porch/prompts.d.ts +10 -1
  158. package/dist/commands/porch/prompts.d.ts.map +1 -1
  159. package/dist/commands/porch/prompts.js +56 -29
  160. package/dist/commands/porch/prompts.js.map +1 -1
  161. package/dist/commands/porch/protocol.js +2 -2
  162. package/dist/commands/porch/state.d.ts +13 -0
  163. package/dist/commands/porch/state.d.ts.map +1 -1
  164. package/dist/commands/porch/state.js +49 -2
  165. package/dist/commands/porch/state.js.map +1 -1
  166. package/dist/commands/update.d.ts.map +1 -1
  167. package/dist/commands/update.js +0 -10
  168. package/dist/commands/update.js.map +1 -1
  169. package/dist/lib/github.d.ts +82 -0
  170. package/dist/lib/github.d.ts.map +1 -0
  171. package/dist/lib/github.js +181 -0
  172. package/dist/lib/github.js.map +1 -0
  173. package/dist/lib/scaffold.d.ts +0 -21
  174. package/dist/lib/scaffold.d.ts.map +1 -1
  175. package/dist/lib/scaffold.js +0 -57
  176. package/dist/lib/scaffold.js.map +1 -1
  177. package/dist/terminal/index.d.ts +16 -0
  178. package/dist/terminal/index.d.ts.map +1 -1
  179. package/dist/terminal/index.js +14 -0
  180. package/dist/terminal/index.js.map +1 -1
  181. package/dist/terminal/pty-manager.d.ts.map +1 -1
  182. package/dist/terminal/pty-manager.js +8 -5
  183. package/dist/terminal/pty-manager.js.map +1 -1
  184. package/dist/terminal/pty-session.js +4 -4
  185. package/dist/terminal/pty-session.js.map +1 -1
  186. package/dist/terminal/session-manager.d.ts +64 -0
  187. package/dist/terminal/session-manager.d.ts.map +1 -1
  188. package/dist/terminal/session-manager.js +299 -10
  189. package/dist/terminal/session-manager.js.map +1 -1
  190. package/dist/terminal/shellper-client.d.ts +2 -1
  191. package/dist/terminal/shellper-client.d.ts.map +1 -1
  192. package/dist/terminal/shellper-client.js +4 -2
  193. package/dist/terminal/shellper-client.js.map +1 -1
  194. package/dist/terminal/shellper-main.js +33 -4
  195. package/dist/terminal/shellper-main.js.map +1 -1
  196. package/dist/terminal/shellper-process.d.ts +24 -7
  197. package/dist/terminal/shellper-process.d.ts.map +1 -1
  198. package/dist/terminal/shellper-process.js +139 -36
  199. package/dist/terminal/shellper-process.js.map +1 -1
  200. package/dist/terminal/shellper-protocol.d.ts +1 -0
  201. package/dist/terminal/shellper-protocol.d.ts.map +1 -1
  202. package/dist/terminal/shellper-protocol.js.map +1 -1
  203. package/package.json +4 -1
  204. package/skeleton/.claude/skills/af/SKILL.md +10 -10
  205. package/skeleton/.claude/skills/consult/SKILL.md +55 -38
  206. package/skeleton/.claude/skills/porch/SKILL.md +53 -0
  207. package/skeleton/DEPENDENCIES.md +2 -2
  208. package/skeleton/builders.md +8 -19
  209. package/skeleton/maintain/.gitkeep +1 -1
  210. package/skeleton/porch/prompts/specify.md +1 -1
  211. package/skeleton/protocol-schema.json +1 -1
  212. package/skeleton/protocols/bugfix/prompts/pr.md +18 -7
  213. package/skeleton/protocols/bugfix/protocol.json +1 -1
  214. package/skeleton/protocols/experiment/protocol.md +17 -17
  215. package/skeleton/protocols/maintain/consult-types/impl-review.md +72 -0
  216. package/skeleton/protocols/maintain/consult-types/pr-review.md +72 -0
  217. package/skeleton/protocols/maintain/prompts/audit.md +2 -2
  218. package/skeleton/protocols/maintain/prompts/sync.md +1 -1
  219. package/skeleton/protocols/maintain/prompts/verify.md +1 -1
  220. package/skeleton/protocols/maintain/protocol.json +4 -4
  221. package/skeleton/protocols/maintain/protocol.md +11 -12
  222. package/skeleton/protocols/maintain/templates/maintenance-run.md +2 -2
  223. package/skeleton/protocols/protocol-schema.json +1 -1
  224. package/skeleton/protocols/spir/consult-types/impl-review.md +72 -0
  225. package/skeleton/protocols/spir/consult-types/phase-review.md +72 -0
  226. package/skeleton/protocols/spir/consult-types/pr-review.md +72 -0
  227. package/skeleton/protocols/spir/prompts/plan.md +4 -4
  228. package/skeleton/protocols/spir/prompts/review.md +8 -8
  229. package/skeleton/protocols/spir/prompts/specify.md +6 -6
  230. package/skeleton/protocols/spir/protocol.json +16 -16
  231. package/skeleton/protocols/spir/protocol.md +8 -8
  232. package/skeleton/protocols/spir/templates/review.md +2 -2
  233. package/skeleton/protocols/tick/consult-types/impl-review.md +72 -0
  234. package/skeleton/protocols/tick/consult-types/plan-review.md +59 -0
  235. package/skeleton/protocols/tick/consult-types/pr-review.md +72 -0
  236. package/skeleton/protocols/tick/consult-types/spec-review.md +55 -0
  237. package/skeleton/protocols/tick/protocol.json +2 -7
  238. package/skeleton/protocols/tick/protocol.md +31 -31
  239. package/skeleton/resources/commands/agent-farm.md +21 -19
  240. package/skeleton/resources/commands/codev.md +0 -36
  241. package/skeleton/resources/commands/consult.md +88 -234
  242. package/skeleton/resources/commands/overview.md +6 -7
  243. package/skeleton/resources/spikes.md +3 -3
  244. package/skeleton/resources/workflow-reference.md +28 -28
  245. package/skeleton/roles/architect.md +34 -38
  246. package/skeleton/roles/builder.md +14 -14
  247. package/skeleton/roles/consultant.md +6 -0
  248. package/skeleton/templates/AGENTS.md +6 -6
  249. package/skeleton/templates/CLAUDE.md +6 -6
  250. package/skeleton/templates/cheatsheet.md +22 -18
  251. package/skeleton/templates/lifecycle.md +9 -9
  252. package/skeleton/templates/pr-overview.md +5 -5
  253. package/templates/open.html +6 -3
  254. package/templates/tower.html +1 -41
  255. package/dashboard/dist/assets/index-4n9zpWLY.css +0 -32
  256. package/dashboard/dist/assets/index-UsH9ixz1.js +0 -136
  257. package/dashboard/dist/assets/index-UsH9ixz1.js.map +0 -1
  258. package/dist/agent-farm/commands/consult.d.ts +0 -15
  259. package/dist/agent-farm/commands/consult.d.ts.map +0 -1
  260. package/dist/agent-farm/commands/consult.js +0 -39
  261. package/dist/agent-farm/commands/consult.js.map +0 -1
  262. package/dist/agent-farm/utils/gate-status.d.ts +0 -16
  263. package/dist/agent-farm/utils/gate-status.d.ts.map +0 -1
  264. package/dist/agent-farm/utils/gate-status.js +0 -79
  265. package/dist/agent-farm/utils/gate-status.js.map +0 -1
  266. package/skeleton/templates/projectlist-archive.md +0 -21
  267. package/skeleton/templates/projectlist.md +0 -147
  268. /package/skeleton/{consult-types → protocols/bugfix/consult-types}/impl-review.md +0 -0
  269. /package/skeleton/{consult-types/pr-ready.md → protocols/bugfix/consult-types/pr-review.md} +0 -0
  270. /package/skeleton/{consult-types → protocols/spir/consult-types}/plan-review.md +0 -0
  271. /package/skeleton/{consult-types → protocols/spir/consult-types}/spec-review.md +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cluesmith/codev",
3
- "version": "2.0.3",
3
+ "version": "2.0.7",
4
4
  "description": "Codev CLI - AI-assisted software development framework",
5
5
  "type": "module",
6
6
  "bin": {
@@ -36,10 +36,13 @@
36
36
  "dependencies": {
37
37
  "@anthropic-ai/claude-agent-sdk": "^0.2.41",
38
38
  "@google/genai": "^1.0.0",
39
+ "@openai/codex-sdk": "^0.101.0",
40
+ "@types/http-proxy": "^1.17.17",
39
41
  "better-sqlite3": "^12.5.0",
40
42
  "chalk": "^5.3.0",
41
43
  "commander": "^12.1.0",
42
44
  "glob": "^11.0.0",
45
+ "http-proxy": "^1.18.1",
43
46
  "js-yaml": "^4.1.0",
44
47
  "node-pty": "^1.1.0",
45
48
  "open": "^10.1.0",
@@ -28,13 +28,13 @@ af dash open # Open dashboard in browser
28
28
  ## Builder Management
29
29
 
30
30
  ```bash
31
- af spawn -p 0003 # Spawn builder for spec (strict mode, default)
32
- af spawn --soft -p 0003 # Spawn builder (soft mode)
33
- af spawn --issue 42 # Spawn builder for a bugfix
34
- af spawn -p 0003 --resume # Resume builder in existing worktree
35
- af status # Check all builder status
36
- af cleanup --project 0003 # Clean up builder worktree (safe)
37
- af cleanup --project 0003 -f # Force cleanup
31
+ af spawn 3 --protocol spir # Spawn builder for SPIR project
32
+ af spawn 3 --protocol spir --soft # Spawn builder (soft mode)
33
+ af spawn 3 --protocol bugfix # Spawn builder for a bugfix
34
+ af spawn 3 --resume # Resume builder in existing worktree
35
+ af status # Check all builder status
36
+ af cleanup --project 3 # Clean up builder worktree (safe)
37
+ af cleanup --project 3 -f # Force cleanup
38
38
  ```
39
39
 
40
40
  ### Resuming Builders
@@ -43,13 +43,13 @@ When a builder's Claude process dies but the worktree and porch state survive,
43
43
  use `--resume` to restart it without recreating the worktree:
44
44
 
45
45
  ```bash
46
- af spawn -p 0003 --resume
46
+ af spawn 3 --resume
47
47
  ```
48
48
 
49
- This reuses the existing `.builders/0003` worktree, creates a fresh terminal
49
+ This reuses the existing `.builders/3` worktree, creates a fresh terminal
50
50
  session registered with the Tower (so it appears in the dashboard), and lets
51
51
  porch pick up from whatever phase the builder was in. Works with all spawn
52
- modes: `-p`, `--issue`, `--task`, `--protocol`, `--worktree`.
52
+ modes: positional issue number, `--task`, `--protocol`, `--worktree`.
53
53
 
54
54
  ## Utility
55
55
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: consult
3
- description: AI consultation CLI quick reference. Use when running consult commands to check syntax for PR reviews, spec reviews, plan reviews, and general queries across Gemini, Codex, and Claude.
3
+ description: AI consultation CLI quick reference. Use when running consult commands to check syntax for general queries, protocol reviews, and stats across Gemini, Codex, and Claude.
4
4
  disable-model-invocation: false
5
5
  ---
6
6
 
@@ -9,73 +9,90 @@ disable-model-invocation: false
9
9
  ## Synopsis
10
10
 
11
11
  ```bash
12
- consult -m <model> <subcommand> [args] [options]
12
+ consult -m <model> [options]
13
+ consult stats [options]
13
14
  ```
14
15
 
15
- The `-m` / `--model` flag is **always required**.
16
+ The `-m` / `--model` flag is **always required** (except for stats).
16
17
 
17
18
  ## Models
18
19
 
19
20
  | Model | Alias | Speed | Approach |
20
21
  |-------|-------|-------|----------|
21
- | `gemini` | `pro` | ~120-150s | Pure text analysis, fast |
22
+ | `gemini` | `pro` | ~120-150s | File access via --yolo, fast |
22
23
  | `codex` | `gpt` | ~200-250s | Shell command exploration, thorough |
23
- | `claude` | `opus` | ~60-120s | Balanced tool use |
24
+ | `claude` | `opus` | ~60-120s | Agent SDK with tool use |
24
25
 
25
- ## Subcommands
26
+ ## Modes
26
27
 
28
+ ### General Mode
27
29
  ```bash
28
- consult -m gemini pr 42 # Review a pull request
29
- consult -m codex spec 42 # Review a specification
30
- consult -m gemini plan 42 # Review an implementation plan
31
- consult -m claude general "query" # General question (quoted string)
30
+ consult -m gemini --prompt "What's the best way to structure auth?"
31
+ consult -m codex --prompt-file review-checklist.md
32
+ ```
33
+
34
+ ### Protocol Mode
35
+ ```bash
36
+ consult -m gemini --protocol spir --type spec # Review a specification
37
+ consult -m codex --protocol spir --type plan # Review a plan
38
+ consult -m claude --protocol spir --type impl # Review implementation
39
+ consult -m gemini --protocol spir --type pr # Review a PR
40
+ consult -m codex --protocol spir --type phase # Phase-scoped review
41
+ consult -m gemini --type integration # Integration review
42
+ ```
43
+
44
+ ### Stats Mode
45
+ ```bash
46
+ consult stats # 30-day summary
47
+ consult stats --days 7 --json # Last 7 days as JSON
32
48
  ```
33
49
 
34
50
  ## Options
35
51
 
36
52
  ```bash
37
- -n, --dry-run # Show command without running
38
- -t, --type <type> # Review type (spec-review, plan-review, impl-review, pr-ready, integration-review)
39
- -r, --role <role> # Custom role from codev/roles/ (without .md extension)
53
+ -m, --model <model> # Model to use (required except stats)
54
+ --prompt <text> # Inline prompt (general mode)
55
+ --prompt-file <path> # Prompt from file (general mode)
56
+ --protocol <name> # Protocol: spir, bugfix, tick, maintain
57
+ -t, --type <type> # Review type: spec, plan, impl, pr, phase, integration
58
+ --issue <number> # Issue number (architect context)
40
59
  ```
41
60
 
42
- ## Review Types (--type)
61
+ ## Review Types (--type with --protocol)
62
+
63
+ | Type | Use Case |
64
+ |------|----------|
65
+ | `spec` | Review specification completeness |
66
+ | `plan` | Review implementation plan |
67
+ | `impl` | Review code implementation |
68
+ | `pr` | Review pull request before merge |
69
+ | `phase` | Phase-scoped review (builder only) |
70
+ | `integration` | Architect's integration review |
43
71
 
44
- | Type | Stage | Use Case |
45
- |------|-------|----------|
46
- | `spec-review` | conceived | Review spec completeness |
47
- | `plan-review` | specified | Review implementation plan |
48
- | `impl-review` | implementing | Review code implementation |
49
- | `pr-ready` | implemented | Final check before PR |
50
- | `integration-review` | committed | Architect's integration review |
72
+ Protocol-specific prompts live in `codev/protocols/<protocol>/consult-types/`.
51
73
 
52
- Review type prompts live in `codev/consult-types/` and can be customized.
74
+ ## Context Resolution
75
+
76
+ - **Builder context** (cwd in `.builders/`): auto-detects project from porch state
77
+ - **Architect context** (cwd outside `.builders/`): requires `--issue <N>`
53
78
 
54
79
  ## Parallel Consultation (3-Way / cmap)
55
80
 
56
81
  Run all three models in parallel for thorough reviews:
57
82
 
58
83
  ```bash
59
- consult -m gemini spec 42 &
60
- consult -m codex spec 42 &
61
- consult -m claude spec 42 &
84
+ consult -m gemini --protocol spir --type spec &
85
+ consult -m codex --protocol spir --type spec &
86
+ consult -m claude --protocol spir --type spec &
62
87
  wait
63
88
  ```
64
89
 
65
90
  Or from Claude Code, use **cmap** pattern: three parallel background Bash calls.
66
91
 
67
- ## Custom Roles
68
-
69
- ```bash
70
- consult -m gemini --role security-reviewer pr 42
71
- consult -m codex --role architect general "Review this design"
72
- ```
73
-
74
- Roles are markdown files in `codev/roles/`. Create your own by adding `.md` files there.
75
-
76
92
  ## Common Mistakes
77
93
 
78
- - The `-m` flag is **required** — `consult pr 42` will fail without it
79
- - PR numbers are GitHub PR numbers, not spec numbers
80
- - Spec/plan numbers match the `0042` prefix in filenames (pass just `42`, not `0042`)
81
- - General queries must be **quoted**: `consult -m gemini general "your question here"`
94
+ - The `-m` flag is **required** — `consult --type spec` will fail without it
95
+ - Cannot combine `--prompt` with `--type` (mode conflict)
96
+ - Cannot use `--prompt` and `--prompt-file` together
97
+ - `--protocol` requires `--type` cannot use alone
98
+ - General mode: `--prompt` text is passed directly, not as a positional arg
@@ -0,0 +1,53 @@
1
+ ---
2
+ name: porch
3
+ description: Protocol orchestrator CLI quick reference. Use when running porch commands to check correct syntax for status, run, done, approve, next, and pending.
4
+ disable-model-invocation: false
5
+ ---
6
+
7
+ # porch - Protocol Orchestrator
8
+
9
+ ## Synopsis
10
+
11
+ ```bash
12
+ porch <command> [project-id]
13
+ ```
14
+
15
+ Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with phase transitions, gates, and multi-agent consultations.
16
+
17
+ ## Commands
18
+
19
+ ```bash
20
+ porch status [id] # Show project status (auto-detects in worktree)
21
+ porch run [id] # Run the protocol loop (strict mode)
22
+ porch next [id] # Get next tasks for a project
23
+ porch done [id] # Signal current phase work is complete
24
+ porch approve <id> <gate> # Approve a gate (human only)
25
+ porch pending # List all pending gates across projects
26
+ ```
27
+
28
+ ## Gates
29
+
30
+ Gates are human approval checkpoints. Builders STOP at gates and wait.
31
+
32
+ | Gate | Protocol | When |
33
+ |------|----------|------|
34
+ | `spec-approval` | SPIR | After spec is written |
35
+ | `plan-approval` | SPIR | After plan is written |
36
+ | `pr` | SPIR, TICK | After PR is created |
37
+
38
+ ```bash
39
+ porch approve 42 spec-approval # Approve spec gate
40
+ porch approve 42 plan-approval # Approve plan gate
41
+ porch approve 42 pr # Approve PR gate
42
+ ```
43
+
44
+ ## Project State
45
+
46
+ State is stored in `codev/projects/<id>/status.yaml`, managed automatically by porch. **Never edit status.yaml directly.**
47
+
48
+ ## Common Mistakes
49
+
50
+ - **Never call `porch approve` as a builder** - Only humans approve gates
51
+ - **Never edit status.yaml directly** - Only porch modifies state
52
+ - Builders should use `porch done` to signal phase completion, not `porch approve`
53
+ - `porch run` is for strict mode only - soft mode builders follow the protocol manually
@@ -120,7 +120,7 @@ claude --version
120
120
  **Installation:**
121
121
 
122
122
  ```bash
123
- npm install -g @anthropic-ai/gemini-cli
123
+ npm install -g @google/gemini-cli
124
124
 
125
125
  # Verify
126
126
  gemini --version
@@ -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
- ./codev/bin/agent-farm ports cleanup
221
+ af ports cleanup
222
222
  ```
223
223
 
224
224
  ### gh authentication issues
@@ -1,30 +1,19 @@
1
1
  # Active Builders
2
2
 
3
- Track active builder agents here. Update manually or via `architect status`.
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.
4
4
 
5
5
  ## Status Values
6
6
 
7
7
  - **spawning**: Worktree being created, terminal starting
8
8
  - **implementing**: Builder is working
9
9
  - **blocked**: Builder waiting for architect input
10
- - **pr-ready**: Builder has created a PR
11
- - **reviewing**: Architect is reviewing the PR
10
+ - **pr**: Builder has created a PR
12
11
  - **complete**: PR merged, ready for cleanup
13
12
 
14
- ---
13
+ ## Commands
15
14
 
16
- ## Builders
17
-
18
- <!-- Add builders below as they are spawned -->
19
-
20
- <!-- Example:
21
- ## Builder 0003: Feature Name
22
- - **Branch**: builder/0003-feature-name
23
- - **Port**: 7681
24
- - **Status**: implementing
25
- - **Phase**: 2/4
26
- - **Started**: 2025-12-02 11:30
27
- - **PR**: (none yet)
28
- -->
29
-
30
- (No active builders)
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
19
+ ```
@@ -1,2 +1,2 @@
1
1
  # Maintenance run files go here
2
- # Files are numbered: 0001-maintenance.md, 0002-maintenance.md, etc.
2
+ # Files are numbered: 1-maintenance.md, 2-maintenance.md, etc.
@@ -10,7 +10,7 @@ Write a detailed specification for the assigned project. The spec must be comple
10
10
 
11
11
  Read these files to understand the task:
12
12
  1. `codev/status/{project-id}-*.md` - Current project state and any notes
13
- 2. `codev/projectlist.md` - Project entry with initial description
13
+ 2. The GitHub Issue for this project (if available)
14
14
  3. Any existing context files mentioned in the project entry
15
15
 
16
16
  ## Output Requirements
@@ -145,7 +145,7 @@
145
145
  "type": {
146
146
  "type": "string",
147
147
  "description": "Review type (maps to consult --type)",
148
- "enum": ["spec-review", "plan-review", "impl-review", "pr-ready", "integration-review"]
148
+ "enum": ["spec", "plan", "impl", "pr", "phase", "integration"]
149
149
  },
150
150
  "models": {
151
151
  "type": "array",
@@ -47,28 +47,39 @@ EOF
47
47
  Run 3-way parallel consultation on the PR:
48
48
 
49
49
  ```bash
50
- consult --model gemini pr <PR_NUMBER> &
51
- consult --model codex pr <PR_NUMBER> &
52
- consult --model claude pr <PR_NUMBER> &
50
+ consult -m gemini --protocol bugfix --type pr &
51
+ consult -m codex --protocol bugfix --type pr &
52
+ consult -m claude --protocol bugfix --type pr &
53
53
  ```
54
54
 
55
55
  All three should run in the background (`run_in_background: true`).
56
56
 
57
- ### 3. Address Feedback
57
+ ### 3. Wait for Results and Address Feedback
58
58
 
59
- Review the consultation results:
59
+ **DO NOT proceed to step 4 until ALL THREE consultations have returned results.**
60
+
61
+ Wait for each background consultation to complete, then read the results:
62
+ - Use `TaskOutput` (with `block: true`) to retrieve each consultation result
63
+ - Record each model's verdict (APPROVE or REQUEST_CHANGES)
60
64
  - Fix any issues identified by reviewers
61
65
  - Push updates to the PR branch
62
66
  - Re-run CMAP if substantial changes were made
63
67
 
68
+ You must have three concrete verdicts (e.g., "gemini: APPROVE, codex: APPROVE, claude: APPROVE") before continuing.
69
+
64
70
  ### 4. Notify Architect
65
71
 
66
- After CMAP review is complete and feedback is addressed, notify the architect:
72
+ **DO NOT send this notification until you have all three CMAP verdicts from step 3.**
73
+
74
+ Send a **single** notification that includes the PR link and each model's verdict:
67
75
 
68
76
  ```bash
69
- af send architect "PR #<number> ready for review (fixes issue #{{issue.number}})"
77
+ af send architect "PR #<number> ready for review (fixes issue #{{issue.number}}). CMAP: gemini=<APPROVE|REQUEST_CHANGES>, codex=<APPROVE|REQUEST_CHANGES>, claude=<APPROVE|REQUEST_CHANGES>"
70
78
  ```
71
79
 
80
+ **This is the only notification you send.** After this, your work is done — the architect
81
+ takes it from here (reviews, merges, cleans up).
82
+
72
83
  ## Signals
73
84
 
74
85
  When PR is created and reviews are complete:
@@ -76,7 +76,7 @@
76
76
  "consultation": {
77
77
  "on": "review",
78
78
  "models": ["gemini", "codex"],
79
- "type": "impl-review",
79
+ "type": "impl",
80
80
  "parallel": true,
81
81
  "max_rounds": 1
82
82
  },
@@ -16,13 +16,13 @@ Disciplined experimentation: Each experiment gets its own directory with `notes.
16
16
 
17
17
  ```
18
18
  experiments/
19
- ├── 0001_descriptive_name/
19
+ ├── 1_descriptive_name/
20
20
  │ ├── notes.md # Goal, code, results
21
21
  │ ├── experiment.py # Your experiment code
22
22
  │ └── data/
23
23
  │ ├── input/ # Input data
24
24
  │ └── output/ # Results, plots, etc.
25
- └── 0002_another_experiment/
25
+ └── 2_another_experiment/
26
26
  ├── notes.md
27
27
  └── ...
28
28
  ```
@@ -33,8 +33,8 @@ experiments/
33
33
 
34
34
  ```bash
35
35
  # Create numbered directory
36
- mkdir -p experiments/0001_experiment_name
37
- cd experiments/0001_experiment_name
36
+ mkdir -p experiments/1_experiment_name
37
+ cd experiments/1_experiment_name
38
38
 
39
39
  # Initialize notes.md from template
40
40
  cp codev/protocols/experiment/templates/notes.md notes.md
@@ -81,8 +81,8 @@ Update `notes.md` with:
81
81
  ### 6. Commit
82
82
 
83
83
  ```bash
84
- git add experiments/0001_experiment_name/
85
- git commit -m "[Experiment 0001] Brief description of findings"
84
+ git add experiments/1_experiment_name/
85
+ git commit -m "[Experiment 1] Brief description of findings"
86
86
  ```
87
87
 
88
88
  ## notes.md Template
@@ -152,8 +152,8 @@ Example spec reference:
152
152
  ```markdown
153
153
  ## Background
154
154
 
155
- Experiment 0005 validated that [approach] achieves [results].
156
- See: experiments/0005_validation_test/notes.md
155
+ Experiment 5 validated that [approach] achieves [results].
156
+ See: experiments/5_validation_test/notes.md
157
157
  ```
158
158
 
159
159
  ### Experiment → TICK
@@ -164,22 +164,22 @@ For small, validated changes discovered during experimentation:
164
164
  ## Numbering Convention
165
165
 
166
166
  Use four-digit sequential numbering (consistent with project list):
167
- - `0001_`, `0002_`, `0003_`...
167
+ - `1_`, `2_`, `3_`...
168
168
  - Shared sequence across all experiments
169
169
  - Descriptive name after the number (snake_case)
170
170
 
171
171
  Examples:
172
- - `0001_api_response_caching`
173
- - `0002_model_comparison`
174
- - `0003_performance_baseline`
172
+ - `1_api_response_caching`
173
+ - `2_model_comparison`
174
+ - `3_performance_baseline`
175
175
 
176
176
  ## Git Workflow
177
177
 
178
178
  ### Commits
179
179
  ```
180
- [Experiment 0001] Initial setup and goal
181
- [Experiment 0001] Add baseline measurements
182
- [Experiment 0001] Complete - caching improves latency 40%
180
+ [Experiment 1] Initial setup and goal
181
+ [Experiment 1] Add baseline measurements
182
+ [Experiment 1] Complete - caching improves latency 40%
183
183
  ```
184
184
 
185
185
  ### When to Commit
@@ -196,7 +196,7 @@ Examples:
196
196
  ## Example Experiment
197
197
 
198
198
  ```
199
- experiments/0001_caching_strategy/
199
+ experiments/1_caching_strategy/
200
200
  ├── notes.md
201
201
  ├── benchmark.py
202
202
  ├── cache_test.py
@@ -210,7 +210,7 @@ experiments/0001_caching_strategy/
210
210
 
211
211
  **notes.md excerpt:**
212
212
  ```markdown
213
- # Experiment 0001: Caching Strategy Evaluation
213
+ # Experiment 1: Caching Strategy Evaluation
214
214
 
215
215
  **Status**: Complete
216
216
 
@@ -0,0 +1,72 @@
1
+ # Implementation Review Prompt
2
+
3
+ ## Context
4
+ You are reviewing implementation work during the Implement phase. A builder has completed a plan phase and needs feedback before proceeding. Your job is to verify the implementation matches the spec and plan.
5
+
6
+ ## CRITICAL: Verify Before Flagging
7
+
8
+ Before requesting changes for missing configuration, incorrect patterns, or framework issues:
9
+ 1. **Check `package.json`** for actual dependency versions — framework conventions change between major versions
10
+ 2. **Read the actual config files** (or confirm their deliberate absence) before flagging missing configs
11
+ 3. **Do not assume** your training data reflects the version in use — verify against project files
12
+ 4. If "Previous Iteration Context" is provided, read it carefully before re-raising concerns that were already disputed
13
+
14
+ ## Focus Areas
15
+
16
+ 1. **Spec Adherence**
17
+ - Does the implementation fulfill the spec requirements for this phase?
18
+ - Are acceptance criteria met?
19
+
20
+ 2. **Code Quality**
21
+ - Is the code readable and maintainable?
22
+ - Are there obvious bugs or issues?
23
+ - Are error cases handled appropriately?
24
+
25
+ 3. **Test Coverage**
26
+ - Are the tests adequate for this phase?
27
+ - Do tests cover the main paths AND edge cases?
28
+
29
+ 4. **Plan Alignment**
30
+ - Does the implementation follow the plan?
31
+ - Are there plan items skipped or partially completed?
32
+
33
+ 5. **UX Verification** (if spec has UX requirements)
34
+ - Does the actual user experience match what the spec describes?
35
+ - If spec says "async" or "non-blocking", is it actually async?
36
+
37
+ ## Verdict Format
38
+
39
+ After your review, provide your verdict in exactly this format:
40
+
41
+ ```
42
+ ---
43
+ VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]
44
+ SUMMARY: [One-line summary of your assessment]
45
+ CONFIDENCE: [HIGH | MEDIUM | LOW]
46
+ ---
47
+ KEY_ISSUES:
48
+ - [Issue 1 or "None"]
49
+ - [Issue 2]
50
+ ...
51
+ ```
52
+
53
+ **Verdict meanings:**
54
+ - `APPROVE`: Phase is complete, builder can proceed
55
+ - `REQUEST_CHANGES`: Issues that must be fixed before proceeding
56
+ - `COMMENT`: Minor suggestions, can proceed but note feedback
57
+
58
+ ## Scoping (Multi-Phase Plans)
59
+
60
+ When the implementation plan has multiple phases (e.g., scaffolding, landing, media_rtl):
61
+ - **ONLY review work belonging to the current plan phase**
62
+ - The query will specify which phase you are reviewing
63
+ - Do NOT request changes for functionality scheduled in later phases
64
+ - Do NOT flag missing features that are out of scope for this phase
65
+ - If unsure whether something belongs to this phase, check the plan file
66
+
67
+ ## Notes
68
+
69
+ - This is a phase-level review, not the final PR review
70
+ - Focus on "does this phase work" not "is the whole feature done"
71
+ - If referencing line numbers, use `file:line` format
72
+ - The builder needs actionable feedback to continue
@@ -0,0 +1,72 @@
1
+ # PR Ready Review Prompt
2
+
3
+ ## Context
4
+ You are performing a final self-check during the Review phase. The builder has completed all implementation phases and is about to create a PR. This is the last check before the work goes to the architect for integration review.
5
+
6
+ ## Focus Areas
7
+
8
+ 1. **Completeness**
9
+ - Are all spec requirements implemented?
10
+ - Are all plan phases complete?
11
+ - Is the review document written (`codev/reviews/XXXX-name.md`)?
12
+ - Are all commits properly formatted (`[Spec XXXX][Phase]`)?
13
+
14
+ 2. **Test Status**
15
+ - Do all tests pass?
16
+ - Is test coverage adequate for the changes?
17
+ - Are there any skipped or flaky tests?
18
+
19
+ 3. **Code Cleanliness**
20
+ - Is there any debug code left in?
21
+ - Are there any TODO comments that should be resolved?
22
+ - Are there any `// REVIEW:` comments that weren't addressed?
23
+ - Is the code properly formatted?
24
+
25
+ 4. **Documentation**
26
+ - Are inline comments clear where needed?
27
+ - Is the review document comprehensive?
28
+ - Are any new APIs documented?
29
+
30
+ 5. **PR Readiness**
31
+ - Is the branch up to date with main?
32
+ - Are commits atomic and well-described?
33
+ - Is the change diff reasonable in size?
34
+
35
+ ## Verdict Format
36
+
37
+ After your review, provide your verdict in exactly this format:
38
+
39
+ ```
40
+ ---
41
+ VERDICT: [APPROVE | REQUEST_CHANGES | COMMENT]
42
+ SUMMARY: [One-line summary of your assessment]
43
+ CONFIDENCE: [HIGH | MEDIUM | LOW]
44
+ ---
45
+ KEY_ISSUES:
46
+ - [Issue 1 or "None"]
47
+ - [Issue 2]
48
+ ...
49
+
50
+ PR_SUMMARY: |
51
+ ## Summary
52
+ [2-3 sentences describing what this PR does]
53
+
54
+ ## Key Changes
55
+ - [Change 1]
56
+ - [Change 2]
57
+
58
+ ## Test Plan
59
+ - [How to test]
60
+ ```
61
+
62
+ **Verdict meanings:**
63
+ - `APPROVE`: Ready to create PR
64
+ - `REQUEST_CHANGES`: Issues to fix before PR creation
65
+ - `COMMENT`: Minor items, can create PR but note feedback
66
+
67
+ ## Notes
68
+
69
+ - This is the builder's final self-review before hand-off
70
+ - The PR_SUMMARY in your output can be used as the PR description
71
+ - Focus on "is this ready for someone else to review" not "is this perfect"
72
+ - Any issues found here are cheaper to fix than during integration review
@@ -56,7 +56,7 @@ grep -E "src/|packages/" codev/resources/arch.md | head -20
56
56
 
57
57
  ### 5. Create Audit Report
58
58
 
59
- Create a maintenance run file: `codev/maintain/NNNN.md`
59
+ Create a maintenance run file: `codev/maintain/NNN.md`
60
60
 
61
61
  Document:
62
62
  - Dead code identified (with file paths)
@@ -66,7 +66,7 @@ Document:
66
66
 
67
67
  Use the template structure:
68
68
  ```markdown
69
- # Maintenance Run NNNN
69
+ # Maintenance Run NNN
70
70
 
71
71
  **Date**: YYYY-MM-DD
72
72
  **Base Commit**: <commit-hash>
@@ -47,7 +47,7 @@ Extract actionable lessons:
47
47
  Format:
48
48
  ```markdown
49
49
  ## [Topic]
50
- - [From NNNN] Lesson description
50
+ - [From NNN] Lesson description
51
51
  ```
52
52
 
53
53
  ### 3. Sync CLAUDE.md with AGENTS.md
@@ -63,7 +63,7 @@ Recommended focus areas for next run:
63
63
  ```bash
64
64
  git push origin HEAD
65
65
 
66
- gh pr create --title "[Maintain] Codebase maintenance run NNNN" --body "$(cat <<'EOF'
66
+ gh pr create --title "[Maintain] Codebase maintenance run NNN" --body "$(cat <<'EOF'
67
67
  ## Summary
68
68
 
69
69
  - Dead code removal