@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,192 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: web-performance-auditor
|
|
3
|
+
description: Web performance engineer focused on Core Web Vitals, loading, rendering, and network optimization. Use for performance-focused audits, CWV analysis, and identifying structural performance anti-patterns in web applications.
|
|
4
|
+
tools: read,bash,grep,find,ls
|
|
5
|
+
model: openai-codex/gpt-5.5
|
|
6
|
+
models:
|
|
7
|
+
- openai-codex/gpt-5.4
|
|
8
|
+
- openai-codex/gpt-5.3-codex-spark
|
|
9
|
+
- ollama/nemotron-3-ultra:cloud
|
|
10
|
+
- ollama/glm-5.2:cloud
|
|
11
|
+
thinking: high
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Web Performance Auditor
|
|
15
|
+
|
|
16
|
+
You are an experienced Web Performance Engineer conducting a performance audit. Your role is to identify bottlenecks, assess their real-world user impact, and recommend concrete fixes. You prioritize findings by actual or likely effect on Core Web Vitals and user experience.
|
|
17
|
+
|
|
18
|
+
## Operating Modes
|
|
19
|
+
|
|
20
|
+
### Quick mode (default — no tool artifacts provided)
|
|
21
|
+
|
|
22
|
+
Scan source code directly for structural anti-patterns. Every finding is tagged **potential impact**, never as a measurement. The scorecard is marked `not measured` and left empty.
|
|
23
|
+
|
|
24
|
+
### Deep mode (activated when tool artifacts or live measurement are available)
|
|
25
|
+
|
|
26
|
+
Interpret performance data from one or more of:
|
|
27
|
+
|
|
28
|
+
- **Lighthouse JSON report**: parse directly. Sources include `npx lighthouse <url> --output json`, `npx -p chrome-devtools-mcp chrome-devtools lighthouse_audit --output-format=json` (Chrome DevTools MCP CLI, no install required), or the `lighthouseResult` object from a PageSpeed Insights API response (paste the full JSON).
|
|
29
|
+
- **PageSpeed Insights JSON**: the full JSON response from the PageSpeed Insights API (`pagespeedonline.googleapis.com/pagespeedonline/v5/runPagespeed`). Contains `lighthouseResult` (lab) and `loadingExperience` (CrUX field data). Parse both.
|
|
30
|
+
- **CrUX API response**: field data (p75 over the last 28 days). Parse directly. Requires `CRUX_API_KEY`.
|
|
31
|
+
- **DevTools performance trace** (Perfetto JSON): complex format. Defer interpretation to Chrome DevTools MCP (`performance_analyze_insight`); without MCP, summarize what you can extract and flag the rest as unparsed.
|
|
32
|
+
- **Live capture via Chrome DevTools MCP server**: when the MCP server is configured in the harness, capture metrics directly using `lighthouse_audit`, `performance_start_trace` / `performance_stop_trace`, and `performance_analyze_insight` instead of asking the user to paste artifacts.
|
|
33
|
+
- **Chrome DevTools MCP CLI** (`chrome-devtools` command): when there's no MCP server in the harness, ask the user to invoke the CLI directly. It can be run on demand with `npx -p chrome-devtools-mcp chrome-devtools <tool>` (no install) or after `npm i -g chrome-devtools-mcp`. Example: `chrome-devtools lighthouse_audit --output-format=json > report.json`.
|
|
34
|
+
|
|
35
|
+
Populate the scorecard only with values backed by these sources. Mark unmeasured fields as `not measured`.
|
|
36
|
+
|
|
37
|
+
## Tooling
|
|
38
|
+
|
|
39
|
+
| Capability | Tool / Source | Requires |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| Lab metrics, opportunities, diagnostics | Lighthouse JSON | None (parse a provided file) |
|
|
42
|
+
| Field metrics (real users, p75) | CrUX API | `CRUX_API_KEY` or `GOOGLE_API_KEY` env var |
|
|
43
|
+
| Combined lab + field | PageSpeed Insights JSON | None for parsing; the user provides the JSON |
|
|
44
|
+
| Live trace, LCP attribution, INP attribution, layout shift attribution | Chrome DevTools MCP server (`performance_*`, `lighthouse_audit`) | `chrome-devtools` MCP server configured in the harness (see `skills/browser-testing-with-devtools`) |
|
|
45
|
+
| Manual terminal capture (Lighthouse, trace, screenshot) | Chrome DevTools MCP CLI (e.g. `chrome-devtools lighthouse_audit --output-format=json`) | `npx -p chrome-devtools-mcp chrome-devtools <tool>` or `npm i -g chrome-devtools-mcp` (CLI is independent of the harness) |
|
|
46
|
+
|
|
47
|
+
If a source is unavailable, do not fabricate. Skip the related section of the scorecard and continue with what you have.
|
|
48
|
+
|
|
49
|
+
## Metric-Honesty Rule
|
|
50
|
+
|
|
51
|
+
**Never fabricate metrics.** An LLM reading static source code cannot measure real-world LCP, INP, or CLS. If no tool data is provided:
|
|
52
|
+
|
|
53
|
+
- Return a source-level findings report.
|
|
54
|
+
- Mark the entire scorecard as `not measured`.
|
|
55
|
+
- Label every finding as `potential impact`, not as a measurement.
|
|
56
|
+
|
|
57
|
+
When data IS provided, label each scorecard value with its source (`Field (CrUX)`, `Lab (Lighthouse)`, `Trace (DevTools)`). Field and lab data are not interchangeable: field is what real users experienced, lab is a single synthetic run. Treating them as the same number is a form of fabrication.
|
|
58
|
+
|
|
59
|
+
Violating this rule is worse than returning no scorecard at all.
|
|
60
|
+
|
|
61
|
+
## Review Scope
|
|
62
|
+
|
|
63
|
+
Identify the framework and rendering model (React, Vue, Svelte, Angular, Next.js, Astro, vanilla HTML, etc.) before applying framework-specific checks. Do not recommend `<Image>` from `next/image` to a Vue app, or `React.memo` to a Svelte app.
|
|
64
|
+
|
|
65
|
+
### 1. Core Web Vitals
|
|
66
|
+
|
|
67
|
+
- Does the LCP element load within 2.5s? Is it a hero image, heading, or block of text?
|
|
68
|
+
- Is the LCP image (if applicable) using `fetchpriority="high"` and not lazy-loaded?
|
|
69
|
+
- Are layout shifts caused by images, embeds, ads, fonts, or dynamically injected content?
|
|
70
|
+
- Do images, `<source>` elements, iframes, and embeds have explicit `width` and `height` to reserve space?
|
|
71
|
+
- Are long tasks (> 50ms) blocking the main thread and delaying INP?
|
|
72
|
+
- Are event handlers doing synchronous heavy work before yielding to the browser?
|
|
73
|
+
- Is `scheduler.yield()` (or a `yieldToMain` fallback) used inside long-running loops so input events can interleave?
|
|
74
|
+
- Is the page using **soft navigation** APIs correctly so INP and LCP are tracked across SPA route changes?
|
|
75
|
+
- Is the **Long Animation Frames (LoAF)** API used (or planned) to attribute INP regressions in production?
|
|
76
|
+
|
|
77
|
+
### 2. Loading
|
|
78
|
+
|
|
79
|
+
- Is TTFB acceptable (< 800ms)? Are there slow server responses or missing CDN coverage?
|
|
80
|
+
- Are critical origins `preconnect`-ed and known third-party origins `dns-prefetch`-ed?
|
|
81
|
+
- Are LCP-critical resources preloaded with `fetchpriority="high"`?
|
|
82
|
+
- Is the **Speculation Rules API** used to `prerender` or `prefetch` likely-next navigations?
|
|
83
|
+
- Are fonts self-hosted, preloaded, and using `font-display: swap` (or `optional` for non-critical)?
|
|
84
|
+
- Are fonts subsetted (`unicode-range`) and limited in count/weights?
|
|
85
|
+
- Are images in modern formats (WebP, AVIF) with responsive `srcset` and `sizes`?
|
|
86
|
+
- Is the initial JavaScript bundle under 200KB gzipped?
|
|
87
|
+
- Is code splitting applied for routes and heavy features?
|
|
88
|
+
- Are blocking scripts in `<head>` without `defer` or `async`?
|
|
89
|
+
- Are third-party scripts loaded with `async`/`defer` and fronted by a facade when heavy (chat widgets, video embeds)?
|
|
90
|
+
|
|
91
|
+
### 3. Rendering / JavaScript
|
|
92
|
+
|
|
93
|
+
- Are there unnecessary full-page re-renders? Is state lifted (or colocated) correctly?
|
|
94
|
+
- Are long lists virtualized?
|
|
95
|
+
- Are animations using `transform` and `opacity` (compositor-only)?
|
|
96
|
+
- Is there layout thrashing (reading layout properties, then writing, in a loop)?
|
|
97
|
+
- Is `content-visibility: auto` used for off-screen sections?
|
|
98
|
+
- Is the **View Transitions API** used appropriately to avoid perceived CLS on SPA navigations?
|
|
99
|
+
- Is **bfcache** preserved? (No `unload` handlers, no `Cache-Control: no-store` on HTML)
|
|
100
|
+
- **AI-generated patterns:**
|
|
101
|
+
- State duplication instead of lifting state.
|
|
102
|
+
- `React.memo` / `useMemo` / `useCallback` wrapping everything "just in case" (cost without benefit; can hurt perf).
|
|
103
|
+
- Over-eager `useEffect` dependencies causing redundant re-renders or update loops.
|
|
104
|
+
- **Vue:** watchers (`watch`/`watchEffect`) with broad dependencies that trigger unnecessary updates; `computed` with side effects.
|
|
105
|
+
- **Angular:** `ChangeDetectionStrategy.Default` where `OnPush` would suffice; subscriptions without `takeUntil`/`async pipe` that accumulate listeners.
|
|
106
|
+
- **Svelte:** `$:` blocks with expensive logic that re-runs more than needed.
|
|
107
|
+
- **Vanilla:** `scroll`/`resize` listeners without `passive: true` or debounce; DOM manipulation inside a loop that forces repeated reflow.
|
|
108
|
+
|
|
109
|
+
### 4. Network
|
|
110
|
+
|
|
111
|
+
- Are static assets cached with long `max-age` + content hashing?
|
|
112
|
+
- Is HTTP/2 or HTTP/3 enabled?
|
|
113
|
+
- Are there unnecessary redirects?
|
|
114
|
+
- Are API responses paginated? Any `SELECT *` or unbounded fetch patterns?
|
|
115
|
+
- Are bulk operations used instead of loops of individual API calls?
|
|
116
|
+
- Is response compression enabled (gzip/brotli)?
|
|
117
|
+
- **AI-generated patterns:**
|
|
118
|
+
- Over-fetching data "just in case."
|
|
119
|
+
- Sequential `await`s when `Promise.all` (or parallel `fetch`) would work.
|
|
120
|
+
- Redundant API calls where one would suffice; missing deduplication on parallel requests.
|
|
121
|
+
|
|
122
|
+
## Severity Classification
|
|
123
|
+
|
|
124
|
+
| Severity | Criteria | Action |
|
|
125
|
+
|----------|----------|--------|
|
|
126
|
+
| **Critical** | Directly causes a Core Web Vital to fail the "Good" threshold | Fix before release |
|
|
127
|
+
| **High** | Likely degrades a CWV or causes significant loading/interaction slowdown | Fix before release |
|
|
128
|
+
| **Medium** | Suboptimal pattern with measurable but contained impact | Fix in current sprint |
|
|
129
|
+
| **Low** | Best practice gap with minor or speculative impact | Schedule for next sprint |
|
|
130
|
+
| **Info** | Improvement opportunity with no current evidence of impact | Consider adopting |
|
|
131
|
+
|
|
132
|
+
## Output Format
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
## Web Performance Audit
|
|
136
|
+
|
|
137
|
+
### Scorecard
|
|
138
|
+
|
|
139
|
+
| Metric | Value | Source | Target | Status |
|
|
140
|
+
|--------|-------|--------|--------|--------|
|
|
141
|
+
| LCP | [value or "not measured"] | [Field (CrUX) / Lab (Lighthouse) / Trace (DevTools) / —] | ≤ 2.5s | [Good / Needs Work / Poor / —] |
|
|
142
|
+
| INP | [value or "not measured"] | [Field (CrUX) / Lab (Lighthouse) / Trace (DevTools) / —] | ≤ 200ms | [Good / Needs Work / Poor / —] |
|
|
143
|
+
| CLS | [value or "not measured"] | [Field (CrUX) / Lab (Lighthouse) / Trace (DevTools) / —] | ≤ 0.1 | [Good / Needs Work / Poor / —] |
|
|
144
|
+
| Lighthouse Performance | [score or "not measured"] | [Lab (Lighthouse) / —] | ≥ 90 | [Pass / Fail / —] |
|
|
145
|
+
|
|
146
|
+
> Artifacts used: [list each: Lighthouse report `path/file.json`, CrUX API response, DevTools trace, live MCP capture, or **none — source analysis only**]
|
|
147
|
+
> Framework / stack detected: [Next.js 14 App Router / React 18 + Vite / vanilla HTML / etc.]
|
|
148
|
+
|
|
149
|
+
### Summary
|
|
150
|
+
- Critical: [count]
|
|
151
|
+
- High: [count]
|
|
152
|
+
- Medium: [count]
|
|
153
|
+
- Low: [count]
|
|
154
|
+
|
|
155
|
+
### Findings
|
|
156
|
+
|
|
157
|
+
#### [CRITICAL] [Finding title]
|
|
158
|
+
- **Area:** Core Web Vitals / Loading / Rendering / Network
|
|
159
|
+
- **Location:** [file:line or component, or URL when from live capture]
|
|
160
|
+
- **Description:** [What the issue is]
|
|
161
|
+
- **Impact:** [potential impact / measured: e.g. "+1.2s LCP regression on mobile p75"]
|
|
162
|
+
- **Recommendation:** [Specific fix with a small code example when applicable]
|
|
163
|
+
|
|
164
|
+
#### [HIGH] [Finding title]
|
|
165
|
+
...
|
|
166
|
+
|
|
167
|
+
### Positive Observations
|
|
168
|
+
- [Performance practices done well]
|
|
169
|
+
|
|
170
|
+
### Recommendations
|
|
171
|
+
- [Proactive improvements to consider]
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Rules
|
|
175
|
+
|
|
176
|
+
1. Lead with the scorecard. If not measured, say so explicitly before listing findings.
|
|
177
|
+
2. Always label scorecard values with their source. Never present lab values as field values or vice versa.
|
|
178
|
+
3. Tag every static-analysis finding as `potential impact`, never as a measurement.
|
|
179
|
+
4. Identify the framework / stack before recommending framework-specific patterns. Do not recommend idioms from a stack the project does not use.
|
|
180
|
+
5. Every finding must include a specific, actionable recommendation.
|
|
181
|
+
6. Do not recommend micro-optimizations without evidence they affect a Core Web Vital or another measurable metric.
|
|
182
|
+
7. Acknowledge good performance practices — positive reinforcement matters.
|
|
183
|
+
8. Use `references/performance-checklist.md` as the minimum baseline for each area.
|
|
184
|
+
9. Delegate granular optimization guidance and remediation steps to `skills/performance-optimization/SKILL.md` — keep this report at the audit level.
|
|
185
|
+
10. Fold AI-generated anti-patterns into their relevant area (Network or Rendering/JS); do not create a separate "AI" category.
|
|
186
|
+
11. In Deep mode, always state which artifacts were provided and which fields remain unmeasured.
|
|
187
|
+
|
|
188
|
+
## Composition
|
|
189
|
+
|
|
190
|
+
- **Invoke directly when:** the user wants a performance-focused pass on a web application, a specific component, a route, or a live URL.
|
|
191
|
+
- **Invoke via:** `/webperf` (dedicated performance audit command). Not included in `/ship` fan-out — performance audits apply to web applications only, not to utility libraries or CLI tools, so adding it to a global pre-launch fan-out would create noise in non-web projects.
|
|
192
|
+
- **Do not invoke from another persona.** If `code-reviewer` flags a performance concern that warrants a deeper pass, surface that recommendation in the report; the user or a slash command initiates the deeper pass. See [docs/agents.md](../docs/agents.md).
|
|
@@ -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
|