@chankov/agent-fleet 0.0.4 → 0.0.5

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 (321) hide show
  1. package/.claude/commands/set-hermes-telegram.md +15 -0
  2. package/.opencode/commands/af-set-hermes-telegram.md +15 -0
  3. package/.pi/agents/dispatch-policy.yaml +1 -1
  4. package/.pi/agents/peers.yaml +4 -4
  5. package/.pi/extensions/chrome-devtools-mcp/README.md +1 -1
  6. package/.pi/extensions/mcp-bridge/README.md +1 -1
  7. package/.pi/harnesses/agent-hub/README.md +26 -26
  8. package/.pi/harnesses/agent-hub/index.ts +6 -6
  9. package/.pi/harnesses/agent-hub/monitor-lifecycle.ts +1 -1
  10. package/.pi/harnesses/agent-hub/monitor-publisher.ts +3 -3
  11. package/.pi/harnesses/agent-hub/monitor-session-bridge.ts +1 -1
  12. package/.pi/harnesses/agent-hub/package.json +1 -1
  13. package/.pi/harnesses/ask-user-remote/README.md +1 -0
  14. package/.pi/harnesses/ask-user-remote/index.ts +36 -8
  15. package/.pi/harnesses/coms/README.md +5 -5
  16. package/.pi/harnesses/coms/package.json +1 -1
  17. package/.pi/harnesses/damage-control-continue/README.md +7 -7
  18. package/.pi/harnesses/damage-control-continue/package.json +1 -1
  19. package/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  20. package/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  21. package/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  22. package/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  23. package/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  24. package/.pi/prompts/set-hermes-telegram.md +15 -0
  25. package/.versions/0.0.5/.claude/commands/build.md +44 -0
  26. package/.versions/0.0.5/.claude/commands/code-simplify.md +22 -0
  27. package/.versions/0.0.5/.claude/commands/design-agent.md +14 -0
  28. package/.versions/0.0.5/.claude/commands/doctor-agent-fleet.md +17 -0
  29. package/.versions/0.0.5/.claude/commands/orchestrate.md +112 -0
  30. package/.versions/0.0.5/.claude/commands/plan.md +16 -0
  31. package/.versions/0.0.5/.claude/commands/prime.md +22 -0
  32. package/.versions/0.0.5/.claude/commands/review.md +16 -0
  33. package/.versions/0.0.5/.claude/commands/set-hermes-telegram.md +15 -0
  34. package/.versions/0.0.5/.claude/commands/setup-agent-fleet.md +25 -0
  35. package/.versions/0.0.5/.claude/commands/ship.md +72 -0
  36. package/.versions/0.0.5/.claude/commands/spec.md +15 -0
  37. package/.versions/0.0.5/.claude/commands/test.md +19 -0
  38. package/.versions/0.0.5/.claude/commands/webperf.md +32 -0
  39. package/.versions/0.0.5/.claude/orchestrate-teams.yaml +24 -0
  40. package/.versions/0.0.5/.opencode/commands/af-build.md +17 -0
  41. package/.versions/0.0.5/.opencode/commands/af-code-simplify.md +16 -0
  42. package/.versions/0.0.5/.opencode/commands/af-compound.md +16 -0
  43. package/.versions/0.0.5/.opencode/commands/af-design-agent.md +15 -0
  44. package/.versions/0.0.5/.opencode/commands/af-doctor-agent-fleet.md +17 -0
  45. package/.versions/0.0.5/.opencode/commands/af-orchestrate.md +112 -0
  46. package/.versions/0.0.5/.opencode/commands/af-plan.md +16 -0
  47. package/.versions/0.0.5/.opencode/commands/af-prime.md +22 -0
  48. package/.versions/0.0.5/.opencode/commands/af-review.md +15 -0
  49. package/.versions/0.0.5/.opencode/commands/af-set-hermes-telegram.md +15 -0
  50. package/.versions/0.0.5/.opencode/commands/af-setup-agent-fleet.md +15 -0
  51. package/.versions/0.0.5/.opencode/commands/af-ship.md +16 -0
  52. package/.versions/0.0.5/.opencode/commands/af-spec.md +16 -0
  53. package/.versions/0.0.5/.opencode/commands/af-test.md +21 -0
  54. package/.versions/0.0.5/.opencode/commands/af-webperf.md +32 -0
  55. package/.versions/0.0.5/.opencode/orchestrate-teams.yaml +24 -0
  56. package/.versions/0.0.5/.pi/agents/dispatch-policy.yaml +32 -0
  57. package/.versions/0.0.5/.pi/agents/model-profiles.yaml +20 -0
  58. package/.versions/0.0.5/.pi/agents/peers.yaml +146 -0
  59. package/.versions/0.0.5/.pi/agents/teams.yaml +39 -0
  60. package/.versions/0.0.5/.pi/damage-control-rules.yaml +297 -0
  61. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/README.md +58 -0
  62. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
  63. package/.versions/0.0.5/.pi/extensions/agent-fleet-update-check/package.json +6 -0
  64. package/.versions/0.0.5/.pi/extensions/btw/README.md +118 -0
  65. package/.versions/0.0.5/.pi/extensions/btw/index.ts +917 -0
  66. package/.versions/0.0.5/.pi/extensions/btw/package.json +6 -0
  67. package/.versions/0.0.5/.pi/extensions/btw/state.js +179 -0
  68. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
  69. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
  70. package/.versions/0.0.5/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
  71. package/.versions/0.0.5/.pi/extensions/compact-and-continue/README.md +42 -0
  72. package/.versions/0.0.5/.pi/extensions/compact-and-continue/index.ts +120 -0
  73. package/.versions/0.0.5/.pi/extensions/compact-and-continue/package.json +6 -0
  74. package/.versions/0.0.5/.pi/extensions/mcp-bridge/README.md +46 -0
  75. package/.versions/0.0.5/.pi/extensions/mcp-bridge/index.ts +206 -0
  76. package/.versions/0.0.5/.pi/extensions/mcp-bridge/package.json +6 -0
  77. package/.versions/0.0.5/.pi/extensions/package-lock.json +1143 -0
  78. package/.versions/0.0.5/.pi/extensions/package.json +9 -0
  79. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/README.md +201 -0
  80. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/config.ts +198 -0
  81. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
  82. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/index.ts +248 -0
  83. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/package.json +6 -0
  84. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/providers.ts +214 -0
  85. package/.versions/0.0.5/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
  86. package/.versions/0.0.5/.pi/harnesses/agent-hub/README.md +798 -0
  87. package/.versions/0.0.5/.pi/harnesses/agent-hub/access-approval.ts +135 -0
  88. package/.versions/0.0.5/.pi/harnesses/agent-hub/artifacts.js +92 -0
  89. package/.versions/0.0.5/.pi/harnesses/agent-hub/backend-policy.js +153 -0
  90. package/.versions/0.0.5/.pi/harnesses/agent-hub/delegate.ts +386 -0
  91. package/.versions/0.0.5/.pi/harnesses/agent-hub/drift-watchdog.js +165 -0
  92. package/.versions/0.0.5/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
  93. package/.versions/0.0.5/.pi/harnesses/agent-hub/footer.ts +29 -0
  94. package/.versions/0.0.5/.pi/harnesses/agent-hub/helpers.ts +214 -0
  95. package/.versions/0.0.5/.pi/harnesses/agent-hub/index.ts +8045 -0
  96. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-control.ts +9 -0
  97. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-lifecycle.ts +13 -0
  98. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-publisher.ts +59 -0
  99. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-recovery.ts +3 -0
  100. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-runtime.ts +3 -0
  101. package/.versions/0.0.5/.pi/harnesses/agent-hub/monitor-session-bridge.ts +11 -0
  102. package/.versions/0.0.5/.pi/harnesses/agent-hub/package.json +7 -0
  103. package/.versions/0.0.5/.pi/harnesses/agent-hub/research-retention.js +34 -0
  104. package/.versions/0.0.5/.pi/harnesses/agent-hub/research-watchdog.ts +40 -0
  105. package/.versions/0.0.5/.pi/harnesses/agent-hub/return-contract.js +215 -0
  106. package/.versions/0.0.5/.pi/harnesses/agent-hub/run-budget.js +155 -0
  107. package/.versions/0.0.5/.pi/harnesses/agent-hub/safety-routing.ts +22 -0
  108. package/.versions/0.0.5/.pi/harnesses/agent-hub/scope-gate.js +103 -0
  109. package/.versions/0.0.5/.pi/harnesses/agent-hub/spawn.ts +246 -0
  110. package/.versions/0.0.5/.pi/harnesses/agent-hub/version.ts +18 -0
  111. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/README.md +19 -0
  112. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/index.ts +321 -0
  113. package/.versions/0.0.5/.pi/harnesses/ask-user-remote/race-core.js +106 -0
  114. package/.versions/0.0.5/.pi/harnesses/coms/README.md +92 -0
  115. package/.versions/0.0.5/.pi/harnesses/coms/index.ts +1745 -0
  116. package/.versions/0.0.5/.pi/harnesses/coms/package.json +7 -0
  117. package/.versions/0.0.5/.pi/harnesses/coms/version.ts +18 -0
  118. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/README.md +117 -0
  119. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/index.ts +536 -0
  120. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/package.json +7 -0
  121. package/.versions/0.0.5/.pi/harnesses/damage-control-continue/version.ts +18 -0
  122. package/.versions/0.0.5/.pi/harnesses/lib/damage-control-shared.ts +197 -0
  123. package/.versions/0.0.5/.pi/harnesses/lib/herdr-client.ts +458 -0
  124. package/.versions/0.0.5/.pi/harnesses/lib/herdr-presence.ts +288 -0
  125. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-herdr.ts +28 -0
  126. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-model.ts +9 -0
  127. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-registry.ts +6 -0
  128. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-socket.ts +118 -0
  129. package/.versions/0.0.5/.pi/harnesses/lib/hermes-monitor-store.ts +31 -0
  130. package/.versions/0.0.5/.pi/harnesses/package-lock.json +35 -0
  131. package/.versions/0.0.5/.pi/harnesses/package.json +9 -0
  132. package/.versions/0.0.5/.pi/prompts/build.md +24 -0
  133. package/.versions/0.0.5/.pi/prompts/code-simplify.md +22 -0
  134. package/.versions/0.0.5/.pi/prompts/doctor-agent-fleet.md +15 -0
  135. package/.versions/0.0.5/.pi/prompts/plan.md +16 -0
  136. package/.versions/0.0.5/.pi/prompts/review.md +16 -0
  137. package/.versions/0.0.5/.pi/prompts/set-hermes-telegram.md +15 -0
  138. package/.versions/0.0.5/.pi/prompts/setup-agent-fleet.md +27 -0
  139. package/.versions/0.0.5/.pi/prompts/ship.md +17 -0
  140. package/.versions/0.0.5/.pi/prompts/spec.md +15 -0
  141. package/.versions/0.0.5/.pi/prompts/test.md +19 -0
  142. package/.versions/0.0.5/.pi/skills/bowser/SKILL.md +145 -0
  143. package/.versions/0.0.5/.version +1 -0
  144. package/.versions/0.0.5/agents/architect.md +23 -0
  145. package/.versions/0.0.5/agents/bowser.md +26 -0
  146. package/.versions/0.0.5/agents/builder.md +53 -0
  147. package/.versions/0.0.5/agents/code-reviewer.md +205 -0
  148. package/.versions/0.0.5/agents/deep-researcher.md +31 -0
  149. package/.versions/0.0.5/agents/documenter.md +18 -0
  150. package/.versions/0.0.5/agents/orchestrator.md +54 -0
  151. package/.versions/0.0.5/agents/plan-reviewer.md +60 -0
  152. package/.versions/0.0.5/agents/planner.md +69 -0
  153. package/.versions/0.0.5/agents/releaser.md +24 -0
  154. package/.versions/0.0.5/agents/researcher.md +28 -0
  155. package/.versions/0.0.5/agents/security-auditor.md +166 -0
  156. package/.versions/0.0.5/agents/test-engineer.md +151 -0
  157. package/.versions/0.0.5/agents/web-debugger.md +42 -0
  158. package/.versions/0.0.5/agents/web-performance-auditor.md +192 -0
  159. package/.versions/0.0.5/codex/CONDUCTOR.md +148 -0
  160. package/.versions/0.0.5/docs/ARCHITECTURE.md +210 -0
  161. package/.versions/0.0.5/docs/agent-fleet-setup.md +366 -0
  162. package/.versions/0.0.5/docs/claude-code-coms-bridge.md +103 -0
  163. package/.versions/0.0.5/docs/codex-remote-conductor.md +170 -0
  164. package/.versions/0.0.5/docs/coms-hermes-bridge.md +179 -0
  165. package/.versions/0.0.5/docs/getting-started.md +183 -0
  166. package/.versions/0.0.5/docs/npm-install.md +337 -0
  167. package/.versions/0.0.5/docs/opencode-setup.md +249 -0
  168. package/.versions/0.0.5/docs/pi-extensions.md +293 -0
  169. package/.versions/0.0.5/docs/pi-setup.md +472 -0
  170. package/.versions/0.0.5/docs/skill-anatomy.md +150 -0
  171. package/.versions/0.0.5/hermes/README.md +231 -0
  172. package/.versions/0.0.5/hermes/skills/hub-conductor/SKILL.md +84 -0
  173. package/.versions/0.0.5/hermes/skills/hub-liaison/SKILL.md +84 -0
  174. package/.versions/0.0.5/hooks/SIMPLIFY-IGNORE.md +90 -0
  175. package/.versions/0.0.5/hooks/coms-stop-hook.mjs +73 -0
  176. package/.versions/0.0.5/hooks/hooks.json +14 -0
  177. package/.versions/0.0.5/hooks/session-start.sh +74 -0
  178. package/.versions/0.0.5/hooks/simplify-ignore.sh +302 -0
  179. package/.versions/0.0.5/justfile +245 -0
  180. package/.versions/0.0.5/references/accessibility-checklist.md +160 -0
  181. package/.versions/0.0.5/references/definition-of-done.md +67 -0
  182. package/.versions/0.0.5/references/fleet-coordination-patterns.md +151 -0
  183. package/.versions/0.0.5/references/observability-checklist.md +91 -0
  184. package/.versions/0.0.5/references/orchestration-patterns.md +370 -0
  185. package/.versions/0.0.5/references/performance-checklist.md +153 -0
  186. package/.versions/0.0.5/references/prompting-patterns.md +380 -0
  187. package/.versions/0.0.5/references/security-checklist.md +179 -0
  188. package/.versions/0.0.5/references/testing-patterns.md +236 -0
  189. package/.versions/0.0.5/scripts/codex-conductor.ts +41 -0
  190. package/.versions/0.0.5/scripts/codex-remote-control.ts +167 -0
  191. package/.versions/0.0.5/scripts/coms-claude-bridge.ts +286 -0
  192. package/.versions/0.0.5/scripts/coms-cli.ts +484 -0
  193. package/.versions/0.0.5/scripts/coms-hermes-bridge.ts +413 -0
  194. package/.versions/0.0.5/scripts/fleet.ts +141 -0
  195. package/.versions/0.0.5/scripts/hermes-monitor-capability-runner.ts +25 -0
  196. package/.versions/0.0.5/scripts/hermes-monitor-scenario.ts +7 -0
  197. package/.versions/0.0.5/scripts/lib/claude-bridge-core.ts +100 -0
  198. package/.versions/0.0.5/scripts/lib/codex-conductor.ts +88 -0
  199. package/.versions/0.0.5/scripts/lib/codex-remote-control.ts +480 -0
  200. package/.versions/0.0.5/scripts/lib/coms-envelope.ts +539 -0
  201. package/.versions/0.0.5/scripts/lib/fake-herdr-server.ts +88 -0
  202. package/.versions/0.0.5/scripts/lib/fleet-command.ts +109 -0
  203. package/.versions/0.0.5/scripts/lib/herdr-layout.ts +263 -0
  204. package/.versions/0.0.5/scripts/lib/hermes-bridge-core.ts +241 -0
  205. package/.versions/0.0.5/scripts/lib/hermes-monitor-herdr.ts +2 -0
  206. package/.versions/0.0.5/scripts/lib/hermes-monitor-model.ts +3 -0
  207. package/.versions/0.0.5/scripts/lib/hermes-monitor-registry.ts +2 -0
  208. package/.versions/0.0.5/scripts/lib/hermes-monitor-socket.ts +2 -0
  209. package/.versions/0.0.5/scripts/lib/hermes-monitor-store.ts +2 -0
  210. package/.versions/0.0.5/scripts/lib/persona-banner.ts +62 -0
  211. package/.versions/0.0.5/scripts/lib/spawn-stagger.ts +101 -0
  212. package/.versions/0.0.5/scripts/lib/team-project.ts +191 -0
  213. package/.versions/0.0.5/scripts/lib/team-snapshot.ts +147 -0
  214. package/.versions/0.0.5/scripts/peer-banner.ts +40 -0
  215. package/.versions/0.0.5/scripts/team-snapshot.ts +237 -0
  216. package/.versions/0.0.5/scripts/team-up.ts +351 -0
  217. package/.versions/0.0.5/skills/_internal/grilling.md +11 -0
  218. package/.versions/0.0.5/skills/browser-testing-with-devtools/SKILL.md +352 -0
  219. package/.versions/0.0.5/skills/code-review-and-quality/SKILL.md +381 -0
  220. package/.versions/0.0.5/skills/compound-learning/SKILL.md +137 -0
  221. package/.versions/0.0.5/skills/context-engineering/SKILL.md +291 -0
  222. package/.versions/0.0.5/skills/deprecation-and-migration/SKILL.md +206 -0
  223. package/.versions/0.0.5/skills/designing-agents/SKILL.md +394 -0
  224. package/.versions/0.0.5/skills/designing-agents/pi-harness-authoring.md +222 -0
  225. package/.versions/0.0.5/skills/frontend-ui-engineering/SKILL.md +328 -0
  226. package/.versions/0.0.5/skills/git-workflow-and-versioning/SKILL.md +316 -0
  227. package/.versions/0.0.5/skills/guided-workspace-setup/SKILL.md +542 -0
  228. package/.versions/0.0.5/skills/guided-workspace-setup/companion-manifest.json +35 -0
  229. package/.versions/0.0.5/skills/idea-refine/SKILL.md +182 -0
  230. package/.versions/0.0.5/skills/idea-refine/examples.md +238 -0
  231. package/.versions/0.0.5/skills/idea-refine/frameworks.md +99 -0
  232. package/.versions/0.0.5/skills/idea-refine/refinement-criteria.md +113 -0
  233. package/.versions/0.0.5/skills/idea-refine/scripts/idea-refine.sh +15 -0
  234. package/.versions/0.0.5/skills/incremental-implementation/SKILL.md +287 -0
  235. package/.versions/0.0.5/skills/interview-me/SKILL.md +226 -0
  236. package/.versions/0.0.5/skills/orchestration-verification/SKILL.md +181 -0
  237. package/.versions/0.0.5/skills/peer-coms/SKILL.md +90 -0
  238. package/.versions/0.0.5/skills/performance-optimization/SKILL.md +350 -0
  239. package/.versions/0.0.5/skills/planning-and-task-breakdown/SKILL.md +236 -0
  240. package/.versions/0.0.5/skills/security-and-hardening/SKILL.md +461 -0
  241. package/.versions/0.0.5/skills/spec-driven-development/SKILL.md +245 -0
  242. package/.versions/0.0.5/skills/using-agent-skills/SKILL.md +199 -0
  243. package/.versions/0.0.5/systemd/user/agent-fleet-codex-remote-control.service.in +23 -0
  244. package/.versions/0.0.5/vendor/agent-skills-upstream/LICENSE +21 -0
  245. package/.versions/0.0.5/vendor/agent-skills-upstream/README.md +11 -0
  246. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
  247. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
  248. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
  249. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
  250. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
  251. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
  252. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
  253. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
  254. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
  255. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
  256. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
  257. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
  258. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
  259. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
  260. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
  261. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
  262. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
  263. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
  264. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
  265. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
  266. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
  267. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
  268. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
  269. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
  270. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
  271. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
  272. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
  273. package/.versions/0.0.5/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
  274. package/CHANGELOG.md +9 -0
  275. package/README.md +14 -13
  276. package/bin/cli.js +83 -1
  277. package/bin/lib/set-hermes-telegram.js +323 -0
  278. package/docs/ARCHITECTURE.md +4 -4
  279. package/docs/agent-fleet-setup.md +1 -1
  280. package/docs/claude-code-coms-bridge.md +4 -4
  281. package/docs/codex-remote-conductor.md +12 -12
  282. package/docs/coms-hermes-bridge.md +62 -4
  283. package/docs/getting-started.md +4 -4
  284. package/docs/opencode-setup.md +1 -0
  285. package/docs/pi-extensions.md +30 -25
  286. package/docs/pi-setup.md +17 -8
  287. package/hermes/README.md +14 -11
  288. package/justfile +141 -152
  289. package/package.json +6 -3
  290. package/references/fleet-coordination-patterns.md +1 -1
  291. package/scripts/coms-hermes-bridge.ts +18 -8
  292. package/scripts/fleet.ts +141 -0
  293. package/scripts/lib/fleet-command.ts +109 -0
  294. package/scripts/lib/hermes-bridge-core.ts +5 -2
  295. package/scripts/lib/hermes-monitor-herdr.ts +2 -28
  296. package/scripts/lib/hermes-monitor-model.ts +3 -9
  297. package/scripts/lib/hermes-monitor-registry.ts +2 -6
  298. package/scripts/lib/hermes-monitor-socket.ts +2 -118
  299. package/scripts/lib/hermes-monitor-store.ts +2 -31
  300. package/scripts/lib/team-project.ts +10 -3
  301. package/scripts/team-snapshot.ts +4 -5
  302. package/scripts/team-up.ts +24 -6
  303. package/skills/guided-workspace-setup/SKILL.md +13 -6
  304. package/skills/guided-workspace-setup/companion-manifest.json +3 -1
  305. package/skills/peer-coms/SKILL.md +1 -1
  306. package/hermes/plugins/agent-fleet-monitor/dashboard/dist/index.js +0 -10
  307. /package/{hermes → .versions/0.0.5/hermes}/desktop-plugins/agent-fleet-monitor/plugin.js +0 -0
  308. /package/{hermes → .versions/0.0.5/hermes}/desktop-plugins/agent-fleet-monitor/state.js +0 -0
  309. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-cap.test.py +0 -0
  310. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-discovery.test.py +0 -0
  311. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-envelope.test.py +0 -0
  312. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-forged-owner.test.py +0 -0
  313. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-lease-list.test.py +0 -0
  314. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-multihub.test.py +0 -0
  315. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter-output.test.py +0 -0
  316. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter.py +0 -0
  317. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/adapter.test.py +0 -0
  318. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/manifest.json +0 -0
  319. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/plugin-api-validation.test.py +0 -0
  320. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/plugin_api.py +0 -0
  321. /package/{hermes → .versions/0.0.5/hermes}/plugins/agent-fleet-monitor/dashboard/review-live-wiring.red.test.py +0 -0
