@chankov/agent-fleet 0.0.9 → 0.0.10

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 (354) hide show
  1. package/.claude/commands/doctor-agent-fleet.md +12 -7
  2. package/.claude/commands/setup-agent-fleet.md +7 -15
  3. package/.opencode/commands/af-doctor-agent-fleet.md +12 -7
  4. package/.opencode/commands/af-setup-agent-fleet.md +8 -6
  5. package/.pi/extensions/agent-fleet-update-check/README.md +2 -3
  6. package/.pi/extensions/btw/README.md +2 -2
  7. package/.pi/extensions/chrome-devtools-mcp/README.md +3 -6
  8. package/.pi/extensions/compact-and-continue/README.md +3 -3
  9. package/.pi/extensions/mcp-bridge/README.md +1 -1
  10. package/.pi/harnesses/agent-hub/README.md +139 -10
  11. package/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  12. package/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  13. package/.pi/harnesses/agent-hub/index.ts +448 -39
  14. package/.pi/harnesses/agent-hub/package.json +1 -1
  15. package/.pi/harnesses/agent-hub/review-findings.js +102 -0
  16. package/.pi/harnesses/agent-hub/run-budget.js +302 -4
  17. package/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  18. package/.pi/harnesses/coms/package.json +1 -1
  19. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  20. package/.pi/prompts/af-doctor-agent-fleet.md +13 -6
  21. package/.pi/prompts/af-setup-agent-fleet.md +7 -15
  22. package/.versions/0.0.10/.claude/commands/build.md +44 -0
  23. package/.versions/0.0.10/.claude/commands/code-simplify.md +22 -0
  24. package/.versions/0.0.10/.claude/commands/design-agent.md +14 -0
  25. package/.versions/0.0.10/.claude/commands/doctor-agent-fleet.md +22 -0
  26. package/.versions/0.0.10/.claude/commands/orchestrate.md +112 -0
  27. package/.versions/0.0.10/.claude/commands/plan.md +16 -0
  28. package/.versions/0.0.10/.claude/commands/prime.md +22 -0
  29. package/.versions/0.0.10/.claude/commands/review.md +16 -0
  30. package/.versions/0.0.10/.claude/commands/set-hermes-telegram.md +15 -0
  31. package/.versions/0.0.10/.claude/commands/set-hermes-watchdog.md +6 -0
  32. package/.versions/0.0.10/.claude/commands/setup-agent-fleet.md +17 -0
  33. package/.versions/0.0.10/.claude/commands/ship.md +72 -0
  34. package/.versions/0.0.10/.claude/commands/spec.md +15 -0
  35. package/.versions/0.0.10/.claude/commands/test.md +19 -0
  36. package/.versions/0.0.10/.claude/commands/webperf.md +32 -0
  37. package/.versions/0.0.10/.claude/orchestrate-teams.yaml +24 -0
  38. package/.versions/0.0.10/.opencode/commands/af-build.md +17 -0
  39. package/.versions/0.0.10/.opencode/commands/af-code-simplify.md +16 -0
  40. package/.versions/0.0.10/.opencode/commands/af-compound.md +16 -0
  41. package/.versions/0.0.10/.opencode/commands/af-design-agent.md +15 -0
  42. package/.versions/0.0.10/.opencode/commands/af-doctor-agent-fleet.md +22 -0
  43. package/.versions/0.0.10/.opencode/commands/af-orchestrate.md +112 -0
  44. package/.versions/0.0.10/.opencode/commands/af-plan.md +16 -0
  45. package/.versions/0.0.10/.opencode/commands/af-prime.md +22 -0
  46. package/.versions/0.0.10/.opencode/commands/af-review.md +15 -0
  47. package/.versions/0.0.10/.opencode/commands/af-set-hermes-telegram.md +15 -0
  48. package/.versions/0.0.10/.opencode/commands/af-set-hermes-watchdog.md +6 -0
  49. package/.versions/0.0.10/.opencode/commands/af-setup-agent-fleet.md +17 -0
  50. package/.versions/0.0.10/.opencode/commands/af-ship.md +16 -0
  51. package/.versions/0.0.10/.opencode/commands/af-spec.md +16 -0
  52. package/.versions/0.0.10/.opencode/commands/af-test.md +21 -0
  53. package/.versions/0.0.10/.opencode/commands/af-webperf.md +32 -0
  54. package/.versions/0.0.10/.opencode/orchestrate-teams.yaml +24 -0
  55. package/.versions/0.0.10/.pi/agents/dispatch-policy.yaml +32 -0
  56. package/.versions/0.0.10/.pi/agents/model-profiles.yaml +27 -0
  57. package/.versions/0.0.10/.pi/agents/peers.yaml +142 -0
  58. package/.versions/0.0.10/.pi/agents/teams.yaml +41 -0
  59. package/.versions/0.0.10/.pi/damage-control-rules.yaml +297 -0
  60. package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/README.md +57 -0
  61. package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  62. package/.versions/0.0.10/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  63. package/.versions/0.0.10/.pi/extensions/btw/README.md +118 -0
  64. package/.versions/0.0.10/.pi/extensions/btw/index.ts +917 -0
  65. package/.versions/0.0.10/.pi/extensions/btw/package.json +6 -0
  66. package/.versions/0.0.10/.pi/extensions/btw/state.js +179 -0
  67. package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/README.md +55 -0
  68. package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/index.ts +93 -0
  69. package/.versions/0.0.10/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  70. package/.versions/0.0.10/.pi/extensions/compact-and-continue/README.md +42 -0
  71. package/.versions/0.0.10/.pi/extensions/compact-and-continue/index.ts +120 -0
  72. package/.versions/0.0.10/.pi/extensions/compact-and-continue/package.json +6 -0
  73. package/.versions/0.0.10/.pi/extensions/mcp-bridge/README.md +46 -0
  74. package/.versions/0.0.10/.pi/extensions/mcp-bridge/index.ts +206 -0
  75. package/.versions/0.0.10/.pi/extensions/mcp-bridge/package.json +6 -0
  76. package/.versions/0.0.10/.pi/extensions/package-lock.json +1143 -0
  77. package/.versions/0.0.10/.pi/extensions/package.json +9 -0
  78. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/README.md +201 -0
  79. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/config.ts +198 -0
  80. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  81. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/index.ts +248 -0
  82. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/package.json +6 -0
  83. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  84. package/.versions/0.0.10/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  85. package/.versions/0.0.10/.pi/harnesses/agent-hub/README.md +1001 -0
  86. package/.versions/0.0.10/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  87. package/.versions/0.0.10/.pi/harnesses/agent-hub/artifacts.js +146 -0
  88. package/.versions/0.0.10/.pi/harnesses/agent-hub/assertion-ledger.js +58 -0
  89. package/.versions/0.0.10/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  90. package/.versions/0.0.10/.pi/harnesses/agent-hub/context-window.js +106 -0
  91. package/.versions/0.0.10/.pi/harnesses/agent-hub/delegate.ts +435 -0
  92. package/.versions/0.0.10/.pi/harnesses/agent-hub/docs-lane.js +122 -0
  93. package/.versions/0.0.10/.pi/harnesses/agent-hub/drift-watchdog.js +211 -0
  94. package/.versions/0.0.10/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  95. package/.versions/0.0.10/.pi/harnesses/agent-hub/external-blocker.js +85 -0
  96. package/.versions/0.0.10/.pi/harnesses/agent-hub/footer.ts +31 -0
  97. package/.versions/0.0.10/.pi/harnesses/agent-hub/helpers.ts +248 -0
  98. package/.versions/0.0.10/.pi/harnesses/agent-hub/index.ts +9111 -0
  99. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  100. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-invoke-journal.ts +131 -0
  101. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-invoke.ts +92 -0
  102. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  103. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  104. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  105. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  106. package/.versions/0.0.10/.pi/harnesses/agent-hub/monitor-session-bridge.ts +257 -0
  107. package/.versions/0.0.10/.pi/harnesses/agent-hub/package.json +7 -0
  108. package/.versions/0.0.10/.pi/harnesses/agent-hub/provider-semaphore.js +138 -0
  109. package/.versions/0.0.10/.pi/harnesses/agent-hub/research-retention.js +34 -0
  110. package/.versions/0.0.10/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  111. package/.versions/0.0.10/.pi/harnesses/agent-hub/return-contract.js +293 -0
  112. package/.versions/0.0.10/.pi/harnesses/agent-hub/return-extract.js +75 -0
  113. package/.versions/0.0.10/.pi/harnesses/agent-hub/review-findings.js +102 -0
  114. package/.versions/0.0.10/.pi/harnesses/agent-hub/run-budget.js +479 -0
  115. package/.versions/0.0.10/.pi/harnesses/agent-hub/run-namespace.js +87 -0
  116. package/.versions/0.0.10/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  117. package/.versions/0.0.10/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  118. package/.versions/0.0.10/.pi/harnesses/agent-hub/session-health.js +110 -0
  119. package/.versions/0.0.10/.pi/harnesses/agent-hub/spawn.ts +354 -0
  120. package/.versions/0.0.10/.pi/harnesses/agent-hub/version.ts +42 -0
  121. package/.versions/0.0.10/.pi/harnesses/ask-user-remote/README.md +19 -0
  122. package/.versions/0.0.10/.pi/harnesses/ask-user-remote/index.ts +321 -0
  123. package/.versions/0.0.10/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  124. package/.versions/0.0.10/.pi/harnesses/coms/README.md +100 -0
  125. package/.versions/0.0.10/.pi/harnesses/coms/index.ts +1767 -0
  126. package/.versions/0.0.10/.pi/harnesses/coms/package.json +7 -0
  127. package/.versions/0.0.10/.pi/harnesses/coms/version.ts +42 -0
  128. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/README.md +124 -0
  129. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/index.ts +536 -0
  130. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/package.json +7 -0
  131. package/.versions/0.0.10/.pi/harnesses/damage-control-continue/version.ts +42 -0
  132. package/.versions/0.0.10/.pi/harnesses/lib/coms-registry-entry.ts +94 -0
  133. package/.versions/0.0.10/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  134. package/.versions/0.0.10/.pi/harnesses/lib/herdr-client.ts +472 -0
  135. package/.versions/0.0.10/.pi/harnesses/lib/herdr-presence.ts +399 -0
  136. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-events.ts +136 -0
  137. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  138. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-model.ts +18 -0
  139. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  140. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-socket.ts +163 -0
  141. package/.versions/0.0.10/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  142. package/.versions/0.0.10/.pi/harnesses/lib/spawned-peers.js +190 -0
  143. package/.versions/0.0.10/.pi/harnesses/package-lock.json +35 -0
  144. package/.versions/0.0.10/.pi/harnesses/package.json +9 -0
  145. package/.versions/0.0.10/.pi/prompts/af-build.md +24 -0
  146. package/.versions/0.0.10/.pi/prompts/af-code-simplify.md +22 -0
  147. package/.versions/0.0.10/.pi/prompts/af-doctor-agent-fleet.md +22 -0
  148. package/.versions/0.0.10/.pi/prompts/af-plan.md +16 -0
  149. package/.versions/0.0.10/.pi/prompts/af-review.md +16 -0
  150. package/.versions/0.0.10/.pi/prompts/af-set-hermes-telegram.md +15 -0
  151. package/.versions/0.0.10/.pi/prompts/af-set-hermes-watchdog.md +6 -0
  152. package/.versions/0.0.10/.pi/prompts/af-setup-agent-fleet.md +19 -0
  153. package/.versions/0.0.10/.pi/prompts/af-ship.md +17 -0
  154. package/.versions/0.0.10/.pi/prompts/af-spec.md +15 -0
  155. package/.versions/0.0.10/.pi/prompts/af-test.md +19 -0
  156. package/.versions/0.0.10/.pi/skills/bowser/SKILL.md +145 -0
  157. package/.versions/0.0.10/.version +1 -0
  158. package/.versions/0.0.10/agents/architect.md +24 -0
  159. package/.versions/0.0.10/agents/bowser.md +27 -0
  160. package/.versions/0.0.10/agents/builder.md +54 -0
  161. package/.versions/0.0.10/agents/code-reviewer.md +208 -0
  162. package/.versions/0.0.10/agents/deep-researcher.md +32 -0
  163. package/.versions/0.0.10/agents/documenter.md +18 -0
  164. package/.versions/0.0.10/agents/orchestrator.md +72 -0
  165. package/.versions/0.0.10/agents/plan-reviewer.md +83 -0
  166. package/.versions/0.0.10/agents/planner.md +70 -0
  167. package/.versions/0.0.10/agents/releaser.md +24 -0
  168. package/.versions/0.0.10/agents/researcher.md +28 -0
  169. package/.versions/0.0.10/agents/security-auditor.md +167 -0
  170. package/.versions/0.0.10/agents/test-engineer.md +153 -0
  171. package/.versions/0.0.10/agents/web-debugger.md +43 -0
  172. package/.versions/0.0.10/agents/web-performance-auditor.md +193 -0
  173. package/.versions/0.0.10/codex/CONDUCTOR.md +148 -0
  174. package/.versions/0.0.10/docs/ARCHITECTURE.md +303 -0
  175. package/.versions/0.0.10/docs/agent-fleet-setup.md +377 -0
  176. package/.versions/0.0.10/docs/claude-code-coms-bridge.md +109 -0
  177. package/.versions/0.0.10/docs/codex-remote-conductor.md +170 -0
  178. package/.versions/0.0.10/docs/coms-hermes-bridge.md +189 -0
  179. package/.versions/0.0.10/docs/getting-started.md +254 -0
  180. package/.versions/0.0.10/docs/npm-install.md +514 -0
  181. package/.versions/0.0.10/docs/opencode-setup.md +281 -0
  182. package/.versions/0.0.10/docs/pi-extensions.md +363 -0
  183. package/.versions/0.0.10/docs/pi-setup.md +571 -0
  184. package/.versions/0.0.10/docs/skill-anatomy.md +150 -0
  185. package/.versions/0.0.10/hermes/README.md +347 -0
  186. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-herdr/plugin.js +1291 -0
  187. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-herdr/presentation.js +672 -0
  188. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-monitor/plugin.js +19 -0
  189. package/.versions/0.0.10/hermes/desktop-plugins/agent-fleet-monitor/state.js +10 -0
  190. package/.versions/0.0.10/hermes/gates/gate-o-capability.md +8 -0
  191. package/.versions/0.0.10/hermes/gates/gate-o-validator-fixtures.json +1 -0
  192. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/activity.py +770 -0
  193. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/coms_registry.py +134 -0
  194. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/coms_send.py +350 -0
  195. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/herdr_source.py +193 -0
  196. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/manifest.json +4 -0
  197. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/plugin_api.py +444 -0
  198. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/sessions.py +205 -0
  199. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/tasks.py +300 -0
  200. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/dashboard/watch.py +819 -0
  201. package/.versions/0.0.10/hermes/plugins/agent-fleet-herdr/plugin.yaml +8 -0
  202. package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/adapter.py +139 -0
  203. package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/manifest.json +11 -0
  204. package/.versions/0.0.10/hermes/plugins/agent-fleet-monitor/dashboard/plugin_api.py +50 -0
  205. package/.versions/0.0.10/hermes/skills/hub-conductor/SKILL.md +84 -0
  206. package/.versions/0.0.10/hermes/skills/hub-liaison/SKILL.md +84 -0
  207. package/.versions/0.0.10/hermes/skills/hub-watchdog/SKILL.md +76 -0
  208. package/.versions/0.0.10/hermes/skills/hub-watchdog/manifest.json +1 -0
  209. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog.py +249 -0
  210. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_actions.py +124 -0
  211. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_contract.py +76 -0
  212. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_delivery.py +10 -0
  213. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_engine.py +128 -0
  214. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_judgment.py +41 -0
  215. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_recovery.py +103 -0
  216. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_state.py +163 -0
  217. package/.versions/0.0.10/hermes/skills/hub-watchdog/scripts/watchdog_transport.py +138 -0
  218. package/.versions/0.0.10/hermes/watchdog-tests/__init__.py +0 -0
  219. package/.versions/0.0.10/hooks/SIMPLIFY-IGNORE.md +90 -0
  220. package/.versions/0.0.10/hooks/coms-stop-hook.mjs +84 -0
  221. package/.versions/0.0.10/hooks/hooks.json +14 -0
  222. package/.versions/0.0.10/hooks/session-start.sh +74 -0
  223. package/.versions/0.0.10/hooks/simplify-ignore.sh +302 -0
  224. package/.versions/0.0.10/install-manifest.json +3615 -0
  225. package/.versions/0.0.10/justfile +254 -0
  226. package/.versions/0.0.10/manifest-meta.json +472 -0
  227. package/.versions/0.0.10/references/accessibility-checklist.md +160 -0
  228. package/.versions/0.0.10/references/definition-of-done.md +67 -0
  229. package/.versions/0.0.10/references/fleet-coordination-patterns.md +151 -0
  230. package/.versions/0.0.10/references/observability-checklist.md +91 -0
  231. package/.versions/0.0.10/references/orchestration-patterns.md +370 -0
  232. package/.versions/0.0.10/references/performance-checklist.md +153 -0
  233. package/.versions/0.0.10/references/prompting-patterns.md +380 -0
  234. package/.versions/0.0.10/references/security-checklist.md +179 -0
  235. package/.versions/0.0.10/references/testing-patterns.md +236 -0
  236. package/.versions/0.0.10/scripts/codex-conductor.ts +41 -0
  237. package/.versions/0.0.10/scripts/codex-remote-control.ts +167 -0
  238. package/.versions/0.0.10/scripts/coms-claude-bridge.ts +401 -0
  239. package/.versions/0.0.10/scripts/coms-cli.ts +484 -0
  240. package/.versions/0.0.10/scripts/coms-hermes-bridge.ts +413 -0
  241. package/.versions/0.0.10/scripts/fleet.ts +168 -0
  242. package/.versions/0.0.10/scripts/hermes-monitor-capability-runner.ts +25 -0
  243. package/.versions/0.0.10/scripts/hermes-monitor-scenario.ts +474 -0
  244. package/.versions/0.0.10/scripts/hermes-watchdog-capability-probe.ts +45 -0
  245. package/.versions/0.0.10/scripts/install-hermes-plugin.sh +180 -0
  246. package/.versions/0.0.10/scripts/lib/claude-bridge-core.ts +165 -0
  247. package/.versions/0.0.10/scripts/lib/codex-conductor.ts +88 -0
  248. package/.versions/0.0.10/scripts/lib/codex-remote-control.ts +480 -0
  249. package/.versions/0.0.10/scripts/lib/coms-envelope.ts +582 -0
  250. package/.versions/0.0.10/scripts/lib/fake-herdr-server.ts +88 -0
  251. package/.versions/0.0.10/scripts/lib/fleet-command.ts +111 -0
  252. package/.versions/0.0.10/scripts/lib/herdr-layout.ts +281 -0
  253. package/.versions/0.0.10/scripts/lib/hermes-bridge-core.ts +241 -0
  254. package/.versions/0.0.10/scripts/lib/hermes-monitor-events.ts +1 -0
  255. package/.versions/0.0.10/scripts/lib/hermes-monitor-herdr.ts +2 -0
  256. package/.versions/0.0.10/scripts/lib/hermes-monitor-model.ts +3 -0
  257. package/.versions/0.0.10/scripts/lib/hermes-monitor-registry.ts +2 -0
  258. package/.versions/0.0.10/scripts/lib/hermes-monitor-socket.ts +2 -0
  259. package/.versions/0.0.10/scripts/lib/hermes-monitor-store.ts +2 -0
  260. package/.versions/0.0.10/scripts/lib/monitor-env.ts +120 -0
  261. package/.versions/0.0.10/scripts/lib/peer-launch.ts +314 -0
  262. package/.versions/0.0.10/scripts/lib/persona-banner.ts +62 -0
  263. package/.versions/0.0.10/scripts/lib/spawn-stagger.ts +101 -0
  264. package/.versions/0.0.10/scripts/lib/team-project.ts +193 -0
  265. package/.versions/0.0.10/scripts/lib/team-snapshot.ts +147 -0
  266. package/.versions/0.0.10/scripts/peer-banner.ts +40 -0
  267. package/.versions/0.0.10/scripts/peer-launch.ts +259 -0
  268. package/.versions/0.0.10/scripts/team-snapshot.ts +237 -0
  269. package/.versions/0.0.10/scripts/team-up.ts +360 -0
  270. package/.versions/0.0.10/skills/_internal/grilling.md +11 -0
  271. package/.versions/0.0.10/skills/browser-testing-with-devtools/SKILL.md +351 -0
  272. package/.versions/0.0.10/skills/code-review-and-quality/SKILL.md +381 -0
  273. package/.versions/0.0.10/skills/compound-learning/SKILL.md +137 -0
  274. package/.versions/0.0.10/skills/context-engineering/SKILL.md +291 -0
  275. package/.versions/0.0.10/skills/deprecation-and-migration/SKILL.md +206 -0
  276. package/.versions/0.0.10/skills/designing-agents/SKILL.md +394 -0
  277. package/.versions/0.0.10/skills/designing-agents/pi-harness-authoring.md +222 -0
  278. package/.versions/0.0.10/skills/frontend-ui-engineering/SKILL.md +328 -0
  279. package/.versions/0.0.10/skills/git-workflow-and-versioning/SKILL.md +316 -0
  280. package/.versions/0.0.10/skills/guided-workspace-setup/SKILL.md +226 -0
  281. package/.versions/0.0.10/skills/guided-workspace-setup/companion-manifest.json +38 -0
  282. package/.versions/0.0.10/skills/idea-refine/SKILL.md +182 -0
  283. package/.versions/0.0.10/skills/idea-refine/examples.md +238 -0
  284. package/.versions/0.0.10/skills/idea-refine/frameworks.md +99 -0
  285. package/.versions/0.0.10/skills/idea-refine/refinement-criteria.md +113 -0
  286. package/.versions/0.0.10/skills/idea-refine/scripts/idea-refine.sh +15 -0
  287. package/.versions/0.0.10/skills/incremental-implementation/SKILL.md +287 -0
  288. package/.versions/0.0.10/skills/interview-me/SKILL.md +226 -0
  289. package/.versions/0.0.10/skills/orchestration-verification/SKILL.md +181 -0
  290. package/.versions/0.0.10/skills/peer-coms/SKILL.md +90 -0
  291. package/.versions/0.0.10/skills/performance-optimization/SKILL.md +350 -0
  292. package/.versions/0.0.10/skills/planning-and-task-breakdown/SKILL.md +254 -0
  293. package/.versions/0.0.10/skills/security-and-hardening/SKILL.md +461 -0
  294. package/.versions/0.0.10/skills/spec-driven-development/SKILL.md +257 -0
  295. package/.versions/0.0.10/skills/using-agent-skills/SKILL.md +199 -0
  296. package/.versions/0.0.10/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  297. package/.versions/0.0.10/vendor/agent-skills-upstream/LICENSE +21 -0
  298. package/.versions/0.0.10/vendor/agent-skills-upstream/README.md +11 -0
  299. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  300. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  301. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  302. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  303. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  304. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  305. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  306. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  307. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  308. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  309. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  310. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  311. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  312. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  313. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  314. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  315. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  316. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  317. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  318. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  319. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  320. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  321. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  322. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  323. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  324. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  325. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  326. package/.versions/0.0.10/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  327. package/CHANGELOG.md +103 -0
  328. package/README.md +22 -5
  329. package/agents/code-reviewer.md +4 -0
  330. package/agents/orchestrator.md +7 -1
  331. package/agents/plan-reviewer.md +22 -1
  332. package/bin/build-manifest.js +68 -0
  333. package/bin/cli.js +679 -49
  334. package/bin/lib/apply.js +641 -0
  335. package/bin/lib/manifest.js +731 -0
  336. package/bin/lib/merge-forms.js +106 -0
  337. package/bin/lib/plan.js +569 -0
  338. package/bin/lib/state.js +213 -0
  339. package/bin/lib/verify.js +576 -0
  340. package/bin/snapshot-version.js +5 -0
  341. package/docs/ARCHITECTURE.md +52 -11
  342. package/docs/agent-fleet-setup.md +59 -48
  343. package/docs/getting-started.md +29 -6
  344. package/docs/npm-install.md +208 -31
  345. package/docs/opencode-setup.md +32 -0
  346. package/docs/pi-extensions.md +17 -10
  347. package/docs/pi-setup.md +164 -69
  348. package/install-manifest.json +3615 -0
  349. package/manifest-meta.json +472 -0
  350. package/package.json +8 -3
  351. package/skills/browser-testing-with-devtools/SKILL.md +3 -4
  352. package/skills/guided-workspace-setup/SKILL.md +172 -490
  353. package/skills/planning-and-task-breakdown/SKILL.md +18 -0
  354. package/skills/spec-driven-development/SKILL.md +12 -0
