@chankov/agent-fleet 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/commands/build.md +44 -0
- package/.claude/commands/code-simplify.md +22 -0
- package/.claude/commands/design-agent.md +14 -0
- package/.claude/commands/doctor-agent-fleet.md +17 -0
- package/.claude/commands/orchestrate.md +112 -0
- package/.claude/commands/plan.md +16 -0
- package/.claude/commands/prime.md +22 -0
- package/.claude/commands/review.md +16 -0
- package/.claude/commands/setup-agent-fleet.md +25 -0
- package/.claude/commands/ship.md +72 -0
- package/.claude/commands/spec.md +15 -0
- package/.claude/commands/test.md +19 -0
- package/.claude/commands/webperf.md +32 -0
- package/.claude/orchestrate-teams.yaml +24 -0
- package/.opencode/commands/af-build.md +17 -0
- package/.opencode/commands/af-code-simplify.md +16 -0
- package/.opencode/commands/af-compound.md +16 -0
- package/.opencode/commands/af-design-agent.md +15 -0
- package/.opencode/commands/af-doctor-agent-fleet.md +15 -0
- package/.opencode/commands/af-orchestrate.md +112 -0
- package/.opencode/commands/af-plan.md +16 -0
- package/.opencode/commands/af-prime.md +22 -0
- package/.opencode/commands/af-review.md +15 -0
- package/.opencode/commands/af-setup-agent-fleet.md +15 -0
- package/.opencode/commands/af-ship.md +16 -0
- package/.opencode/commands/af-spec.md +16 -0
- package/.opencode/commands/af-test.md +21 -0
- package/.opencode/commands/af-webperf.md +32 -0
- package/.opencode/orchestrate-teams.yaml +24 -0
- package/.pi/agents/dispatch-policy.yaml +32 -0
- package/.pi/agents/model-profiles.yaml +20 -0
- package/.pi/agents/peers.yaml +142 -0
- package/.pi/agents/teams.yaml +39 -0
- package/.pi/damage-control-rules.yaml +297 -0
- package/.pi/extensions/agent-fleet-update-check/README.md +58 -0
- package/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.pi/extensions/btw/README.md +118 -0
- package/.pi/extensions/btw/index.ts +917 -0
- package/.pi/extensions/btw/package.json +6 -0
- package/.pi/extensions/btw/state.js +179 -0
- package/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
- package/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
- package/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.pi/extensions/package-lock.json +1143 -0
- package/.pi/extensions/package.json +9 -0
- package/.pi/extensions/pi-voice-stt/README.md +201 -0
- package/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.pi/harnesses/agent-hub/README.md +562 -0
- package/.pi/harnesses/agent-hub/artifacts.js +92 -0
- package/.pi/harnesses/agent-hub/backend-policy.js +153 -0
- package/.pi/harnesses/agent-hub/delegate.ts +363 -0
- package/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.pi/harnesses/agent-hub/helpers.ts +165 -0
- package/.pi/harnesses/agent-hub/index.ts +7098 -0
- package/.pi/harnesses/agent-hub/package.json +6 -0
- package/.pi/harnesses/agent-hub/return-contract.js +215 -0
- package/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.pi/harnesses/agent-hub/spawn.ts +179 -0
- package/.pi/harnesses/ask-user-remote/README.md +10 -0
- package/.pi/harnesses/ask-user-remote/index.ts +253 -0
- package/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.pi/harnesses/coms/README.md +71 -0
- package/.pi/harnesses/coms/index.ts +1743 -0
- package/.pi/harnesses/coms/package.json +6 -0
- package/.pi/harnesses/damage-control/README.md +65 -0
- package/.pi/harnesses/damage-control/index.ts +250 -0
- package/.pi/harnesses/damage-control/package.json +6 -0
- package/.pi/harnesses/damage-control/shared.ts +183 -0
- package/.pi/harnesses/damage-control-continue/README.md +116 -0
- package/.pi/harnesses/damage-control-continue/index.ts +522 -0
- package/.pi/harnesses/damage-control-continue/package.json +6 -0
- package/.pi/harnesses/lib/herdr-client.ts +458 -0
- package/.pi/harnesses/lib/herdr-presence.ts +288 -0
- package/.pi/harnesses/package-lock.json +35 -0
- package/.pi/harnesses/package.json +9 -0
- package/.pi/prompts/build.md +24 -0
- package/.pi/prompts/code-simplify.md +22 -0
- package/.pi/prompts/doctor-agent-fleet.md +15 -0
- package/.pi/prompts/plan.md +16 -0
- package/.pi/prompts/review.md +16 -0
- package/.pi/prompts/setup-agent-fleet.md +27 -0
- package/.pi/prompts/ship.md +17 -0
- package/.pi/prompts/spec.md +15 -0
- package/.pi/prompts/test.md +19 -0
- package/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/0.0.1/.claude/commands/build.md +44 -0
- package/.versions/0.0.1/.claude/commands/code-simplify.md +22 -0
- package/.versions/0.0.1/.claude/commands/design-agent.md +14 -0
- package/.versions/0.0.1/.claude/commands/doctor-agent-fleet.md +17 -0
- package/.versions/0.0.1/.claude/commands/orchestrate.md +112 -0
- package/.versions/0.0.1/.claude/commands/plan.md +16 -0
- package/.versions/0.0.1/.claude/commands/prime.md +22 -0
- package/.versions/0.0.1/.claude/commands/review.md +16 -0
- package/.versions/0.0.1/.claude/commands/setup-agent-fleet.md +25 -0
- package/.versions/0.0.1/.claude/commands/ship.md +72 -0
- package/.versions/0.0.1/.claude/commands/spec.md +15 -0
- package/.versions/0.0.1/.claude/commands/test.md +19 -0
- package/.versions/0.0.1/.claude/commands/webperf.md +32 -0
- package/.versions/0.0.1/.claude/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.1/.opencode/commands/af-build.md +17 -0
- package/.versions/0.0.1/.opencode/commands/af-code-simplify.md +16 -0
- package/.versions/0.0.1/.opencode/commands/af-compound.md +16 -0
- package/.versions/0.0.1/.opencode/commands/af-design-agent.md +15 -0
- package/.versions/0.0.1/.opencode/commands/af-doctor-agent-fleet.md +15 -0
- package/.versions/0.0.1/.opencode/commands/af-orchestrate.md +112 -0
- package/.versions/0.0.1/.opencode/commands/af-plan.md +16 -0
- package/.versions/0.0.1/.opencode/commands/af-prime.md +22 -0
- package/.versions/0.0.1/.opencode/commands/af-review.md +15 -0
- package/.versions/0.0.1/.opencode/commands/af-setup-agent-fleet.md +15 -0
- package/.versions/0.0.1/.opencode/commands/af-ship.md +16 -0
- package/.versions/0.0.1/.opencode/commands/af-spec.md +16 -0
- package/.versions/0.0.1/.opencode/commands/af-test.md +21 -0
- package/.versions/0.0.1/.opencode/commands/af-webperf.md +32 -0
- package/.versions/0.0.1/.opencode/orchestrate-teams.yaml +24 -0
- package/.versions/0.0.1/.pi/agents/dispatch-policy.yaml +32 -0
- package/.versions/0.0.1/.pi/agents/model-profiles.yaml +20 -0
- package/.versions/0.0.1/.pi/agents/peers.yaml +142 -0
- package/.versions/0.0.1/.pi/agents/teams.yaml +39 -0
- package/.versions/0.0.1/.pi/damage-control-rules.yaml +297 -0
- package/.versions/0.0.1/.pi/extensions/agent-fleet-update-check/README.md +58 -0
- package/.versions/0.0.1/.pi/extensions/agent-fleet-update-check/index.ts +161 -0
- package/.versions/0.0.1/.pi/extensions/agent-fleet-update-check/package.json +6 -0
- package/.versions/0.0.1/.pi/extensions/btw/README.md +118 -0
- package/.versions/0.0.1/.pi/extensions/btw/index.ts +917 -0
- package/.versions/0.0.1/.pi/extensions/btw/package.json +6 -0
- package/.versions/0.0.1/.pi/extensions/btw/state.js +179 -0
- package/.versions/0.0.1/.pi/extensions/chrome-devtools-mcp/README.md +58 -0
- package/.versions/0.0.1/.pi/extensions/chrome-devtools-mcp/index.ts +92 -0
- package/.versions/0.0.1/.pi/extensions/chrome-devtools-mcp/package.json +6 -0
- package/.versions/0.0.1/.pi/extensions/compact-and-continue/README.md +42 -0
- package/.versions/0.0.1/.pi/extensions/compact-and-continue/index.ts +120 -0
- package/.versions/0.0.1/.pi/extensions/compact-and-continue/package.json +6 -0
- package/.versions/0.0.1/.pi/extensions/mcp-bridge/README.md +46 -0
- package/.versions/0.0.1/.pi/extensions/mcp-bridge/index.ts +206 -0
- package/.versions/0.0.1/.pi/extensions/mcp-bridge/package.json +6 -0
- package/.versions/0.0.1/.pi/extensions/package-lock.json +1143 -0
- package/.versions/0.0.1/.pi/extensions/package.json +9 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/README.md +201 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/config.ts +198 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/examples/stt.json +35 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/index.ts +248 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/package.json +6 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/providers.ts +214 -0
- package/.versions/0.0.1/.pi/extensions/pi-voice-stt/recorder.ts +158 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/README.md +562 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/artifacts.js +92 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/backend-policy.js +153 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/delegate.ts +363 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/evidence-rules.js +96 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/helpers.ts +165 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/index.ts +7098 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/package.json +6 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/return-contract.js +215 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/scope-gate.js +103 -0
- package/.versions/0.0.1/.pi/harnesses/agent-hub/spawn.ts +179 -0
- package/.versions/0.0.1/.pi/harnesses/ask-user-remote/README.md +10 -0
- package/.versions/0.0.1/.pi/harnesses/ask-user-remote/index.ts +253 -0
- package/.versions/0.0.1/.pi/harnesses/ask-user-remote/race-core.js +106 -0
- package/.versions/0.0.1/.pi/harnesses/coms/README.md +71 -0
- package/.versions/0.0.1/.pi/harnesses/coms/index.ts +1743 -0
- package/.versions/0.0.1/.pi/harnesses/coms/package.json +6 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control/README.md +65 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control/index.ts +250 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control/package.json +6 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control/shared.ts +183 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control-continue/README.md +116 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control-continue/index.ts +522 -0
- package/.versions/0.0.1/.pi/harnesses/damage-control-continue/package.json +6 -0
- package/.versions/0.0.1/.pi/harnesses/lib/herdr-client.ts +458 -0
- package/.versions/0.0.1/.pi/harnesses/lib/herdr-presence.ts +288 -0
- package/.versions/0.0.1/.pi/harnesses/package-lock.json +35 -0
- package/.versions/0.0.1/.pi/harnesses/package.json +9 -0
- package/.versions/0.0.1/.pi/prompts/build.md +24 -0
- package/.versions/0.0.1/.pi/prompts/code-simplify.md +22 -0
- package/.versions/0.0.1/.pi/prompts/doctor-agent-fleet.md +15 -0
- package/.versions/0.0.1/.pi/prompts/plan.md +16 -0
- package/.versions/0.0.1/.pi/prompts/review.md +16 -0
- package/.versions/0.0.1/.pi/prompts/setup-agent-fleet.md +27 -0
- package/.versions/0.0.1/.pi/prompts/ship.md +17 -0
- package/.versions/0.0.1/.pi/prompts/spec.md +15 -0
- package/.versions/0.0.1/.pi/prompts/test.md +19 -0
- package/.versions/0.0.1/.pi/skills/bowser/SKILL.md +145 -0
- package/.versions/0.0.1/.version +1 -0
- package/.versions/0.0.1/agents/architect.md +21 -0
- package/.versions/0.0.1/agents/bowser.md +25 -0
- package/.versions/0.0.1/agents/builder.md +52 -0
- package/.versions/0.0.1/agents/code-reviewer.md +205 -0
- package/.versions/0.0.1/agents/deep-researcher.md +31 -0
- package/.versions/0.0.1/agents/documenter.md +16 -0
- package/.versions/0.0.1/agents/orchestrator.md +43 -0
- package/.versions/0.0.1/agents/plan-reviewer.md +60 -0
- package/.versions/0.0.1/agents/planner.md +69 -0
- package/.versions/0.0.1/agents/releaser.md +22 -0
- package/.versions/0.0.1/agents/researcher.md +28 -0
- package/.versions/0.0.1/agents/security-auditor.md +166 -0
- package/.versions/0.0.1/agents/test-engineer.md +144 -0
- package/.versions/0.0.1/agents/web-debugger.md +42 -0
- package/.versions/0.0.1/agents/web-performance-auditor.md +192 -0
- package/.versions/0.0.1/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/.versions/0.0.1/hooks/coms-stop-hook.mjs +73 -0
- package/.versions/0.0.1/hooks/hooks.json +14 -0
- package/.versions/0.0.1/hooks/session-start.sh +74 -0
- package/.versions/0.0.1/hooks/simplify-ignore.sh +302 -0
- package/.versions/0.0.1/justfile +143 -0
- package/.versions/0.0.1/references/accessibility-checklist.md +160 -0
- package/.versions/0.0.1/references/definition-of-done.md +67 -0
- package/.versions/0.0.1/references/fleet-coordination-patterns.md +151 -0
- package/.versions/0.0.1/references/observability-checklist.md +91 -0
- package/.versions/0.0.1/references/orchestration-patterns.md +370 -0
- package/.versions/0.0.1/references/performance-checklist.md +153 -0
- package/.versions/0.0.1/references/prompting-patterns.md +380 -0
- package/.versions/0.0.1/references/security-checklist.md +179 -0
- package/.versions/0.0.1/references/testing-patterns.md +236 -0
- package/.versions/0.0.1/scripts/coms-claude-bridge.ts +286 -0
- package/.versions/0.0.1/scripts/coms-cli.ts +372 -0
- package/.versions/0.0.1/scripts/coms-hermes-bridge.ts +399 -0
- package/.versions/0.0.1/scripts/lib/claude-bridge-core.ts +100 -0
- package/.versions/0.0.1/scripts/lib/coms-envelope.ts +494 -0
- package/.versions/0.0.1/scripts/lib/herdr-layout.ts +235 -0
- package/.versions/0.0.1/scripts/lib/hermes-bridge-core.ts +238 -0
- package/.versions/0.0.1/scripts/lib/persona-banner.ts +62 -0
- package/.versions/0.0.1/scripts/lib/team-project.ts +75 -0
- package/.versions/0.0.1/scripts/lib/team-snapshot.ts +146 -0
- package/.versions/0.0.1/scripts/peer-banner.ts +40 -0
- package/.versions/0.0.1/scripts/team-snapshot.ts +221 -0
- package/.versions/0.0.1/scripts/team-up.ts +245 -0
- package/.versions/0.0.1/skills/_internal/grilling.md +11 -0
- package/.versions/0.0.1/skills/browser-testing-with-devtools/SKILL.md +352 -0
- package/.versions/0.0.1/skills/code-review-and-quality/SKILL.md +381 -0
- package/.versions/0.0.1/skills/compound-learning/SKILL.md +137 -0
- package/.versions/0.0.1/skills/context-engineering/SKILL.md +291 -0
- package/.versions/0.0.1/skills/deprecation-and-migration/SKILL.md +206 -0
- package/.versions/0.0.1/skills/designing-agents/SKILL.md +394 -0
- package/.versions/0.0.1/skills/designing-agents/pi-harness-authoring.md +209 -0
- package/.versions/0.0.1/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.1/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/.versions/0.0.1/skills/guided-workspace-setup/SKILL.md +506 -0
- package/.versions/0.0.1/skills/idea-refine/SKILL.md +182 -0
- package/.versions/0.0.1/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.1/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.1/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.1/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.1/skills/incremental-implementation/SKILL.md +287 -0
- package/.versions/0.0.1/skills/interview-me/SKILL.md +226 -0
- package/.versions/0.0.1/skills/orchestration-verification/SKILL.md +181 -0
- package/.versions/0.0.1/skills/peer-coms/SKILL.md +81 -0
- package/.versions/0.0.1/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.1/skills/planning-and-task-breakdown/SKILL.md +236 -0
- package/.versions/0.0.1/skills/security-and-hardening/SKILL.md +461 -0
- package/.versions/0.0.1/skills/spec-driven-development/SKILL.md +245 -0
- package/.versions/0.0.1/skills/using-agent-skills/SKILL.md +199 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/LICENSE +21 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/README.md +11 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/.versions/0.0.1/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
- package/CHANGELOG.md +65 -0
- package/LICENSE +21 -0
- package/README.md +458 -0
- package/agents/architect.md +21 -0
- package/agents/bowser.md +25 -0
- package/agents/builder.md +52 -0
- package/agents/code-reviewer.md +205 -0
- package/agents/deep-researcher.md +31 -0
- package/agents/documenter.md +16 -0
- package/agents/orchestrator.md +43 -0
- package/agents/plan-reviewer.md +60 -0
- package/agents/planner.md +69 -0
- package/agents/releaser.md +22 -0
- package/agents/researcher.md +28 -0
- package/agents/security-auditor.md +166 -0
- package/agents/test-engineer.md +144 -0
- package/agents/web-debugger.md +42 -0
- package/agents/web-performance-auditor.md +192 -0
- package/bin/cli.js +633 -0
- package/bin/force-patch-changesets.js +44 -0
- package/bin/lib/bootstrap.js +323 -0
- package/bin/lib/detect-agent.js +49 -0
- package/bin/lib/doctor.js +302 -0
- package/bin/lib/transform-persona.js +180 -0
- package/bin/lib/update-notifier.js +195 -0
- package/bin/lib/validate-overrides.js +229 -0
- package/bin/snapshot-version.js +91 -0
- package/docs/agent-fleet-setup.md +355 -0
- package/docs/claude-code-coms-bridge.md +93 -0
- package/docs/getting-started.md +169 -0
- package/docs/npm-install.md +335 -0
- package/docs/opencode-setup.md +248 -0
- package/docs/pi-extensions.md +237 -0
- package/docs/pi-setup.md +455 -0
- package/docs/skill-anatomy.md +150 -0
- package/hooks/SIMPLIFY-IGNORE.md +90 -0
- package/hooks/coms-stop-hook.mjs +73 -0
- package/hooks/hooks.json +14 -0
- package/hooks/session-start.sh +74 -0
- package/hooks/simplify-ignore.sh +302 -0
- package/justfile +143 -0
- package/node_modules/pi-ask-user/LICENSE +21 -0
- package/node_modules/pi-ask-user/README.md +156 -0
- package/node_modules/pi-ask-user/index.ts +1795 -0
- package/node_modules/pi-ask-user/package.json +51 -0
- package/node_modules/pi-ask-user/single-select-layout.ts +203 -0
- package/node_modules/pi-ask-user/skills/ask-user/SKILL.md +162 -0
- package/node_modules/pi-ask-user/skills/ask-user/references/ask-user-skill-extension-spec.md +96 -0
- package/package.json +121 -0
- package/references/accessibility-checklist.md +160 -0
- package/references/definition-of-done.md +67 -0
- package/references/fleet-coordination-patterns.md +151 -0
- package/references/observability-checklist.md +91 -0
- package/references/orchestration-patterns.md +370 -0
- package/references/performance-checklist.md +153 -0
- package/references/prompting-patterns.md +380 -0
- package/references/security-checklist.md +179 -0
- package/references/testing-patterns.md +236 -0
- package/scripts/coms-claude-bridge.ts +286 -0
- package/scripts/coms-cli.ts +372 -0
- package/scripts/coms-hermes-bridge.ts +399 -0
- package/scripts/lib/claude-bridge-core.ts +100 -0
- package/scripts/lib/coms-envelope.ts +494 -0
- package/scripts/lib/herdr-layout.ts +235 -0
- package/scripts/lib/hermes-bridge-core.ts +238 -0
- package/scripts/lib/persona-banner.ts +62 -0
- package/scripts/lib/team-project.ts +75 -0
- package/scripts/lib/team-snapshot.ts +146 -0
- package/scripts/peer-banner.ts +40 -0
- package/scripts/team-snapshot.ts +221 -0
- package/scripts/team-up.ts +245 -0
- package/skills/_internal/grilling.md +11 -0
- package/skills/browser-testing-with-devtools/SKILL.md +352 -0
- package/skills/code-review-and-quality/SKILL.md +381 -0
- package/skills/compound-learning/SKILL.md +137 -0
- package/skills/context-engineering/SKILL.md +291 -0
- package/skills/deprecation-and-migration/SKILL.md +206 -0
- package/skills/designing-agents/SKILL.md +394 -0
- package/skills/designing-agents/pi-harness-authoring.md +209 -0
- package/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/skills/git-workflow-and-versioning/SKILL.md +316 -0
- package/skills/guided-workspace-setup/SKILL.md +506 -0
- package/skills/idea-refine/SKILL.md +182 -0
- package/skills/idea-refine/examples.md +238 -0
- package/skills/idea-refine/frameworks.md +99 -0
- package/skills/idea-refine/refinement-criteria.md +113 -0
- package/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/skills/incremental-implementation/SKILL.md +287 -0
- package/skills/interview-me/SKILL.md +226 -0
- package/skills/orchestration-verification/SKILL.md +181 -0
- package/skills/peer-coms/SKILL.md +81 -0
- package/skills/performance-optimization/SKILL.md +350 -0
- package/skills/planning-and-task-breakdown/SKILL.md +236 -0
- package/skills/security-and-hardening/SKILL.md +461 -0
- package/skills/spec-driven-development/SKILL.md +245 -0
- package/skills/using-agent-skills/SKILL.md +199 -0
- package/vendor/agent-skills-upstream/LICENSE +21 -0
- package/vendor/agent-skills-upstream/README.md +11 -0
- package/vendor/agent-skills-upstream/skills/api-and-interface-design/SKILL.md +294 -0
- package/vendor/agent-skills-upstream/skills/browser-testing-with-devtools/SKILL.md +317 -0
- package/vendor/agent-skills-upstream/skills/ci-cd-and-automation/SKILL.md +390 -0
- package/vendor/agent-skills-upstream/skills/code-review-and-quality/SKILL.md +396 -0
- package/vendor/agent-skills-upstream/skills/code-simplification/SKILL.md +331 -0
- package/vendor/agent-skills-upstream/skills/context-engineering/SKILL.md +289 -0
- package/vendor/agent-skills-upstream/skills/debugging-and-error-recovery/SKILL.md +300 -0
- package/vendor/agent-skills-upstream/skills/deprecation-and-migration/SKILL.md +247 -0
- package/vendor/agent-skills-upstream/skills/documentation-and-adrs/SKILL.md +278 -0
- package/vendor/agent-skills-upstream/skills/doubt-driven-development/SKILL.md +243 -0
- package/vendor/agent-skills-upstream/skills/frontend-ui-engineering/SKILL.md +328 -0
- package/vendor/agent-skills-upstream/skills/git-workflow-and-versioning/SKILL.md +355 -0
- package/vendor/agent-skills-upstream/skills/idea-refine/SKILL.md +178 -0
- package/vendor/agent-skills-upstream/skills/idea-refine/examples.md +238 -0
- package/vendor/agent-skills-upstream/skills/idea-refine/frameworks.md +99 -0
- package/vendor/agent-skills-upstream/skills/idea-refine/refinement-criteria.md +113 -0
- package/vendor/agent-skills-upstream/skills/idea-refine/scripts/idea-refine.sh +15 -0
- package/vendor/agent-skills-upstream/skills/incremental-implementation/SKILL.md +249 -0
- package/vendor/agent-skills-upstream/skills/interview-me/SKILL.md +225 -0
- package/vendor/agent-skills-upstream/skills/observability-and-instrumentation/SKILL.md +203 -0
- package/vendor/agent-skills-upstream/skills/performance-optimization/SKILL.md +350 -0
- package/vendor/agent-skills-upstream/skills/planning-and-task-breakdown/SKILL.md +234 -0
- package/vendor/agent-skills-upstream/skills/security-and-hardening/SKILL.md +467 -0
- package/vendor/agent-skills-upstream/skills/shipping-and-launch/SKILL.md +310 -0
- package/vendor/agent-skills-upstream/skills/source-driven-development/SKILL.md +194 -0
- package/vendor/agent-skills-upstream/skills/spec-driven-development/SKILL.md +206 -0
- package/vendor/agent-skills-upstream/skills/test-driven-development/SKILL.md +383 -0
- package/vendor/agent-skills-upstream/skills/using-agent-skills/SKILL.md +191 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// scripts/lib/team-snapshot.ts
|
|
2
|
+
//
|
|
3
|
+
// Pure logic for fleet resume (B5): snapshot a running team (peer manifest +
|
|
4
|
+
// per-peer session resume refs harvested from herdr) and rebuild it later.
|
|
5
|
+
// See docs/plans/herdr/b5-resume-notes.md for the decisions: pane exit closes
|
|
6
|
+
// the pane (nothing to re-attach), layout.export cannot target an unfocused
|
|
7
|
+
// workspace, so snapshots store peers + refs and the grid is regenerated with
|
|
8
|
+
// the same builder team-up uses.
|
|
9
|
+
//
|
|
10
|
+
// No sockets, no fs, no process.exit here — the wiring lives in
|
|
11
|
+
// scripts/team-snapshot.ts.
|
|
12
|
+
|
|
13
|
+
import type { Peer } from "./herdr-layout.ts";
|
|
14
|
+
import { DEFAULT_PROJECT, teamWorkspaceLabel, validateProject, validateTeamName } from "./team-project.ts";
|
|
15
|
+
|
|
16
|
+
// Shape of herdr's agent_session (agent.list): pi panes carry
|
|
17
|
+
// {kind:"path", value:<session .jsonl>}, claude panes {kind:"id", value:<uuid>}.
|
|
18
|
+
export interface ResumeRef {
|
|
19
|
+
kind: string;
|
|
20
|
+
value: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PeerSnapshot extends Peer {
|
|
24
|
+
resume: ResumeRef | null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface TeamSnapshot {
|
|
28
|
+
version: 1;
|
|
29
|
+
team: string;
|
|
30
|
+
project: string;
|
|
31
|
+
hub: boolean;
|
|
32
|
+
workspace_label: string;
|
|
33
|
+
taken_at: string;
|
|
34
|
+
peers: PeerSnapshot[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Minimal shapes of the herdr responses the builder joins over.
|
|
38
|
+
export interface PaneLite {
|
|
39
|
+
pane_id: string;
|
|
40
|
+
label?: string;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
export interface AgentLite {
|
|
44
|
+
pane_id?: string;
|
|
45
|
+
agent?: string;
|
|
46
|
+
agent_session?: { kind?: string; value?: string };
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Join: peers.yaml manifest × pane labels (pane label = peer name, set by the
|
|
51
|
+
// layout) × agent sessions (keyed by pane_id). A peer whose pane or session
|
|
52
|
+
// is missing snapshots with resume: null — it will start fresh on resume.
|
|
53
|
+
export function buildSnapshot(opts: {
|
|
54
|
+
team: string;
|
|
55
|
+
hub: boolean;
|
|
56
|
+
peers: Peer[];
|
|
57
|
+
panes: PaneLite[];
|
|
58
|
+
agents: AgentLite[];
|
|
59
|
+
now?: Date;
|
|
60
|
+
project?: string;
|
|
61
|
+
}): TeamSnapshot {
|
|
62
|
+
const { team, hub, peers, panes, agents, project = DEFAULT_PROJECT } = opts;
|
|
63
|
+
validateTeamName(team);
|
|
64
|
+
validateProject(project);
|
|
65
|
+
const paneByLabel = new Map<string, string>();
|
|
66
|
+
for (const p of panes) {
|
|
67
|
+
if (p.label) paneByLabel.set(p.label, p.pane_id);
|
|
68
|
+
}
|
|
69
|
+
const sessionByPane = new Map<string, ResumeRef>();
|
|
70
|
+
for (const a of agents) {
|
|
71
|
+
const s = a.agent_session;
|
|
72
|
+
if (a.pane_id && s && typeof s.kind === "string" && typeof s.value === "string") {
|
|
73
|
+
sessionByPane.set(a.pane_id, { kind: s.kind, value: s.value });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
version: 1,
|
|
78
|
+
team,
|
|
79
|
+
project,
|
|
80
|
+
hub,
|
|
81
|
+
workspace_label: teamWorkspaceLabel(hub ? "hub" : "peers", team, project),
|
|
82
|
+
taken_at: (opts.now ?? new Date()).toISOString(),
|
|
83
|
+
peers: peers.map((peer) => {
|
|
84
|
+
const paneId = peer.name ? paneByLabel.get(peer.name) : undefined;
|
|
85
|
+
const resume = paneId ? sessionByPane.get(paneId) ?? null : null;
|
|
86
|
+
return { ...peer, resume };
|
|
87
|
+
}),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// The resume ref usable by this peer's launch recipe, or undefined to start
|
|
92
|
+
// fresh. `refUsable` is injected (fs check for pi paths); refs of kinds the
|
|
93
|
+
// recipes cannot consume yet (e.g. claude ids before the Phase-4 runner
|
|
94
|
+
// lands) resolve undefined with a reason via `onSkip`.
|
|
95
|
+
export function resumeRefForPeer(
|
|
96
|
+
peer: PeerSnapshot,
|
|
97
|
+
refUsable: (ref: ResumeRef) => boolean,
|
|
98
|
+
onSkip?: (peer: PeerSnapshot, reason: string) => void,
|
|
99
|
+
): string | undefined {
|
|
100
|
+
if (!peer.resume) {
|
|
101
|
+
onSkip?.(peer, "no session ref in snapshot — starting fresh");
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
// pi peers resume by session file path; claude-code peers by session id
|
|
105
|
+
// (herdr reports {kind:"id"} for claude — `claude --resume <id>`).
|
|
106
|
+
const wantKind = peer.runner === "claude-code" ? "id" : "path";
|
|
107
|
+
if (peer.resume.kind !== wantKind) {
|
|
108
|
+
onSkip?.(peer, `unsupported resume kind "${peer.resume.kind}" — starting fresh`);
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
if (!refUsable(peer.resume)) {
|
|
112
|
+
onSkip?.(peer, `session file gone (${peer.resume.value}) — starting fresh`);
|
|
113
|
+
return undefined;
|
|
114
|
+
}
|
|
115
|
+
return peer.resume.value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function parseSnapshot(raw: string): TeamSnapshot {
|
|
119
|
+
let parsed: unknown;
|
|
120
|
+
try {
|
|
121
|
+
parsed = JSON.parse(raw);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
throw new Error(`Snapshot is not valid JSON: ${err instanceof Error ? err.message : String(err)}`);
|
|
124
|
+
}
|
|
125
|
+
const s = parsed as TeamSnapshot;
|
|
126
|
+
if (!s || s.version !== 1 || typeof s.team !== "string" || !Array.isArray(s.peers)) {
|
|
127
|
+
throw new Error("Snapshot has an unexpected shape (want {version:1, team, peers[]}).");
|
|
128
|
+
}
|
|
129
|
+
validateTeamName(s.team);
|
|
130
|
+
if (!("project" in (s as Record<string, unknown>))) {
|
|
131
|
+
(s as { project: string }).project = DEFAULT_PROJECT;
|
|
132
|
+
} else if (typeof (s as { project?: unknown }).project !== "string") {
|
|
133
|
+
throw new Error("Snapshot has an unexpected shape (project must be a string when present).");
|
|
134
|
+
}
|
|
135
|
+
validateProject(s.project);
|
|
136
|
+
return s;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function assertSnapshotProject(snap: TeamSnapshot, requestedProject: string): void {
|
|
140
|
+
validateProject(requestedProject);
|
|
141
|
+
if (snap.project !== requestedProject) {
|
|
142
|
+
throw new Error(
|
|
143
|
+
`Snapshot project mismatch: snapshot is ${JSON.stringify(snap.project)}, requested ${JSON.stringify(requestedProject)}.`,
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// scripts/peer-banner.ts
|
|
2
|
+
//
|
|
3
|
+
// Print a colored identity banner for a peer pane. Called by the hidden
|
|
4
|
+
// `just _peer`/`_peer-plus` recipes right before exec'ing pi, so every pane
|
|
5
|
+
// announces who lives in it. Never fails the recipe: any problem (missing
|
|
6
|
+
// persona, unreadable file) degrades to a plain banner and exit 0.
|
|
7
|
+
//
|
|
8
|
+
// usage: peer-banner.ts <persona> [<name>]
|
|
9
|
+
|
|
10
|
+
import * as fs from "node:fs";
|
|
11
|
+
import * as path from "node:path";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
|
|
14
|
+
import { parsePersonaFrontmatter, renderBanner } from "./lib/persona-banner.ts";
|
|
15
|
+
|
|
16
|
+
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
const REPO_ROOT = path.resolve(SCRIPT_DIR, "..");
|
|
18
|
+
|
|
19
|
+
function main(): void {
|
|
20
|
+
const [persona, nameArg] = process.argv.slice(2);
|
|
21
|
+
if (!persona) return;
|
|
22
|
+
const name = nameArg || persona;
|
|
23
|
+
|
|
24
|
+
let meta = {};
|
|
25
|
+
for (const dir of ["agents", path.join(".pi", "agents")]) {
|
|
26
|
+
const p = path.join(REPO_ROOT, dir, `${persona}.md`);
|
|
27
|
+
try {
|
|
28
|
+
meta = parsePersonaFrontmatter(fs.readFileSync(p, "utf-8"));
|
|
29
|
+
break;
|
|
30
|
+
} catch {
|
|
31
|
+
// try the next location; fall through to a plain banner
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const width = process.stdout.columns ? Math.min(process.stdout.columns, 100) : 60;
|
|
36
|
+
for (const line of renderBanner(name, meta, width)) console.log(line);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const isEntry = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
40
|
+
if (isEntry) main();
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
// scripts/team-snapshot.ts
|
|
2
|
+
//
|
|
3
|
+
// Fleet resume (B5): snapshot / tear down / rebuild a running peer team.
|
|
4
|
+
// Backs the `just team-snapshot`, `just team-down`, `just team-resume`
|
|
5
|
+
// recipes. herdr is a hard dependency (requireHerdr refuses readably).
|
|
6
|
+
//
|
|
7
|
+
// snapshot <team> — capture peers + per-peer session refs to
|
|
8
|
+
// ~/.pi/team-snapshots/<team>.json (team keeps running)
|
|
9
|
+
// down <team> — snapshot, then workspace.close (peers get SIGTERM →
|
|
10
|
+
// coms clean shutdown removes their registry entries)
|
|
11
|
+
// resume <team> — rebuild the workspace from the snapshot; every pi peer
|
|
12
|
+
// relaunches with `--session <ref>` and continues its
|
|
13
|
+
// conversation; peers whose ref is gone start fresh with
|
|
14
|
+
// a warning
|
|
15
|
+
//
|
|
16
|
+
// Snapshots live OUTSIDE the repo (~/.pi/team-snapshots/) because
|
|
17
|
+
// .pi/agent-sessions/ is wiped at hub session start. Pure logic in
|
|
18
|
+
// scripts/lib/team-snapshot.ts; entrypoint-guarded like team-up.
|
|
19
|
+
|
|
20
|
+
import * as fs from "node:fs";
|
|
21
|
+
import * as os from "node:os";
|
|
22
|
+
import * as path from "node:path";
|
|
23
|
+
import { fileURLToPath } from "node:url";
|
|
24
|
+
|
|
25
|
+
import { buildTeamLayout, parsePeersYaml, type Peer } from "./lib/herdr-layout.ts";
|
|
26
|
+
import { DEFAULT_PROJECT, hubCommand, parseProjectFlag, teamSnapshotPath, teamWorkspaceLabel, validateTeamName } from "./lib/team-project.ts";
|
|
27
|
+
import {
|
|
28
|
+
assertSnapshotProject,
|
|
29
|
+
buildSnapshot,
|
|
30
|
+
parseSnapshot,
|
|
31
|
+
resumeRefForPeer,
|
|
32
|
+
type PeerSnapshot,
|
|
33
|
+
type TeamSnapshot,
|
|
34
|
+
} from "./lib/team-snapshot.ts";
|
|
35
|
+
|
|
36
|
+
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
37
|
+
const REPO_ROOT = path.resolve(SCRIPT_DIR, "..");
|
|
38
|
+
const PEERS_YAML = path.join(REPO_ROOT, ".pi", "agents", "peers.yaml");
|
|
39
|
+
const SNAPSHOT_DIR = path.join(os.homedir(), ".pi", "team-snapshots");
|
|
40
|
+
|
|
41
|
+
function die(msg: string): never {
|
|
42
|
+
console.error(msg);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function snapshotPath(team: string, project = DEFAULT_PROJECT): string {
|
|
47
|
+
try {
|
|
48
|
+
return teamSnapshotPath(SNAPSHOT_DIR, team, project);
|
|
49
|
+
} catch (err) {
|
|
50
|
+
die(err instanceof Error ? err.message : String(err));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function requireClient() {
|
|
55
|
+
const client = await import("../.pi/harnesses/lib/herdr-client.ts");
|
|
56
|
+
try {
|
|
57
|
+
await client.requireHerdr();
|
|
58
|
+
} catch (err) {
|
|
59
|
+
if (err instanceof client.HerdrUnavailableError) die(err.message);
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
return client;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
type Client = Awaited<ReturnType<typeof requireClient>>;
|
|
66
|
+
|
|
67
|
+
async function findTeamWorkspace(client: Client, team: string, project = DEFAULT_PROJECT) {
|
|
68
|
+
let peersLabel: string;
|
|
69
|
+
let hubLabel: string;
|
|
70
|
+
try {
|
|
71
|
+
peersLabel = teamWorkspaceLabel("peers", team, project);
|
|
72
|
+
hubLabel = teamWorkspaceLabel("hub", team, project);
|
|
73
|
+
} catch (err) {
|
|
74
|
+
die(err instanceof Error ? err.message : String(err));
|
|
75
|
+
}
|
|
76
|
+
const { workspaces } = await client.herdr.workspaceList();
|
|
77
|
+
return workspaces.find((w) => w.label === peersLabel) ?? workspaces.find((w) => w.label === hubLabel) ?? null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function captureSnapshot(client: Client, team: string, project = DEFAULT_PROJECT): Promise<TeamSnapshot> {
|
|
81
|
+
const peersLabel = teamWorkspaceLabel("peers", team, project);
|
|
82
|
+
const hubLabel = teamWorkspaceLabel("hub", team, project);
|
|
83
|
+
const ws = await findTeamWorkspace(client, team, project);
|
|
84
|
+
if (!ws) {
|
|
85
|
+
const projectArgs = project === DEFAULT_PROJECT ? "" : ` --project ${project}`;
|
|
86
|
+
die(
|
|
87
|
+
`No running workspace "${peersLabel}" or "${hubLabel}" found.\n` +
|
|
88
|
+
`Start one with: just team-up ${team}${projectArgs} (or just hub-team ${team}${projectArgs})`,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
if (!fs.existsSync(PEERS_YAML)) die(`peers.yaml not found at ${PEERS_YAML}`);
|
|
92
|
+
const teams = parsePeersYaml(fs.readFileSync(PEERS_YAML, "utf-8"));
|
|
93
|
+
const peers = teams[team];
|
|
94
|
+
if (!peers || peers.length === 0) die(`Team "${team}" not found in peers.yaml.`);
|
|
95
|
+
|
|
96
|
+
const { panes } = await client.herdr.paneList({ workspace_id: ws.workspace_id });
|
|
97
|
+
const { agents } = await client.herdr.agentList();
|
|
98
|
+
const inWorkspace = agents.filter((a) => (a as { workspace_id?: string }).workspace_id === ws.workspace_id);
|
|
99
|
+
|
|
100
|
+
const snap = buildSnapshot({
|
|
101
|
+
team,
|
|
102
|
+
project,
|
|
103
|
+
hub: ws.label === hubLabel,
|
|
104
|
+
peers,
|
|
105
|
+
panes,
|
|
106
|
+
agents: inWorkspace as Parameters<typeof buildSnapshot>[0]["agents"],
|
|
107
|
+
});
|
|
108
|
+
const file = snapshotPath(team, project);
|
|
109
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
110
|
+
fs.writeFileSync(file, JSON.stringify(snap, null, 2) + "\n");
|
|
111
|
+
const withRef = snap.peers.filter((p) => p.resume).length;
|
|
112
|
+
console.log(`Snapshot: ${file} — ${snap.peers.length} peer(s), ${withRef} with a session ref.`);
|
|
113
|
+
return snap;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function cmdSnapshot(team: string, project = DEFAULT_PROJECT): Promise<void> {
|
|
117
|
+
const client = await requireClient();
|
|
118
|
+
await captureSnapshot(client, team, project);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
async function cmdDown(team: string, project = DEFAULT_PROJECT): Promise<void> {
|
|
122
|
+
const client = await requireClient();
|
|
123
|
+
await captureSnapshot(client, team, project);
|
|
124
|
+
const ws = await findTeamWorkspace(client, team, project);
|
|
125
|
+
if (ws) {
|
|
126
|
+
await client.herdr.workspaceClose(ws.workspace_id);
|
|
127
|
+
const projectArgs = project === DEFAULT_PROJECT ? "" : ` --project ${project}`;
|
|
128
|
+
console.log(`Closed workspace ${ws.workspace_id} ("${ws.label}"). Resume with: just team-resume ${team}${projectArgs}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function cmdResume(team: string, project = DEFAULT_PROJECT): Promise<void> {
|
|
133
|
+
const file = snapshotPath(team, project);
|
|
134
|
+
if (!fs.existsSync(file)) {
|
|
135
|
+
const projectArgs = project === DEFAULT_PROJECT ? "" : ` --project ${project}`;
|
|
136
|
+
die(`No snapshot at ${file}.\nTake one while the team runs: just team-snapshot ${team}${projectArgs} (or just team-down ${team}${projectArgs}).`);
|
|
137
|
+
}
|
|
138
|
+
const snap = parseSnapshot(fs.readFileSync(file, "utf-8"));
|
|
139
|
+
try {
|
|
140
|
+
assertSnapshotProject(snap, project);
|
|
141
|
+
if (snap.team !== team) throw new Error(`Snapshot team mismatch: snapshot is ${JSON.stringify(snap.team)}, requested ${JSON.stringify(team)}.`);
|
|
142
|
+
} catch (err) {
|
|
143
|
+
die(err instanceof Error ? err.message : String(err));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const client = await requireClient();
|
|
147
|
+
const existing = await findTeamWorkspace(client, team, project);
|
|
148
|
+
if (existing) {
|
|
149
|
+
die(
|
|
150
|
+
`Workspace "${existing.label}" (${existing.workspace_id}) is already running.\n` +
|
|
151
|
+
` focus: herdr workspace focus ${existing.workspace_id}\n` +
|
|
152
|
+
` close: herdr workspace close ${existing.workspace_id}`,
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const resumedNames = new Set<string>();
|
|
157
|
+
const resumeFor = (peer: Peer): string | undefined => {
|
|
158
|
+
const ref = resumeRefForPeer(
|
|
159
|
+
peer as PeerSnapshot,
|
|
160
|
+
// path refs must still exist on disk; id refs (claude-code) cannot
|
|
161
|
+
// be pre-checked and are handed to `claude --resume` as-is
|
|
162
|
+
(r) => (r.kind === "id" ? true : fs.existsSync(r.value)),
|
|
163
|
+
(p, reason) => console.warn(` ⚠ ${p.name}: ${reason}`),
|
|
164
|
+
);
|
|
165
|
+
if (ref && peer.name) resumedNames.add(peer.name);
|
|
166
|
+
return ref;
|
|
167
|
+
};
|
|
168
|
+
const workspaceLabel = teamWorkspaceLabel(snap.hub ? "hub" : "peers", snap.team, project);
|
|
169
|
+
const layout = buildTeamLayout({
|
|
170
|
+
team: snap.team,
|
|
171
|
+
peers: snap.peers,
|
|
172
|
+
repoRoot: REPO_ROOT,
|
|
173
|
+
resumeForPeer: resumeFor,
|
|
174
|
+
project,
|
|
175
|
+
...(snap.hub ? { hub: { command: hubCommand(project), label: "hub", ratio: 0.4 } } : {}),
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const created = await client.herdr.workspaceCreate({
|
|
179
|
+
label: workspaceLabel,
|
|
180
|
+
cwd: REPO_ROOT,
|
|
181
|
+
focus: false,
|
|
182
|
+
});
|
|
183
|
+
const wsId = created.workspace.workspace_id;
|
|
184
|
+
const initialTab = created.workspace.active_tab_id ?? created.tab?.tab_id;
|
|
185
|
+
await client.herdr.layoutApply({ workspace_id: wsId, root: layout });
|
|
186
|
+
if (initialTab) {
|
|
187
|
+
try {
|
|
188
|
+
await client.herdr.tabClose(initialTab);
|
|
189
|
+
} catch {
|
|
190
|
+
// cosmetic
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
console.log(`Resumed team "${snap.team}" in workspace "${workspaceLabel}" (${wsId}):`);
|
|
194
|
+
for (const p of snap.peers) {
|
|
195
|
+
console.log(` • ${p.name}${p.name && resumedNames.has(p.name) ? " (session resumed)" : " (fresh)"}`);
|
|
196
|
+
}
|
|
197
|
+
console.log(`Focus: herdr workspace focus ${wsId}`);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function main(): Promise<void> {
|
|
201
|
+
const argv = process.argv.slice(2);
|
|
202
|
+
const [cmd, team] = argv;
|
|
203
|
+
if (!cmd || !team) {
|
|
204
|
+
console.error("usage: team-snapshot.ts <snapshot|down|resume> <team> [--project <name>]");
|
|
205
|
+
process.exit(2);
|
|
206
|
+
}
|
|
207
|
+
let project = DEFAULT_PROJECT;
|
|
208
|
+
try {
|
|
209
|
+
validateTeamName(team);
|
|
210
|
+
project = parseProjectFlag(argv.slice(2));
|
|
211
|
+
} catch (err) {
|
|
212
|
+
die(err instanceof Error ? err.message : String(err));
|
|
213
|
+
}
|
|
214
|
+
if (cmd === "snapshot") return cmdSnapshot(team, project);
|
|
215
|
+
if (cmd === "down") return cmdDown(team, project);
|
|
216
|
+
if (cmd === "resume") return cmdResume(team, project);
|
|
217
|
+
die(`Unknown command "${cmd}" (want snapshot | down | resume).`);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const isEntry = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
221
|
+
if (isEntry) void main();
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
// scripts/team-up.ts
|
|
2
|
+
//
|
|
3
|
+
// Spawn a team of reusable coms peers (from .pi/agents/peers.yaml) into a
|
|
4
|
+
// herdr workspace — one pane per peer in a tiled BSP layout, each running the
|
|
5
|
+
// hidden `just _peer …` helper. Backs the `just team-up <name>` and
|
|
6
|
+
// `just hub-team <name>` recipes (see the justfile). herdr is a hard
|
|
7
|
+
// dependency for fleet spawning: without a running server the recipes refuse
|
|
8
|
+
// with an actionable message.
|
|
9
|
+
//
|
|
10
|
+
// Hard rules:
|
|
11
|
+
// - Entrypoint guard: launching lives inside main(); importing the module must
|
|
12
|
+
// NOT spawn anything.
|
|
13
|
+
// - peers.yaml + the repo root are resolved relative to THIS file, so the script
|
|
14
|
+
// works regardless of the caller's cwd.
|
|
15
|
+
// - Manifest values are validated against a safe charset before being placed in
|
|
16
|
+
// a pane command (the file is user-edited) — reject anything else. The pure
|
|
17
|
+
// parsing/validation/layout logic lives in scripts/lib/herdr-layout.ts.
|
|
18
|
+
// - --dry-run prints the resolved layout JSON and exits WITHOUT touching herdr
|
|
19
|
+
// (must work with no herdr installed), so command construction is testable
|
|
20
|
+
// without launching pi. env_file VALUES never appear in dry-run output —
|
|
21
|
+
// only the path (secrets stay out of terminals and logs).
|
|
22
|
+
// - Never clobber an existing workspace of the same label; refuse and explain.
|
|
23
|
+
|
|
24
|
+
import * as fs from "node:fs";
|
|
25
|
+
import * as path from "node:path";
|
|
26
|
+
import { fileURLToPath } from "node:url";
|
|
27
|
+
|
|
28
|
+
import {
|
|
29
|
+
buildTeamLayout,
|
|
30
|
+
parseEnvFile,
|
|
31
|
+
parsePeersYaml,
|
|
32
|
+
resolveEnvFilePath,
|
|
33
|
+
type LayoutNode,
|
|
34
|
+
type Peer,
|
|
35
|
+
} from "./lib/herdr-layout.ts";
|
|
36
|
+
import { DEFAULT_PROJECT, conductorCommand, hubCommand, parseProjectFlag, teamWorkspaceLabel, validateTeamName } from "./lib/team-project.ts";
|
|
37
|
+
|
|
38
|
+
const SCRIPT_DIR = path.dirname(fileURLToPath(import.meta.url));
|
|
39
|
+
const REPO_ROOT = path.resolve(SCRIPT_DIR, "..");
|
|
40
|
+
const DEFAULT_PEERS_YAML = path.join(REPO_ROOT, ".pi", "agents", "peers.yaml");
|
|
41
|
+
|
|
42
|
+
// The guarded hub or Hermes conductor occupies this share of the workspace in
|
|
43
|
+
// --hub/--conductor mode; the team tiles in the rest.
|
|
44
|
+
const HUB_RATIO = 0.4;
|
|
45
|
+
const CONDUCTOR_RATIO = 0.35;
|
|
46
|
+
|
|
47
|
+
function flagValue(argv: string[], flag: string): string | null {
|
|
48
|
+
const i = argv.indexOf(flag);
|
|
49
|
+
if (i < 0) return null;
|
|
50
|
+
const value = argv[i + 1];
|
|
51
|
+
if (!value || value.startsWith("--")) throw new Error(`${flag} requires a value`);
|
|
52
|
+
return value;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function die(msg: string): never {
|
|
56
|
+
console.error(msg);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function loadTeam(team: string, peersYaml: string): Peer[] {
|
|
61
|
+
if (!fs.existsSync(peersYaml)) die(`peers.yaml not found at ${peersYaml}`);
|
|
62
|
+
const teams = parsePeersYaml(fs.readFileSync(peersYaml, "utf-8"));
|
|
63
|
+
const peers = teams[team];
|
|
64
|
+
if (!peers) {
|
|
65
|
+
const names = Object.keys(teams).join(", ") || "(none)";
|
|
66
|
+
die(`Unknown team "${team}". Available teams: ${names}`);
|
|
67
|
+
}
|
|
68
|
+
if (peers.length === 0) die(`Team "${team}" has no peers.`);
|
|
69
|
+
return peers;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// B3: resolve + validate every peer's env_file BEFORE any spawning, so a bad
|
|
73
|
+
// manifest refuses up front, never mid-boot. Returns a loader for the layout
|
|
74
|
+
// builder; when `redact` is set (dry-run) values are never read at all.
|
|
75
|
+
function makeEnvLoader(
|
|
76
|
+
peers: Peer[],
|
|
77
|
+
redact: boolean,
|
|
78
|
+
): (peer: Peer) => Record<string, string> | undefined {
|
|
79
|
+
const resolved = new Map<Peer, string>();
|
|
80
|
+
for (const p of peers) {
|
|
81
|
+
if (!p.env_file) continue;
|
|
82
|
+
let abs: string;
|
|
83
|
+
try {
|
|
84
|
+
abs = resolveEnvFilePath(p.env_file, REPO_ROOT);
|
|
85
|
+
} catch (err) {
|
|
86
|
+
die(err instanceof Error ? err.message : String(err));
|
|
87
|
+
}
|
|
88
|
+
if (!redact && !fs.existsSync(abs)) {
|
|
89
|
+
die(`Peer "${p.name}": env_file not found: ${p.env_file} (resolved: ${abs})`);
|
|
90
|
+
}
|
|
91
|
+
resolved.set(p, abs);
|
|
92
|
+
}
|
|
93
|
+
return (peer) => {
|
|
94
|
+
const abs = resolved.get(peer);
|
|
95
|
+
if (!abs || redact) return undefined;
|
|
96
|
+
try {
|
|
97
|
+
return parseEnvFile(fs.readFileSync(abs, "utf-8"), peer.env_file);
|
|
98
|
+
} catch (err) {
|
|
99
|
+
die(err instanceof Error ? err.message : String(err));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function buildLayoutOrDie(
|
|
105
|
+
team: string,
|
|
106
|
+
peers: Peer[],
|
|
107
|
+
envForPeer: (p: Peer) => Record<string, string> | undefined,
|
|
108
|
+
mode: "peers" | "hub" | "conductor",
|
|
109
|
+
project: string,
|
|
110
|
+
): LayoutNode {
|
|
111
|
+
try {
|
|
112
|
+
const rootPane = mode === "hub"
|
|
113
|
+
? { command: hubCommand(project), label: "hub", ratio: HUB_RATIO }
|
|
114
|
+
: mode === "conductor"
|
|
115
|
+
? { command: conductorCommand(), label: "conductor", ratio: CONDUCTOR_RATIO }
|
|
116
|
+
: undefined;
|
|
117
|
+
return buildTeamLayout({
|
|
118
|
+
team,
|
|
119
|
+
peers,
|
|
120
|
+
repoRoot: REPO_ROOT,
|
|
121
|
+
envForPeer,
|
|
122
|
+
project,
|
|
123
|
+
...(rootPane ? { hub: rootPane } : {}),
|
|
124
|
+
});
|
|
125
|
+
} catch (err) {
|
|
126
|
+
die(err instanceof Error ? err.message : String(err));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
async function main(): Promise<void> {
|
|
131
|
+
const argv = process.argv.slice(2);
|
|
132
|
+
let team: string | null = null;
|
|
133
|
+
let peersYaml = DEFAULT_PEERS_YAML;
|
|
134
|
+
let project = DEFAULT_PROJECT;
|
|
135
|
+
try {
|
|
136
|
+
team = flagValue(argv, "--team");
|
|
137
|
+
project = parseProjectFlag(argv);
|
|
138
|
+
// --peers: alternate manifest path (tests use it; defaults to the repo's).
|
|
139
|
+
peersYaml = flagValue(argv, "--peers") ?? DEFAULT_PEERS_YAML;
|
|
140
|
+
} catch (err) {
|
|
141
|
+
die(err instanceof Error ? err.message : String(err));
|
|
142
|
+
}
|
|
143
|
+
const dryRun = argv.includes("--dry-run");
|
|
144
|
+
const hub = argv.includes("--hub");
|
|
145
|
+
const conductor = argv.includes("--conductor");
|
|
146
|
+
if (hub && conductor) die("--hub and --conductor are mutually exclusive");
|
|
147
|
+
const mode: "peers" | "hub" | "conductor" = hub ? "hub" : conductor ? "conductor" : "peers";
|
|
148
|
+
|
|
149
|
+
if (!team) {
|
|
150
|
+
console.error("usage: team-up.ts --team <name> [--hub|--conductor] [--dry-run] [--peers <peers.yaml>] [--project <name>]");
|
|
151
|
+
process.exit(2);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
try {
|
|
155
|
+
validateTeamName(team);
|
|
156
|
+
} catch (err) {
|
|
157
|
+
die(err instanceof Error ? err.message : String(err));
|
|
158
|
+
}
|
|
159
|
+
const peers = loadTeam(team, peersYaml);
|
|
160
|
+
let label: string;
|
|
161
|
+
try {
|
|
162
|
+
label = teamWorkspaceLabel(mode, team, project);
|
|
163
|
+
} catch (err) {
|
|
164
|
+
die(err instanceof Error ? err.message : String(err));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (dryRun) {
|
|
168
|
+
// No herdr calls and no env_file reads on this path — must work with no
|
|
169
|
+
// herdr installed, and secrets never reach the output.
|
|
170
|
+
const layout = buildLayoutOrDie(team, peers, makeEnvLoader(peers, true), mode, project);
|
|
171
|
+
const projectNote = project === DEFAULT_PROJECT ? "" : `, project "${project}"`;
|
|
172
|
+
const extra = mode === "hub" ? " + hub" : mode === "conductor" ? " + conductor" : "";
|
|
173
|
+
console.log(
|
|
174
|
+
`# team-up (dry run) — team "${team}"${projectNote}, ${peers.length} peer(s)${extra}, herdr workspace "${label}"`,
|
|
175
|
+
);
|
|
176
|
+
for (const p of peers) {
|
|
177
|
+
const cmd = layoutCommands(layout, p.name as string) ?? [];
|
|
178
|
+
const envNote = p.env_file ? ` [env_file: ${p.env_file} — values redacted]` : "";
|
|
179
|
+
console.log(`${p.name}\t${cmd.join(" ")}${envNote}`);
|
|
180
|
+
}
|
|
181
|
+
console.log(JSON.stringify({ label, layout }, null, 2));
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const layout = buildLayoutOrDie(team, peers, makeEnvLoader(peers, false), mode, project);
|
|
186
|
+
|
|
187
|
+
// Import lazily so --dry-run never touches the client (or the socket).
|
|
188
|
+
const { herdr, requireHerdr, HerdrUnavailableError } = await import(
|
|
189
|
+
"../.pi/harnesses/lib/herdr-client.ts"
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
try {
|
|
193
|
+
await requireHerdr();
|
|
194
|
+
} catch (err) {
|
|
195
|
+
if (err instanceof HerdrUnavailableError) {
|
|
196
|
+
console.error(err.message);
|
|
197
|
+
const dryRecipe = mode === "hub" ? "hub-team-dry" : mode === "conductor" ? "conductor-dry" : "team-up-dry";
|
|
198
|
+
console.error(`(dry run still works: just ${dryRecipe} ${team}${project === DEFAULT_PROJECT ? "" : ` --project ${project}`})`);
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
throw err;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
const { workspaces } = await herdr.workspaceList();
|
|
205
|
+
const existing = workspaces.find((w) => w.label === label);
|
|
206
|
+
if (existing) {
|
|
207
|
+
console.error(`herdr workspace "${label}" already exists (${existing.workspace_id}).`);
|
|
208
|
+
console.error(` focus: herdr workspace focus ${existing.workspace_id}`);
|
|
209
|
+
console.error(` close: herdr workspace close ${existing.workspace_id}`);
|
|
210
|
+
process.exit(1);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const created = await herdr.workspaceCreate({ label, cwd: REPO_ROOT, focus: false });
|
|
214
|
+
const wsId = created.workspace.workspace_id;
|
|
215
|
+
const initialTab = created.workspace.active_tab_id ?? created.tab?.tab_id;
|
|
216
|
+
await herdr.layoutApply({ workspace_id: wsId, root: layout });
|
|
217
|
+
// layout.apply lands in a fresh tab; drop the empty shell tab
|
|
218
|
+
// workspace.create made so the team tab is the only one.
|
|
219
|
+
if (initialTab) {
|
|
220
|
+
try {
|
|
221
|
+
await herdr.tabClose(initialTab);
|
|
222
|
+
} catch {
|
|
223
|
+
// non-fatal: an extra empty tab is cosmetic
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
const launchedPrefix = mode === "hub" ? "hub + " : mode === "conductor" ? "conductor + " : "";
|
|
228
|
+
console.log(
|
|
229
|
+
`Launched ${launchedPrefix}${peers.length} peer(s) for team "${team}" in herdr workspace "${label}" (${wsId}):`,
|
|
230
|
+
);
|
|
231
|
+
if (mode === "hub") console.log(` • hub (${hubCommand(project).join(" ")} — guarded dispatcher)`);
|
|
232
|
+
if (mode === "conductor") console.log(` • conductor (${conductorCommand().join(" ")} — Hermes conductor; no herdr control)`);
|
|
233
|
+
for (const p of peers) console.log(` • ${p.name}`);
|
|
234
|
+
console.log(`Focus: herdr workspace focus ${wsId}`);
|
|
235
|
+
console.log(`Close: herdr workspace close ${wsId}`);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Dry-run helper: find the command argv for the pane labeled `name`.
|
|
239
|
+
function layoutCommands(node: LayoutNode, name: string): string[] | undefined {
|
|
240
|
+
if (node.type === "pane") return node.label === name ? node.command : undefined;
|
|
241
|
+
return layoutCommands(node.first, name) ?? layoutCommands(node.second, name);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const isEntry = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url);
|
|
245
|
+
if (isEntry) void main();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Grilling (Internal Helper)
|
|
2
|
+
|
|
3
|
+
Use this helper from a parent skill when the user asks to grill or stress-test a plan, spec, or design, or when an important design choice is being silently assumed.
|
|
4
|
+
|
|
5
|
+
Interview the user relentlessly until the important decisions are explicitly accepted, rejected, or deferred. Walk the design tree one dependency at a time: choose the next question based on prior answers, and skip questions made irrelevant by earlier decisions.
|
|
6
|
+
|
|
7
|
+
Ask one focused question at a time. Offer 2-4 concrete options plus your recommended answer and a brief reason, then wait for the user's decision before continuing. This should feel like guided architectural interrogation, not a questionnaire dump.
|
|
8
|
+
|
|
9
|
+
If a question can be answered by reading the codebase, docs, tests, or runtime evidence, investigate first and ask only about the remaining decision.
|
|
10
|
+
|
|
11
|
+
Keep grilling until shared understanding is strong enough to write or revise the downstream artifact. When review exposes gaps later, convert each gap into one targeted follow-up question.
|