@@ -0,0 +1,231 @@
1
+ # Hermes artifacts
2
+
3
+ This directory contains in-repository Hermes skills for the coms Hermes bridge plan. They are source artifacts only; this pass does not modify `~/.hermes`.
4
+
5
+ ## Skills
6
+
7
+ - `skills/hub-liaison/` — gateway-side Telegram liaison. It writes `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json` answer files for `[HUB-Q:<qid>]` questions consumed by `scripts/coms-hermes-bridge.ts`.
8
+ - `skills/hub-conductor/` — dev-profile conductor. It uses `scripts/coms-cli.ts list` and `scripts/coms-cli.ts send --await --timeout` to delegate to live pi hub-team peers, while preserving the no-herdr damage-control boundary.
9
+
10
+ ## Install
11
+
12
+ For `hub-liaison`, use Agent Fleet's deterministic profile-aware installer rather than a raw copy:
13
+
14
+ ```bash
15
+ agent-fleet set-hermes-telegram status --profile default
16
+ agent-fleet set-hermes-telegram install --profile default
17
+ # Only when status reports a differing local tree:
18
+ agent-fleet set-hermes-telegram install --profile default --force
19
+ # Restart a currently running gateway only by explicit request:
20
+ agent-fleet set-hermes-telegram install --profile default --force --restart
21
+ ```
22
+
23
+ The corresponding Pi/Claude slash command is `/set-hermes-telegram`; OpenCode uses `/af-set-hermes-telegram`. The installer resolves the real profile path via `hermes profile show`, refuses drift without `--force`, backs up forced replacements, copies atomically, and verifies skill/tool/gateway readiness. It never sends a test Telegram message and never starts a stopped gateway. See [the bridge runbook](../docs/coms-hermes-bridge.md#set-hermes-telegram-bridge-control).
24
+
25
+ The current `hermes skills install` CLI documents registry identifiers and direct HTTP(S) `SKILL.md` URLs, not local directories, so `hermes skills install hermes/skills/hub-liaison` is not the supported local installation path.
26
+
27
+ `hub-conductor` remains a source artifact for the human's dev/conductor profile. Install it by a reviewed local copy into the path reported by `hermes profile show <profile>`, or publish/install it through a pinned Hermes skill source; it is intentionally not managed by the Telegram bridge command.
28
+
29
+ Use `hub-liaison` in the gateway-owning Telegram profile and `hub-conductor` in the human's dev/conductor profile. Verify availability with `hermes --profile <profile> skills list --enabled-only` before relying on them.
30
+
31
+ ## Local agent-hub monitor integration
32
+
33
+ Agent Fleet exposes an optional **local monitor transport** for Hermes-facing tools. This is
34
+ separate from the Telegram/coms bridge:
35
+
36
+ - `hub-liaison` and `hub-conductor` handle human questions and delegation through coms.
37
+ - The monitor transport exposes dispatcher and specialist state through owner-only discovery,
38
+ a token file, and a Unix domain socket (UDS).
39
+
40
+ The repository does **not** ship or install a Hermes backend or Desktop plugin. A Hermes UI,
41
+ operator tool, or other local client may consume the transport contract described below, but it
42
+ owns its own presentation and lifecycle. The hub remains the source of truth for task state,
43
+ output cursors, leases, and generation-safe cancellation.
44
+
45
+ ### Integration in action
46
+
47
+ The hub can surface an `ask_user` decision in Hermes Desktop while the specialist workflow keeps
48
+ running. The prompt preserves the question and its choices instead of flattening them into an
49
+ unstructured message:
50
+
51
+ ![Hermes Desktop displaying a multiple-choice question piped from agent-hub](../docs/assets/hermes-question-in-desktop.png)
52
+
53
+ The side-by-side view shows the same live question in the Pi hub and Hermes Desktop. This is the
54
+ question-piping path used for remote human input; task monitoring remains the separate local
55
+ transport described below.
56
+
57
+ ![Pi agent-hub and Hermes Desktop showing the same piped question side by side](../docs/assets/hermes-pi-question-piping.png)
58
+
59
+ ### Start a monitored hub
60
+
61
+ Choose a stable Hermes profile ID and an absolute, owner-only runtime directory. A Herdr-backed
62
+ hub is required because the stable hub identity includes `HERDR_WORKSPACE_ID` and
63
+ `HERDR_PANE_ID`; the normal `hub-team` recipe supplies the Herdr environment.
64
+
65
+ ```bash
66
+ monitor_runtime="${XDG_RUNTIME_DIR:?XDG_RUNTIME_DIR must be set}/agent-fleet-monitor"
67
+ install -d -m 700 "$monitor_runtime"
68
+
69
+ export AGENT_FLEET_PROFILE_ID="dev"
70
+ export AGENT_FLEET_MONITOR_RUNTIME_DIR="$monitor_runtime"
71
+
72
+ just fleet team default
73
+ ```
74
+
75
+ If either monitor variable is missing or invalid, or if the hub lacks stable Herdr identity, the
76
+ monitor stays disabled while normal agent-hub orchestration continues. The profile ID must start
77
+ with an alphanumeric character and may contain only alphanumerics, `.`, `_`, or `-`; `..` is
78
+ rejected.
79
+
80
+ ### Discover the local endpoint
81
+
82
+ The hub creates mode `0700` namespaces under the runtime root. Each active registration contains
83
+ one mode `0600` discovery file and token file, plus a mode `0600` socket:
84
+
85
+ ```text
86
+ <runtime>/<profile-sha256>/<hub-sha256>/discovery-<owner-id>.json
87
+ <runtime>/<profile-sha256>/<hub-sha256>/token-<owner-id>
88
+ <runtime>/s/<registration-sha256>/s
89
+ ```
90
+
91
+ You can list discovery paths without reading or printing their tokens:
92
+
93
+ ```bash
94
+ find "$AGENT_FLEET_MONITOR_RUNTIME_DIR" -type f -name 'discovery-*.json' -print
95
+ ```
96
+
97
+ A discovery record has this shape:
98
+
99
+ ```json
100
+ {
101
+ "owner": "9db4478e-ef6e-4d5d-930b-6d637f5de4d1",
102
+ "socket": "@runtime/s/0123456789abcdef0123456789abcdef/s",
103
+ "token": "token-9db4478e-ef6e-4d5d-930b-6d637f5de4d1",
104
+ "lease": {
105
+ "hub": "<stable-hub-id>",
106
+ "pid": 12345,
107
+ "startedAt": "2026-07-21T09:00:00.000Z",
108
+ "expiresAt": "2026-07-21T09:00:30.000Z"
109
+ }
110
+ }
111
+ ```
112
+
113
+ A consumer must reject expired or malformed discovery, paths outside the configured runtime root,
114
+ symlinks, unsafe modes, and socket/token names that do not match the discovery schema. It should
115
+ re-discover after reconnect instead of caching a token or absolute socket path. Never put the token
116
+ in a URL, log, Desktop storage, or command-line argument.
117
+
118
+ ### Request snapshot, output, and cancellation
119
+
120
+ The UDS protocol is newline-delimited JSON with one request per connection. Read the token from the
121
+ discovery record's sibling token file, use it only in memory, and terminate every request with
122
+ `\n`.
123
+
124
+ ```js
125
+ import net from "node:net";
126
+
127
+ export function monitorRequest(socketPath, request) {
128
+ return new Promise((resolve, reject) => {
129
+ const client = net.createConnection(socketPath);
130
+ let body = "";
131
+ client.setTimeout(1_000, () => client.destroy(new Error("monitor timeout")));
132
+ client.on("connect", () => client.end(`${JSON.stringify(request)}\n`));
133
+ client.on("data", chunk => { body += chunk; });
134
+ client.on("error", reject);
135
+ client.on("close", () => resolve(body ? JSON.parse(body) : null));
136
+ });
137
+ }
138
+
139
+ // `token` and `socketPath` were resolved and validated from live discovery.
140
+ const current = await monitorRequest(socketPath, { type: "snapshot", token });
141
+ const delta = await monitorRequest(socketPath, {
142
+ type: "output",
143
+ token,
144
+ taskId: "builder:1",
145
+ generation: 1,
146
+ afterSequence: 0
147
+ });
148
+ ```
149
+
150
+ Example snapshot response:
151
+
152
+ ```json
153
+ {
154
+ "ok": true,
155
+ "snapshot": {
156
+ "tasks": [
157
+ {
158
+ "id": "builder:1",
159
+ "generation": 1,
160
+ "kind": "child",
161
+ "state": "running",
162
+ "outputLatestSequence": 4
163
+ }
164
+ ]
165
+ }
166
+ }
167
+ ```
168
+
169
+ Continue incremental output from the returned sequence to avoid duplicates:
170
+
171
+ ```js
172
+ const next = await monitorRequest(socketPath, {
173
+ type: "output",
174
+ token,
175
+ taskId: "builder:1",
176
+ generation: 1,
177
+ afterSequence: delta.output.sequence
178
+ });
179
+ ```
180
+
181
+ Cancellation is an explicit operator action and must use the exact displayed task ID and
182
+ generation:
183
+
184
+ ```js
185
+ const cancelled = await monitorRequest(socketPath, {
186
+ type: "cancel",
187
+ token,
188
+ taskId: "builder:1",
189
+ generation: 1
190
+ });
191
+ ```
192
+
193
+ A native specialist cancellation targets only the hub-owned process generation and validates its
194
+ process identity before signalling it. Cancelling a coms-backed run abandons the hub's local wait;
195
+ the remote peer may continue. Neither operation creates, focuses, closes, or otherwise controls a
196
+ Herdr pane or workspace.
197
+
198
+ ### Failure and reconnect behavior
199
+
200
+ - `{"ok":false,"error":"unauthorized"}` means the token does not match current ownership.
201
+ - `monitor_unavailable` means the hub-side snapshot/output/cancel handler failed closed.
202
+ - `response_too_large` means the consumer must fall back to a fresh bounded snapshot or cursor.
203
+ - An empty response indicates malformed or out-of-contract input; do not retry it unchanged.
204
+ - When the lease expires, the socket closes, or ownership changes, discard the token and repeat
205
+ discovery. Never fall back to public TCP, a gateway endpoint, or Herdr pane control.
206
+
207
+ Stopping the hub removes its owned discovery, token, and socket. Historical monitor journals under
208
+ the configured runtime root are separate from this live registration and should be removed only by
209
+ an operator who has identified the exact profile/runtime scope.
210
+
211
+ ## Usage notes
212
+
213
+ For `hub-liaison`, ensure the Telegram-capable profile has terminal/file-write tools enabled so it can create exactly `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json` and nothing outside that questions directory.
214
+
215
+ For `hub-conductor`, either start the pi team/pool outside Hermes first, or use the repo recipe to create a visible conductor workspace:
216
+
217
+ ```bash
218
+ just conductor docs # conductor pane (`hermes -p dev`) + docs team panes
219
+ just fleet conductor hermes docs --dry-run # preview, no Herdr calls
220
+ ```
221
+
222
+ Inside Hermes, discover and delegate only through coms:
223
+
224
+ ```bash
225
+ node --experimental-strip-types /home/nchankov/repos/agent-fleet/scripts/coms-cli.ts list
226
+ node --experimental-strip-types /home/nchankov/repos/agent-fleet/scripts/coms-cli.ts send <peer> "<task>" --await --timeout 300000
227
+ ```
228
+
229
+ Hermes must not drive herdr panes or workspaces; the `just conductor` recipe creates the pane before Hermes starts. The no-herdr boundary is documented in `docs/coms-hermes-bridge.md` and governed by `.pi/damage-control-rules.yaml`.
230
+
231
+ Hermes/Telegram remains the inbound `ask_user` path beside the experimental Codex remote-control conductor. Codex is outbound-initiated, approval-gated, and serialized through the validated wrapper; both Hermes and Codex contracts remain advisory outside Pi damage-control, and neither external process has an OS command allowlist. See the [Codex operator runbook](../docs/codex-remote-conductor.md).
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: hub-conductor
3
+ description: Conducts local pi hub-team peers from Hermes through coms-cli list/send --await, while preserving no-herdr and pool-scope damage-control boundaries.
4
+ ---
5
+
6
+ # Hub Conductor
7
+
8
+ ## Overview
9
+
10
+ You are the human-facing conductor for a local pi coms pool. Your job is to decompose the human's request, discover live hub-team peers, delegate bounded tasks through `scripts/coms-cli.ts`, wait for results, and synthesize a final answer.
11
+
12
+ This is conductor-side orchestration only: the existing coms CLI is the bridge. You do not need a daemon or standing Hermes peer to ask pi peers for work.
13
+
14
+ ## When to Use
15
+
16
+ Use this skill when:
17
+
18
+ - the human asks Hermes to coordinate pi hub-team peers;
19
+ - a task benefits from parallel specialist work such as research, implementation, docs, review, or testing;
20
+ - you need to inspect which local peers are alive before deciding who should do what;
21
+ - a previous peer response needs follow-up, retry, or synthesis.
22
+
23
+ Do not use it for single-step work Hermes can safely complete alone without peer help.
24
+
25
+ ## Process
26
+
27
+ 1. Identify the repository root and set a shell variable for it when useful:
28
+
29
+ ```bash
30
+ REPO=/home/nchankov/repos/agent-fleet
31
+ ```
32
+
33
+ 2. Discover live peers in the current coms project:
34
+
35
+ ```bash
36
+ node --experimental-strip-types "$REPO/scripts/coms-cli.ts" list
37
+ ```
38
+
39
+ Use `--project <name>` when the human or launch recipe specifies a non-default project.
40
+
41
+ 3. Choose peers by their listed name and purpose. Send bounded, self-contained prompts that include the expected deliverable and any acceptance assertions the peer must prove.
42
+
43
+ 4. Delegate with an explicit timeout and wait for the response:
44
+
45
+ ```bash
46
+ node --experimental-strip-types "$REPO/scripts/coms-cli.ts" send <peer-name> \
47
+ "<bounded task; include required output and evidence>" \
48
+ --await --timeout 300000
49
+ ```
50
+
51
+ Use a longer timeout for build/test/review tasks when needed. Every `send --await` must include `--timeout <ms>`.
52
+
53
+ 5. If a peer times out or is missing, retry at most once when the task still matters. Otherwise report that peer as unavailable and continue with the best available evidence.
54
+
55
+ 6. Synthesize peer outputs for the human. Name which peers were asked, what each returned, what evidence supports the result, and what remains unproven.
56
+
57
+ 7. For inbound conversational requests, answer directly in chat after any peer delegation; keep the final response self-contained because the human sees your synthesis, not the peer transcript.
58
+
59
+ ## Hard Boundaries
60
+
61
+ - **Advisory contract only.** This skill runs in an external Hermes process. Pi damage-control wraps Pi tool calls, not Hermes; this contract and any human confirmation reduce risk but do not provide an OS command allowlist or technical enforcement.
62
+ - **No herdr driving.** Do not run `herdr pane`, `herdr workspace`, pane lifecycle commands, workspace lifecycle commands, or any command that creates, closes, restarts, or drives panes. Rationale: fleet lifecycle belongs to the human/orchestrator so the `.pi/damage-control-rules.yaml` model remains intact and Hermes cannot accidentally destroy or commandeer active work.
63
+ - **Pool scope only.** Operate only through peers visible in the current project coms pool (`coms-cli list`, then `coms-cli send ... --await`). Do not widen to unrelated projects, global registries, hidden explicit peers, or external agent pools unless the human explicitly starts that topology and names the target project. Rationale: coms pool boundaries keep delegation auditable and prevent cross-project leakage.
64
+ - **No secret or bulk-data relay.** Send bounded prompts and path references, not secrets or whole-file dumps. Rationale: peers need task context, not uncontrolled data replication.
65
+
66
+ ## Red Flags
67
+
68
+ - Running or proposing `herdr` pane/workspace commands yourself.
69
+ - Sending to a peer that was not shown by `coms-cli list` for the intended project.
70
+ - Omitting `--await` or `--timeout` for delegated work that the human expects you to synthesize.
71
+ - Retrying repeatedly after a timeout instead of one retry then reporting the gap.
72
+ - Treating a peer's prose success claim as proof when it lacks named evidence.
73
+ - Expanding beyond the repository/project pool without explicit human direction.
74
+
75
+ ## Verification
76
+
77
+ Before reporting done, check:
78
+
79
+ - [ ] `coms-cli list` was run for the intended project and the selected peers were visible.
80
+ - [ ] Every delegated task used `coms-cli send <peer> ... --await --timeout <ms>`.
81
+ - [ ] Peer responses were synthesized with named evidence and unresolved gaps.
82
+ - [ ] At most one retry was used for any timeout or missing peer.
83
+ - [ ] No `herdr` command was run or requested by Hermes.
84
+ - [ ] No delegation crossed outside the intended project coms pool.
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: hub-liaison
3
+ description: On any Telegram HUB-Q reply ALWAYS write the pi hub bridge answer file — even when the thread shows cancel/closed/timeout notes; the bridge classifies late answers itself. Use when a Telegram message replies to or contains a [HUB-Q:<qid>] marker.
4
+ ---
5
+
6
+ # Hub Liaison
7
+
8
+ ## Overview
9
+
10
+ You are the gateway-side liaison between a human Telegram reply and the pi `user-remote` coms peer. When a Telegram message correlates to a hub question marker, write one answer file for the bridge. Do not answer by paraphrasing in chat only; the bridge only consumes the file.
11
+
12
+ ## When to Use
13
+
14
+ Use this skill when an incoming Telegram message either:
15
+
16
+ - replies to a message that contains `[HUB-Q:<qid>]`, or
17
+ - contains the explicit prefix `HUB-Q:<qid>:`.
18
+
19
+ `<qid>` must be a 26-character Crockford ULID matching:
20
+
21
+ ```text
22
+ ^[0-9A-HJKMNP-TV-Z]{26}$
23
+ ```
24
+
25
+ Ignore non-matching messages. If a message is ambiguous and there is more than one plausible question marker, ask the human to reply to the original question or use `HUB-Q:<qid>: <answer>`.
26
+
27
+ ## Correlation Rules
28
+
29
+ 1. Prefer the qid from the replied-to message marker: `[HUB-Q:<qid>]`.
30
+ 2. If there is no replied-to marker, accept a message prefix exactly shaped as `HUB-Q:<qid>: <answer>`.
31
+ 3. The answer text is the Telegram reply body, except for prefix-form messages where the answer text is everything after `HUB-Q:<qid>:`.
32
+ 4. Preserve the human's answer text exactly except for trimming leading/trailing whitespace around the extracted answer.
33
+ 5. Never invent or alter the qid. If the qid does not match the regex above, do not write a file.
34
+ 6. If a human message contains or replies to a `[HUB-Q:<qid>]` question, write the answer file even when the thread also contains a cancel/closed note or the user appears to be answering after cancellation. Do not decide whether the question is still open; the bridge validates pending vs. late and sends the appropriate polite closed note.
35
+
36
+ ## Process
37
+
38
+ 1. Extract `<qid>` and `<answer>` using the correlation rules.
39
+ 2. Confirm `<answer>` is non-empty. If it is empty, ask the human for the answer text.
40
+ 3. Do not suppress the write because the question appears canceled, closed, timed out, or answered locally. That state belongs to the bridge, not this skill.
41
+ 4. Write exactly this file path, replacing `<qid>` with the extracted qid:
42
+
43
+ ```text
44
+ ~/.pi/coms/hermes-bridge/questions/<qid>.answer.json
45
+ ```
46
+
47
+ 5. The JSON content must use exactly these fields:
48
+
49
+ ```json
50
+ {
51
+ "qid": "<qid>",
52
+ "answer": "<answer>",
53
+ "answered_by": "telegram:<user>",
54
+ "at": "<ISO timestamp>"
55
+ }
56
+ ```
57
+
58
+ - `qid`: the extracted 26-character qid.
59
+ - `answer`: the extracted answer text.
60
+ - `answered_by`: `telegram:<user>`, using the Telegram username/handle when available; otherwise use a stable Telegram sender identifier.
61
+ - `at`: the current ISO-8601 timestamp.
62
+
63
+ 6. After writing the file, briefly confirm to the human that the answer was delivered for `HUB-Q:<qid>`; if it was late, the bridge will handle the closed-question response.
64
+
65
+ ## Write Boundary
66
+
67
+ Hard rule: never write outside `~/.pi/coms/hermes-bridge/questions/` for this skill. Do not create, edit, or delete files elsewhere. The bridge validates and consumes only `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json`; any other path is outside the private wire contract.
68
+
69
+ ## Red Flags
70
+
71
+ - A message has no `[HUB-Q:<qid>]` marker and no `HUB-Q:<qid>:` prefix.
72
+ - The qid fails `^[0-9A-HJKMNP-TV-Z]{26}$`.
73
+ - The answer text is empty after extraction.
74
+ - The requested write path is not under `~/.pi/coms/hermes-bridge/questions/`.
75
+ - The human asks you to modify bridge logs, registry files, or any unrelated project files.
76
+ - Suppressing an otherwise correlated answer because a cancel/closed note is visible in the thread.
77
+
78
+ ## Verification
79
+
80
+ - [ ] The qid came from `[HUB-Q:<qid>]` or `HUB-Q:<qid>:` and matches the regex.
81
+ - [ ] The answer file path is exactly `~/.pi/coms/hermes-bridge/questions/<qid>.answer.json`.
82
+ - [ ] The JSON has exactly `qid`, `answer`, `answered_by`, and `at` with an ISO timestamp.
83
+ - [ ] No file outside `~/.pi/coms/hermes-bridge/questions/` was written.
84
+ - [ ] Correlated late/canceled answers were still written for the bridge to classify.
@@ -0,0 +1,90 @@
1
+ # simplify-ignore hook
2
+
3
+ Block-level protection for `/code-simplify`. Mark code that should never be simplified — the model won't see it.
4
+
5
+ ## Setup
6
+
7
+ 1. Annotate blocks you want to protect:
8
+
9
+ ```js
10
+ /* simplify-ignore-start: perf-critical */
11
+ // manually unrolled XOR — 3x faster than a loop
12
+ result[0] = buf[0] ^ key[0];
13
+ result[1] = buf[1] ^ key[1];
14
+ result[2] = buf[2] ^ key[2];
15
+ result[3] = buf[3] ^ key[3];
16
+ /* simplify-ignore-end */
17
+ ```
18
+
19
+ 2. Add hooks to `.claude/settings.json`:
20
+
21
+ ```json
22
+ {
23
+ "hooks": {
24
+ "PreToolUse": [
25
+ {
26
+ "matcher": "Read",
27
+ "hooks": [{ "type": "command", "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/simplify-ignore.sh" }]
28
+ }
29
+ ],
30
+ "PostToolUse": [
31
+ {
32
+ "matcher": "Edit|Write",
33
+ "hooks": [{ "type": "command", "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/simplify-ignore.sh" }]
34
+ }
35
+ ],
36
+ "Stop": [
37
+ {
38
+ "hooks": [{ "type": "command", "command": "bash ${CLAUDE_PROJECT_DIR}/hooks/simplify-ignore.sh" }]
39
+ }
40
+ ]
41
+ }
42
+ }
43
+ ```
44
+
45
+ 3. Run `/code-simplify` — protected blocks become `/* BLOCK_de115a1d: perf-critical */` placeholders. The model reasons about surrounding code without seeing the protected implementation.
46
+
47
+ > **Note:** The hook stores temporary backups in `.claude/.simplify-ignore-cache/`. Make sure this path is in your `.gitignore`.
48
+
49
+ ## How it works
50
+
51
+ One script, three hook events:
52
+
53
+ | Event | Action |
54
+ |---|---|
55
+ | `PreToolUse Read` | Backs up file, replaces blocks with `BLOCK_<hash>` placeholders in-place |
56
+ | `PostToolUse Edit\|Write` | Expands placeholders back to real code, saves model's changes, re-filters |
57
+ | `Stop` | Restores all files from backup when session ends |
58
+
59
+ Each block is content-hashed (8 hex chars via `shasum`/`sha1sum`) so the round-trip is unambiguous even if the model duplicates or reorders placeholders. Cache is project-scoped to prevent cross-session interference.
60
+
61
+ ## Annotation syntax
62
+
63
+ ```js
64
+ /* simplify-ignore-start */ // basic — hides the block
65
+ /* simplify-ignore-start: reason */ // with reason — appears in placeholder
66
+ /* simplify-ignore-end */
67
+ ```
68
+
69
+ Any comment style works (`//`, `/*`, `#`, `<!--`). Multiple blocks per file and single-line blocks supported. Placeholders preserve the original comment syntax (e.g. `# BLOCK_xxx` for Python, `<!-- BLOCK_xxx -->` for HTML).
70
+
71
+ ## Crash recovery
72
+
73
+ If Claude Code crashes without triggering the Stop hook, files on disk may still have `BLOCK_<hash>` placeholders. To restore manually:
74
+
75
+ ```bash
76
+ echo '{}' | bash hooks/simplify-ignore.sh
77
+ ```
78
+
79
+ Backups are stored in `.claude/.simplify-ignore-cache/` within your project directory.
80
+
81
+ ## Known limitations
82
+
83
+ - **Single-line blocks hide the entire line.** If `simplify-ignore-start` and `simplify-ignore-end` appear on the same line as other code, the whole line is hidden from the model, not just the annotated portion. Use dedicated lines for annotations.
84
+ - **Comment suffix detection covers `*/` and `-->` only.** Template engines with non-standard comment closers (ERB `%>`, Blade `--}}`) may produce unbalanced placeholders. Use `#` or `//` style comments instead.
85
+ - **Fallback expansion is progressive, not exact.** If the model alters a placeholder's formatting (e.g. changes the reason text), the hook tries progressively simpler matches: full placeholder → prefix+hash+suffix → hash-only. The hash-only fallback may leave cosmetic debris (e.g. stray `:` or reason text). A warning is printed to stderr when this happens.
86
+ - **File renaming leaves placeholders.** If the model renames or moves a file via a shell command, the new file will retain `BLOCK_<hash>` placeholders. The original code is saved as `<old-filename>.recovered` when the session stops. You must manually restore the recovered code into the new file.
87
+
88
+ ## Requirements
89
+
90
+ - `jq`, `shasum` or `sha1sum` (auto-detected), Bash 3.2+
@@ -0,0 +1,73 @@
1
+ #!/usr/bin/env node
2
+ // hooks/coms-stop-hook.mjs — Claude Code Stop hook for the coms bridge.
3
+ //
4
+ // Writes the final assistant message of each turn to the file the
5
+ // coms-claude-bridge watches (~/.pi/coms/claude-bridge/<pane>/last-message.json,
6
+ // keyed by HERDR_PANE_ID), making the hook the bridge's PRIMARY completion
7
+ // path (exact text, no pane scraping). Outside a herdr pane it does nothing.
8
+ //
9
+ // Install (project or user settings.json):
10
+ // {
11
+ // "hooks": {
12
+ // "Stop": [{ "hooks": [{ "type": "command",
13
+ // "command": "node /path/to/agent-fleet/hooks/coms-stop-hook.mjs" }] }]
14
+ // }
15
+ // }
16
+ //
17
+ // The hook receives {session_id, transcript_path, …} as JSON on stdin and
18
+ // must never fail the turn: every error path exits 0.
19
+
20
+ import * as fs from "node:fs";
21
+ import * as os from "node:os";
22
+ import * as path from "node:path";
23
+
24
+ function lastAssistantText(transcriptPath) {
25
+ const raw = fs.readFileSync(transcriptPath, "utf-8");
26
+ let text = null;
27
+ for (const line of raw.split("\n")) {
28
+ if (!line.trim()) continue;
29
+ let entry;
30
+ try {
31
+ entry = JSON.parse(line);
32
+ } catch {
33
+ continue;
34
+ }
35
+ if (entry?.type !== "assistant") continue;
36
+ const content = entry?.message?.content;
37
+ if (!Array.isArray(content)) continue;
38
+ const parts = content.filter((c) => c?.type === "text" && typeof c.text === "string").map((c) => c.text);
39
+ if (parts.length > 0) text = parts.join("\n");
40
+ }
41
+ return text;
42
+ }
43
+
44
+ try {
45
+ const paneId = process.env.HERDR_PANE_ID;
46
+ if (!paneId) process.exit(0); // not in a herdr pane — nothing to bridge
47
+
48
+ const input = JSON.parse(fs.readFileSync(0, "utf-8"));
49
+ const transcriptPath = input?.transcript_path;
50
+ if (!transcriptPath || !fs.existsSync(transcriptPath)) process.exit(0);
51
+
52
+ const text = lastAssistantText(transcriptPath);
53
+ if (text == null) process.exit(0);
54
+
55
+ const dir = path.join(
56
+ os.homedir(),
57
+ ".pi",
58
+ "coms",
59
+ "claude-bridge",
60
+ paneId.replace(/[^A-Za-z0-9_-]/g, "_"),
61
+ );
62
+ fs.mkdirSync(dir, { recursive: true });
63
+ const file = path.join(dir, "last-message.json");
64
+ const tmp = `${file}.tmp-${process.pid}`;
65
+ fs.writeFileSync(
66
+ tmp,
67
+ JSON.stringify({ text, session_id: input.session_id ?? null, written_at: new Date().toISOString() }),
68
+ );
69
+ fs.renameSync(tmp, file);
70
+ } catch {
71
+ // never fail the turn
72
+ }
73
+ process.exit(0);
@@ -0,0 +1,14 @@
1
+ {
2
+ "hooks": {
3
+ "SessionStart": [
4
+ {
5
+ "hooks": [
6
+ {
7
+ "type": "command",
8
+ "command": "SCRIPT=\"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ] || SCRIPT=\"${CLAUDE_PROJECT_DIR}/.claude/hooks/session-start.sh\"; [ -f \"$SCRIPT\" ]&& bash \"$SCRIPT\" || true"
9
+ }
10
+ ]
11
+ }
12
+ ]
13
+ }
14
+ }
@@ -0,0 +1,74 @@
1
+ #!/bin/bash
2
+ # agent-fleet session start hook (Claude Code).
3
+ #
4
+ # Two responsibilities:
5
+ # 1. Inject the using-agent-skills meta-skill into the session context so
6
+ # Claude can route tasks to the right skill.
7
+ # 2. Surface a one-line "update available" banner when the installed
8
+ # package is behind the published version on npm.
9
+ #
10
+ # Both are best-effort. Network errors, missing files, and missing tools
11
+ # never block session start — the hook always exits 0 and prints a valid
12
+ # JSON object on stdout.
13
+
14
+ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
15
+ PACKAGE_ROOT="$(dirname "$SCRIPT_DIR")"
16
+ SKILLS_DIR="$PACKAGE_ROOT/skills"
17
+ META_SKILL="$SKILLS_DIR/using-agent-skills/SKILL.md"
18
+ CHECK_SCRIPT="$PACKAGE_ROOT/bin/cli.js"
19
+
20
+ # ── 1. Meta-skill content ────────────────────────────────────────────────
21
+ if [ -f "$META_SKILL" ]; then
22
+ META_CONTENT=$(cat "$META_SKILL")
23
+ PRIORITY="IMPORTANT"
24
+ BASE_MESSAGE="agent-fleet loaded. Use the skill discovery flowchart to find the right skill for your task."
25
+ else
26
+ META_CONTENT=""
27
+ PRIORITY="INFO"
28
+ BASE_MESSAGE="agent-fleet: using-agent-skills meta-skill not found. Skills may still be available individually."
29
+ fi
30
+
31
+ # ── 2. Update banner (silent on any error) ───────────────────────────────
32
+ UPDATE_BANNER=""
33
+ if [ "$AGENT_SKILLS_NO_UPDATE_CHECK" != "1" ] \
34
+ && [ "$NO_UPDATE_NOTIFIER" != "1" ] \
35
+ && [ "$CI" != "true" ] \
36
+ && command -v node >/dev/null 2>&1 \
37
+ && [ -f "$CHECK_SCRIPT" ]; then
38
+ # Run with a 3-second wall-clock cap so a hung registry never stalls the
39
+ # session. The check-update subcommand emits the banner on stdout when an
40
+ # upgrade is available, nothing otherwise. Errors go to /dev/null.
41
+ if command -v timeout >/dev/null 2>&1; then
42
+ UPDATE_BANNER=$(timeout 3 node "$CHECK_SCRIPT" check-update 2>/dev/null || true)
43
+ else
44
+ UPDATE_BANNER=$(node "$CHECK_SCRIPT" check-update 2>/dev/null || true)
45
+ fi
46
+ fi
47
+
48
+ # ── Compose the message ──────────────────────────────────────────────────
49
+ FULL_MESSAGE="$BASE_MESSAGE"
50
+ if [ -n "$UPDATE_BANNER" ]; then
51
+ FULL_MESSAGE=$(printf '%s\n\n%s' "$FULL_MESSAGE" "$UPDATE_BANNER")
52
+ fi
53
+ if [ -n "$META_CONTENT" ]; then
54
+ FULL_MESSAGE=$(printf '%s\n\n%s' "$FULL_MESSAGE" "$META_CONTENT")
55
+ fi
56
+
57
+ # ── Emit JSON (node handles escaping correctly) ──────────────────────────
58
+ if command -v node >/dev/null 2>&1; then
59
+ printf '%s' "$FULL_MESSAGE" | node -e '
60
+ let msg = "";
61
+ process.stdin.setEncoding("utf8");
62
+ process.stdin.on("data", c => { msg += c; });
63
+ process.stdin.on("end", () => {
64
+ process.stdout.write(JSON.stringify({
65
+ priority: process.env.PRIORITY || "INFO",
66
+ message: msg,
67
+ }) + "\n");
68
+ });
69
+ '
70
+ else
71
+ # Fallback: ship just the base message with minimal escaping.
72
+ SAFE_MSG=$(printf '%s' "$BASE_MESSAGE" | sed 's/\\/\\\\/g; s/"/\\"/g')
73
+ printf '{"priority": "%s", "message": "%s"}\n' "$PRIORITY" "$SAFE_MSG"
74
+ fi