@@ -0,0 +1,377 @@
1
+ # Agent Fleet — Project Files
2
+
3
+ agent-fleet keeps a few small files in a project's `.ai/` directory. They have
4
+ different readers and different lifetimes, so they are kept separate.
5
+
6
+ | File | Read by | When |
7
+ |------|---------|------|
8
+ | `.ai/agent-fleet-overrides.md` | `spec-driven-development`, `planning-and-task-breakdown`, `browser-testing-with-devtools`, `git-workflow-and-versioning`, `compound-learning` (the `rules:`/`docs:` keys of `## agent-hub`), `agent-hub` pi harness | Every run of those skills / every session start of the harness |
9
+ | `.ai/agent-fleet-state.json` | the `agent-fleet` CLI (`install`, `upgrade`, `uninstall`, `verify`, `doctor`) | Every plan and every apply |
10
+ | `.ai/agent-fleet-setup.md` | humans — rendered from the state file, never parsed back | Rewritten on every apply |
11
+ | `.ai/stt.json` *(optional)* | `pi-voice-stt` extension | Every pi session start, when the extension is installed |
12
+
13
+ The `.ai/stt.json` file is present only when the optional `pi-voice-stt` voice-dictation
14
+ extension has been configured (by guided setup or by hand). Like the overrides file it holds
15
+ **no secrets** — it names the env vars (`apiKeyEnv`, plus the Azure endpoint var) whose values
16
+ live in a gitignored root `.env`. See [pi-voice-stt config](#ai-sttjson) below.
17
+
18
+ Keep them split: the overrides file is loaded into context constantly, so it
19
+ must stay minimal; the install record is read only by the CLI, so it can be
20
+ large.
21
+
22
+ ## The overrides file — `.ai/agent-fleet-overrides.md`
23
+
24
+ Some skills and pi harnesses need facts specific to each project — where specs
25
+ and plans are saved, how to start a dev server, whether the agent may create
26
+ branches, or which user-facing language a dispatcher should use. Each reader
27
+ ships a sensible **default**; a project that needs something different declares
28
+ it here, and the reader picks it up.
29
+
30
+ - **Location:** `.ai/agent-fleet-overrides.md` at the project root.
31
+ - **Format:** Markdown. One `## <section-name>` section per skill or harness reader, with terse
32
+ `key: value` lines. Block values use the `key: |` multi-line form. No prose
33
+ and no install detail — readers parse it by key and load it on every run/session start.
34
+ - **Commit it.** Shared project configuration belongs in version control. Make
35
+ sure no `.gitignore` rule (for example a broad `.env*` pattern) excludes it.
36
+ - **No secrets.** For anything sensitive (test-account credentials), reference
37
+ the **name** of an environment variable; the real value lives in a gitignored
38
+ `.env`.
39
+ - If the file is absent, or a reader has no section in it, that reader uses its
40
+ built-in default.
41
+ - **Validation.** Because an unknown section or key silently falls back to the
42
+ default, typos are invisible at runtime. `agent-fleet doctor` (and the
43
+ runtime's Agent Fleet doctor command) validates the file — unknown sections,
44
+ unknown keys in known sections, invalid values for the mechanically parsed
45
+ `agent-hub` keys, missing `rules:` folders, and unset `## env` vars — as
46
+ **advisory, warn-only findings**; it never edits the file.
47
+
48
+ ### `spec-driven-development`
49
+
50
+ | Key | Default | Meaning |
51
+ |-----|---------|---------|
52
+ | `spec-dir` | `docs/prds/{area}` | Directory specs are written to |
53
+ | `naming` | `PRD{n}-{topic}` | File name pattern; `{n}` = next free PRD number, `{topic}` = kebab-case slug |
54
+
55
+ Default output: `docs/prds/{area}/PRD{n}-{topic}.md`.
56
+
57
+ ### `planning-and-task-breakdown`
58
+
59
+ | Key | Default | Meaning |
60
+ |-----|---------|---------|
61
+ | `plan-dir` | `docs/plans/{area}` | Directory plans are written to |
62
+ | `naming` | `PLAN-{prd-name}-{phase}` | File name pattern; `{phase}` suffix only when a plan spans multiple files |
63
+ | `todo` | `embedded` | `embedded` keeps the task list inside the plan; `separate` writes a standalone `todo.md` |
64
+
65
+ Default output: `docs/plans/{area}/PLAN-{prd-name}-{phase}.md`, task list embedded.
66
+
67
+ ### `browser-testing-with-devtools`
68
+
69
+ This skill has **no default** — the section is required for browser testing,
70
+ because dev-server commands and login flows cannot be guessed.
71
+
72
+ | Key | Meaning |
73
+ |-----|---------|
74
+ | `dev-server` | Command to start the local dev server |
75
+ | `ready-check` | How to confirm the server is up |
76
+ | `base-url` | Root URL for navigation |
77
+ | `auth-flow` | Steps to log in (multi-line `|` block) |
78
+ | `roles` | Test account per privilege level, referenced by env-var name |
79
+ | `notes` | Anything else the agent should know (certs, seed data, ...) |
80
+
81
+ ### `git-workflow-and-versioning`
82
+
83
+ | Key | Default | Meaning |
84
+ |-----|---------|---------|
85
+ | `branching` | `never` | `never` = agent works in the current branch and never creates or switches branches; `allow` = agent may create feature branches |
86
+
87
+ ### `agent-hub`
88
+
89
+ Read by the `.pi/harnesses/agent-hub/` pi harness on every session start. The canonical
90
+ section name is `## agent-hub`; the harness also accepts the legacy `## agent-team` name
91
+ (from before the standalone `agent-team` harness was retired), so existing project
92
+ override files keep working unchanged. When both sections are present their keys merge,
93
+ with later lines winning.
94
+
95
+ The `rules:` and `docs:` keys are also read outside the harness: the `compound-learning`
96
+ skill (and the `/compound` Claude Code / `/af-compound` OpenCode commands built on it) resolves them as the
97
+ targets an end-of-session compound pass writes lessons to.
98
+
99
+ | Key | Default | Meaning |
100
+ |-----|---------|---------|
101
+ | `language` | `English` | User-facing language the dispatcher uses for every `ask_user` question, every `context` field, and every summary. Specialist task strings always stay in English regardless. |
102
+ | `persona-gate` | `off` | When `on`, blocks input at session start until an orchestrator persona is picked. |
103
+ | `model.<persona>` | persona frontmatter `model:` | Replaces the named persona's default model for this project (a full pi model spec). If the override reports a model/provider error or aborted request before producing text or starting a tool (including a local-model memory-limit failure), agent-hub restores the child session and retries once with the original frontmatter model; it does not fallback after work starts, cancellation, timeout, drift stop, or process-spawn failure. |
104
+ | `models.<persona>` | persona frontmatter `models:` | Replaces the named persona's model-candidate list for `/af-agent-model` and `/af-models` profiles (comma-separated pi model specs). |
105
+ | `thinking.<persona>` | persona frontmatter `thinking:` | Replaces the named persona's pi `--thinking` reasoning level for this project: one of `off`, `minimal`, `low`, `medium`, `high`, `xhigh`. Switchable at runtime with `/af-agent-model-thinking <persona>`. An invalid value is ignored with a session-start warning. |
106
+ | `subagents.<persona>.<role>` | persona frontmatter `subagents:` | Replaces or adds one delegate sub-role for this project: `<model>[, tools=<caps>]`. Other declared roles keep their frontmatter values. Existing roles retain their original frontmatter model as the same one-shot, pre-work-only runtime fallback; model-only overrides retain the declared tool cap. |
107
+ | `delegate-depth.<persona>` | persona frontmatter `delegate_depth:` (default/max 1) | Replaces the persona's delegation depth budget: `0` makes its delegate tool refuse (delegation off for this project), `1` lets it spawn terminal children. Values above 1 are clamped to 1; children at remaining depth 0 do not receive delegate tooling. |
108
+ | `rules` | none | Comma-separated repo-relative folders holding the project's own rule files (HOW — implementation patterns the work must comply with). Resolution is **index-first**: when a folder has a top-level `README.md`/`index.md`, personas read it first and follow its loading manifest (session bundles, conditional-load lists) instead of bulk-reading the tree; a folder without an index is searched **recursively** through all subfolders. The harness tells every dispatched specialist where the rules live and how to resolve them; the planner and code-reviewer personas read the relevant rules, validate their subject against them, and pass them on (cited in plan acceptance criteria / handed to delegate sub-reviewers). Missing folders produce a session-start warning. |
109
+ | `docs` | none | Comma-separated repo-relative documentation **entry points** (WHAT/WHY — architecture, standards, decisions): canonical files (e.g. `Docs/AGENTS.md`) or doc folders (personas start from a folder's `README.md`/index). Unlike `rules`, docs orient rather than bind: every dispatched specialist and research helper is told to read the entry points relevant to its task and follow their links instead of bulk-reading doc trees; the code-reviewer flags changes that alter documented behavior without a doc update; the documenter treats the entry points and the trees they link as the docs it maintains. Missing paths produce a session-start warning. |
110
+ | `research-keep` | `4` | How many **finished** manual/persona research helpers the hub retains (LRU by finish time) so they stay resumable via `/af-agents-cont rN`; older ones are pruned along with their session files. `all` disables the cap. Auto-research pipe helpers (spawned for `NEEDS_RESEARCH:` pauses) are always pruned as soon as they finish — their findings persist as files under `.pi/agent-sessions/findings/`. Running helpers are never pruned. An invalid value is ignored with a session-start warning. |
111
+ | `recon-search-timeout-s` | `120` | Parent-side deadline, in seconds, for each `read`, `grep`, `find`, or `ls` call made by a native research helper or nested delegate child. Accepts an integer `1`–`3600` or `off`; invalid input warns and falls back to `120`. This is **not** an agent/turn deadline: non-tool work can run indefinitely. On timeout the hub returns `tool_timeout` with call metadata, sends SIGTERM to its owned process group, escalates to SIGKILL after a finite grace period, and settles even if the child never closes or a descendant holds a pipe. If that bounded cleanup cannot confirm child/process-group death, the metadata reports `terminationConfirmed: false`; this prevents a parent hang but may indicate an uninterruptible OS-level process needing operator attention. |
112
+ | `mode` | `standard` | Execution mode for the hub's per-turn budgets: `fast` (single-specialist path, no nested delegation, assertion ledger optional), `standard` (batched execution with moderate budgets), or `strict` (full Verification Contract with wide budgets). Budgets are per **user turn** — exhausted budgets make `dispatch_agent`/`spawn_research` refuse with "summarize and ask the user"; the next user message opens a fresh window. Switchable live with `/af-hub-mode`. |
113
+ | `max-dispatches-per-turn` | mode default (2/8/24) | `dispatch_agent` calls allowed per user turn. Positive integer or `off` (unlimited). |
114
+ | `max-research-per-turn` | mode default (1/4/12) | `spawn_research` calls allowed per user turn (the auto-research pipe and the `/af-research` command are exempt). Positive integer or `off`. |
115
+ | `turn-wall-time-s` | mode default (900/3600/14400) | Wall-clock budget, in seconds, per user turn; once exceeded, further dispatch/research calls refuse. Positive integer or `off`. |
116
+ | `agent-turn-timeout-s` | mode default (600/1800/off) | Whole-run deadline, in seconds, for each spawned specialist, research helper, and nested delegate child (unlike `recon-search-timeout-s`, this bounds the entire run). On expiry the run terminates as `turn_timeout` (exit 124) with partial output preserved. Positive integer or `off`. |
117
+ | `session-recycle-runs` | mode default (3/5/5) | Recycle a specialist's accumulated session (fresh spawn instead of `-c` resume) after this many resumed runs. Context is also always recycled at ≥60% measured context (input + cacheRead + cacheWrite). Positive integer or `off` (context threshold still applies). |
118
+ | `watchdog` | `auto` | Drift watchdog default for dispatched specialists: `auto`/`on` arm the in-flight rules (out-of-scope writes, tool-call loops, repeated failures, tool-call cap) with LLM-judge escalation; `off` disarms. Overridable live per hub (`/af-watchdog on\|off\|auto`), per agent (`/af-watchdog <agent> on\|off\|clear`), and per dispatch (the `watchdog` param). A DRIFTING/STUCK verdict terminates the run as `drift_stop` (exit 125) with partial output preserved. |
119
+ | `watchdog-judge-model` | researcher persona's model | pi model spec for the one-shot drift judge (e.g. `openai-codex/gpt-5.3-codex-spark`). Falls back to the researcher persona's resolved model, then the dispatcher's. |
120
+
121
+ Example — switch the dispatcher to Bulgarian, pin the builder to sonnet, raise the
122
+ code-reviewer's thinking level, move the code-reviewer's docs sub-reviewer to a
123
+ different model, and point the team at the project's rule folders and doc entry
124
+ points:
125
+
126
+ ```markdown
127
+ ## agent-hub
128
+ language: Bulgarian
129
+ model.builder: github-copilot/claude-sonnet-4.6
130
+ models.builder: github-copilot/claude-sonnet-4.6, github-copilot/claude-haiku-4.5
131
+ thinking.code-reviewer: xhigh
132
+ subagents.code-reviewer.docs: github-copilot/claude-sonnet-4.6, tools=read,grep
133
+ delegate-depth.code-reviewer: 1
134
+ recon-search-timeout-s: 120 # or off to disable the per-tool watchdog
135
+ rules: docs/rules, .ai/rules
136
+ docs: Docs/AGENTS.md, Docs/architecture/ARCHITECTURE_OVERVIEW.md
137
+ ```
138
+
139
+ ### `env` (optional, read by the doctor)
140
+
141
+ The overrides file references environment variables by **name** — test-account
142
+ credentials for `browser-testing-with-devtools`, the `pi-voice-stt` API key —
143
+ while the values live in a gitignored root `.env`. The optional `## env`
144
+ section declares which names the project's readers expect, so a fresh clone
145
+ can find out what's missing *before* a skill fails mid-run:
146
+
147
+ | Key | Meaning |
148
+ |-----|---------|
149
+ | `required` | Comma-separated env-var **names** (never values) the project's sections reference |
150
+
151
+ ```markdown
152
+ ## env
153
+ required: APP_TEST_ADMIN_USER, APP_TEST_ADMIN_PASS, AZURE_SPEECH_KEY
154
+ ```
155
+
156
+ No skill or harness loads this section. Its only reader is `agent-fleet doctor`
157
+ (and the runtime's Agent Fleet doctor command), which warns when a declared name is neither set in
158
+ the environment nor declared in the workspace root `.env`.
159
+
160
+ ### Per-peer env files (`env_file:` in peers.yaml)
161
+
162
+ Fleet peers spawned by `just fleet team` can carry their own
163
+ environment: an `env_file:` entry in `.pi/agents/peers.yaml` names a
164
+ **repo-relative** KEY=VALUE file (same format as `.env`, no shell evaluation)
165
+ that herdr injects into the peer's pane before the command runs — no `source`,
166
+ no leaking into sibling panes. The file must exist at spawn (team-up refuses
167
+ otherwise, never mid-run), and its **values never appear in `--dry-run`
168
+ output** — only the path. Keep these files gitignored exactly like the root
169
+ `.env` this section describes.
170
+
171
+ ## The install record — `.ai/agent-fleet-state.json` and `.ai/agent-fleet-setup.md`
172
+
173
+ Two files, one source of truth. `.ai/agent-fleet-state.json` is what the
174
+ installer writes and the only thing it reads back: agent, method, package
175
+ version, source root, and one entry per installed item with a per-file sha256
176
+ (or, in symlink mode, the resolved link target). `.ai/agent-fleet-setup.md` is
177
+ **rendered from it** on every apply and never parsed back, so the two cannot
178
+ disagree — it exists for humans and for older readers that still look for
179
+ `version:` and `agent:`.
180
+
181
+ Ownership is the point of the state file. An entry means "agent-fleet installed
182
+ this"; anything not listed is never removed or overwritten. That lookup is what
183
+ replaced the prose ownership rule the setup skill used to carry.
184
+
185
+ | State-file field | Meaning |
186
+ |---|---|
187
+ | `agent`, `method`, `sourceRoot` | How and from where this workspace was installed |
188
+ | `packageVersion` | The version that performed the last apply — the merge base for the next `upgrade` |
189
+ | `items` | One entry per installed artifact: strategy, method, files with hashes, JSON key paths |
190
+ | `externalPackages` | Packages the user was told to install; recorded, never installed for them |
191
+ | `events` | Last few applies (verb, version, action count, conflicts) |
192
+
193
+ **No secrets, ever.** Only env-var *names* may appear — for example in the
194
+ `pi-voice-stt` record. A test asserts nothing value-shaped is persisted.
195
+
196
+ ### The recorded version and the three-way merge
197
+
198
+ `packageVersion` drives `upgrade`. For each installed artifact the engine
199
+ compares three sides: *source@recorded* from the package's `.versions/<x.y.z>/`
200
+ snapshot tree, the installed copy on disk, and *source@current*.
201
+
202
+ | Outcome | What happens |
203
+ |---|---|
204
+ | Only the source moved | Clean refresh |
205
+ | Only your copy moved | Kept — `upgrade` never eats a local edit |
206
+ | Both moved, to different content | **Conflict**: the incoming version is written as `<file>.new`, your file is untouched, the run exits `3` |
207
+ | Retired upstream | Proposed for removal by name, subject to the ownership rule |
208
+
209
+ If the snapshot is missing (an unpublished local build, or a version older than
210
+ `.versions/` retention), the comparison degrades to two-way, the installed copy
211
+ is treated as canonical, and `verify` says so as an advisory finding rather than
212
+ pretending a diff exists.
213
+
214
+ ### Pre-engine workspaces
215
+
216
+ A workspace with only `.ai/agent-fleet-setup.md` and no state file predates the
217
+ installer engine. `verify` reads what it can from the markdown (`agent:`,
218
+ `version:`), reports `stateSource: "legacy-record"`, and `upgrade` says plainly
219
+ that ownership cannot be read back — run `install` once to reconstruct the state
220
+ file first. A workspace with no `version:` at all is pre-versioning: there is no
221
+ recorded baseline, so no three-way merge is attempted.
222
+
223
+ Commit these files if the team should share install state — keep paths relative
224
+ so they stay portable. A self-referencing checkout (agent-fleet itself) may
225
+ instead `.gitignore` them, since their recorded paths are local to one machine.
226
+
227
+ ## The `/orchestrate` command and its team config
228
+
229
+ `/orchestrate` turns the main session (Claude Code) or primary agent (OpenCode)
230
+ into an **orchestrator** that drives a config-defined team of installed
231
+ subagents — subagents cannot nest, so all dispatching is the main session's job.
232
+ The default team is `planner` + `builder` (no reviewer); the orchestrator routes
233
+ the team as a **runtime roster, not a fixed `researcher → planner → builder`
234
+ pipeline** — it skips planning when a plan already exists, re-runs `researcher`
235
+ at any point, and loops back to `planner` when the build surfaces a wrong plan.
236
+ It honours the existing subagent handoff markers: `PLAN_FILE: <path>` from the
237
+ planner, and `NEEDS_RESEARCH: <question>` from planner/builder (which dispatches a
238
+ read-only `researcher` and resumes the paused persona with the findings inlined).
239
+
240
+ The named teams live in a per-agent config that mirrors pi's
241
+ `.pi/agents/teams.yaml` (a map of team-name → ordered persona list, first key =
242
+ default; `researcher`/`deep-researcher` deliberately unlisted but always
243
+ available). The reader differs by runtime: pi's harness parses its YAML, while
244
+ `/orchestrate` has the **command's instructions** read the YAML via the Read tool
245
+ (no harness runtime in claude-code/opencode):
246
+
247
+ | | Config file | Command |
248
+ |---|---|---|
249
+ | claude-code | `.claude/orchestrate-teams.yaml` | `/orchestrate` |
250
+ | opencode | `.opencode/orchestrate-teams.yaml` | `/af-orchestrate` |
251
+ | pi | `.pi/agents/teams.yaml` | via the `agent-hub` harness (no `/orchestrate`) |
252
+
253
+ Switch teams at runtime with `/orchestrate <team> "<task>"` (parallel of pi's
254
+ `/af-agents-team`); use `/orchestrate team=<name> <task>` to disambiguate when the
255
+ task text starts with a word that collides with a team key.
256
+
257
+ **Guided-setup behaviour.** `guided-workspace-setup` offers `/orchestrate`
258
+ **`★`-recommended** for claude-code + opencode (hidden for pi via the existing
259
+ source-availability filter — there is no `.pi/prompts/af-orchestrate.md`), and
260
+ installs the agent's `orchestrate-teams.yaml` as a **companion** of the command
261
+ (a user-edited config is preserved on uninstall, never silently clobbered).
262
+ Two artifacts stay **claude-only**: the lifecycle **hooks** (they register into
263
+ `.claude/settings.json`, which opencode/pi have no install path for) and the
264
+ **`AskUserQuestion` questionnaire menu mode** (the primary menu interaction on
265
+ claude-code). The orchestrate command and its team config are *not* claude-only —
266
+ they ship for opencode too.
267
+
268
+ ## Templates
269
+
270
+ ### `.ai/agent-fleet-overrides.md`
271
+
272
+ Copy this in and delete the sections you don't need — anything absent falls
273
+ back to that reader's default.
274
+
275
+ ```markdown
276
+ # Agent Fleet — Project Overrides
277
+ #
278
+ # Each section is applied ON TOP of the skill's built-in defaults.
279
+ # Keys not listed keep the default. Absent file/section → pure defaults.
280
+
281
+ ## spec-driven-development
282
+ spec-dir: docs/prds/{area}
283
+ naming: PRD{n}-{topic}
284
+
285
+ ## planning-and-task-breakdown
286
+ plan-dir: docs/plans/{area}
287
+ naming: PLAN-{prd-name}-{phase}
288
+ todo: embedded
289
+
290
+ ## browser-testing-with-devtools
291
+ dev-server: <command to start the local dev server>
292
+ ready-check: <url or check that confirms the server is up>
293
+ base-url: <root url>
294
+ auth-flow: |
295
+ 1. Navigate to <login url>
296
+ 2. Submit credentials for the role needed by the screen under test
297
+ roles:
298
+ admin: env APP_TEST_ADMIN_USER / APP_TEST_ADMIN_PASS
299
+ player: env APP_TEST_PLAYER_USER / APP_TEST_PLAYER_PASS
300
+ notes: |
301
+ <anything else: self-signed certs, required seed data, ...>
302
+
303
+ ## git-workflow-and-versioning
304
+ branching: never
305
+
306
+ # Optional for pi agent-hub; omit this section to keep default English.
307
+ # (`## agent-team` is still accepted as a legacy alias for this section.)
308
+ ## agent-hub
309
+ language: <language name>
310
+ rules: <repo-relative rule folder>[, <another folder>]
311
+ docs: <repo-relative doc entry point>[, <another file or folder>]
312
+
313
+ # Optional; names (never values) of env vars the sections above reference.
314
+ # Only `agent-fleet doctor` reads this — it warns when one is unset.
315
+ ## env
316
+ required: <ENV_VAR_NAME>[, <ANOTHER_NAME>]
317
+ ```
318
+
319
+ ### `.ai/agent-fleet-setup.md`
320
+
321
+ Rendered from `.ai/agent-fleet-state.json` by every apply, for humans to read.
322
+ Edit the workspace, not this file — the next apply overwrites it.
323
+
324
+ ```markdown
325
+ # Agent Fleet — Workspace Setup
326
+ #
327
+ # Generated from .ai/agent-fleet-state.json by `agent-fleet install`.
328
+ # Edit the workspace, not this file: it is rewritten on every apply.
329
+
330
+ ## workspace-summary
331
+ agent: claude-code
332
+ method: copy
333
+ version: 1.4.2
334
+ source: /home/you/.npm/_npx/<hash>/node_modules/@chankov/agent-fleet
335
+
336
+ ## install-status
337
+ skills: [spec-driven-development, test-driven-development, code-review-and-quality]
338
+ commands: [spec, plan, build]
339
+ personas: [code-reviewer]
340
+ extensions: []
341
+ harnesses: []
342
+ companions: [skills-internal-grilling]
343
+ external: []
344
+ updated: 2026-05-22
345
+
346
+ ## verification
347
+ - 21 item(s) recorded; run `agent-fleet verify` to check them against disk.
348
+ - No secrets are stored in this file or in .ai/agent-fleet-state.json.
349
+ ```
350
+
351
+ ### `.ai/stt.json`
352
+
353
+ Optional. Present only when the `pi-voice-stt` extension is installed and configured. Read by
354
+ the extension on every pi session start, ahead of the global `~/.pi/agent/stt.json`. Holds the
355
+ non-secret provider config; the API key (and Azure endpoint) live in a gitignored root `.env`
356
+ as named env vars, which the `justfile`'s `dotenv-load` exposes to the session.
357
+
358
+ ```json
359
+ {
360
+ "language": "bg-BG",
361
+ "provider": {
362
+ "type": "azure",
363
+ "apiKeyEnv": "AZURE_SPEECH_KEY",
364
+ "locales": ["bg-BG", "en-US"]
365
+ }
366
+ }
367
+ ```
368
+
369
+ Corresponding gitignored `.env` at the repo root:
370
+
371
+ ```sh
372
+ AZURE_SPEECH_ENDPOINT=https://<resource>.cognitiveservices.azure.com
373
+ AZURE_SPEECH_KEY=<your-resource-key>
374
+ ```
375
+
376
+ For the OpenAI-compatible backend, `provider.type` is `openai` with `baseUrl` / `model` and an
377
+ `OPENAI_API_KEY` env var instead. Full schema: [.pi/extensions/pi-voice-stt/README.md](../.pi/extensions/pi-voice-stt/README.md).
@@ -0,0 +1,109 @@
1
+ # Claude Code as a coms peer — the bridge
2
+
3
+ Makes an interactive Claude Code (terminal CLI) a **first-class, bidirectional peer** in
4
+ the local coms pool: pi agents reach it with plain `coms_send`/`coms_await`, and Claude
5
+ Code itself asks pi peers questions mid-task via `coms-cli`. Requires a running
6
+ [herdr](https://herdr.dev) server (the bridge drives the Claude pane through herdr's
7
+ socket API).
8
+
9
+ ```
10
+ pi hub ── coms envelope ──▶ coms-claude-bridge ── pane.send_text ──▶ Claude Code (pane)
11
+ pi hub ◀── response ─────── coms-claude-bridge ◀── Stop hook file ─── (turn ends)
12
+ Claude Code ── Bash: coms-cli send/await ──▶ any pi peer (outbound asks)
13
+ ```
14
+
15
+ ## Pieces
16
+
17
+ | Piece | File | Role |
18
+ |---|---|---|
19
+ | Bridge daemon | `scripts/coms-claude-bridge.ts` | One per Claude pane. Registers coms peer `<name>`, serializes inbound prompts, types them into the pane (+ Enter separately — TUI quirk), captures the reply, sends the response envelope. |
20
+ | Envelope CLI | `scripts/coms-cli.ts` | `list` / `send` / `await` / `reply` — any process becomes a coms participant. `send --await` is a blocking round trip; plain `send` prints a `msg_id` and a detached waiter holds the reply for `await`. |
21
+ | Stop hook | `hooks/coms-stop-hook.mjs` | PRIMARY completion path: writes each turn's final assistant message to `~/.pi/coms/claude-bridge/<pane>/last-message.json` (keyed by `HERDR_PANE_ID`). Exact text, no scraping. |
22
+ | Skill | `skills/peer-coms/SKILL.md` | Teaches Claude Code its peer role: discover with `coms-cli list`, ask with `send --await`, answer inbound prompts normally, never drive panes itself. |
23
+ | Runner | `runner: claude-code` in `.pi/agents/peers.yaml` | `just fleet team` spawns the Claude CLI + its bridge in one pane (`_claude-peer` internally); `model:` maps to `claude --model`, and `just fleet resume` maps the Herdr-captured session id to `claude --resume`. |
24
+
25
+ ## Setup
26
+
27
+ 1. **Hook (recommended):** add to the project's (or user's) Claude Code `settings.json`:
28
+
29
+ ```json
30
+ {
31
+ "hooks": {
32
+ "Stop": [{ "hooks": [{ "type": "command",
33
+ "command": "node /path/to/agent-fleet/hooks/coms-stop-hook.mjs" }] }]
34
+ }
35
+ }
36
+ ```
37
+
38
+ Without the hook the bridge falls back to asking Claude for a
39
+ `<<COMS_DONE:msg_id>>` sentinel and scraping the pane — it works, but replies can
40
+ carry TUI noise (tool-status lines). The hook returns exact text.
41
+
42
+ 2. **Skill:** install `peer-coms` via the normal per-agent flow so Claude Code knows it
43
+ is a peer and how to use `coms-cli`.
44
+
45
+ 3. **Spawn:** either add a `runner: claude-code` peer to a peers.yaml team and
46
+ `just fleet team <team> --no-hub`, or attach a bridge to an existing Herdr Claude pane:
47
+
48
+ ```bash
49
+ node --experimental-strip-types scripts/coms-claude-bridge.ts --name claude-main
50
+ # (inside the pane: HERDR_PANE_ID is inherited; or pass --pane <id>)
51
+ ```
52
+
53
+ ## Demo scenario (verified live)
54
+
55
+ ```bash
56
+ just fleet team docs --no-hub # Pi peers up
57
+ # pane with: bridge (claude-main) + claude
58
+ just fleet hub # in another pane: the orchestrator
59
+ # from the hub (or any shell):
60
+ node --experimental-strip-types scripts/coms-cli.ts send claude-main \
61
+ "Summarize the failing test output in artifacts/test.log" --await --timeout 300000
62
+ ```
63
+
64
+ And the reverse — Claude Code, mid-task, asking a pi peer:
65
+
66
+ ```bash
67
+ node --experimental-strip-types scripts/coms-cli.ts send researcher \
68
+ "Where is the retry logic for webhooks? file:line" --await --timeout 300000
69
+ ```
70
+
71
+ ## Serving team dispatches (coms-backed dispatch)
72
+
73
+ A bridge peer that shares a name with an agent-hub team member (e.g. `code-reviewer`,
74
+ `plan-reviewer` in the shipped `peers.yaml`) can serve that member's `dispatch_agent`
75
+ calls transparently: `.pi/agents/dispatch-policy.yaml` marks the member `prefer: coms`,
76
+ and the hub routes the dispatch to the live peer instead of spawning a native subagent —
77
+ same return contract, ASK_USER handling, and history. The standing Claude session keeps
78
+ its context across review rounds, which is the point for code/plan review. See
79
+ "Coms-backed dispatch" in `.pi/harnesses/agent-hub/README.md`.
80
+
81
+ ## Migrating legacy CLI spools
82
+
83
+ Current releases isolate CLI queues by project at:
84
+
85
+ ```text
86
+ ~/.pi/coms/cli/projects/<project>/<name>/
87
+ ```
88
+
89
+ Older releases used the ambiguous name-only path `~/.pi/coms/cli/<name>/`. If that legacy directory exists, `send`, `await`, `reply`, and listener operations fail closed rather than assigning queued messages to whichever project runs first. Before upgrading, stop commands using that CLI identity, inspect its `pending`, `responses`, and `inbound` files, determine the owning project, and move the complete `<name>` directory to `cli/projects/<project>/<name>`. Do not merge two queues or delete pending data merely to clear the error. The name `projects` is reserved for the namespace and cannot be used as a coms identity.
90
+
91
+ ## Behavior notes
92
+
93
+ - **Serialization:** one prompt at a time per pane; queue depth shows in the peer's
94
+ agent card and the herdr sidebar (`q<depth>`).
95
+ - **Presence:** the bridge annotates its pane through the shared `HerdrPresence`
96
+ (same dialect negotiation as pi peers — `tokens` on herdr >= 0.7.4, one latched
97
+ fallback to `custom_status`), so the pane carries `coms`/`proj` and the fleet panel
98
+ can join it to the registry entry. It writes the annotation ONLY, never
99
+ `pane.report_agent`: the pane's `agent_status` is herdr's own Claude detection and
100
+ the bridge polls it back as its turn-completion signal.
101
+ - **Blocked panes:** a Claude waiting on a permission prompt returns a readable error
102
+ envelope ("blocked on a permission prompt — a human must approve it") instead of
103
+ hanging until timeout.
104
+ - **Busy panes:** a prompt arriving while Claude is mid-turn errors immediately
105
+ ("mid-turn — try again shortly") rather than typing into a running turn.
106
+ - **Restarts:** the bridge is bound to the pane id, not the Claude process — restart
107
+ Claude in the pane and the bridge keeps working.
108
+ - **Fleet safety:** the bridge and skill never create or close panes; herdr driving
109
+ stays with the orchestrator (see `.pi/damage-control-rules.yaml`).