agent-toolkit-cli 1.11.0__py3-none-win_amd64.whl
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.
- agent_toolkit/__init__.py +4 -0
- agent_toolkit/__main__.py +5 -0
- agent_toolkit/_paths.py +145 -0
- agent_toolkit/bin/.gitkeep +0 -0
- agent_toolkit/bin/agent-toolkit.exe +0 -0
- agent_toolkit/cli/__init__.py +0 -0
- agent_toolkit/cli/__main__.py +5 -0
- agent_toolkit/cli/build.py +278 -0
- agent_toolkit/cli/completion.py +297 -0
- agent_toolkit/cli/context_budget.py +455 -0
- agent_toolkit/cli/devcompanion.py +923 -0
- agent_toolkit/cli/devcompanion_queue.py +235 -0
- agent_toolkit/cli/diff.py +176 -0
- agent_toolkit/cli/doctor.py +1052 -0
- agent_toolkit/cli/insights.py +771 -0
- agent_toolkit/cli/install.py +706 -0
- agent_toolkit/cli/main.py +171 -0
- agent_toolkit/cli/mcp.py +537 -0
- agent_toolkit/cli/memory.py +739 -0
- agent_toolkit/cli/plugin.py +224 -0
- agent_toolkit/cli/project.py +459 -0
- agent_toolkit/cli/release.py +178 -0
- agent_toolkit/cli/skills.py +461 -0
- agent_toolkit/cli/uninstall.py +166 -0
- agent_toolkit/cli/update.py +298 -0
- agent_toolkit/cli/workspace.py +1713 -0
- agent_toolkit/compiler/hook_registry.py +110 -0
- agent_toolkit/compiler/loader.py +338 -0
- agent_toolkit/compiler/mcp_registry.py +87 -0
- agent_toolkit/compiler/model.py +182 -0
- agent_toolkit/compiler/provenance.py +140 -0
- agent_toolkit/compiler/registry_emit.py +263 -0
- agent_toolkit/compiler/target_registry.py +122 -0
- agent_toolkit/compiler/targets/__init__.py +1 -0
- agent_toolkit/compiler/targets/agent_plugins.py +160 -0
- agent_toolkit/compiler/targets/base.py +229 -0
- agent_toolkit/compiler/targets/claude_code.py +241 -0
- agent_toolkit/compiler/targets/codex.py +261 -0
- agent_toolkit/compiler/targets/copilot.py +275 -0
- agent_toolkit/compiler/targets/cursor.py +207 -0
- agent_toolkit/compiler/targets/gemini_cli.py +213 -0
- agent_toolkit/compiler/targets/muse_code.py +113 -0
- agent_toolkit/compiler/targets/opencode.py +204 -0
- agent_toolkit/compiler/targets/pi.py +263 -0
- agent_toolkit/compiler/targets/windsurf.py +267 -0
- agent_toolkit/compiler/tool_mapping.py +83 -0
- agent_toolkit/data/.gitignore +4 -0
- agent_toolkit/data/__init__.py +1 -0
- agent_toolkit/data/agents/agentic-security-reviewer/AGENT.md +60 -0
- agent_toolkit/data/agents/architect/AGENT.md +30 -0
- agent_toolkit/data/agents/assistant/AGENT.md +59 -0
- agent_toolkit/data/agents/build-error-resolver/AGENT.md +30 -0
- agent_toolkit/data/agents/client-workflow-bootstrap/AGENT.md +60 -0
- agent_toolkit/data/agents/code-reviewer/AGENT.md +49 -0
- agent_toolkit/data/agents/database-reviewer/AGENT.md +44 -0
- agent_toolkit/data/agents/docs-lookup/AGENT.md +28 -0
- agent_toolkit/data/agents/e2e-runner/AGENT.md +38 -0
- agent_toolkit/data/agents/performance-optimizer/AGENT.md +52 -0
- agent_toolkit/data/agents/planner/AGENT.md +41 -0
- agent_toolkit/data/agents/refactor-cleaner/AGENT.md +43 -0
- agent_toolkit/data/agents/reference-lookup/AGENT.md +33 -0
- agent_toolkit/data/agents/security-reviewer/AGENT.md +47 -0
- agent_toolkit/data/agents/tdd-guide/AGENT.md +58 -0
- agent_toolkit/data/agents/tech-assistant/AGENT.md +11 -0
- agent_toolkit/data/agents/typescript-reviewer/AGENT.md +61 -0
- agent_toolkit/data/capabilities/hooks/README.md +6 -0
- agent_toolkit/data/capabilities/hooks/pre-commit-validate.yaml +26 -0
- agent_toolkit/data/capabilities/hooks/scripts/pre-commit-validate.sh +41 -0
- agent_toolkit/data/capabilities/hooks/scripts/session-start-context.sh +11 -0
- agent_toolkit/data/capabilities/hooks/session-start-context.yaml +23 -0
- agent_toolkit/data/capabilities/targets/registry.yaml +90 -0
- agent_toolkit/data/capabilities/upstream.lock +118 -0
- agent_toolkit/data/catalogs/agent-catalog.yaml +81 -0
- agent_toolkit/data/catalogs/loop-catalog.yaml +55 -0
- agent_toolkit/data/catalogs/skill-catalog.yaml +520 -0
- agent_toolkit/data/catalogs/skills-layout.json +391 -0
- agent_toolkit/data/distributions/products.yaml +190 -0
- agent_toolkit/data/distributions/targets/claude-code.yaml +47 -0
- agent_toolkit/data/distributions/targets/cursor.yaml +42 -0
- agent_toolkit/data/distributions/targets/opencode.yaml +55 -0
- agent_toolkit/data/loops/changelog-drafter/loop.yaml +40 -0
- agent_toolkit/data/loops/ci-sweeper/loop.yaml +53 -0
- agent_toolkit/data/loops/daily-triage/loop.yaml +47 -0
- agent_toolkit/data/loops/dep-sweeper/loop.yaml +46 -0
- agent_toolkit/data/loops/issue-triage/loop.yaml +40 -0
- agent_toolkit/data/loops/oss-daily-briefing/loop.yaml +65 -0
- agent_toolkit/data/loops/oss-pr-monitor/loop.yaml +86 -0
- agent_toolkit/data/loops/oss-triage/loop.yaml +67 -0
- agent_toolkit/data/loops/post-merge-cleanup/loop.yaml +44 -0
- agent_toolkit/data/loops/pr-babysitter/loop.yaml +46 -0
- agent_toolkit/data/mcp/registry/chrome-devtools.yaml +61 -0
- agent_toolkit/data/mcp/registry/clickup.yaml +48 -0
- agent_toolkit/data/mcp/registry/figma.yaml +44 -0
- agent_toolkit/data/mcp/registry/github.yaml +52 -0
- agent_toolkit/data/mcp/registry/linear.yaml +47 -0
- agent_toolkit/data/mcp/registry/notion.yaml +48 -0
- agent_toolkit/data/mcp/registry/slack.yaml +46 -0
- agent_toolkit/data/mcp/templates/chrome-devtools/README.md +57 -0
- agent_toolkit/data/mcp/templates/chrome-devtools/config.template.json +6 -0
- agent_toolkit/data/mcp/templates/clickup/README.md +45 -0
- agent_toolkit/data/mcp/templates/clickup/config.template.json +8 -0
- agent_toolkit/data/mcp/templates/clickup/wrapper.sh +23 -0
- agent_toolkit/data/mcp/templates/figma/README.md +54 -0
- agent_toolkit/data/mcp/templates/figma/config.template.json +9 -0
- agent_toolkit/data/mcp/templates/github/README.md +16 -0
- agent_toolkit/data/mcp/templates/github/config.template.json +15 -0
- agent_toolkit/data/mcp/templates/github/wrapper.sh +6 -0
- agent_toolkit/data/mcp/templates/linear/README.md +49 -0
- agent_toolkit/data/mcp/templates/linear/config.template.json +10 -0
- agent_toolkit/data/mcp/templates/notion/README.md +7 -0
- agent_toolkit/data/mcp/templates/notion/config.template.json +8 -0
- agent_toolkit/data/mcp/templates/notion/wrapper.sh +23 -0
- agent_toolkit/data/mcp/templates/slack/README.md +8 -0
- agent_toolkit/data/mcp/templates/slack/config.template.json +9 -0
- agent_toolkit/data/mcp/templates/slack/wrapper.sh +23 -0
- agent_toolkit/data/packs/README.md +66 -0
- agent_toolkit/data/packs/agentic-security/README.md +19 -0
- agent_toolkit/data/packs/agentic-security/config.yaml +25 -0
- agent_toolkit/data/packs/architecture/README.md +22 -0
- agent_toolkit/data/packs/architecture/config.yaml +27 -0
- agent_toolkit/data/packs/code-quality/README.md +19 -0
- agent_toolkit/data/packs/code-quality/config.yaml +21 -0
- agent_toolkit/data/packs/delivery-discipline/README.md +19 -0
- agent_toolkit/data/packs/delivery-discipline/config.yaml +42 -0
- agent_toolkit/data/packs/design-engineering/README.md +19 -0
- agent_toolkit/data/packs/design-engineering/config.yaml +41 -0
- agent_toolkit/data/packs/engineering-workflow/README.md +21 -0
- agent_toolkit/data/packs/engineering-workflow/config.yaml +57 -0
- agent_toolkit/data/packs/oss-maintenance/README.md +245 -0
- agent_toolkit/data/packs/oss-maintenance/config.yaml +75 -0
- agent_toolkit/data/profiles/claude-code/CLAUDE.md +110 -0
- agent_toolkit/data/profiles/claude-code/agents/assistant.md +59 -0
- agent_toolkit/data/profiles/claude-code/agents/build-error-resolver.md +30 -0
- agent_toolkit/data/profiles/claude-code/agents/client-workflow-bootstrap.md +60 -0
- agent_toolkit/data/profiles/claude-code/agents/contribution-planner.md +39 -0
- agent_toolkit/data/profiles/claude-code/agents/database-reviewer.md +44 -0
- agent_toolkit/data/profiles/claude-code/agents/docs-lookup.md +28 -0
- agent_toolkit/data/profiles/claude-code/agents/e2e-runner.md +38 -0
- agent_toolkit/data/profiles/claude-code/agents/performance-optimizer.md +52 -0
- agent_toolkit/data/profiles/claude-code/agents/planner.md +41 -0
- agent_toolkit/data/profiles/claude-code/agents/refactor-cleaner.md +43 -0
- agent_toolkit/data/profiles/claude-code/agents/reference-lookup.md +33 -0
- agent_toolkit/data/profiles/claude-code/agents/security-reviewer.md +47 -0
- agent_toolkit/data/profiles/claude-code/agents/tdd-guide.md +58 -0
- agent_toolkit/data/profiles/claude-code/agents/typescript-reviewer.md +61 -0
- agent_toolkit/data/profiles/claude-code/settings.json +86 -0
- agent_toolkit/data/profiles/copilot/copilot-instructions.md +15 -0
- agent_toolkit/data/profiles/cursor/README.md +33 -0
- agent_toolkit/data/profiles/cursor/rules/architect.mdc +23 -0
- agent_toolkit/data/profiles/cursor/rules/assistant.mdc +61 -0
- agent_toolkit/data/profiles/cursor/rules/build-error-resolver.mdc +20 -0
- agent_toolkit/data/profiles/cursor/rules/code-reviewer.mdc +21 -0
- agent_toolkit/data/profiles/cursor/rules/database-reviewer.mdc +29 -0
- agent_toolkit/data/profiles/cursor/rules/docs-lookup.mdc +15 -0
- agent_toolkit/data/profiles/cursor/rules/e2e-runner.mdc +30 -0
- agent_toolkit/data/profiles/cursor/rules/performance-optimizer.mdc +27 -0
- agent_toolkit/data/profiles/cursor/rules/planner.mdc +28 -0
- agent_toolkit/data/profiles/cursor/rules/refactor-cleaner.mdc +26 -0
- agent_toolkit/data/profiles/cursor/rules/reference-lookup.mdc +20 -0
- agent_toolkit/data/profiles/cursor/rules/security-reviewer.mdc +20 -0
- agent_toolkit/data/profiles/cursor/rules/tdd-guide.mdc +26 -0
- agent_toolkit/data/profiles/cursor/rules/typescript-reviewer.mdc +28 -0
- agent_toolkit/data/profiles/muse-code/README.md +35 -0
- agent_toolkit/data/profiles/opencode/README.md +44 -0
- agent_toolkit/data/profiles/opencode/agents/architect.md +30 -0
- agent_toolkit/data/profiles/opencode/agents/assistant.md +96 -0
- agent_toolkit/data/profiles/opencode/agents/build-error-resolver.md +31 -0
- agent_toolkit/data/profiles/opencode/agents/client-workflow-bootstrap.md +66 -0
- agent_toolkit/data/profiles/opencode/agents/code-reviewer.md +47 -0
- agent_toolkit/data/profiles/opencode/agents/contribution-planner.md +44 -0
- agent_toolkit/data/profiles/opencode/agents/database-reviewer.md +43 -0
- agent_toolkit/data/profiles/opencode/agents/docs-lookup.md +28 -0
- agent_toolkit/data/profiles/opencode/agents/e2e-runner.md +33 -0
- agent_toolkit/data/profiles/opencode/agents/performance-optimizer.md +34 -0
- agent_toolkit/data/profiles/opencode/agents/planner.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/refactor-cleaner.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/reference-lookup.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/security-reviewer.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/tdd-guide.md +27 -0
- agent_toolkit/data/profiles/opencode/agents/typescript-reviewer.md +30 -0
- agent_toolkit/data/profiles/opencode/opencode.json +3 -0
- agent_toolkit/data/profiles/pi/skills/architect/skill.md +5 -0
- agent_toolkit/data/profiles/pi/skills/assistant/skill.md +3 -0
- agent_toolkit/data/profiles/pi/skills/code-reviewer/skill.md +5 -0
- agent_toolkit/data/profiles/pi/skills/planner/skill.md +3 -0
- agent_toolkit/data/profiles/pi/skills/security-reviewer/skill.md +3 -0
- agent_toolkit/data/profiles/windsurf/memories/global_rules.md +114 -0
- agent_toolkit/data/profiles/windsurf/rules/architect.mdc +23 -0
- agent_toolkit/data/profiles/windsurf/rules/assistant.mdc +61 -0
- agent_toolkit/data/profiles/windsurf/rules/build-error-resolver.mdc +20 -0
- agent_toolkit/data/profiles/windsurf/rules/code-reviewer.mdc +21 -0
- agent_toolkit/data/profiles/windsurf/rules/database-reviewer.mdc +29 -0
- agent_toolkit/data/profiles/windsurf/rules/docs-lookup.mdc +15 -0
- agent_toolkit/data/profiles/windsurf/rules/e2e-runner.mdc +30 -0
- agent_toolkit/data/profiles/windsurf/rules/performance-optimizer.mdc +27 -0
- agent_toolkit/data/profiles/windsurf/rules/planner.mdc +28 -0
- agent_toolkit/data/profiles/windsurf/rules/refactor-cleaner.mdc +26 -0
- agent_toolkit/data/profiles/windsurf/rules/reference-lookup.mdc +20 -0
- agent_toolkit/data/profiles/windsurf/rules/security-reviewer.mdc +20 -0
- agent_toolkit/data/profiles/windsurf/rules/tdd-guide.mdc +26 -0
- agent_toolkit/data/profiles/windsurf/rules/typescript-reviewer.mdc +28 -0
- agent_toolkit/data/skills/accessibility/review/SKILL.md +116 -0
- agent_toolkit/data/skills/accessibility/review/references/a11y-checklist.md +25 -0
- agent_toolkit/data/skills/accessibility/review/references/a11y-findings-template.md +56 -0
- agent_toolkit/data/skills/accessibility/review/references/research.md +47 -0
- agent_toolkit/data/skills/agentic-security/mcp-audit/SKILL.md +116 -0
- agent_toolkit/data/skills/agentic-security/mcp-audit/references/mcp-audit-template.md +51 -0
- agent_toolkit/data/skills/agentic-security/owasp-agentic-review/SKILL.md +73 -0
- agent_toolkit/data/skills/agentic-security/owasp-agentic-review/references/owasp-agentic-template.md +32 -0
- agent_toolkit/data/skills/agentic-security/supply-chain-audit/SKILL.md +142 -0
- agent_toolkit/data/skills/agentic-security/threat-modeling/SKILL.md +100 -0
- agent_toolkit/data/skills/agentic-security/threat-modeling/references/threat-model-template.md +55 -0
- agent_toolkit/data/skills/architecture/c4-model/SKILL.md +49 -0
- agent_toolkit/data/skills/cloud/aws-well-architected-review/SKILL.md +37 -0
- agent_toolkit/data/skills/cloud/cloud-design-patterns/SKILL.md +38 -0
- agent_toolkit/data/skills/core/assistant/SKILL.md +216 -0
- agent_toolkit/data/skills/core/assistant/references/AGENTS_TEMPLATE.md +0 -0
- agent_toolkit/data/skills/core/assistant/references/ORCHESTRATION.md +0 -0
- agent_toolkit/data/skills/core/assistant/references/REPO_INSPECTION.md +0 -0
- agent_toolkit/data/skills/core/dev-companion/SKILL.md +65 -0
- agent_toolkit/data/skills/core/dev-companion/references/LOOP_GUARDRAILS.md +0 -0
- agent_toolkit/data/skills/core/onboarding/SKILL.md +122 -0
- agent_toolkit/data/skills/core/output-handshake/SKILL.md +26 -0
- agent_toolkit/data/skills/core/pr-fallback/SKILL.md +35 -0
- agent_toolkit/data/skills/core/pr-fallback/references/pr-body-default.md +0 -0
- agent_toolkit/data/skills/core/project/SKILL.md +89 -0
- agent_toolkit/data/skills/core/workspace/SKILL.md +103 -0
- agent_toolkit/data/skills/core/workspace-knowledge-sync/SKILL.md +140 -0
- agent_toolkit/data/skills/data/dbt-validation/SKILL.md +41 -0
- agent_toolkit/data/skills/data/snowflake-validation/SKILL.md +38 -0
- agent_toolkit/data/skills/delivery/adr/SKILL.md +56 -0
- agent_toolkit/data/skills/delivery/adr/references/default-template.md +35 -0
- agent_toolkit/data/skills/delivery/adr/references/example-001-graphql-adoption.md +66 -0
- agent_toolkit/data/skills/delivery/agreement/SKILL.md +24 -0
- agent_toolkit/data/skills/delivery/agreement/references/default-template.md +17 -0
- agent_toolkit/data/skills/delivery/agreement/references/example-api-versioning.md +29 -0
- agent_toolkit/data/skills/delivery/bug/SKILL.md +26 -0
- agent_toolkit/data/skills/delivery/bug/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/bug/references/example-search-filter-bug.md +58 -0
- agent_toolkit/data/skills/delivery/decision-log/SKILL.md +28 -0
- agent_toolkit/data/skills/delivery/decision-log/references/default-template.md +17 -0
- agent_toolkit/data/skills/delivery/decision-log/references/example-repository-pattern.md +27 -0
- agent_toolkit/data/skills/delivery/development-workflow/SKILL.md +34 -0
- agent_toolkit/data/skills/delivery/development-workflow/references/default-workflow-checklist.md +44 -0
- agent_toolkit/data/skills/delivery/epic/SKILL.md +22 -0
- agent_toolkit/data/skills/delivery/epic/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/epic/references/example-unified-dashboard.md +40 -0
- agent_toolkit/data/skills/delivery/incident/SKILL.md +24 -0
- agent_toolkit/data/skills/delivery/incident/references/default-template.md +29 -0
- agent_toolkit/data/skills/delivery/incident/references/example-payment-outage.md +62 -0
- agent_toolkit/data/skills/delivery/management-unit-assessment/SKILL.md +104 -0
- agent_toolkit/data/skills/delivery/management-unit-assessment/references/default-template.md +24 -0
- agent_toolkit/data/skills/delivery/management-unit-assessment/references/example-team-assessment.md +126 -0
- agent_toolkit/data/skills/delivery/meeting-minutes/SKILL.md +25 -0
- agent_toolkit/data/skills/delivery/meeting-minutes/references/default-template.md +22 -0
- agent_toolkit/data/skills/delivery/meeting-minutes/references/example-weekly-sync.md +72 -0
- agent_toolkit/data/skills/delivery/planning/SKILL.md +31 -0
- agent_toolkit/data/skills/delivery/planning/references/default-template.md +25 -0
- agent_toolkit/data/skills/delivery/planning/references/example-sprint-planning.md +62 -0
- agent_toolkit/data/skills/delivery/prd/SKILL.md +46 -0
- agent_toolkit/data/skills/delivery/prd/references/default-template.md +31 -0
- agent_toolkit/data/skills/delivery/prd/references/example-unified-api.md +71 -0
- agent_toolkit/data/skills/delivery/project-assessment/SKILL.md +90 -0
- agent_toolkit/data/skills/delivery/project-assessment/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/project-assessment/references/example-platform-assessment.md +122 -0
- agent_toolkit/data/skills/delivery/project-assessment-evidence/SKILL.md +88 -0
- agent_toolkit/data/skills/delivery/project-assessment-evidence/references/default-template.md +24 -0
- agent_toolkit/data/skills/delivery/project-assessment-evidence/references/example-evidence-map.md +46 -0
- agent_toolkit/data/skills/delivery/spike/SKILL.md +24 -0
- agent_toolkit/data/skills/delivery/spike/references/default-template.md +29 -0
- agent_toolkit/data/skills/delivery/spike/references/example-graphql-federation.md +79 -0
- agent_toolkit/data/skills/delivery/task/SKILL.md +21 -0
- agent_toolkit/data/skills/delivery/task/references/default-template.md +21 -0
- agent_toolkit/data/skills/delivery/task/references/example-nav-system.md +33 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/SKILL.md +58 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/references/default-template.md +26 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/references/example-frontend-assessment.md +112 -0
- agent_toolkit/data/skills/delivery/technical-unit-assessment/references/indicator-groups.md +65 -0
- agent_toolkit/data/skills/delivery/trd/SKILL.md +49 -0
- agent_toolkit/data/skills/delivery/trd/references/default-template.md +31 -0
- agent_toolkit/data/skills/delivery/trd/references/example-api-migration.md +122 -0
- agent_toolkit/data/skills/delivery/user-story/SKILL.md +21 -0
- agent_toolkit/data/skills/delivery/user-story/references/default-template.md +21 -0
- agent_toolkit/data/skills/delivery/user-story/references/example-advanced-filtering.md +37 -0
- agent_toolkit/data/skills/delivery/work-item/SKILL.md +31 -0
- agent_toolkit/data/skills/delivery/work-item/references/default-template.md +21 -0
- agent_toolkit/data/skills/delivery/work-item/references/example-routing-dashboard.md +23 -0
- agent_toolkit/data/skills/delivery/workflow-client-bootstrap/SKILL.md +148 -0
- agent_toolkit/data/skills/delivery/workflow-client-bootstrap/questions.yaml +165 -0
- agent_toolkit/data/skills/delivery/workflow-generic-project/SKILL.md +79 -0
- agent_toolkit/data/skills/design/design-assessment/SKILL.md +150 -0
- agent_toolkit/data/skills/design/design-assessment/references/design-scorecard-template.md +78 -0
- agent_toolkit/data/skills/design/design-improvement/SKILL.md +167 -0
- agent_toolkit/data/skills/design/design-improvement/references/improvement-plan-template.md +113 -0
- agent_toolkit/data/skills/design/figma/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma/NOTICE.txt +25 -0
- agent_toolkit/data/skills/design/figma/SKILL.md +98 -0
- agent_toolkit/data/skills/design/figma/references/figma-mcp-config.md +82 -0
- agent_toolkit/data/skills/design/figma/references/figma-tools-and-prompts.md +34 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/NOTICE.txt +18 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/SKILL.md +354 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/references/mapping-checklist.md +7 -0
- agent_toolkit/data/skills/design/figma-code-connect-components/scripts/normalize_node_id.py +25 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/NOTICE.txt +19 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/SKILL.md +554 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/references/rule-template.md +15 -0
- agent_toolkit/data/skills/design/figma-create-design-system-rules/scripts/check_agents_md.sh +9 -0
- agent_toolkit/data/skills/design/figma-create-new-file/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-create-new-file/NOTICE.txt +17 -0
- agent_toolkit/data/skills/design/figma-create-new-file/SKILL.md +72 -0
- agent_toolkit/data/skills/design/figma-implement-design/LICENSE.txt +2 -0
- agent_toolkit/data/skills/design/figma-implement-design/NOTICE.txt +19 -0
- agent_toolkit/data/skills/design/figma-implement-design/SKILL.md +268 -0
- agent_toolkit/data/skills/design/frontend-design/LICENSE.txt +177 -0
- agent_toolkit/data/skills/design/frontend-design/SKILL.md +82 -0
- agent_toolkit/data/skills/design/frontend-design/UPSTREAM.md +14 -0
- agent_toolkit/data/skills/design/frontend-design-review/LICENSE +21 -0
- agent_toolkit/data/skills/design/frontend-design-review/SKILL.md +194 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/pattern-examples.md +21 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/quick-checklist.md +38 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/review-output-format.md +68 -0
- agent_toolkit/data/skills/design/frontend-design-review/references/review-type-modifiers.md +31 -0
- agent_toolkit/data/skills/design/web-design-guidelines/SKILL.md +78 -0
- agent_toolkit/data/skills/design/web-design-guidelines/references/LICENSE +21 -0
- agent_toolkit/data/skills/design/web-design-guidelines/references/web-interface-guidelines.md +180 -0
- agent_toolkit/data/skills/forge/gh-address-comments/LICENSE.txt +202 -0
- agent_toolkit/data/skills/forge/gh-address-comments/NOTICE.txt +20 -0
- agent_toolkit/data/skills/forge/gh-address-comments/SKILL.md +72 -0
- agent_toolkit/data/skills/forge/gh-address-comments/scripts/fetch_comments.py +239 -0
- agent_toolkit/data/skills/forge/gh-contribution-planner/SKILL.md +160 -0
- agent_toolkit/data/skills/forge/gh-contribution-planner/scripts/inspect_contributions.py +818 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/LICENSE.txt +201 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/NOTICE.txt +20 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/SKILL.md +74 -0
- agent_toolkit/data/skills/forge/gh-fix-ci/scripts/inspect_pr_checks.py +509 -0
- agent_toolkit/data/skills/forge/github-cli-workflow/SKILL.md +49 -0
- agent_toolkit/data/skills/forge/gitlab-cli-workflow/SKILL.md +44 -0
- agent_toolkit/data/skills/forge/workflow-client-bootstrap/SKILL.md +14 -0
- agent_toolkit/data/skills/forge/workflow-generic-project/SKILL.md +14 -0
- agent_toolkit/data/skills/forge/worktree/SKILL.md +113 -0
- agent_toolkit/data/skills/integrations/clickup-cli/SKILL.md +78 -0
- agent_toolkit/data/skills/integrations/clickup-cli/references/docs-management.md +57 -0
- agent_toolkit/data/skills/integrations/clickup-cli/references/task-management.md +131 -0
- agent_toolkit/data/skills/integrations/clickup-cli/references/time-tracking.md +38 -0
- agent_toolkit/data/skills/integrations/linear/LICENSE.txt +202 -0
- agent_toolkit/data/skills/integrations/linear/NOTICE.txt +23 -0
- agent_toolkit/data/skills/integrations/linear/SKILL.md +134 -0
- agent_toolkit/data/skills/integrations/mcp/SKILL.md +88 -0
- agent_toolkit/data/skills/integrations/slack-assistant/SKILL.md +138 -0
- agent_toolkit/data/skills/integrations/slack-cli/SKILL.md +109 -0
- agent_toolkit/data/skills/integrations/slack-cli/references/INSTALLATION.md +42 -0
- agent_toolkit/data/skills/loops/loop-runner/SKILL.md +92 -0
- agent_toolkit/data/skills/ops/docs-generator/SKILL.md +120 -0
- agent_toolkit/data/skills/ops/llm-cost-advisor/SKILL.md +87 -0
- agent_toolkit/data/skills/ops/swarm/SKILL.md +108 -0
- agent_toolkit/data/skills/ops/swarm-handoff/SKILL.md +112 -0
- agent_toolkit/data/skills/ops/swarm-observer/SKILL.md +102 -0
- agent_toolkit/data/skills/ops/triage/SKILL.md +119 -0
- agent_toolkit/data/skills/quality/codeql/SKILL.md +106 -0
- agent_toolkit/data/skills/quality/codeql/references/codeql-queries.md +43 -0
- agent_toolkit/data/skills/quality/megalinter/SKILL.md +162 -0
- agent_toolkit/data/skills/quality/megalinter/references/megalinter-images.md +36 -0
- agent_toolkit/data/skills/quality/megalinter/references/megalinter-license.md +41 -0
- agent_toolkit/data/skills/quality/megalinter/references/megalinter-targets.md +66 -0
- agent_toolkit/data/skills/tooling/chrome-devtools/SKILL.md +146 -0
- agent_toolkit/data/skills/tooling/herdr/SKILL.md +109 -0
- agent_toolkit/data/skills/tooling/inventory/SKILL.md +81 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/LICENSE.txt +201 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/NOTICE.txt +27 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/SKILL.md +145 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/assets/experiment-template.ipynb +117 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/assets/tutorial-template.ipynb +115 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/experiment-patterns.md +10 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/notebook-structure.md +17 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/quality-checklist.md +11 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/references/tutorial-patterns.md +9 -0
- agent_toolkit/data/skills/tooling/jupyter-notebook/scripts/new_notebook.py +132 -0
- agent_toolkit/data/skills/tooling/mermaid/SKILL.md +36 -0
- agent_toolkit/data/skills/tooling/playwright-cli/LICENSE.txt +201 -0
- agent_toolkit/data/skills/tooling/playwright-cli/NOTICE.txt +29 -0
- agent_toolkit/data/skills/tooling/playwright-cli/SKILL.md +154 -0
- agent_toolkit/data/skills/tooling/playwright-cli/references/cli.md +116 -0
- agent_toolkit/data/skills/tooling/playwright-cli/references/workflows.md +98 -0
- agent_toolkit/data/skills/tooling/playwright-cli/scripts/executable_playwright_cli.sh +25 -0
- agent_toolkit/data_cache.py +79 -0
- agent_toolkit/data_sync.py +144 -0
- agent_toolkit/installer/__init__.py +0 -0
- agent_toolkit/installer/merge.py +59 -0
- agent_toolkit/installer/receipt.py +89 -0
- agent_toolkit/installer/sources.py +92 -0
- agent_toolkit/installer/tracking.py +63 -0
- agent_toolkit/launcher.py +69 -0
- agent_toolkit/loop/__init__.py +0 -0
- agent_toolkit/loop/budget.py +107 -0
- agent_toolkit/loop/gh_gate.py +923 -0
- agent_toolkit/loop/loop-gh-gate +923 -0
- agent_toolkit/loop/pack.py +65 -0
- agent_toolkit/loop/runner.py +2722 -0
- agent_toolkit/runner/__init__.py +0 -0
- agent_toolkit/runner/dispatcher.py +163 -0
- agent_toolkit/runner/policy.py +356 -0
- agent_toolkit/runner/providers/__init__.py +21 -0
- agent_toolkit/runner/providers/anthropic_provider.py +109 -0
- agent_toolkit/runner/providers/base.py +53 -0
- agent_toolkit/runner/providers/ollama_provider.py +108 -0
- agent_toolkit/runner/providers/openai_provider.py +103 -0
- agent_toolkit/runner/providers/opencode_provider.py +127 -0
- agent_toolkit/swarm/__init__.py +5 -0
- agent_toolkit/swarm/approvals.py +121 -0
- agent_toolkit/swarm/backends/__init__.py +596 -0
- agent_toolkit/swarm/budget.py +83 -0
- agent_toolkit/swarm/cli.py +2448 -0
- agent_toolkit/swarm/config.py +351 -0
- agent_toolkit/swarm/handoff.py +174 -0
- agent_toolkit/swarm/models.py +230 -0
- agent_toolkit/swarm/prompts.py +177 -0
- agent_toolkit/swarm/recipes.py +304 -0
- agent_toolkit/swarm/runner.py +267 -0
- agent_toolkit/swarm/state.py +93 -0
- agent_toolkit/swarm/store.py +148 -0
- agent_toolkit/swarm/worktree.py +105 -0
- agent_toolkit/templates/workspace/.gitignore +19 -0
- agent_toolkit/templates/workspace/AGENTS.md +82 -0
- agent_toolkit/templates/workspace/knowledge/README.md +22 -0
- agent_toolkit/templates/workspace/knowledge/learnings/general.md +3 -0
- agent_toolkit/templates/workspace/knowledge/todos/pending.md +7 -0
- agent_toolkit/templates/workspace/packs/README.md +24 -0
- agent_toolkit/templates/workspace/personas/architect.md +12 -0
- agent_toolkit/templates/workspace/personas/implementer.md +12 -0
- agent_toolkit/templates/workspace/personas/researcher.md +12 -0
- agent_toolkit/templates/workspace/personas/reviewer.md +12 -0
- agent_toolkit_cli-1.11.0.dist-info/METADATA +363 -0
- agent_toolkit_cli-1.11.0.dist-info/RECORD +438 -0
- agent_toolkit_cli-1.11.0.dist-info/WHEEL +4 -0
- agent_toolkit_cli-1.11.0.dist-info/entry_points.txt +4 -0
- agent_toolkit_cli-1.11.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
"""Swarm recipes — built-in pair/team/full, YAML loading, validation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
from .models import API_VERSION, KIND, RolePolicy
|
|
10
|
+
|
|
11
|
+
BUILTIN_RECIPES: dict[str, dict[str, Any]] = {
|
|
12
|
+
"pair": {
|
|
13
|
+
"apiVersion": API_VERSION,
|
|
14
|
+
"kind": KIND,
|
|
15
|
+
"metadata": {
|
|
16
|
+
"name": "pair",
|
|
17
|
+
"description": "Two-role implementer + reviewer/integrator workflow",
|
|
18
|
+
},
|
|
19
|
+
"spec": {
|
|
20
|
+
"ui": "auto",
|
|
21
|
+
"transport": "filesystem",
|
|
22
|
+
"workspace": {
|
|
23
|
+
"strategy": "worktree-per-writer",
|
|
24
|
+
"base_ref": "HEAD",
|
|
25
|
+
"integration_branch": True,
|
|
26
|
+
"keep_on_failure": True,
|
|
27
|
+
},
|
|
28
|
+
"execution": {
|
|
29
|
+
"max_concurrency": 2,
|
|
30
|
+
"lazy_start": True,
|
|
31
|
+
"resumable": True,
|
|
32
|
+
"max_role_round_trips": 2,
|
|
33
|
+
},
|
|
34
|
+
"budget": {"max_total_tokens": 900000, "max_cost_usd": 4.00, "max_wall_seconds": 7200},
|
|
35
|
+
"gates": {
|
|
36
|
+
"require_plan_approval": False,
|
|
37
|
+
"require_final_approval": True,
|
|
38
|
+
"allow_direct_base_merge": False,
|
|
39
|
+
"allow_push": False,
|
|
40
|
+
},
|
|
41
|
+
"roles": {
|
|
42
|
+
"implementer": {
|
|
43
|
+
"persona": "tdd-guide",
|
|
44
|
+
"policy": "writer",
|
|
45
|
+
"model_profile": "coding",
|
|
46
|
+
"worktree": "implementer",
|
|
47
|
+
"consumes": ["task-contract"],
|
|
48
|
+
"produces": ["commit", "implementation-report"],
|
|
49
|
+
"receive_mode": "task",
|
|
50
|
+
"skills": ["tdd"],
|
|
51
|
+
},
|
|
52
|
+
"reviewer": {
|
|
53
|
+
"persona": "code-reviewer",
|
|
54
|
+
"policy": "reviewer-writer",
|
|
55
|
+
"model_profile": "review",
|
|
56
|
+
"worktree": "reviewer",
|
|
57
|
+
"consumes": ["commit"],
|
|
58
|
+
"produces": ["feedback", "reviewed-commit"],
|
|
59
|
+
"receive_mode": "task",
|
|
60
|
+
"skills": ["code-review"],
|
|
61
|
+
},
|
|
62
|
+
"integrator": {
|
|
63
|
+
"persona": "architect",
|
|
64
|
+
"policy": "integrator",
|
|
65
|
+
"model_profile": "architecture",
|
|
66
|
+
"worktree": "integration",
|
|
67
|
+
"consumes": ["reviewed-commit"],
|
|
68
|
+
"produces": ["final-candidate", "final-report"],
|
|
69
|
+
"receive_mode": "batch",
|
|
70
|
+
"skills": [],
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
"team": {
|
|
76
|
+
"apiVersion": API_VERSION,
|
|
77
|
+
"kind": KIND,
|
|
78
|
+
"metadata": {
|
|
79
|
+
"name": "team",
|
|
80
|
+
"description": "Four-role planner → implementer → reviewer → architect workflow",
|
|
81
|
+
},
|
|
82
|
+
"spec": {
|
|
83
|
+
"ui": "auto",
|
|
84
|
+
"transport": "filesystem",
|
|
85
|
+
"workspace": {
|
|
86
|
+
"strategy": "worktree-per-writer",
|
|
87
|
+
"base_ref": "HEAD",
|
|
88
|
+
"integration_branch": True,
|
|
89
|
+
"keep_on_failure": True,
|
|
90
|
+
},
|
|
91
|
+
"execution": {
|
|
92
|
+
"max_concurrency": 2,
|
|
93
|
+
"lazy_start": True,
|
|
94
|
+
"resumable": True,
|
|
95
|
+
"max_role_round_trips": 2,
|
|
96
|
+
},
|
|
97
|
+
"budget": {"max_total_tokens": 900000, "max_cost_usd": 4.00, "max_wall_seconds": 7200},
|
|
98
|
+
"gates": {
|
|
99
|
+
"require_plan_approval": True,
|
|
100
|
+
"require_final_approval": True,
|
|
101
|
+
"allow_direct_base_merge": False,
|
|
102
|
+
"allow_push": False,
|
|
103
|
+
},
|
|
104
|
+
"roles": {
|
|
105
|
+
"planner": {
|
|
106
|
+
"persona": "planner",
|
|
107
|
+
"policy": "read-only",
|
|
108
|
+
"model_profile": "planning",
|
|
109
|
+
"worktree": None,
|
|
110
|
+
"consumes": [],
|
|
111
|
+
"produces": ["task-contract", "acceptance-criteria", "risk-assessment"],
|
|
112
|
+
"receive_mode": "task",
|
|
113
|
+
"skills": ["planning"],
|
|
114
|
+
},
|
|
115
|
+
"implementer": {
|
|
116
|
+
"persona": "tdd-guide",
|
|
117
|
+
"policy": "writer",
|
|
118
|
+
"model_profile": "coding",
|
|
119
|
+
"worktree": "implementer",
|
|
120
|
+
"consumes": ["task-contract"],
|
|
121
|
+
"produces": ["commit", "implementation-report"],
|
|
122
|
+
"receive_mode": "task",
|
|
123
|
+
"skills": ["tdd"],
|
|
124
|
+
},
|
|
125
|
+
"reviewer": {
|
|
126
|
+
"persona": "code-reviewer",
|
|
127
|
+
"policy": "reviewer-writer",
|
|
128
|
+
"model_profile": "review",
|
|
129
|
+
"worktree": "reviewer",
|
|
130
|
+
"consumes": ["commit"],
|
|
131
|
+
"produces": ["feedback", "reviewed-commit"],
|
|
132
|
+
"receive_mode": "task",
|
|
133
|
+
"skills": ["code-review"],
|
|
134
|
+
},
|
|
135
|
+
"architect": {
|
|
136
|
+
"persona": "architect",
|
|
137
|
+
"policy": "integrator",
|
|
138
|
+
"model_profile": "architecture",
|
|
139
|
+
"worktree": "integration",
|
|
140
|
+
"consumes": ["reviewed-commit"],
|
|
141
|
+
"produces": ["final-candidate", "final-report"],
|
|
142
|
+
"receive_mode": "batch",
|
|
143
|
+
"skills": ["architecture"],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
"full": {
|
|
149
|
+
"apiVersion": API_VERSION,
|
|
150
|
+
"kind": KIND,
|
|
151
|
+
"metadata": {
|
|
152
|
+
"name": "full",
|
|
153
|
+
"description": "Six-role planner → implementer → refactorer → architect → hardener → qa workflow",
|
|
154
|
+
},
|
|
155
|
+
"spec": {
|
|
156
|
+
"ui": "auto",
|
|
157
|
+
"transport": "filesystem",
|
|
158
|
+
"workspace": {
|
|
159
|
+
"strategy": "worktree-per-writer",
|
|
160
|
+
"base_ref": "HEAD",
|
|
161
|
+
"integration_branch": True,
|
|
162
|
+
"keep_on_failure": True,
|
|
163
|
+
},
|
|
164
|
+
"execution": {
|
|
165
|
+
"max_concurrency": 2,
|
|
166
|
+
"lazy_start": True,
|
|
167
|
+
"resumable": True,
|
|
168
|
+
"max_role_round_trips": 2,
|
|
169
|
+
},
|
|
170
|
+
"budget": {
|
|
171
|
+
"max_total_tokens": 1200000,
|
|
172
|
+
"max_cost_usd": 8.00,
|
|
173
|
+
"max_wall_seconds": 10800,
|
|
174
|
+
},
|
|
175
|
+
"gates": {
|
|
176
|
+
"require_plan_approval": True,
|
|
177
|
+
"require_final_approval": True,
|
|
178
|
+
"allow_direct_base_merge": False,
|
|
179
|
+
"allow_push": False,
|
|
180
|
+
},
|
|
181
|
+
"roles": {
|
|
182
|
+
"planner": {
|
|
183
|
+
"persona": "planner",
|
|
184
|
+
"policy": "read-only",
|
|
185
|
+
"model_profile": "planning",
|
|
186
|
+
"worktree": None,
|
|
187
|
+
"consumes": [],
|
|
188
|
+
"produces": ["task-contract"],
|
|
189
|
+
"receive_mode": "task",
|
|
190
|
+
"skills": ["planning"],
|
|
191
|
+
},
|
|
192
|
+
"implementer": {
|
|
193
|
+
"persona": "tdd-guide",
|
|
194
|
+
"policy": "writer",
|
|
195
|
+
"model_profile": "coding",
|
|
196
|
+
"worktree": "implementer",
|
|
197
|
+
"consumes": ["task-contract"],
|
|
198
|
+
"produces": ["commit"],
|
|
199
|
+
"receive_mode": "task",
|
|
200
|
+
"skills": [],
|
|
201
|
+
},
|
|
202
|
+
"refactorer": {
|
|
203
|
+
"persona": "refactor-cleaner",
|
|
204
|
+
"policy": "writer",
|
|
205
|
+
"model_profile": "review",
|
|
206
|
+
"worktree": "reviewer",
|
|
207
|
+
"consumes": ["commit"],
|
|
208
|
+
"produces": ["refactored-commit"],
|
|
209
|
+
"receive_mode": "task",
|
|
210
|
+
"skills": [],
|
|
211
|
+
},
|
|
212
|
+
"architect": {
|
|
213
|
+
"persona": "architect",
|
|
214
|
+
"policy": "integrator",
|
|
215
|
+
"model_profile": "architecture",
|
|
216
|
+
"worktree": "integration",
|
|
217
|
+
"consumes": ["refactored-commit"],
|
|
218
|
+
"produces": ["integrated-commit"],
|
|
219
|
+
"receive_mode": "batch",
|
|
220
|
+
"skills": [],
|
|
221
|
+
},
|
|
222
|
+
"hardener": {
|
|
223
|
+
"persona": "security-reviewer",
|
|
224
|
+
"policy": "reviewer-writer",
|
|
225
|
+
"model_profile": "hardening",
|
|
226
|
+
"worktree": "hardener",
|
|
227
|
+
"consumes": ["integrated-commit"],
|
|
228
|
+
"produces": ["hardened-commit"],
|
|
229
|
+
"receive_mode": "task",
|
|
230
|
+
"skills": [],
|
|
231
|
+
},
|
|
232
|
+
"qa": {
|
|
233
|
+
"persona": "e2e-runner",
|
|
234
|
+
"policy": "reviewer-writer",
|
|
235
|
+
"model_profile": "qa",
|
|
236
|
+
"worktree": "qa",
|
|
237
|
+
"consumes": ["hardened-commit"],
|
|
238
|
+
"produces": ["qa-report", "final-report"],
|
|
239
|
+
"receive_mode": "task",
|
|
240
|
+
"skills": [],
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
VALID_POLICIES = {p.value for p in RolePolicy}
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
def list_recipes() -> list[str]:
|
|
251
|
+
return sorted(BUILTIN_RECIPES.keys())
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
def get_recipe(name: str) -> dict[str, Any] | None:
|
|
255
|
+
return BUILTIN_RECIPES.get(name)
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
def validate_recipe(data: dict[str, Any]) -> list[str]:
|
|
259
|
+
errors: list[str] = []
|
|
260
|
+
if data.get("apiVersion") != API_VERSION:
|
|
261
|
+
errors.append(f"apiVersion must be {API_VERSION!r}")
|
|
262
|
+
if data.get("kind") != KIND:
|
|
263
|
+
errors.append(f"kind must be {KIND!r}")
|
|
264
|
+
meta = data.get("metadata") or {}
|
|
265
|
+
if not meta.get("name"):
|
|
266
|
+
errors.append("metadata.name required")
|
|
267
|
+
spec = data.get("spec")
|
|
268
|
+
if not isinstance(spec, dict):
|
|
269
|
+
errors.append("spec must be object")
|
|
270
|
+
return errors
|
|
271
|
+
roles = spec.get("roles")
|
|
272
|
+
if not isinstance(roles, dict) or not roles:
|
|
273
|
+
errors.append("spec.roles must be non-empty object")
|
|
274
|
+
else:
|
|
275
|
+
for rname, rdef in roles.items():
|
|
276
|
+
if not re.match(r"^[a-z][a-z0-9_-]{1,31}$", rname):
|
|
277
|
+
errors.append(f"invalid role name {rname!r}")
|
|
278
|
+
if not isinstance(rdef, dict):
|
|
279
|
+
errors.append(f"role {rname} must be object")
|
|
280
|
+
continue
|
|
281
|
+
policy = rdef.get("policy")
|
|
282
|
+
if policy not in VALID_POLICIES:
|
|
283
|
+
errors.append(
|
|
284
|
+
f"role {rname} policy {policy!r} invalid, must be one of {VALID_POLICIES}"
|
|
285
|
+
)
|
|
286
|
+
if rdef.get("receive_mode") not in ("task", "batch", None):
|
|
287
|
+
errors.append(f"role {rname} receive_mode must be task|batch")
|
|
288
|
+
return errors
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
def load_recipe_file(path: Path) -> dict[str, Any]:
|
|
292
|
+
text = path.read_text(encoding="utf-8")
|
|
293
|
+
try:
|
|
294
|
+
import yaml # type: ignore
|
|
295
|
+
|
|
296
|
+
data = yaml.safe_load(text)
|
|
297
|
+
if not isinstance(data, dict):
|
|
298
|
+
raise ValueError("YAML top level must be mapping")
|
|
299
|
+
return data
|
|
300
|
+
except ImportError:
|
|
301
|
+
# minimal fallback: only JSON
|
|
302
|
+
import json
|
|
303
|
+
|
|
304
|
+
return json.loads(text)
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"""Runner abstraction and OpenCode agent generation."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
import shutil
|
|
7
|
+
import subprocess
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
RUNNER_CAPS: dict[str, dict[str, Any]] = {
|
|
12
|
+
"opencode": {
|
|
13
|
+
"interactive": True,
|
|
14
|
+
"resume": True,
|
|
15
|
+
"per_role_model": True,
|
|
16
|
+
"usage_data": True,
|
|
17
|
+
"herdr": "official",
|
|
18
|
+
},
|
|
19
|
+
"claude": {
|
|
20
|
+
"interactive": True,
|
|
21
|
+
"resume": True,
|
|
22
|
+
"per_role_model": True,
|
|
23
|
+
"usage_data": True,
|
|
24
|
+
"herdr": "official",
|
|
25
|
+
},
|
|
26
|
+
"codex": {
|
|
27
|
+
"interactive": True,
|
|
28
|
+
"resume": True,
|
|
29
|
+
"per_role_model": True,
|
|
30
|
+
"usage_data": True,
|
|
31
|
+
"herdr": "official",
|
|
32
|
+
},
|
|
33
|
+
"cursor": {
|
|
34
|
+
"interactive": True,
|
|
35
|
+
"resume": True,
|
|
36
|
+
"per_role_model": True,
|
|
37
|
+
"usage_data": True,
|
|
38
|
+
"herdr": "official",
|
|
39
|
+
},
|
|
40
|
+
"copilot": {
|
|
41
|
+
"interactive": True,
|
|
42
|
+
"resume": False,
|
|
43
|
+
"per_role_model": False,
|
|
44
|
+
"usage_data": False,
|
|
45
|
+
"herdr": "custom",
|
|
46
|
+
},
|
|
47
|
+
"muse": {
|
|
48
|
+
"interactive": True,
|
|
49
|
+
"resume": True,
|
|
50
|
+
"per_role_model": True,
|
|
51
|
+
"usage_data": True,
|
|
52
|
+
"herdr": "detect",
|
|
53
|
+
},
|
|
54
|
+
"skeleton": {
|
|
55
|
+
"interactive": False,
|
|
56
|
+
"resume": False,
|
|
57
|
+
"per_role_model": False,
|
|
58
|
+
"usage_data": False,
|
|
59
|
+
"herdr": "none",
|
|
60
|
+
},
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def list_runners() -> list[str]:
|
|
65
|
+
return sorted(RUNNER_CAPS.keys())
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def runner_available(name: str) -> bool:
|
|
69
|
+
bin_map = {
|
|
70
|
+
"opencode": "opencode",
|
|
71
|
+
"claude": "claude",
|
|
72
|
+
"codex": "codex",
|
|
73
|
+
"cursor": "cursor-agent",
|
|
74
|
+
"copilot": "copilot",
|
|
75
|
+
"muse": "muse",
|
|
76
|
+
"skeleton": "true",
|
|
77
|
+
}
|
|
78
|
+
binary = bin_map.get(name, name)
|
|
79
|
+
return shutil.which(binary) is not None
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def capability_matrix() -> dict[str, dict[str, Any]]:
|
|
83
|
+
return {k: dict(v, available=runner_available(k)) for k, v in RUNNER_CAPS.items()}
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
MODEL_PROFILES = {
|
|
87
|
+
"economy": {
|
|
88
|
+
"planning": "anthropic/claude-3-5-haiku-20241022",
|
|
89
|
+
"coding": "anthropic/claude-3-5-haiku-20241022",
|
|
90
|
+
"review": "openai/gpt-4o-mini",
|
|
91
|
+
"architecture": "anthropic/claude-3-5-haiku-20241022",
|
|
92
|
+
"hardening": "anthropic/claude-3-5-haiku-20241022",
|
|
93
|
+
"qa": "openai/gpt-4o-mini",
|
|
94
|
+
},
|
|
95
|
+
"balanced": {
|
|
96
|
+
"planning": "anthropic/claude-sonnet-4-20250514",
|
|
97
|
+
"coding": "anthropic/claude-sonnet-4-20250514",
|
|
98
|
+
"review": "openai/gpt-4o",
|
|
99
|
+
"architecture": "anthropic/claude-sonnet-4-20250514",
|
|
100
|
+
"hardening": "openai/gpt-4o",
|
|
101
|
+
"qa": "anthropic/claude-3-5-haiku-20241022",
|
|
102
|
+
},
|
|
103
|
+
"quality": {
|
|
104
|
+
"planning": "anthropic/claude-opus-4-20250514",
|
|
105
|
+
"coding": "anthropic/claude-opus-4-20250514",
|
|
106
|
+
"review": "openai/gpt-4o",
|
|
107
|
+
"architecture": "anthropic/claude-opus-4-20250514",
|
|
108
|
+
"hardening": "anthropic/claude-opus-4-20250514",
|
|
109
|
+
"qa": "openai/gpt-4o",
|
|
110
|
+
},
|
|
111
|
+
"private": {
|
|
112
|
+
"planning": "ollama/llama3.1",
|
|
113
|
+
"coding": "ollama/llama3.1",
|
|
114
|
+
"review": "ollama/llama3.1",
|
|
115
|
+
"architecture": "ollama/llama3.1",
|
|
116
|
+
"hardening": "ollama/llama3.1",
|
|
117
|
+
"qa": "ollama/llama3.1",
|
|
118
|
+
},
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def resolve_model(
|
|
123
|
+
profile: str,
|
|
124
|
+
task_class: str,
|
|
125
|
+
override: str | None = None,
|
|
126
|
+
model_profiles: dict[str, dict[str, str]] | None = None,
|
|
127
|
+
) -> str | None:
|
|
128
|
+
if override:
|
|
129
|
+
if "/" not in override:
|
|
130
|
+
raise ValueError(f"Model must be provider/model format: {override!r}")
|
|
131
|
+
return override
|
|
132
|
+
if model_profiles and profile in model_profiles and task_class in model_profiles[profile]:
|
|
133
|
+
return model_profiles[profile][task_class]
|
|
134
|
+
mapping = MODEL_PROFILES.get(profile) or MODEL_PROFILES["balanced"]
|
|
135
|
+
return mapping.get(task_class)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
def discover_models(runner: str) -> list[str]:
|
|
139
|
+
# Try to list models via runner CLI if available
|
|
140
|
+
cmds = {
|
|
141
|
+
"opencode": ["opencode", "models"],
|
|
142
|
+
"claude": ["claude", "models"],
|
|
143
|
+
}
|
|
144
|
+
cmd = cmds.get(runner)
|
|
145
|
+
if not cmd or not shutil.which(cmd[0]):
|
|
146
|
+
# Return profile models as fallback
|
|
147
|
+
vals = set()
|
|
148
|
+
for m in MODEL_PROFILES.values():
|
|
149
|
+
vals.update(m.values())
|
|
150
|
+
return sorted(vals)
|
|
151
|
+
try:
|
|
152
|
+
res = subprocess.run(cmd, capture_output=True, text=True, timeout=5)
|
|
153
|
+
if res.returncode == 0:
|
|
154
|
+
# naive parse: each line contains model id
|
|
155
|
+
models: list[str] = []
|
|
156
|
+
for line in res.stdout.splitlines():
|
|
157
|
+
line = line.strip()
|
|
158
|
+
if "/" in line and not line.startswith("#"):
|
|
159
|
+
models.append(line.split()[0])
|
|
160
|
+
if models:
|
|
161
|
+
return models
|
|
162
|
+
except Exception:
|
|
163
|
+
pass
|
|
164
|
+
vals2 = set()
|
|
165
|
+
for m in MODEL_PROFILES.values():
|
|
166
|
+
vals2.update(m.values())
|
|
167
|
+
return sorted(vals2)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
# OpenCode permission generation
|
|
171
|
+
OPENCODE_PERMISSIONS = {
|
|
172
|
+
"read-only": {
|
|
173
|
+
"edit": "deny",
|
|
174
|
+
"external_directory": "deny",
|
|
175
|
+
"websearch": "allow",
|
|
176
|
+
"skill": "allow",
|
|
177
|
+
"bash": {"*": "ask", "git status *": "allow", "git log *": "allow", "git diff *": "allow"},
|
|
178
|
+
},
|
|
179
|
+
"writer": {
|
|
180
|
+
"edit": "allow",
|
|
181
|
+
"external_directory": "deny",
|
|
182
|
+
"bash": {
|
|
183
|
+
"*": "ask",
|
|
184
|
+
"git status *": "allow",
|
|
185
|
+
"git diff *": "allow",
|
|
186
|
+
"git log *": "allow",
|
|
187
|
+
"git add *": "allow",
|
|
188
|
+
"git commit *": "ask",
|
|
189
|
+
"git push *": "deny",
|
|
190
|
+
"git reset --hard*": "deny",
|
|
191
|
+
"git clean *": "deny",
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
"reviewer-writer": {
|
|
195
|
+
"edit": "allow",
|
|
196
|
+
"external_directory": "deny",
|
|
197
|
+
"bash": {"*": "ask", "git status *": "allow", "git diff *": "allow", "git log *": "allow"},
|
|
198
|
+
},
|
|
199
|
+
"integrator": {
|
|
200
|
+
"edit": "allow",
|
|
201
|
+
"external_directory": "deny",
|
|
202
|
+
"bash": {
|
|
203
|
+
"*": "ask",
|
|
204
|
+
"git status *": "allow",
|
|
205
|
+
"git diff *": "allow",
|
|
206
|
+
"git log *": "allow",
|
|
207
|
+
"git merge *": "ask",
|
|
208
|
+
"git push *": "deny",
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def generate_opencode_agent(
|
|
215
|
+
run_dir: Path,
|
|
216
|
+
role: str,
|
|
217
|
+
persona: str,
|
|
218
|
+
policy: str,
|
|
219
|
+
model: str,
|
|
220
|
+
recipe_name: str,
|
|
221
|
+
run_id: str,
|
|
222
|
+
worktree: str | None,
|
|
223
|
+
) -> Path:
|
|
224
|
+
agents_dir = run_dir / "runner" / "opencode" / "agents"
|
|
225
|
+
agents_dir.mkdir(parents=True, exist_ok=True)
|
|
226
|
+
perm = OPENCODE_PERMISSIONS.get(policy, OPENCODE_PERMISSIONS["read-only"])
|
|
227
|
+
content = f"""---
|
|
228
|
+
description: "Swarm role {role} ({persona}) for recipe {recipe_name}, run {run_id}"
|
|
229
|
+
mode: primary
|
|
230
|
+
model: {model}
|
|
231
|
+
permission:
|
|
232
|
+
edit: {perm.get("edit", "deny")}
|
|
233
|
+
external_directory: {perm.get("external_directory", "deny")}
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
# Role: {role} ({persona})
|
|
237
|
+
|
|
238
|
+
You are the **{role}** role in the Agent Toolkit Swarm `{recipe_name}` (run `{run_id}`).
|
|
239
|
+
|
|
240
|
+
## Policy
|
|
241
|
+
- Policy: {policy}
|
|
242
|
+
- Worktree: {worktree or "read-only (no worktree)"}
|
|
243
|
+
- Permissions: {json.dumps(perm)}
|
|
244
|
+
|
|
245
|
+
## Workflow
|
|
246
|
+
- Read the task contract at `artifacts/task-contract.md` if present.
|
|
247
|
+
- Follow the handoff protocol: use `agent-toolkit swarm handoff create` and `agent-toolkit swarm task next/complete` — do not move queue files manually.
|
|
248
|
+
- Work only inside your worktree path when you have one.
|
|
249
|
+
- Do not push, do not merge to base branch, do not publish releases.
|
|
250
|
+
- Keep artifacts small (<1MB) and do not include secrets.
|
|
251
|
+
|
|
252
|
+
## Handoff commands
|
|
253
|
+
```bash
|
|
254
|
+
agent-toolkit swarm handoff create --type artifact --to <role> --artifact artifacts/<file>.md
|
|
255
|
+
agent-toolkit swarm task next
|
|
256
|
+
agent-toolkit swarm task complete --handoff <id>
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Context manifest
|
|
260
|
+
- Run ID: {run_id}
|
|
261
|
+
- Role: {role}
|
|
262
|
+
- Recipe: {recipe_name}
|
|
263
|
+
- Model: {model}
|
|
264
|
+
"""
|
|
265
|
+
path = agents_dir / f"{role}.md"
|
|
266
|
+
path.write_text(content, encoding="utf-8")
|
|
267
|
+
return path
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Swarm state machine — run and role states, transitions."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from .models import RoleState, RunState
|
|
6
|
+
|
|
7
|
+
RUN_TRANSITIONS: dict[RunState, set[RunState]] = {
|
|
8
|
+
RunState.PLANNING: {
|
|
9
|
+
RunState.AWAITING_PLAN_APPROVAL,
|
|
10
|
+
RunState.RUNNING,
|
|
11
|
+
RunState.FAILED,
|
|
12
|
+
RunState.CANCELLED,
|
|
13
|
+
},
|
|
14
|
+
RunState.AWAITING_PLAN_APPROVAL: {RunState.RUNNING, RunState.CANCELLED, RunState.FAILED},
|
|
15
|
+
RunState.RUNNING: {
|
|
16
|
+
RunState.AWAITING_HUMAN,
|
|
17
|
+
RunState.PAUSED,
|
|
18
|
+
RunState.COMPLETED,
|
|
19
|
+
RunState.FAILED,
|
|
20
|
+
RunState.CANCELLED,
|
|
21
|
+
RunState.BUDGET_EXHAUSTED,
|
|
22
|
+
},
|
|
23
|
+
RunState.AWAITING_HUMAN: {
|
|
24
|
+
RunState.RUNNING,
|
|
25
|
+
RunState.PAUSED,
|
|
26
|
+
RunState.COMPLETED,
|
|
27
|
+
RunState.FAILED,
|
|
28
|
+
RunState.CANCELLED,
|
|
29
|
+
},
|
|
30
|
+
RunState.PAUSED: {RunState.RUNNING, RunState.CANCELLED, RunState.FAILED},
|
|
31
|
+
RunState.COMPLETED: {RunState.CLEANUP_PENDING},
|
|
32
|
+
RunState.FAILED: {RunState.CLEANUP_PENDING, RunState.RUNNING},
|
|
33
|
+
RunState.CANCELLED: {RunState.CLEANUP_PENDING},
|
|
34
|
+
RunState.BUDGET_EXHAUSTED: {RunState.RUNNING, RunState.CANCELLED, RunState.CLEANUP_PENDING},
|
|
35
|
+
RunState.CLEANUP_PENDING: set(),
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ROLE_TRANSITIONS: dict[RoleState, set[RoleState]] = {
|
|
39
|
+
RoleState.INACTIVE: {RoleState.STARTING, RoleState.IDLE},
|
|
40
|
+
RoleState.STARTING: {RoleState.IDLE, RoleState.WORKING, RoleState.FAILED, RoleState.STOPPED},
|
|
41
|
+
RoleState.IDLE: {RoleState.READY, RoleState.WORKING, RoleState.STOPPED, RoleState.FAILED},
|
|
42
|
+
RoleState.READY: {
|
|
43
|
+
RoleState.WORKING,
|
|
44
|
+
RoleState.BLOCKED,
|
|
45
|
+
RoleState.COMPLETED,
|
|
46
|
+
RoleState.FAILED,
|
|
47
|
+
RoleState.STOPPED,
|
|
48
|
+
},
|
|
49
|
+
RoleState.WORKING: {
|
|
50
|
+
RoleState.AWAITING_HANDOFF,
|
|
51
|
+
RoleState.BLOCKED,
|
|
52
|
+
RoleState.COMPLETED,
|
|
53
|
+
RoleState.FAILED,
|
|
54
|
+
RoleState.STOPPED,
|
|
55
|
+
RoleState.IDLE,
|
|
56
|
+
},
|
|
57
|
+
RoleState.BLOCKED: {RoleState.WORKING, RoleState.FAILED, RoleState.STOPPED},
|
|
58
|
+
RoleState.AWAITING_HANDOFF: {
|
|
59
|
+
RoleState.WORKING,
|
|
60
|
+
RoleState.COMPLETED,
|
|
61
|
+
RoleState.FAILED,
|
|
62
|
+
RoleState.STOPPED,
|
|
63
|
+
},
|
|
64
|
+
RoleState.COMPLETED: {RoleState.WORKING, RoleState.STOPPED},
|
|
65
|
+
RoleState.FAILED: {RoleState.STARTING, RoleState.STOPPED},
|
|
66
|
+
RoleState.STOPPED: {RoleState.STARTING},
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def can_transition_run(from_state: str, to_state: str) -> bool:
|
|
71
|
+
try:
|
|
72
|
+
f = RunState(from_state)
|
|
73
|
+
t = RunState(to_state)
|
|
74
|
+
except ValueError:
|
|
75
|
+
return False
|
|
76
|
+
return t in RUN_TRANSITIONS.get(f, set())
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
def can_transition_role(from_state: str, to_state: str) -> bool:
|
|
80
|
+
try:
|
|
81
|
+
f = RoleState(from_state)
|
|
82
|
+
t = RoleState(to_state)
|
|
83
|
+
except ValueError:
|
|
84
|
+
return False
|
|
85
|
+
return t in ROLE_TRANSITIONS.get(f, set())
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def initial_run_state(recipe_name: str, requires_plan_approval: bool) -> str:
|
|
89
|
+
if recipe_name in ("team", "full") and requires_plan_approval:
|
|
90
|
+
return RunState.AWAITING_PLAN_APPROVAL.value
|
|
91
|
+
if recipe_name in ("team", "full"):
|
|
92
|
+
return RunState.PLANNING.value
|
|
93
|
+
return RunState.RUNNING.value
|