@arthai/agents 1.0.0
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/README.md +123 -0
- package/VERSION +1 -0
- package/agents/ai-consultant.md +999 -0
- package/agents/architect.md +174 -0
- package/agents/code-reviewer.md +115 -0
- package/agents/competitive-analyst.md +688 -0
- package/agents/content-strategist.md +607 -0
- package/agents/design-studio-create.md +304 -0
- package/agents/design-studio-critique.md +258 -0
- package/agents/design-studio-think.md +79 -0
- package/agents/domain-hunter.md +519 -0
- package/agents/explore-light.md +52 -0
- package/agents/frontend.md +261 -0
- package/agents/gtm-expert.md +811 -0
- package/agents/meeting-prep.md +318 -0
- package/agents/ops.md +149 -0
- package/agents/product-manager.md +563 -0
- package/agents/python-backend.md +286 -0
- package/agents/qa-baseline-updater.md +45 -0
- package/agents/qa-challenger.md +97 -0
- package/agents/qa-domain.md +145 -0
- package/agents/qa-e2e.md +184 -0
- package/agents/qa-test-promoter.md +97 -0
- package/agents/qa.md +226 -0
- package/agents/setup.md +134 -0
- package/agents/sre.md +165 -0
- package/agents/stakeholder-reporter.md +94 -0
- package/agents/user-researcher.md +602 -0
- package/bin/cli.js +322 -0
- package/bundles/canvas.json +16 -0
- package/bundles/compass.json +16 -0
- package/bundles/counsel.json +31 -0
- package/bundles/cruise.json +11 -0
- package/bundles/forge.json +26 -0
- package/bundles/prime.json +10 -0
- package/bundles/prism.json +23 -0
- package/bundles/scalpel.json +17 -0
- package/bundles/sentinel.json +19 -0
- package/bundles/shield.json +14 -0
- package/bundles/spark.json +19 -0
- package/compiler.sh +305 -0
- package/dist/plugins/canvas/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/canvas/agents/design-studio-create.md +304 -0
- package/dist/plugins/canvas/agents/design-studio-critique.md +258 -0
- package/dist/plugins/canvas/agents/design-studio-think.md +79 -0
- package/dist/plugins/canvas/agents/frontend.md +261 -0
- package/dist/plugins/canvas/skills/planning/SKILL.md +436 -0
- package/dist/plugins/compass/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/compass/agents/content-strategist.md +607 -0
- package/dist/plugins/compass/agents/gtm-expert.md +811 -0
- package/dist/plugins/compass/agents/product-manager.md +563 -0
- package/dist/plugins/compass/agents/user-researcher.md +602 -0
- package/dist/plugins/compass/skills/planning/SKILL.md +436 -0
- package/dist/plugins/counsel/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/counsel/agents/ai-consultant.md +999 -0
- package/dist/plugins/counsel/agents/competitive-analyst.md +688 -0
- package/dist/plugins/counsel/agents/meeting-prep.md +318 -0
- package/dist/plugins/counsel/agents/stakeholder-reporter.md +94 -0
- package/dist/plugins/counsel/hooks/check-deliverable.sh +65 -0
- package/dist/plugins/counsel/hooks/ensure-client-dir.sh +59 -0
- package/dist/plugins/counsel/hooks/hooks.json +28 -0
- package/dist/plugins/counsel/skills/client-discovery/SKILL.md +266 -0
- package/dist/plugins/counsel/skills/consulting/SKILL.md +282 -0
- package/dist/plugins/counsel/skills/deliverable-builder/SKILL.md +928 -0
- package/dist/plugins/counsel/skills/engagement-tracker/SKILL.md +380 -0
- package/dist/plugins/counsel/skills/market-research/SKILL.md +300 -0
- package/dist/plugins/counsel/skills/opportunity-map/SKILL.md +307 -0
- package/dist/plugins/counsel/skills/pitch-generator/SKILL.md +378 -0
- package/dist/plugins/counsel/skills/roi-calculator/SKILL.md +469 -0
- package/dist/plugins/counsel/skills/share/SKILL.md +211 -0
- package/dist/plugins/counsel/skills/solution-architect/SKILL.md +566 -0
- package/dist/plugins/counsel/skills/templates/SKILL.md +194 -0
- package/dist/plugins/counsel/skills/welcome/SKILL.md +136 -0
- package/dist/plugins/counsel/skills/wizard/SKILL.md +411 -0
- package/dist/plugins/cruise/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/cruise/skills/autopilot/SKILL.md +425 -0
- package/dist/plugins/forge/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/forge/agents/architect.md +174 -0
- package/dist/plugins/forge/agents/code-reviewer.md +115 -0
- package/dist/plugins/forge/agents/frontend.md +261 -0
- package/dist/plugins/forge/agents/product-manager.md +563 -0
- package/dist/plugins/forge/agents/python-backend.md +286 -0
- package/dist/plugins/forge/agents/qa.md +226 -0
- package/dist/plugins/forge/hooks/hooks.json +28 -0
- package/dist/plugins/forge/hooks/post-test-summary.sh +115 -0
- package/dist/plugins/forge/hooks/triage-router.sh +740 -0
- package/dist/plugins/forge/skills/implement/SKILL.md +532 -0
- package/dist/plugins/forge/skills/planning/SKILL.md +436 -0
- package/dist/plugins/forge/skills/pr/SKILL.md +275 -0
- package/dist/plugins/forge/skills/precheck/SKILL.md +159 -0
- package/dist/plugins/forge/skills/qa/SKILL.md +127 -0
- package/dist/plugins/forge/skills/review-pr/SKILL.md +367 -0
- package/dist/plugins/prime/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/prime/agents/ai-consultant.md +999 -0
- package/dist/plugins/prime/agents/architect.md +174 -0
- package/dist/plugins/prime/agents/code-reviewer.md +115 -0
- package/dist/plugins/prime/agents/competitive-analyst.md +688 -0
- package/dist/plugins/prime/agents/content-strategist.md +607 -0
- package/dist/plugins/prime/agents/design-studio-create.md +304 -0
- package/dist/plugins/prime/agents/design-studio-critique.md +258 -0
- package/dist/plugins/prime/agents/design-studio-think.md +79 -0
- package/dist/plugins/prime/agents/explore-light.md +52 -0
- package/dist/plugins/prime/agents/frontend.md +261 -0
- package/dist/plugins/prime/agents/gtm-expert.md +811 -0
- package/dist/plugins/prime/agents/meeting-prep.md +318 -0
- package/dist/plugins/prime/agents/ops.md +149 -0
- package/dist/plugins/prime/agents/product-manager.md +563 -0
- package/dist/plugins/prime/agents/python-backend.md +286 -0
- package/dist/plugins/prime/agents/qa-baseline-updater.md +45 -0
- package/dist/plugins/prime/agents/qa-challenger.md +97 -0
- package/dist/plugins/prime/agents/qa-domain.md +145 -0
- package/dist/plugins/prime/agents/qa-e2e.md +184 -0
- package/dist/plugins/prime/agents/qa-test-promoter.md +97 -0
- package/dist/plugins/prime/agents/qa.md +226 -0
- package/dist/plugins/prime/agents/setup.md +134 -0
- package/dist/plugins/prime/agents/sre.md +165 -0
- package/dist/plugins/prime/agents/stakeholder-reporter.md +94 -0
- package/dist/plugins/prime/agents/user-researcher.md +602 -0
- package/dist/plugins/prime/hooks/check-deliverable.sh +65 -0
- package/dist/plugins/prime/hooks/ensure-client-dir.sh +59 -0
- package/dist/plugins/prime/hooks/hooks.json +184 -0
- package/dist/plugins/prime/hooks/post-deploy-health.sh +83 -0
- package/dist/plugins/prime/hooks/post-diff-test-compare.sh +125 -0
- package/dist/plugins/prime/hooks/post-edit-lint.sh +92 -0
- package/dist/plugins/prime/hooks/post-git-state.sh +54 -0
- package/dist/plugins/prime/hooks/post-merge-cleanup.sh +101 -0
- package/dist/plugins/prime/hooks/post-test-summary.sh +115 -0
- package/dist/plugins/prime/hooks/pre-bash-guard.sh +142 -0
- package/dist/plugins/prime/hooks/pre-edit-guard.sh +121 -0
- package/dist/plugins/prime/hooks/pre-task-context.sh +113 -0
- package/dist/plugins/prime/hooks/session-bootstrap.sh +379 -0
- package/dist/plugins/prime/hooks/session-end.sh +107 -0
- package/dist/plugins/prime/hooks/session-summary.sh +97 -0
- package/dist/plugins/prime/hooks/sync-agents.sh +269 -0
- package/dist/plugins/prime/hooks/triage-router.sh +740 -0
- package/dist/plugins/prime/skills/arth/SKILL.md +165 -0
- package/dist/plugins/prime/skills/autopilot/SKILL.md +425 -0
- package/dist/plugins/prime/skills/calibrate/SKILL.md +1807 -0
- package/dist/plugins/prime/skills/ci-fix/SKILL.md +293 -0
- package/dist/plugins/prime/skills/client-discovery/SKILL.md +266 -0
- package/dist/plugins/prime/skills/consulting/SKILL.md +282 -0
- package/dist/plugins/prime/skills/custom-domain/SKILL.md +261 -0
- package/dist/plugins/prime/skills/deliverable-builder/SKILL.md +928 -0
- package/dist/plugins/prime/skills/discord-ops/SKILL.md +125 -0
- package/dist/plugins/prime/skills/engagement-tracker/SKILL.md +380 -0
- package/dist/plugins/prime/skills/explore.md +43 -0
- package/dist/plugins/prime/skills/fix/SKILL.md +1058 -0
- package/dist/plugins/prime/skills/implement/SKILL.md +532 -0
- package/dist/plugins/prime/skills/incident/SKILL.md +910 -0
- package/dist/plugins/prime/skills/issue/SKILL.md +134 -0
- package/dist/plugins/prime/skills/market-research/SKILL.md +300 -0
- package/dist/plugins/prime/skills/onboard/SKILL.md +344 -0
- package/dist/plugins/prime/skills/opportunity-map/SKILL.md +307 -0
- package/dist/plugins/prime/skills/pitch-generator/SKILL.md +378 -0
- package/dist/plugins/prime/skills/planning/SKILL.md +436 -0
- package/dist/plugins/prime/skills/pr/SKILL.md +275 -0
- package/dist/plugins/prime/skills/precheck/SKILL.md +159 -0
- package/dist/plugins/prime/skills/qa/SKILL.md +127 -0
- package/dist/plugins/prime/skills/qa-incident/SKILL.md +54 -0
- package/dist/plugins/prime/skills/qa-learn/SKILL.md +47 -0
- package/dist/plugins/prime/skills/restart/SKILL.md +70 -0
- package/dist/plugins/prime/skills/review-pr/SKILL.md +367 -0
- package/dist/plugins/prime/skills/roi-calculator/SKILL.md +469 -0
- package/dist/plugins/prime/skills/scan/SKILL.md +232 -0
- package/dist/plugins/prime/skills/setup/SKILL.md +691 -0
- package/dist/plugins/prime/skills/share/SKILL.md +211 -0
- package/dist/plugins/prime/skills/solution-architect/SKILL.md +566 -0
- package/dist/plugins/prime/skills/sre/SKILL.md +362 -0
- package/dist/plugins/prime/skills/sync/SKILL.md +188 -0
- package/dist/plugins/prime/skills/templates/SKILL.md +194 -0
- package/dist/plugins/prime/skills/welcome/SKILL.md +136 -0
- package/dist/plugins/prime/skills/wizard/SKILL.md +411 -0
- package/dist/plugins/prism/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/prism/agents/qa-baseline-updater.md +45 -0
- package/dist/plugins/prism/agents/qa-challenger.md +97 -0
- package/dist/plugins/prism/agents/qa-domain.md +145 -0
- package/dist/plugins/prism/agents/qa-e2e.md +184 -0
- package/dist/plugins/prism/agents/qa-test-promoter.md +97 -0
- package/dist/plugins/prism/agents/qa.md +226 -0
- package/dist/plugins/prism/hooks/hooks.json +26 -0
- package/dist/plugins/prism/hooks/post-diff-test-compare.sh +125 -0
- package/dist/plugins/prism/hooks/post-test-summary.sh +115 -0
- package/dist/plugins/prism/skills/qa/SKILL.md +127 -0
- package/dist/plugins/prism/skills/qa-incident/SKILL.md +54 -0
- package/dist/plugins/prism/skills/qa-learn/SKILL.md +47 -0
- package/dist/plugins/scalpel/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/scalpel/agents/code-reviewer.md +115 -0
- package/dist/plugins/scalpel/hooks/hooks.json +26 -0
- package/dist/plugins/scalpel/hooks/pre-edit-guard.sh +121 -0
- package/dist/plugins/scalpel/skills/ci-fix/SKILL.md +293 -0
- package/dist/plugins/scalpel/skills/fix/SKILL.md +1058 -0
- package/dist/plugins/scalpel/skills/issue/SKILL.md +134 -0
- package/dist/plugins/sentinel/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/sentinel/agents/ops.md +149 -0
- package/dist/plugins/sentinel/agents/sre.md +165 -0
- package/dist/plugins/sentinel/hooks/hooks.json +26 -0
- package/dist/plugins/sentinel/hooks/post-deploy-health.sh +83 -0
- package/dist/plugins/sentinel/hooks/post-git-state.sh +54 -0
- package/dist/plugins/sentinel/skills/incident/SKILL.md +910 -0
- package/dist/plugins/sentinel/skills/restart/SKILL.md +70 -0
- package/dist/plugins/sentinel/skills/sre/SKILL.md +362 -0
- package/dist/plugins/shield/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/shield/hooks/hooks.json +60 -0
- package/dist/plugins/shield/hooks/pre-bash-guard.sh +142 -0
- package/dist/plugins/shield/hooks/pre-edit-guard.sh +121 -0
- package/dist/plugins/shield/hooks/session-bootstrap.sh +379 -0
- package/dist/plugins/shield/hooks/triage-router.sh +740 -0
- package/dist/plugins/spark/.claude-plugin/plugin.json +6 -0
- package/dist/plugins/spark/agents/explore-light.md +52 -0
- package/dist/plugins/spark/agents/setup.md +134 -0
- package/dist/plugins/spark/hooks/hooks.json +16 -0
- package/dist/plugins/spark/hooks/session-bootstrap.sh +379 -0
- package/dist/plugins/spark/skills/calibrate/SKILL.md +1807 -0
- package/dist/plugins/spark/skills/onboard/SKILL.md +344 -0
- package/dist/plugins/spark/skills/scan/SKILL.md +232 -0
- package/dist/plugins/spark/skills/setup/SKILL.md +691 -0
- package/hook-defs.json +104 -0
- package/hooks/check-deliverable.sh +65 -0
- package/hooks/ensure-client-dir.sh +59 -0
- package/hooks/hooks.json +16 -0
- package/hooks/post-deploy-health.sh +83 -0
- package/hooks/post-diff-test-compare.sh +125 -0
- package/hooks/post-edit-lint.sh +92 -0
- package/hooks/post-git-state.sh +54 -0
- package/hooks/post-merge-cleanup.sh +101 -0
- package/hooks/post-test-summary.sh +115 -0
- package/hooks/pre-bash-guard.sh +142 -0
- package/hooks/pre-edit-guard.sh +121 -0
- package/hooks/pre-task-context.sh +113 -0
- package/hooks/session-bootstrap.sh +379 -0
- package/hooks/session-end.sh +107 -0
- package/hooks/session-start.sh +46 -0
- package/hooks/session-summary.sh +97 -0
- package/hooks/sync-agents.sh +269 -0
- package/hooks/triage-router.sh +740 -0
- package/install.sh +3185 -0
- package/package.json +40 -0
- package/portable.manifest +112 -0
- package/skills/arth/SKILL.md +165 -0
- package/skills/autopilot/SKILL.md +425 -0
- package/skills/calibrate/SKILL.md +1807 -0
- package/skills/ci-fix/SKILL.md +293 -0
- package/skills/client-discovery/SKILL.md +266 -0
- package/skills/consulting/SKILL.md +282 -0
- package/skills/continue/SKILL.md +174 -0
- package/skills/custom-domain/SKILL.md +261 -0
- package/skills/deliverable-builder/SKILL.md +928 -0
- package/skills/discord-ops/SKILL.md +125 -0
- package/skills/engagement-tracker/SKILL.md +380 -0
- package/skills/explore.md +43 -0
- package/skills/fix/SKILL.md +1058 -0
- package/skills/implement/SKILL.md +532 -0
- package/skills/incident/SKILL.md +910 -0
- package/skills/issue/SKILL.md +134 -0
- package/skills/market-research/SKILL.md +300 -0
- package/skills/onboard/SKILL.md +344 -0
- package/skills/opportunity-map/SKILL.md +307 -0
- package/skills/pitch-generator/SKILL.md +378 -0
- package/skills/planning/SKILL.md +436 -0
- package/skills/pr/SKILL.md +275 -0
- package/skills/precheck/SKILL.md +159 -0
- package/skills/qa/SKILL.md +127 -0
- package/skills/qa-incident/SKILL.md +54 -0
- package/skills/qa-learn/SKILL.md +47 -0
- package/skills/railway/central-station/SKILL.md +226 -0
- package/skills/railway/central-station/references/environment-config.md +183 -0
- package/skills/railway/central-station/references/monorepo.md +216 -0
- package/skills/railway/central-station/references/railpack.md +257 -0
- package/skills/railway/central-station/references/variables.md +170 -0
- package/skills/railway/database/SKILL.md +284 -0
- package/skills/railway/database/references/environment-config.md +183 -0
- package/skills/railway/database/references/monorepo.md +216 -0
- package/skills/railway/database/references/railpack.md +257 -0
- package/skills/railway/database/references/variables.md +170 -0
- package/skills/railway/database/scripts/railway-api.sh +41 -0
- package/skills/railway/deploy/SKILL.md +128 -0
- package/skills/railway/deploy/references/environment-config.md +183 -0
- package/skills/railway/deploy/references/monorepo.md +216 -0
- package/skills/railway/deploy/references/railpack.md +257 -0
- package/skills/railway/deploy/references/variables.md +170 -0
- package/skills/railway/deployment/SKILL.md +222 -0
- package/skills/railway/deployment/references/environment-config.md +183 -0
- package/skills/railway/deployment/references/monorepo.md +216 -0
- package/skills/railway/deployment/references/railpack.md +257 -0
- package/skills/railway/deployment/references/variables.md +170 -0
- package/skills/railway/domain/SKILL.md +137 -0
- package/skills/railway/domain/references/environment-config.md +183 -0
- package/skills/railway/domain/references/monorepo.md +216 -0
- package/skills/railway/domain/references/railpack.md +257 -0
- package/skills/railway/domain/references/variables.md +170 -0
- package/skills/railway/environment/SKILL.md +266 -0
- package/skills/railway/environment/references/environment-config.md +183 -0
- package/skills/railway/environment/references/monorepo.md +216 -0
- package/skills/railway/environment/references/railpack.md +257 -0
- package/skills/railway/environment/references/variables.md +170 -0
- package/skills/railway/metrics/SKILL.md +211 -0
- package/skills/railway/metrics/references/environment-config.md +183 -0
- package/skills/railway/metrics/references/monorepo.md +216 -0
- package/skills/railway/metrics/references/railpack.md +257 -0
- package/skills/railway/metrics/references/variables.md +170 -0
- package/skills/railway/metrics/scripts/railway-api.sh +41 -0
- package/skills/railway/new/SKILL.md +489 -0
- package/skills/railway/new/references/environment-config.md +183 -0
- package/skills/railway/new/references/monorepo.md +216 -0
- package/skills/railway/new/references/railpack.md +257 -0
- package/skills/railway/new/references/variables.md +170 -0
- package/skills/railway/projects/SKILL.md +142 -0
- package/skills/railway/projects/references/environment-config.md +183 -0
- package/skills/railway/projects/references/monorepo.md +216 -0
- package/skills/railway/projects/references/railpack.md +257 -0
- package/skills/railway/projects/references/variables.md +170 -0
- package/skills/railway/projects/scripts/railway-api.sh +41 -0
- package/skills/railway/railway-docs/SKILL.md +47 -0
- package/skills/railway/railway-docs/references/environment-config.md +183 -0
- package/skills/railway/railway-docs/references/monorepo.md +216 -0
- package/skills/railway/railway-docs/references/railpack.md +257 -0
- package/skills/railway/railway-docs/references/variables.md +170 -0
- package/skills/railway/service/SKILL.md +249 -0
- package/skills/railway/service/references/environment-config.md +183 -0
- package/skills/railway/service/references/monorepo.md +216 -0
- package/skills/railway/service/references/railpack.md +257 -0
- package/skills/railway/service/references/variables.md +170 -0
- package/skills/railway/service/scripts/railway-api.sh +41 -0
- package/skills/railway/status/SKILL.md +91 -0
- package/skills/railway/status/references/environment-config.md +183 -0
- package/skills/railway/status/references/monorepo.md +216 -0
- package/skills/railway/status/references/railpack.md +257 -0
- package/skills/railway/status/references/variables.md +170 -0
- package/skills/railway/templates/SKILL.md +275 -0
- package/skills/railway/templates/references/environment-config.md +183 -0
- package/skills/railway/templates/references/monorepo.md +216 -0
- package/skills/railway/templates/references/railpack.md +257 -0
- package/skills/railway/templates/references/variables.md +170 -0
- package/skills/railway/templates/scripts/railway-api.sh +41 -0
- package/skills/restart/SKILL.md +70 -0
- package/skills/review-pr/SKILL.md +367 -0
- package/skills/roi-calculator/SKILL.md +469 -0
- package/skills/scan/SKILL.md +232 -0
- package/skills/setup/SKILL.md +691 -0
- package/skills/share/SKILL.md +211 -0
- package/skills/solution-architect/SKILL.md +566 -0
- package/skills/sre/SKILL.md +362 -0
- package/skills/superpowers/brainstorming/SKILL.md +96 -0
- package/skills/superpowers/dispatching-parallel-agents/SKILL.md +180 -0
- package/skills/superpowers/executing-plans/SKILL.md +84 -0
- package/skills/superpowers/finishing-a-development-branch/SKILL.md +200 -0
- package/skills/superpowers/receiving-code-review/SKILL.md +213 -0
- package/skills/superpowers/requesting-code-review/SKILL.md +105 -0
- package/skills/superpowers/requesting-code-review/code-reviewer.md +146 -0
- package/skills/superpowers/subagent-driven-development/SKILL.md +242 -0
- package/skills/superpowers/subagent-driven-development/code-quality-reviewer-prompt.md +20 -0
- package/skills/superpowers/subagent-driven-development/implementer-prompt.md +78 -0
- package/skills/superpowers/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/skills/superpowers/systematic-debugging/CREATION-LOG.md +119 -0
- package/skills/superpowers/systematic-debugging/SKILL.md +296 -0
- package/skills/superpowers/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/skills/superpowers/systematic-debugging/condition-based-waiting.md +115 -0
- package/skills/superpowers/systematic-debugging/defense-in-depth.md +122 -0
- package/skills/superpowers/systematic-debugging/find-polluter.sh +63 -0
- package/skills/superpowers/systematic-debugging/root-cause-tracing.md +169 -0
- package/skills/superpowers/systematic-debugging/test-academic.md +14 -0
- package/skills/superpowers/systematic-debugging/test-pressure-1.md +58 -0
- package/skills/superpowers/systematic-debugging/test-pressure-2.md +68 -0
- package/skills/superpowers/systematic-debugging/test-pressure-3.md +69 -0
- package/skills/superpowers/test-driven-development/SKILL.md +371 -0
- package/skills/superpowers/test-driven-development/testing-anti-patterns.md +299 -0
- package/skills/superpowers/using-git-worktrees/SKILL.md +218 -0
- package/skills/superpowers/using-superpowers/SKILL.md +95 -0
- package/skills/superpowers/verification-before-completion/SKILL.md +139 -0
- package/skills/superpowers/writing-plans/SKILL.md +116 -0
- package/skills/superpowers/writing-skills/SKILL.md +655 -0
- package/skills/superpowers/writing-skills/anthropic-best-practices.md +1150 -0
- package/skills/superpowers/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/superpowers/writing-skills/graphviz-conventions.dot +172 -0
- package/skills/superpowers/writing-skills/persuasion-principles.md +187 -0
- package/skills/superpowers/writing-skills/render-graphs.js +168 -0
- package/skills/superpowers/writing-skills/testing-skills-with-subagents.md +384 -0
- package/skills/sync/SKILL.md +188 -0
- package/skills/templates/SKILL.md +194 -0
- package/skills/welcome/SKILL.md +136 -0
- package/skills/wizard/SKILL.md +411 -0
- package/templates/CLAUDE.md.managed-block +123 -0
- package/templates/CLAUDE.md.template +111 -0
- package/templates/consulting/engagement-tracker-template.md +181 -0
- package/templates/consulting/executive-summary-template.md +83 -0
- package/templates/consulting/maturity-assessment-template.md +182 -0
- package/templates/consulting/proposal-template.md +209 -0
- package/templates/consulting/roi-model-template.md +139 -0
- package/templates/consulting/solution-architecture-template.md +313 -0
- package/templates/settings.json +130 -0
|
@@ -0,0 +1,740 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
# UserPromptSubmit hook: Route requests to appropriate agents/skills.
|
|
4
|
+
# v2: Injects full routing table ONCE per session, compact reminders afterward.
|
|
5
|
+
# Saves ~1,400 tokens per message after the first (95% context reduction).
|
|
6
|
+
# stdout is injected as context into the conversation.
|
|
7
|
+
#
|
|
8
|
+
# CONFIG-AWARE: Sources .claude-agents.conf to build routing table dynamically.
|
|
9
|
+
# AUTO-DISCOVERY: Scans for project-specific agents/skills (regular files, not symlinks).
|
|
10
|
+
# FALLBACK: If no config found, emits hardcoded table for backwards compatibility.
|
|
11
|
+
|
|
12
|
+
# ---------------------------------------------------------------------------
|
|
13
|
+
# Resolve project directory
|
|
14
|
+
# ---------------------------------------------------------------------------
|
|
15
|
+
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-$(pwd)}"
|
|
16
|
+
CONF_FILE="$PROJECT_DIR/.claude/.claude-agents.conf"
|
|
17
|
+
MARKER_FILE="$PROJECT_DIR/.claude/.triage-full-emitted"
|
|
18
|
+
|
|
19
|
+
# ---------------------------------------------------------------------------
|
|
20
|
+
# Conversational filter — skip routing for short follow-up messages
|
|
21
|
+
# ---------------------------------------------------------------------------
|
|
22
|
+
# ---------------------------------------------------------------------------
|
|
23
|
+
# Step 1: Autopilot intercept — runs FIRST, before any filtering
|
|
24
|
+
# ---------------------------------------------------------------------------
|
|
25
|
+
USER_MSG="${CLAUDE_USER_PROMPT:-}"
|
|
26
|
+
WORKFLOW_STATE="$PROJECT_DIR/.claude/.workflow-state.json"
|
|
27
|
+
if [ -f "$WORKFLOW_STATE" ]; then
|
|
28
|
+
_ap_mode=$(python3 -c "import json; print(json.load(open('$WORKFLOW_STATE')).get('mode',''))" 2>/dev/null || echo "")
|
|
29
|
+
if [ "$_ap_mode" = "autopilot" ]; then
|
|
30
|
+
# Auto-pause stale workflows (older than 24 hours)
|
|
31
|
+
_ap_age=$(python3 -c "
|
|
32
|
+
import json, datetime
|
|
33
|
+
s = json.load(open('$WORKFLOW_STATE'))
|
|
34
|
+
started = s.get('started_at','')
|
|
35
|
+
if started:
|
|
36
|
+
dt = datetime.datetime.fromisoformat(started.replace('Z','+00:00'))
|
|
37
|
+
age_hours = (datetime.datetime.now(datetime.timezone.utc) - dt).total_seconds() / 3600
|
|
38
|
+
print(int(age_hours))
|
|
39
|
+
else:
|
|
40
|
+
print(0)
|
|
41
|
+
" 2>/dev/null || echo "0")
|
|
42
|
+
if [ "${_ap_age:-0}" -gt 24 ]; then
|
|
43
|
+
# Stale — auto-pause and fall through to normal routing
|
|
44
|
+
python3 << PYEOF
|
|
45
|
+
import json
|
|
46
|
+
path = "$WORKFLOW_STATE"
|
|
47
|
+
with open(path) as f: s = json.load(f)
|
|
48
|
+
s["mode"] = "paused"
|
|
49
|
+
with open(path, "w") as f: json.dump(s, f, indent=2)
|
|
50
|
+
PYEOF
|
|
51
|
+
echo "Autopilot auto-paused (stale — started ${_ap_age}h ago). Resume with /autopilot."
|
|
52
|
+
# Fall through to normal routing below
|
|
53
|
+
else
|
|
54
|
+
# Active and fresh — route to autopilot
|
|
55
|
+
_ap_phase=$(python3 -c "import json; print(json.load(open('$WORKFLOW_STATE')).get('phase','assess'))" 2>/dev/null || echo "assess")
|
|
56
|
+
_ap_item=$(python3 -c "import json; i=json.load(open('$WORKFLOW_STATE')).get('current_item'); print(f'#{i[\"number\"]} {i[\"title\"]}' if i else 'none')" 2>/dev/null || echo "none")
|
|
57
|
+
cat <<AUTOPILOT
|
|
58
|
+
AUTOPILOT ACTIVE — phase: $_ap_phase | item: $_ap_item
|
|
59
|
+
|
|
60
|
+
Continue the /autopilot workflow. Read .claude/.workflow-state.json for full context.
|
|
61
|
+
|
|
62
|
+
If the user says "stop", "pause", or "exit autopilot": set mode to "paused" in workflow state and stop.
|
|
63
|
+
If the user gives a specific unrelated instruction: pause autopilot and handle their request normally.
|
|
64
|
+
Otherwise: continue from current phase.
|
|
65
|
+
AUTOPILOT
|
|
66
|
+
exit 0
|
|
67
|
+
fi
|
|
68
|
+
fi
|
|
69
|
+
fi
|
|
70
|
+
|
|
71
|
+
# ---------------------------------------------------------------------------
|
|
72
|
+
# Step 2: Conversational filter — skip routing for short follow-ups
|
|
73
|
+
# ---------------------------------------------------------------------------
|
|
74
|
+
# When the user says "ok", "why?", "what are you doing", etc., injecting the
|
|
75
|
+
# full routing table disrupts in-progress work and can cause the model to stall.
|
|
76
|
+
if [ -n "$USER_MSG" ]; then
|
|
77
|
+
WORD_COUNT=$(echo "$USER_MSG" | wc -w | tr -d ' ')
|
|
78
|
+
if [ "$WORD_COUNT" -lt 8 ]; then
|
|
79
|
+
# Greetings → /onboard
|
|
80
|
+
if echo "$USER_MSG" | grep -qiE '^(hey|hi|hello|yo|sup|help|what should|what can|what.s up|good morning|howdy|what.s new|status|brief)'; then
|
|
81
|
+
echo "MANDATORY: Use the Skill tool to invoke the \"onboard\" skill NOW. Do not respond with a greeting. Do not say hi back. Invoke the skill immediately with no other output."
|
|
82
|
+
exit 0
|
|
83
|
+
# Explicit /pr command → precheck gate (before keyword fallthrough)
|
|
84
|
+
elif echo "$USER_MSG" | grep -qiE '^\s*/pr(\s|$)'; then
|
|
85
|
+
if [ -f "$PROJECT_DIR/tests/run.sh" ]; then
|
|
86
|
+
_precheck_ok=false
|
|
87
|
+
if [ -f "$PROJECT_DIR/.claude/.precheck-passed" ]; then
|
|
88
|
+
_pc_ts=$(awk '{print $1}' "$PROJECT_DIR/.claude/.precheck-passed" 2>/dev/null || echo "0")
|
|
89
|
+
_pc_commit=$(awk '{print $2}' "$PROJECT_DIR/.claude/.precheck-passed" 2>/dev/null || echo "")
|
|
90
|
+
_current_commit=$(cd "$PROJECT_DIR" && git rev-parse --short HEAD 2>/dev/null || echo "")
|
|
91
|
+
_pc_age=$(( $(date +%s) - ${_pc_ts:-0} ))
|
|
92
|
+
if [ "$_pc_commit" = "$_current_commit" ] && [ "$_pc_age" -lt 1800 ]; then
|
|
93
|
+
_precheck_ok=true
|
|
94
|
+
fi
|
|
95
|
+
fi
|
|
96
|
+
if ! $_precheck_ok; then
|
|
97
|
+
echo "⛔ PRECHECK REQUIRED. Run /precheck before /pr on toolkit projects."
|
|
98
|
+
echo "Use the Skill tool to invoke the \"precheck\" skill NOW. Do NOT invoke /pr until precheck passes."
|
|
99
|
+
exit 0
|
|
100
|
+
fi
|
|
101
|
+
fi
|
|
102
|
+
: # Fall through — let harness handle /pr normally
|
|
103
|
+
# ANY keyword that matches a workflow → fall through to pattern matching
|
|
104
|
+
elif echo "$USER_MSG" | grep -qiE 'down|outage|crash|500|broke|fail|error|slow|timeout|incident|prod|deploy|fix|bug|build|add|create|implement|plan|test|lint|review|pr|merge|push|commit|restart|start|stop|check|health|debug|ship|release|refactor|migrate|search|find|where|show|login|auth|can.t|cannot|unable|exhaust|regress|wrong|broken|validate|verify|calibrate|autopilot|explain|how does'; then
|
|
105
|
+
: # Fall through — pattern matching in compact section will handle it
|
|
106
|
+
# Explicit slash commands always get routed
|
|
107
|
+
elif echo "$USER_MSG" | grep -qiE '^\s*/'; then
|
|
108
|
+
: # Fall through to routing
|
|
109
|
+
else
|
|
110
|
+
exit 0 # Conversational follow-up — no routing needed
|
|
111
|
+
fi
|
|
112
|
+
fi
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
# ---------------------------------------------------------------------------
|
|
116
|
+
# Non-engineer role detection — route vague messages to /welcome
|
|
117
|
+
# ---------------------------------------------------------------------------
|
|
118
|
+
USER_ROLE=""
|
|
119
|
+
if [ -f "$CONF_FILE" ]; then
|
|
120
|
+
USER_ROLE=$(grep '^USER_ROLE=' "$CONF_FILE" 2>/dev/null | head -1 | sed 's/^USER_ROLE="//' | sed 's/"$//' || true)
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
# Non-engineer roles get /welcome for vague/greeting messages
|
|
124
|
+
if [ -n "$USER_ROLE" ] && [ "$USER_ROLE" != "engineer" ] && [ "$USER_ROLE" != "dev" ] && [ "$USER_ROLE" != "developer" ]; then
|
|
125
|
+
if [ -n "$USER_MSG" ]; then
|
|
126
|
+
WORD_COUNT_CHECK=$(echo "$USER_MSG" | wc -w | tr -d ' ')
|
|
127
|
+
# Vague/greeting messages from non-engineers → /welcome
|
|
128
|
+
if [ "$WORD_COUNT_CHECK" -lt 8 ]; then
|
|
129
|
+
if echo "$USER_MSG" | grep -qiE '^(hey|hi|hello|yo|sup|help|what|how|who)' && \
|
|
130
|
+
! echo "$USER_MSG" | grep -qiE '^\s*/'; then
|
|
131
|
+
echo "NON-ENGINEER WELCOME — Role: $USER_ROLE"
|
|
132
|
+
echo "Route to /welcome skill. This user is a $(echo "$USER_ROLE" | tr '-' ' '). Show the role-appropriate menu."
|
|
133
|
+
echo "Do NOT show the full routing table. Do NOT mention agents, skills, hooks, or model tiers."
|
|
134
|
+
date +%s > "$MARKER_FILE" 2>/dev/null || true
|
|
135
|
+
exit 0
|
|
136
|
+
fi
|
|
137
|
+
fi
|
|
138
|
+
fi
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
# ---------------------------------------------------------------------------
|
|
142
|
+
# Determine: full table or compact reminder?
|
|
143
|
+
# ---------------------------------------------------------------------------
|
|
144
|
+
needs_full=false
|
|
145
|
+
|
|
146
|
+
# No marker → first message this session → need full table
|
|
147
|
+
if [ ! -f "$MARKER_FILE" ]; then
|
|
148
|
+
needs_full=true
|
|
149
|
+
else
|
|
150
|
+
# Check marker freshness (re-inject if stale >2 hours)
|
|
151
|
+
if [ "$(uname)" = "Darwin" ]; then
|
|
152
|
+
marker_age=$(( $(date +%s) - $(stat -f%m "$MARKER_FILE") ))
|
|
153
|
+
else
|
|
154
|
+
marker_age=$(( $(date +%s) - $(stat -c%Y "$MARKER_FILE") ))
|
|
155
|
+
fi
|
|
156
|
+
if [ "$marker_age" -gt 7200 ]; then
|
|
157
|
+
needs_full=true
|
|
158
|
+
fi
|
|
159
|
+
fi
|
|
160
|
+
|
|
161
|
+
# Force full table if user is asking about available tools/skills/agents
|
|
162
|
+
if [ -n "$USER_MSG" ]; then
|
|
163
|
+
if echo "$USER_MSG" | grep -qiE '(what|which|list|show|available).*(skill|agent|tool|command|can I|can you)'; then
|
|
164
|
+
needs_full=true
|
|
165
|
+
fi
|
|
166
|
+
fi
|
|
167
|
+
|
|
168
|
+
# ---------------------------------------------------------------------------
|
|
169
|
+
# COMPACT ROUTING — pattern-matched direct routing for ALL workflows
|
|
170
|
+
# Checks patterns in priority order. First match wins.
|
|
171
|
+
# ---------------------------------------------------------------------------
|
|
172
|
+
if ! $needs_full; then
|
|
173
|
+
if [ -n "$USER_MSG" ]; then
|
|
174
|
+
|
|
175
|
+
# ===================================================================
|
|
176
|
+
# PRIORITY 1: INCIDENTS (urgent — act immediately)
|
|
177
|
+
# ===================================================================
|
|
178
|
+
|
|
179
|
+
# Critical production incidents → /incident
|
|
180
|
+
if echo "$USER_MSG" | grep -qiE 'down|outage|crash|data.?loss|security.?breach|breach|corrupt|site.*(not|is).*(work|respond)|can.?t.*(access|reach|connect|login|log.?in|sign.?in)|service.*(unavail|unreach)|users?.*(can.?t|cannot|unable)'; then
|
|
181
|
+
echo "CRITICAL INCIDENT. Use the Skill tool to invoke the \"incident\" skill NOW with the user's description. Do not ask questions."
|
|
182
|
+
exit 0
|
|
183
|
+
fi
|
|
184
|
+
|
|
185
|
+
# Production/staging errors → /incident
|
|
186
|
+
if echo "$USER_MSG" | grep -qiE '(prod|production|staging|live).*(error|issue|problem|broken|slow|timeout|degrad)|50[0-4].?(error|in prod|in staging)|gateway.?timeout|bad.?gateway|service.?unavail'; then
|
|
187
|
+
echo "PRODUCTION ISSUE. Use the Skill tool to invoke the \"incident\" skill with the user's description."
|
|
188
|
+
exit 0
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
# Performance issues → /incident
|
|
192
|
+
if echo "$USER_MSG" | grep -qiE '(extremely|very|super).?slow|latency.*(spike|increas|high)|memory.?(leak|spike|full)|cpu.*(spike|100|high)|disk.?(full|space)|connection.?(pool|exhaust|limit)|exhaust|out.?of.?(memory|connections|space)'; then
|
|
193
|
+
echo "PERFORMANCE INCIDENT. Use the Skill tool to invoke the \"incident\" skill with the user's description."
|
|
194
|
+
exit 0
|
|
195
|
+
fi
|
|
196
|
+
|
|
197
|
+
# ===================================================================
|
|
198
|
+
# PRIORITY 2: CI/CD (broken pipeline — needs fast fix)
|
|
199
|
+
# ===================================================================
|
|
200
|
+
|
|
201
|
+
# CI failures → /ci-fix
|
|
202
|
+
if echo "$USER_MSG" | grep -qiE 'ci.*(fail|broke|red|down)|pipeline.*(fail|broke|error)|build.*(fail|broke|error)|actions.*(fail|red)|workflow.*(fail|error)|tests?.*(fail|broke).*(ci|pipeline|actions)|lint.*(fail|error).*(ci|pipeline)|type.*(error|fail).*(ci|pipeline)|checks?.*(fail|red)|fail.*(in|on).*(ci|pipeline|actions|workflow)'; then
|
|
203
|
+
echo "CI FAILURE. Use the Skill tool to invoke the \"ci-fix\" skill. It handles 3-attempt diagnosis and fix."
|
|
204
|
+
exit 0
|
|
205
|
+
fi
|
|
206
|
+
|
|
207
|
+
# ===================================================================
|
|
208
|
+
# PRIORITY 3: BUG FIXES (broken code — needs formal pipeline)
|
|
209
|
+
# ===================================================================
|
|
210
|
+
|
|
211
|
+
# Bug fix with issue reference → /fix #N
|
|
212
|
+
if echo "$USER_MSG" | grep -qiE 'fix.*(issue|bug|ticket|#[0-9])|#[0-9]+.*(fix|bug|broken|regression)|resolve.*(issue|bug|#[0-9])|close.*(issue|bug|#[0-9])'; then
|
|
213
|
+
echo "BUG FIX. Use the Skill tool to invoke the \"fix\" skill with the user's description. Formal pipeline: root cause → scope lock → behavior contract → test."
|
|
214
|
+
exit 0
|
|
215
|
+
fi
|
|
216
|
+
|
|
217
|
+
# Bug fix without issue reference → /fix
|
|
218
|
+
if echo "$USER_MSG" | grep -qiE 'fix.*(bug|crash|error|regression|issue|broken)|debug.*(this|the|a|why)|why.*(crash|fail|error|broken|wrong)|broken.*(feature|endpoint|page|button|form|api|login|auth)|regression.*(in|on|with|from)|not.?working.*(correct|proper|right|anymore)|stopped.?working|wrong.*(output|result|behavior|response)|(page|endpoint|feature|api|login|form|button).*(is|are).*(broken|wrong|not working)|there.?s.?a.?(bug|regression|issue|problem)'; then
|
|
219
|
+
echo "BUG FIX. Use the Skill tool to invoke the \"fix\" skill with the user's description."
|
|
220
|
+
exit 0
|
|
221
|
+
fi
|
|
222
|
+
|
|
223
|
+
# ===================================================================
|
|
224
|
+
# PRIORITY 4: PR CREATION (ship code — before feature check so "create a PR" doesn't match feature)
|
|
225
|
+
# ===================================================================
|
|
226
|
+
|
|
227
|
+
# Create PR → /pr (with precheck gate for toolkit projects)
|
|
228
|
+
if echo "$USER_MSG" | grep -qiE 'create.*(a |the )?pr|make.*(a |the )?pr|open.*(a |the )?pr|submit.*(a |the )?pr|push.*(and|&).*(pr|pull)|ship.*(this|it|the code|changes)|ready.?to.?(ship|merge|pr)|let.?s.?(ship|pr|merge|push)|merge.*(this|it|the|my)'; then
|
|
229
|
+
# Precheck gate: if this is a toolkit project, require /precheck first
|
|
230
|
+
if [ -f "$PROJECT_DIR/tests/run.sh" ]; then
|
|
231
|
+
_precheck_ok=false
|
|
232
|
+
if [ -f "$PROJECT_DIR/.claude/.precheck-passed" ]; then
|
|
233
|
+
_pc_ts=$(awk '{print $1}' "$PROJECT_DIR/.claude/.precheck-passed" 2>/dev/null || echo "0")
|
|
234
|
+
_pc_commit=$(awk '{print $2}' "$PROJECT_DIR/.claude/.precheck-passed" 2>/dev/null || echo "")
|
|
235
|
+
_current_commit=$(cd "$PROJECT_DIR" && git rev-parse --short HEAD 2>/dev/null || echo "")
|
|
236
|
+
_pc_age=$(( $(date +%s) - ${_pc_ts:-0} ))
|
|
237
|
+
# Valid if: same commit AND less than 30 minutes old
|
|
238
|
+
if [ "$_pc_commit" = "$_current_commit" ] && [ "$_pc_age" -lt 1800 ]; then
|
|
239
|
+
_precheck_ok=true
|
|
240
|
+
fi
|
|
241
|
+
fi
|
|
242
|
+
if ! $_precheck_ok; then
|
|
243
|
+
echo "⛔ PRECHECK REQUIRED. This is a toolkit project — run /precheck before creating a PR."
|
|
244
|
+
echo "Use the Skill tool to invoke the \"precheck\" skill NOW. Do NOT invoke /pr until precheck passes."
|
|
245
|
+
exit 0
|
|
246
|
+
fi
|
|
247
|
+
fi
|
|
248
|
+
echo "CREATE PR. Use the Skill tool to invoke the \"pr\" skill. It runs QA first, then creates the PR."
|
|
249
|
+
exit 0
|
|
250
|
+
fi
|
|
251
|
+
|
|
252
|
+
# ===================================================================
|
|
253
|
+
# PRIORITY 5: FEATURE DEVELOPMENT (new work — needs planning)
|
|
254
|
+
# ===================================================================
|
|
255
|
+
|
|
256
|
+
# New feature → /planning (exclude PR-related phrases)
|
|
257
|
+
if echo "$USER_MSG" | grep -qiE 'build.*(a|the|new|me)|create.*(a|the|new|me).*(feature|endpoint|page|component|system|service|module|api|app)|add.*(a|the|new|feature|support|ability|endpoint|page|component|functionality)|implement.*(a|the|new)|develop.*(a|the|new)|make.*(a|the|new)|design.*(a|the|new|system)|plan.*(a|the|new|feature|how)|new.?feature|feature.?request|i.?want.*(to add|to build|to create|a new)|let.?s.*(build|create|add|make|design)|we.?need.*(a|to add|to build|to create)'; then
|
|
258
|
+
echo "FEATURE DEVELOPMENT. Use the Skill tool to invoke the \"planning\" skill with the feature name extracted from the user's description. This spawns PM + architect to create an implementation plan."
|
|
259
|
+
exit 0
|
|
260
|
+
fi
|
|
261
|
+
|
|
262
|
+
# Implement from existing plan → /implement
|
|
263
|
+
if echo "$USER_MSG" | grep -qiE 'implement.*(plan|the plan|from plan)|build.*(from plan|the plan)|start.*(implement|building|coding)|execute.*(the plan|plan)|let.?s.?(code|implement|build).?it|ready.?to.?(build|implement|code)|go.?ahead.?(and)?.?(build|implement|code)'; then
|
|
264
|
+
echo "IMPLEMENTATION. Use the Skill tool to invoke the \"implement\" skill. It reads the plan from .claude/plans/ and spawns dev agents."
|
|
265
|
+
exit 0
|
|
266
|
+
fi
|
|
267
|
+
|
|
268
|
+
# ===================================================================
|
|
269
|
+
# PRIORITY 5: QA & REVIEW (validation — before shipping)
|
|
270
|
+
# ===================================================================
|
|
271
|
+
|
|
272
|
+
# Run tests/QA → /qa
|
|
273
|
+
if echo "$USER_MSG" | grep -qiE 'run.*(test|qa|check|validat|lint|type.?check)|test.*(this|it|everything|all|the)|check.*(quality|code|if.*work|if.*pass)|validate|verify.*(this|the|code|changes|it)|does.*(this|it).*(work|pass)|make.?sure.*(it|this|everything).*(work|pass)|qa.*(this|check|run|full)|are.*(tests|checks).*(pass|green)'; then
|
|
274
|
+
echo "QA. Use the Skill tool to invoke the \"qa\" skill. Modes: /qa (commit), /qa full (comprehensive), /qa staging, /qa prod."
|
|
275
|
+
exit 0
|
|
276
|
+
fi
|
|
277
|
+
|
|
278
|
+
# Review PR → /review-pr
|
|
279
|
+
if echo "$USER_MSG" | grep -qiE 'review.*(pr|pull|code|this|the|my|changes|diff)|code.?review|check.*(my|the|this).*(pr|code|changes|diff)|look.?(at|over).*(my|the|this).*(pr|code|changes)|pr.*(review|feedback)|give.*(feedback|review)'; then
|
|
280
|
+
echo "CODE REVIEW. Use the Skill tool to invoke the \"review-pr\" skill. Auto-detects bug fix vs feature PR."
|
|
281
|
+
exit 0
|
|
282
|
+
fi
|
|
283
|
+
|
|
284
|
+
# ===================================================================
|
|
285
|
+
# PRIORITY 7: OPS & SRE (infrastructure, deployment, health)
|
|
286
|
+
# ===================================================================
|
|
287
|
+
|
|
288
|
+
# SRE operations → /sre
|
|
289
|
+
if echo "$USER_MSG" | grep -qiE 'deploy.*(to|status|check|log)|check.*(deploy|health|status|infra|prod|staging)|health.?(check|status|endpoint)|infra.?(status|health|check)|service.?(status|health)|what.?s.*(the status|running|deployed)|is.*(prod|staging|deploy).*(ok|healthy|up|running)|show.*(logs|status|health|deploy)|monitor|uptime'; then
|
|
290
|
+
echo "SRE. Use the Skill tool to invoke the \"sre\" skill. Commands: /sre status, /sre health, /sre logs, /sre deploy-check, /sre debug."
|
|
291
|
+
exit 0
|
|
292
|
+
fi
|
|
293
|
+
|
|
294
|
+
# Restart → /restart
|
|
295
|
+
if echo "$USER_MSG" | grep -qiE 'restart.*(server|service|app|dev|local|frontend|backend)|stop.*(server|service|app)|start.*(server|service|app|dev)|kill.*(server|port|process)|server.*(not|isn.t).*(starting|running|responding)'; then
|
|
296
|
+
echo "RESTART. Use the Skill tool to invoke the \"restart\" skill to restart local dev servers."
|
|
297
|
+
exit 0
|
|
298
|
+
fi
|
|
299
|
+
|
|
300
|
+
# ===================================================================
|
|
301
|
+
# PRIORITY 7: SEARCH & EXPLORE (codebase questions)
|
|
302
|
+
# ===================================================================
|
|
303
|
+
|
|
304
|
+
# Codebase search → explore-light agent (Haiku, cheap)
|
|
305
|
+
if echo "$USER_MSG" | grep -qiE 'find.*(file|function|class|where|code|import|usage|reference|middleware|handler|route|endpoint|component)|search.*(for|the|codebase)|where.*(is|are|does|do)|show.*(me|the).*(file|code|function|class|import|route|endpoint|api|component)|how.*(does|is|do).*(this|the|it|the.*flow|payment|auth|login).*(work|implement|structured|flow)|what.*(file|function|class|module|service).*(is|has|contains|does)|look.?(up|for)|locate|grep.?for|explain.*(the|this|how)'; then
|
|
306
|
+
echo "CODEBASE SEARCH. Spawn an explore-light agent (Haiku, 1x cost) to search the codebase. Do NOT search yourself — delegate to explore-light."
|
|
307
|
+
exit 0
|
|
308
|
+
fi
|
|
309
|
+
|
|
310
|
+
# ===================================================================
|
|
311
|
+
# PRIORITY 8: GIT OPS (cheap operations)
|
|
312
|
+
# ===================================================================
|
|
313
|
+
|
|
314
|
+
# Git operations → ops agent (Haiku, cheap)
|
|
315
|
+
if echo "$USER_MSG" | grep -qiE 'git.*(status|log|diff|branch|stash|pull|fetch|checkout|rebase|cherry)|commit.*(this|the|changes|code)|push.*(this|the|code|branch)|branch.*(create|switch|delete|list|name)|what.*(branch|commit|changed)|show.*(diff|changes|log|history)|stash|merge.*(branch|conflict|this)'; then
|
|
316
|
+
echo "GIT OPS. Spawn an ops agent (Haiku, 1x cost) to handle git operations. Do NOT do git ops yourself — delegate to ops."
|
|
317
|
+
exit 0
|
|
318
|
+
fi
|
|
319
|
+
|
|
320
|
+
# Run commands → ops agent
|
|
321
|
+
if echo "$USER_MSG" | grep -qiE 'run.*(lint|build|format|clean|install|migrate|seed)|lint.*(this|the|code|all)|build.*(this|the|app|project)|format.*(this|the|code)|clean.*(cache|build|node_modules)|install.*(deps|dependencies|packages)|migrate.*(database|db|schema)|seed.*(database|db|data)'; then
|
|
322
|
+
echo "OPS. Spawn an ops agent (Haiku, 1x cost) to run the command."
|
|
323
|
+
exit 0
|
|
324
|
+
fi
|
|
325
|
+
|
|
326
|
+
# ===================================================================
|
|
327
|
+
# PRIORITY 9: CODE CHANGES (targeted edits)
|
|
328
|
+
# ===================================================================
|
|
329
|
+
|
|
330
|
+
# Frontend code changes → frontend agent
|
|
331
|
+
if echo "$USER_MSG" | grep -qiE '(change|update|edit|modify|style|tweak|adjust).*(component|page|button|form|modal|ui|css|style|layout|header|footer|nav|sidebar|theme|color|font|icon|image)|frontend.*(change|update|fix)|ui.*(change|update|fix|tweak)|css.*(change|fix|update)|style.*(change|fix|update)|responsive|mobile.?(view|layout|design)'; then
|
|
332
|
+
echo "FRONTEND. Spawn a frontend agent (Sonnet, 10x) for UI/frontend code changes."
|
|
333
|
+
exit 0
|
|
334
|
+
fi
|
|
335
|
+
|
|
336
|
+
# Backend code changes → backend agent
|
|
337
|
+
if echo "$USER_MSG" | grep -qiE '(change|update|edit|modify|add).*(endpoint|route|api|model|schema|service|controller|middleware|migration|query|database)|backend.*(change|update|fix)|api.*(change|update|fix|add)|database.*(change|update|query|add)|model.*(change|update|add|field)|endpoint.*(change|update|add|remove)|migration.*(create|add|run)'; then
|
|
338
|
+
echo "BACKEND. Spawn a backend agent (Sonnet, 10x) for backend/API code changes."
|
|
339
|
+
exit 0
|
|
340
|
+
fi
|
|
341
|
+
|
|
342
|
+
# ===================================================================
|
|
343
|
+
# PRIORITY 10: AUTONOMOUS & CALIBRATE
|
|
344
|
+
# ===================================================================
|
|
345
|
+
|
|
346
|
+
# Autopilot → /autopilot
|
|
347
|
+
if echo "$USER_MSG" | grep -qiE 'autopilot|auto.?pilot|work.*(on|through).*(issues|tickets|backlog)|pick.?up.*(issues|work|tickets)|be.*(a|my).*(junior|engineer|dev)|handle.*(the|my).*(backlog|issues|tickets)|autonomous|auto.?mode'; then
|
|
348
|
+
echo "AUTOPILOT. Use the Skill tool to invoke the \"autopilot\" skill. It picks up issues, implements, QAs, and creates PRs autonomously."
|
|
349
|
+
exit 0
|
|
350
|
+
fi
|
|
351
|
+
|
|
352
|
+
# Calibrate → /calibrate
|
|
353
|
+
if echo "$USER_MSG" | grep -qiE 'calibrate|setup.*(toolkit|agents|mcp)|configure.*(toolkit|agents|mcp)|learn.*(my|the|this).*(project|codebase)|scan.*(codebase|project)|what.*(tools|mcp|agents).*(need|should|install|recommend)'; then
|
|
354
|
+
echo "CALIBRATE. Use the Skill tool to invoke the \"calibrate\" skill. It deep-learns the project and configures MCP servers, agents, skills, and workflows."
|
|
355
|
+
exit 0
|
|
356
|
+
fi
|
|
357
|
+
|
|
358
|
+
# ===================================================================
|
|
359
|
+
# PRIORITY 11: ARCHITECTURE (expensive — Opus, last resort)
|
|
360
|
+
# ===================================================================
|
|
361
|
+
|
|
362
|
+
# Architecture decisions → architect agent (Opus)
|
|
363
|
+
if echo "$USER_MSG" | grep -qiE 'architect.*(this|the|a|system|service)|system.?design|how.?should.*(we|i).*(structure|design|architect|organize)|what.*(approach|pattern|architecture)|trade.?off|scale.*(this|the|system|service)|microservice|monolith|event.?driven|should.*(we|i).*(use|pick|choose).*(pattern|framework|approach)'; then
|
|
364
|
+
echo "ARCHITECTURE. Spawn an architect agent (Opus, 60x — expensive). Only use for genuine architecture decisions, not for implementation."
|
|
365
|
+
exit 0
|
|
366
|
+
fi
|
|
367
|
+
|
|
368
|
+
fi
|
|
369
|
+
# No pattern matched → generic compact reminder
|
|
370
|
+
cat <<'COMPACT'
|
|
371
|
+
TRIAGE — Use SPEED scoring. 2+ → toolkit agent/skill. 0-1 → built-in tools.
|
|
372
|
+
If mid-task, finish the work — don't re-route.
|
|
373
|
+
COMPACT
|
|
374
|
+
exit 0
|
|
375
|
+
fi
|
|
376
|
+
|
|
377
|
+
# ===========================================================================
|
|
378
|
+
# FULL TABLE — first message of session (or refresh triggered)
|
|
379
|
+
# ===========================================================================
|
|
380
|
+
|
|
381
|
+
# ---------------------------------------------------------------------------
|
|
382
|
+
# Known agent/skill metadata (pattern, display name, cost)
|
|
383
|
+
# Bash 3 doesn't have associative arrays — use parallel indexed arrays.
|
|
384
|
+
# ---------------------------------------------------------------------------
|
|
385
|
+
KNOWN_NAMES=()
|
|
386
|
+
KNOWN_PATTERNS=()
|
|
387
|
+
KNOWN_DISPLAYS=()
|
|
388
|
+
KNOWN_COSTS=()
|
|
389
|
+
|
|
390
|
+
_register() {
|
|
391
|
+
KNOWN_NAMES+=("$1")
|
|
392
|
+
KNOWN_PATTERNS+=("$2")
|
|
393
|
+
KNOWN_DISPLAYS+=("$3")
|
|
394
|
+
KNOWN_COSTS+=("$4")
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
# Core agents
|
|
398
|
+
_register "explore-light" "find/search/where/what files" "explore-light (Haiku)" "1x"
|
|
399
|
+
|
|
400
|
+
# Strategy & Design agents
|
|
401
|
+
_register "architect" "architecture/system design" "architect agent" "10x"
|
|
402
|
+
_register "code-reviewer" "code review" "code-reviewer agent" "10x"
|
|
403
|
+
_register "design-studio-create" "UI/UX design implementation" "design-studio:create" "10x"
|
|
404
|
+
_register "design-studio-critique" "design review/critique" "design-studio:critique" "10x"
|
|
405
|
+
_register "design-studio-think" "design exploration/thinking" "design-studio:think" "10x"
|
|
406
|
+
_register "gtm-expert" "go-to-market/launch strategy" "gtm-expert agent" "10x"
|
|
407
|
+
_register "product-manager" "product specs/PRD/roadmap" "product-manager agent" "10x"
|
|
408
|
+
|
|
409
|
+
# Development agents
|
|
410
|
+
_register "frontend" "frontend/UI code change" "frontend agent (Sonnet)" "10x"
|
|
411
|
+
_register "python-backend" "backend/API code change" "backend agent (Sonnet)" "10x"
|
|
412
|
+
_register "ops" "run tests/lint/restart/git ops" "ops agent (Haiku)" "1x"
|
|
413
|
+
|
|
414
|
+
# Quality agents
|
|
415
|
+
_register "qa" "QA/test validation" "qa orchestrator" "10x"
|
|
416
|
+
_register "qa-e2e" "E2E browser tests" "qa-e2e agent" "10x"
|
|
417
|
+
_register "qa-challenger" "adversarial QA/red-team" "qa-challenger agent" "10x"
|
|
418
|
+
_register "qa-test-promoter" "promote tests to baseline" "qa-test-promoter agent" "10x"
|
|
419
|
+
_register "qa-baseline-updater" "update test baselines" "qa-baseline-updater" "10x"
|
|
420
|
+
_register "qa-domain" "domain logic validation" "qa-domain agent" "10x"
|
|
421
|
+
|
|
422
|
+
# Operations agents
|
|
423
|
+
_register "sre" "SRE/infra/deploy/debug" "sre agent (Sonnet)" "10x"
|
|
424
|
+
|
|
425
|
+
# Skills
|
|
426
|
+
_register "sync" "sync claude-agents tooling" "/sync skill" "1x"
|
|
427
|
+
_register "calibrate" "calibrate/adapt toolkit to project" "/calibrate skill" "10x"
|
|
428
|
+
_register "scan" "scan codebase → update CLAUDE.md" "/scan skill" "1x"
|
|
429
|
+
_register "explore" "deep codebase exploration" "/explore skill" "1x"
|
|
430
|
+
_register "discord-ops" "Discord ChatOps" "/discord-ops skill" "1x"
|
|
431
|
+
_register "fix" "bug fix with formal pipeline" "/fix skill" "team"
|
|
432
|
+
_register "incident" "incident triage (anything broken)" "/incident skill" "team"
|
|
433
|
+
_register "implement" "implementation from plan" "/implement skill" "team"
|
|
434
|
+
_register "issue" "GitHub issue management" "/issue skill" "1x"
|
|
435
|
+
_register "planning" "feature planning" "/planning skill" "team"
|
|
436
|
+
_register "pr" "create PR with QA" "/pr skill" "1x-10x"
|
|
437
|
+
_register "review-pr" "PR review (bug/feature)" "/review-pr skill" "10x"
|
|
438
|
+
_register "superpowers" "advanced operations" "/superpowers skill" "varies"
|
|
439
|
+
_register "skill-qa" "QA test suite" "/qa skill" "10x"
|
|
440
|
+
_register "ci-fix" "fix CI/deploy failures" "/ci-fix skill" "10x"
|
|
441
|
+
_register "qa-incident" "log QA incident" "/qa-incident skill" "1x"
|
|
442
|
+
_register "qa-learn" "QA knowledge review" "/qa-learn skill" "1x"
|
|
443
|
+
_register "skill-sre" "SRE operations" "/sre skill" "10x"
|
|
444
|
+
_register "restart" "restart local servers" "/restart skill" "1x"
|
|
445
|
+
_register "onboard" "getting started/what to do" "/onboard skill" "1x"
|
|
446
|
+
_register "continue" "continue/resume/what was I doing" "/continue skill" "1x"
|
|
447
|
+
_register "autopilot" "autonomous work loop" "/autopilot skill" "team"
|
|
448
|
+
_register "welcome" "role-based welcome/menu" "/welcome skill" "1x"
|
|
449
|
+
_register "share" "share/export plan or strategy" "/share skill" "1x"
|
|
450
|
+
|
|
451
|
+
# ---------------------------------------------------------------------------
|
|
452
|
+
# Lookup helpers
|
|
453
|
+
# ---------------------------------------------------------------------------
|
|
454
|
+
_lookup_index() {
|
|
455
|
+
local name="$1"
|
|
456
|
+
local i
|
|
457
|
+
for i in "${!KNOWN_NAMES[@]}"; do
|
|
458
|
+
if [ "${KNOWN_NAMES[$i]}" = "$name" ]; then
|
|
459
|
+
echo "$i"
|
|
460
|
+
return 0
|
|
461
|
+
fi
|
|
462
|
+
done
|
|
463
|
+
return 1
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
# ---------------------------------------------------------------------------
|
|
467
|
+
# Emit a single markdown table row
|
|
468
|
+
# ---------------------------------------------------------------------------
|
|
469
|
+
_row() {
|
|
470
|
+
printf '| %s | %s | %s |\n' "$1" "$2" "$3"
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
# ---------------------------------------------------------------------------
|
|
474
|
+
# Build the routing table
|
|
475
|
+
# ---------------------------------------------------------------------------
|
|
476
|
+
build_table() {
|
|
477
|
+
local has_config=false
|
|
478
|
+
local rows=()
|
|
479
|
+
|
|
480
|
+
# ------------------------------------------------------------------
|
|
481
|
+
# 1. Source config if it exists
|
|
482
|
+
# ------------------------------------------------------------------
|
|
483
|
+
if [ -f "$CONF_FILE" ]; then
|
|
484
|
+
has_config=true
|
|
485
|
+
# shellcheck disable=SC1090
|
|
486
|
+
. "$CONF_FILE"
|
|
487
|
+
fi
|
|
488
|
+
|
|
489
|
+
if $has_config; then
|
|
490
|
+
# --------------------------------------------------------------
|
|
491
|
+
# 2a. Emit rows for INSTALLED_AGENTS from config
|
|
492
|
+
# --------------------------------------------------------------
|
|
493
|
+
if [ -n "${INSTALLED_AGENTS:-}" ]; then
|
|
494
|
+
for agent in $INSTALLED_AGENTS; do
|
|
495
|
+
local idx
|
|
496
|
+
if idx=$(_lookup_index "$agent"); then
|
|
497
|
+
rows+=("$(_row "${KNOWN_PATTERNS[$idx]}" "${KNOWN_DISPLAYS[$idx]}" "${KNOWN_COSTS[$idx]}")")
|
|
498
|
+
else
|
|
499
|
+
# Agent in config but not in known metadata — generic row
|
|
500
|
+
rows+=("$(_row "$agent tasks" "$agent agent" "10x")")
|
|
501
|
+
fi
|
|
502
|
+
done
|
|
503
|
+
fi
|
|
504
|
+
|
|
505
|
+
# --------------------------------------------------------------
|
|
506
|
+
# 2b. Emit rows for INSTALLED_SKILLS from config
|
|
507
|
+
# --------------------------------------------------------------
|
|
508
|
+
if [ -n "${INSTALLED_SKILLS:-}" ]; then
|
|
509
|
+
for skill in $INSTALLED_SKILLS; do
|
|
510
|
+
local idx
|
|
511
|
+
# Try skill-prefixed key first (disambiguates qa/sre which exist as both agent+skill)
|
|
512
|
+
if idx=$(_lookup_index "skill-$skill"); then
|
|
513
|
+
rows+=("$(_row "${KNOWN_PATTERNS[$idx]}" "${KNOWN_DISPLAYS[$idx]}" "${KNOWN_COSTS[$idx]}")")
|
|
514
|
+
elif idx=$(_lookup_index "$skill"); then
|
|
515
|
+
rows+=("$(_row "${KNOWN_PATTERNS[$idx]}" "${KNOWN_DISPLAYS[$idx]}" "${KNOWN_COSTS[$idx]}")")
|
|
516
|
+
else
|
|
517
|
+
# Skill in config but not in known metadata — generic row
|
|
518
|
+
rows+=("$(_row "$skill tasks" "/$skill skill" "1x")")
|
|
519
|
+
fi
|
|
520
|
+
done
|
|
521
|
+
fi
|
|
522
|
+
|
|
523
|
+
# --------------------------------------------------------------
|
|
524
|
+
# 3. Auto-discover project-specific agents (regular files, NOT symlinks)
|
|
525
|
+
# --------------------------------------------------------------
|
|
526
|
+
if [ -d "$PROJECT_DIR/.claude/agents" ]; then
|
|
527
|
+
for agent_file in "$PROJECT_DIR/.claude/agents/"*.md; do
|
|
528
|
+
[ ! -f "$agent_file" ] && continue
|
|
529
|
+
[ -L "$agent_file" ] && continue # Skip symlinks (managed by portable install)
|
|
530
|
+
local name
|
|
531
|
+
name="$(basename "$agent_file" .md)"
|
|
532
|
+
|
|
533
|
+
# Skip if already emitted from config
|
|
534
|
+
local already=false
|
|
535
|
+
if [ -n "${INSTALLED_AGENTS:-}" ]; then
|
|
536
|
+
for a in $INSTALLED_AGENTS; do
|
|
537
|
+
if [ "$a" = "$name" ]; then
|
|
538
|
+
already=true
|
|
539
|
+
break
|
|
540
|
+
fi
|
|
541
|
+
done
|
|
542
|
+
fi
|
|
543
|
+
$already && continue
|
|
544
|
+
|
|
545
|
+
# Check known metadata
|
|
546
|
+
local idx
|
|
547
|
+
if idx=$(_lookup_index "$name"); then
|
|
548
|
+
rows+=("$(_row "${KNOWN_PATTERNS[$idx]}" "${KNOWN_DISPLAYS[$idx]}" "${KNOWN_COSTS[$idx]}")")
|
|
549
|
+
else
|
|
550
|
+
rows+=("$(_row "$name tasks" "$name agent" "10x")")
|
|
551
|
+
fi
|
|
552
|
+
done
|
|
553
|
+
fi
|
|
554
|
+
|
|
555
|
+
# --------------------------------------------------------------
|
|
556
|
+
# 4. Auto-discover project-specific skills (regular dirs, NOT symlinks)
|
|
557
|
+
# --------------------------------------------------------------
|
|
558
|
+
if [ -d "$PROJECT_DIR/.claude/skills" ]; then
|
|
559
|
+
for skill_entry in "$PROJECT_DIR/.claude/skills/"*; do
|
|
560
|
+
# Handle both dirs and .md files (some skills are single files)
|
|
561
|
+
[ ! -e "$skill_entry" ] && continue
|
|
562
|
+
[ -L "$skill_entry" ] && continue # Skip symlinks
|
|
563
|
+
|
|
564
|
+
local name
|
|
565
|
+
name="$(basename "$skill_entry")"
|
|
566
|
+
# Strip .md extension if present
|
|
567
|
+
name="${name%.md}"
|
|
568
|
+
|
|
569
|
+
# Skip if already emitted from config
|
|
570
|
+
local already=false
|
|
571
|
+
if [ -n "${INSTALLED_SKILLS:-}" ]; then
|
|
572
|
+
for s in $INSTALLED_SKILLS; do
|
|
573
|
+
if [ "$s" = "$name" ]; then
|
|
574
|
+
already=true
|
|
575
|
+
break
|
|
576
|
+
fi
|
|
577
|
+
done
|
|
578
|
+
fi
|
|
579
|
+
$already && continue
|
|
580
|
+
|
|
581
|
+
# Check known metadata
|
|
582
|
+
local idx
|
|
583
|
+
if idx=$(_lookup_index "$name"); then
|
|
584
|
+
rows+=("$(_row "${KNOWN_PATTERNS[$idx]}" "${KNOWN_DISPLAYS[$idx]}" "${KNOWN_COSTS[$idx]}")")
|
|
585
|
+
else
|
|
586
|
+
rows+=("$(_row "$name tasks" "/$name skill" "1x")")
|
|
587
|
+
fi
|
|
588
|
+
done
|
|
589
|
+
fi
|
|
590
|
+
else
|
|
591
|
+
# ------------------------------------------------------------------
|
|
592
|
+
# FALLBACK: No config found — emit full hardcoded table
|
|
593
|
+
# ------------------------------------------------------------------
|
|
594
|
+
for i in "${!KNOWN_NAMES[@]}"; do
|
|
595
|
+
rows+=("$(_row "${KNOWN_PATTERNS[$i]}" "${KNOWN_DISPLAYS[$i]}" "${KNOWN_COSTS[$i]}")")
|
|
596
|
+
done
|
|
597
|
+
|
|
598
|
+
# Auto-discover project-specific agents (regular files, NOT symlinks)
|
|
599
|
+
if [ -d "$PROJECT_DIR/.claude/agents" ]; then
|
|
600
|
+
for agent_file in "$PROJECT_DIR/.claude/agents/"*.md; do
|
|
601
|
+
[ ! -f "$agent_file" ] && continue
|
|
602
|
+
[ -L "$agent_file" ] && continue
|
|
603
|
+
local name
|
|
604
|
+
name="$(basename "$agent_file" .md)"
|
|
605
|
+
# Skip if already in KNOWN_NAMES
|
|
606
|
+
local already=false
|
|
607
|
+
for kn in "${KNOWN_NAMES[@]}"; do
|
|
608
|
+
if [ "$kn" = "$name" ]; then
|
|
609
|
+
already=true
|
|
610
|
+
break
|
|
611
|
+
fi
|
|
612
|
+
done
|
|
613
|
+
$already && continue
|
|
614
|
+
rows+=("$(_row "$name tasks" "$name agent" "10x")")
|
|
615
|
+
done
|
|
616
|
+
fi
|
|
617
|
+
|
|
618
|
+
# Auto-discover project-specific skills (regular files/dirs, NOT symlinks)
|
|
619
|
+
if [ -d "$PROJECT_DIR/.claude/skills" ]; then
|
|
620
|
+
for skill_entry in "$PROJECT_DIR/.claude/skills/"*; do
|
|
621
|
+
[ ! -e "$skill_entry" ] && continue
|
|
622
|
+
[ -L "$skill_entry" ] && continue
|
|
623
|
+
local name
|
|
624
|
+
name="$(basename "$skill_entry")"
|
|
625
|
+
name="${name%.md}"
|
|
626
|
+
# Skip if already in KNOWN_NAMES
|
|
627
|
+
local already=false
|
|
628
|
+
for kn in "${KNOWN_NAMES[@]}"; do
|
|
629
|
+
if [ "$kn" = "$name" ]; then
|
|
630
|
+
already=true
|
|
631
|
+
break
|
|
632
|
+
fi
|
|
633
|
+
done
|
|
634
|
+
$already && continue
|
|
635
|
+
rows+=("$(_row "$name tasks" "/$name skill" "1x")")
|
|
636
|
+
done
|
|
637
|
+
fi
|
|
638
|
+
fi
|
|
639
|
+
|
|
640
|
+
# ------------------------------------------------------------------
|
|
641
|
+
# Output
|
|
642
|
+
# ------------------------------------------------------------------
|
|
643
|
+
echo "TRIAGE — BEFORE ANY ACTION, ROUTE THIS REQUEST:"
|
|
644
|
+
echo ""
|
|
645
|
+
echo "| Pattern | Route to | Cost |"
|
|
646
|
+
echo "|---------|----------|------|"
|
|
647
|
+
|
|
648
|
+
# Emit collected rows
|
|
649
|
+
for row in "${rows[@]}"; do
|
|
650
|
+
echo "$row"
|
|
651
|
+
done
|
|
652
|
+
|
|
653
|
+
# Static rows — only emit if the EXACT pattern column isn't already in dynamic rows.
|
|
654
|
+
# This prevents true duplicates while keeping different patterns for the same tool.
|
|
655
|
+
local all_rows
|
|
656
|
+
all_rows=$(printf '%s\n' "${rows[@]}" 2>/dev/null || true)
|
|
657
|
+
|
|
658
|
+
# Helper: emit static row only if its PATTERN (first column) isn't in dynamic rows
|
|
659
|
+
_static_row() {
|
|
660
|
+
local pattern="$1" row="$2"
|
|
661
|
+
if ! echo "$all_rows" | grep -qF "$pattern" 2>/dev/null; then
|
|
662
|
+
echo "$row"
|
|
663
|
+
fi
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
_static_row "git status/pull" "| git status/pull/branch/checkout | ops agent (Haiku) | 1x |"
|
|
667
|
+
_static_row "restart/start/stop" "| restart/start/stop servers | /restart skill | 1x |"
|
|
668
|
+
_static_row "run tests/lint/build" "| run tests/lint/build/type-check | ops agent (Haiku) | 1x |"
|
|
669
|
+
_static_row "commit + push + PR" "| commit + push + PR | /pr skill | 1x-10x |"
|
|
670
|
+
_static_row "railway/deploy/status" "| railway/deploy/status/logs/health | /sre skill | 10x |"
|
|
671
|
+
_static_row "CI/CD failures (fix)" "| CI/CD failures (fix) | /ci-fix skill | 10x |"
|
|
672
|
+
_static_row "CI/CD failures (investigate)" "| CI/CD failures (investigate) | /sre ci | 10x |"
|
|
673
|
+
_static_row "new feature (multi-layer)" "| new feature (multi-layer) | /planning → /implement | team |"
|
|
674
|
+
_static_row "bug fix (any)" "| bug fix (any scope) | /fix skill | team |"
|
|
675
|
+
_static_row "review PR" "| review PR/code review | /review-pr skill | 10x |"
|
|
676
|
+
_static_row "frontend-only code change" "| frontend-only code change | frontend agent (Sonnet) | 10x |"
|
|
677
|
+
_static_row "backend-only code change" "| backend-only code change | backend agent (Sonnet) | 10x |"
|
|
678
|
+
_static_row "QA/test validation" "| QA/test validation | /qa skill | 10x |"
|
|
679
|
+
|
|
680
|
+
cat <<'STATIC'
|
|
681
|
+
| share/export plan or strategy ("share this", "format for slack", "make shareable") | /share skill | 1x |
|
|
682
|
+
| autonomous work loop ("work on issues", "autopilot", "be a junior engineer") | /autopilot skill | team |
|
|
683
|
+
| vague/greeting/broad first message ("hey", "hi", "hello", "yo", "sup", "help", "what's up", "what should I work on") | /welcome (non-engineers) or /onboard (engineers) | 1x |
|
|
684
|
+
| architecture/complex reasoning | You (Opus) | 60x — LAST RESORT |
|
|
685
|
+
| doesn't fit above | CREATE a new skill/agent, then use it | — |
|
|
686
|
+
STATIC
|
|
687
|
+
|
|
688
|
+
cat <<'FOOTER'
|
|
689
|
+
|
|
690
|
+
You are the ORCHESTRATOR. Route to the best tool for each NEW task.
|
|
691
|
+
If you are already mid-task (e.g., restarting servers, running a multi-step operation),
|
|
692
|
+
finish the work — don't delegate verification steps or quick follow-ups.
|
|
693
|
+
|
|
694
|
+
ROUTING DECISION — use the SPEED test (takes 2 seconds):
|
|
695
|
+
|
|
696
|
+
S — Scope: How many files/steps? 1-2 files = defaults, 3+ = toolkit
|
|
697
|
+
P — Project: Needs CLAUDE.md context? Yes = toolkit (agents read it)
|
|
698
|
+
E — Expertise: Domain-specific? QA/SRE/design/architecture = toolkit agents
|
|
699
|
+
E — Effort: Multi-turn workflow? PR/deploy/planning = toolkit skills
|
|
700
|
+
D — Dollars: Cheaper model enough? Haiku/Sonnet agents save $$$ vs Opus
|
|
701
|
+
|
|
702
|
+
Score: 0-1 → Claude Code defaults. 2+ → toolkit agent or skill.
|
|
703
|
+
|
|
704
|
+
ROUTING RULES (after SPEED scoring):
|
|
705
|
+
1. Score 2+ AND skill match → use the skill (encodes multi-step workflows)
|
|
706
|
+
2. Score 2+ AND agent match → spawn the agent (domain expertise + project context)
|
|
707
|
+
3. Score 3+ AND multi-layer → /planning or /implement (team orchestration)
|
|
708
|
+
4. Score 0-1 → Claude Code built-in tools:
|
|
709
|
+
- Read/Grep/Glob for quick lookups
|
|
710
|
+
- Edit/Write for small targeted changes
|
|
711
|
+
- Bash for single commands
|
|
712
|
+
- Built-in plugins (code review, setup) when they fit
|
|
713
|
+
5. Nothing fits → CREATE a new skill/agent, then use it
|
|
714
|
+
|
|
715
|
+
EXAMPLES:
|
|
716
|
+
"what's in config.py?" → S:1 P:no E:no E:no D:no → 0 → use Read
|
|
717
|
+
"find all API routes" → S:1 P:no E:no E:no D:yes → 1 → use Grep
|
|
718
|
+
"fix the auth bug" → S:3+ P:yes E:yes E:yes D:yes → 4 → backend agent
|
|
719
|
+
"create a PR" → S:multi P:yes E:no E:yes D:yes → 3 → /pr skill
|
|
720
|
+
"deploy to staging" → S:multi P:yes E:yes E:yes D:yes → 4 → /sre skill
|
|
721
|
+
"run tests" → S:1 P:no E:no E:no D:yes → 1 → ops (Haiku, cheap)
|
|
722
|
+
|
|
723
|
+
VAGUE/ONBOARDING: If the user's first message is a greeting or vague ("hey",
|
|
724
|
+
"hi", "hello", "yo", "sup", "help", "what's up", "what should I work on",
|
|
725
|
+
or ANY message under 5 words with no specific task) → route to /onboard skill.
|
|
726
|
+
NEVER respond to greetings yourself — always use /onboard for the full briefing.
|
|
727
|
+
|
|
728
|
+
SELF-IMPROVEMENT: When you use Claude Code defaults over toolkit, note WHY
|
|
729
|
+
in 1 line at the end. Example:
|
|
730
|
+
"Note: Used Grep — single-file search, SPEED score 0."
|
|
731
|
+
This helps identify toolkit gaps. If you notice a pattern of defaults being
|
|
732
|
+
chosen for a task category, suggest creating a new agent/skill for it.
|
|
733
|
+
FOOTER
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
build_table
|
|
737
|
+
|
|
738
|
+
# Update marker — full table has been emitted for this session
|
|
739
|
+
mkdir -p "$(dirname "$MARKER_FILE")"
|
|
740
|
+
date +%s > "$MARKER_FILE"
|