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,230 @@
|
|
|
1
|
+
"""Swarm domain model — typed dataclasses for orchestration."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import re
|
|
6
|
+
from dataclasses import dataclass, field
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
# Valid identifiers: lower kebab or snake, must start with letter
|
|
11
|
+
_ROLE_RE = re.compile(r"^[a-z][a-z0-9_-]{1,31}$")
|
|
12
|
+
_RUN_ID_RE = re.compile(r"^[a-zA-Z0-9][a-zA-Z0-9._-]{2,64}$")
|
|
13
|
+
_BRANCH_SAFE_RE = re.compile(r"^[a-zA-Z0-9/._-]+$")
|
|
14
|
+
_SHA_RE = re.compile(r"^[0-9a-f]{40}$")
|
|
15
|
+
|
|
16
|
+
API_VERSION = "agent-toolkit.dev/v1alpha1"
|
|
17
|
+
KIND = "SwarmRecipe"
|
|
18
|
+
STATE_VERSION = 1
|
|
19
|
+
HANDOFF_VERSION = 1
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class RolePolicy(str, Enum):
|
|
23
|
+
READ_ONLY = "read-only"
|
|
24
|
+
WRITER = "writer"
|
|
25
|
+
REVIEWER_WRITER = "reviewer-writer"
|
|
26
|
+
INTEGRATOR = "integrator"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class UIBackend(str, Enum):
|
|
30
|
+
AUTO = "auto"
|
|
31
|
+
HERDR = "herdr"
|
|
32
|
+
TMUX = "tmux"
|
|
33
|
+
HEADLESS = "headless"
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
class RunnerName(str, Enum):
|
|
37
|
+
OPENCODE = "opencode"
|
|
38
|
+
CLAUDE = "claude"
|
|
39
|
+
CODEX = "codex"
|
|
40
|
+
CURSOR = "cursor"
|
|
41
|
+
COPILOT = "copilot"
|
|
42
|
+
MUSE = "muse"
|
|
43
|
+
SKELETON = "skeleton"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class RunState(str, Enum):
|
|
47
|
+
PLANNING = "planning"
|
|
48
|
+
AWAITING_PLAN_APPROVAL = "awaiting_plan_approval"
|
|
49
|
+
RUNNING = "running"
|
|
50
|
+
AWAITING_HUMAN = "awaiting_human"
|
|
51
|
+
PAUSED = "paused"
|
|
52
|
+
COMPLETED = "completed"
|
|
53
|
+
FAILED = "failed"
|
|
54
|
+
CANCELLED = "cancelled"
|
|
55
|
+
BUDGET_EXHAUSTED = "budget_exhausted"
|
|
56
|
+
CLEANUP_PENDING = "cleanup_pending"
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class RoleState(str, Enum):
|
|
60
|
+
INACTIVE = "inactive"
|
|
61
|
+
STARTING = "starting"
|
|
62
|
+
IDLE = "idle"
|
|
63
|
+
READY = "ready"
|
|
64
|
+
WORKING = "working"
|
|
65
|
+
BLOCKED = "blocked"
|
|
66
|
+
AWAITING_HANDOFF = "awaiting_handoff"
|
|
67
|
+
COMPLETED = "completed"
|
|
68
|
+
FAILED = "failed"
|
|
69
|
+
STOPPED = "stopped"
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def validate_role_name(name: str) -> str:
|
|
73
|
+
if not _ROLE_RE.match(name):
|
|
74
|
+
raise ValueError(f"Invalid role name: {name!r} (must match {_ROLE_RE.pattern})")
|
|
75
|
+
return name
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def validate_run_id(run_id: str) -> str:
|
|
79
|
+
if not _RUN_ID_RE.match(run_id):
|
|
80
|
+
raise ValueError(f"Invalid run id: {run_id!r}")
|
|
81
|
+
return run_id
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def validate_branch(branch: str) -> str:
|
|
85
|
+
if (
|
|
86
|
+
not _BRANCH_SAFE_RE.match(branch)
|
|
87
|
+
or ".." in branch
|
|
88
|
+
or branch.startswith("/")
|
|
89
|
+
or branch.endswith("/")
|
|
90
|
+
):
|
|
91
|
+
raise ValueError(f"Invalid branch: {branch!r}")
|
|
92
|
+
return branch
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def validate_commit_sha(sha: str) -> str:
|
|
96
|
+
if not _SHA_RE.match(sha.lower()):
|
|
97
|
+
raise ValueError(f"Invalid commit SHA (must be 40 hex chars): {sha!r}")
|
|
98
|
+
return sha.lower()
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
@dataclass(frozen=True)
|
|
102
|
+
class RoleBudget:
|
|
103
|
+
max_tokens: int | None = None
|
|
104
|
+
max_cost_usd: float | None = None
|
|
105
|
+
max_wall_seconds: int | None = None
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@dataclass(frozen=True)
|
|
109
|
+
class RunBudget:
|
|
110
|
+
max_total_tokens: int | None = None
|
|
111
|
+
max_cost_usd: float | None = None
|
|
112
|
+
max_wall_seconds: int | None = None
|
|
113
|
+
max_concurrency: int = 2
|
|
114
|
+
max_role_round_trips: int = 2
|
|
115
|
+
max_handoffs: int | None = None
|
|
116
|
+
max_artifact_bytes: int | None = None
|
|
117
|
+
per_role: dict[str, RoleBudget] = field(default_factory=dict)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@dataclass(frozen=True)
|
|
121
|
+
class ApprovalGate:
|
|
122
|
+
id: str
|
|
123
|
+
description: str
|
|
124
|
+
required: bool = True
|
|
125
|
+
approved: bool = False
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
@dataclass(frozen=True)
|
|
129
|
+
class WorktreeAssignment:
|
|
130
|
+
role: str
|
|
131
|
+
path: str
|
|
132
|
+
branch: str
|
|
133
|
+
owned: bool = True
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
@dataclass(frozen=True)
|
|
137
|
+
class RunnerDefinition:
|
|
138
|
+
name: str
|
|
139
|
+
kind: str
|
|
140
|
+
model: str | None = None
|
|
141
|
+
capabilities: dict[str, Any] = field(default_factory=dict)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
@dataclass(frozen=True)
|
|
145
|
+
class ModelProfile:
|
|
146
|
+
name: str
|
|
147
|
+
mapping: dict[str, str] = field(default_factory=dict)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
@dataclass(frozen=True)
|
|
151
|
+
class TaskContract:
|
|
152
|
+
title: str
|
|
153
|
+
body: str
|
|
154
|
+
acceptance: str | None = None
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
@dataclass(frozen=True)
|
|
158
|
+
class Handoff:
|
|
159
|
+
version: int
|
|
160
|
+
type: str
|
|
161
|
+
from_role: str
|
|
162
|
+
to_role: str
|
|
163
|
+
priority: int
|
|
164
|
+
artifact: str | None = None
|
|
165
|
+
commit: str | None = None
|
|
166
|
+
branch: str | None = None
|
|
167
|
+
blocking: bool = False
|
|
168
|
+
handoff_id: str | None = None
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
@dataclass(frozen=True)
|
|
172
|
+
class ArtifactReference:
|
|
173
|
+
path: str
|
|
174
|
+
role: str
|
|
175
|
+
size_bytes: int | None = None
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
@dataclass(frozen=True)
|
|
179
|
+
class CommitReference:
|
|
180
|
+
sha: str
|
|
181
|
+
branch: str
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
@dataclass(frozen=True)
|
|
185
|
+
class RoleAssignment:
|
|
186
|
+
role: str
|
|
187
|
+
persona: str
|
|
188
|
+
policy: RolePolicy
|
|
189
|
+
model_profile: str
|
|
190
|
+
runner: str
|
|
191
|
+
worktree: str | None = None
|
|
192
|
+
consumes: list[str] = field(default_factory=list)
|
|
193
|
+
produces: list[str] = field(default_factory=list)
|
|
194
|
+
receive_mode: str = "task" # task | batch
|
|
195
|
+
skills: list[str] = field(default_factory=list)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
@dataclass(frozen=True)
|
|
199
|
+
class SwarmRecipe:
|
|
200
|
+
api_version: str
|
|
201
|
+
kind: str
|
|
202
|
+
name: str
|
|
203
|
+
description: str
|
|
204
|
+
spec: dict[str, Any]
|
|
205
|
+
|
|
206
|
+
@property
|
|
207
|
+
def roles(self) -> dict[str, Any]:
|
|
208
|
+
return self.spec.get("roles", {}) # type: ignore
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
@dataclass(frozen=True)
|
|
212
|
+
class SwarmRun:
|
|
213
|
+
run_id: str
|
|
214
|
+
recipe: str
|
|
215
|
+
run_state: RunState
|
|
216
|
+
roles: dict[str, RoleState]
|
|
217
|
+
budget: RunBudget
|
|
218
|
+
ui_backend: UIBackend
|
|
219
|
+
runner: str
|
|
220
|
+
model_profile: str
|
|
221
|
+
created_at: str
|
|
222
|
+
worktrees: list[WorktreeAssignment] = field(default_factory=list)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
@dataclass(frozen=True)
|
|
226
|
+
class TraceEvent:
|
|
227
|
+
ts: str
|
|
228
|
+
kind: str
|
|
229
|
+
run_id: str
|
|
230
|
+
details: dict[str, Any] = field(default_factory=dict)
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"""Prompt composition — combine protocol + recipe + role + persona + skills."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
GLOBAL_PROTOCOL = """# Agent Toolkit Swarm — Global Protocol
|
|
9
|
+
- You are a role in a multi-agent swarm. Work only on your assigned task.
|
|
10
|
+
- Do not push, do not merge to base branch, do not publish releases.
|
|
11
|
+
- Transfer code only via validated Git commits on your Toolkit-owned branch.
|
|
12
|
+
- Use durable handoffs via `agent-toolkit swarm handoff create` and `agent-toolkit swarm task next/complete`.
|
|
13
|
+
- Stay inside your worktree when you have one. Do not write outside `.agent-toolkit/swarm/runs/<run-id>/` except your worktree.
|
|
14
|
+
- Keep artifacts under 1MB, no secrets, no full transcript forwarding.
|
|
15
|
+
- Record decisions in artifacts and trace events.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
# Interactive bootstrap — when swarm starts without a task, the first agent must NOT invent work.
|
|
19
|
+
# It does a very brief context analysis and then waits for the user to provide the first request.
|
|
20
|
+
INTERACTIVE_BOOTSTRAP = """# Interactive mode — No initial task
|
|
21
|
+
> This swarm was started **without an initial prompt/task**. The user will provide the first request next in this same Herdr/Tmux session.
|
|
22
|
+
|
|
23
|
+
**Instructions for the first agent (planner/implementer):**
|
|
24
|
+
- **Do NOT invent work** or start tasks on your own. Do not create a plan or code yet.
|
|
25
|
+
- Do only a **very brief** context analysis (max 3-4 sentences / 30 seconds):
|
|
26
|
+
- If you detect a **workspace** (exists `AGENTS.md` and/or `knowledge/` or `find_workspace_root()` is not None, e.g. `~/.ai-workspace`):
|
|
27
|
+
Run `agent-toolkit workspace context` and briefly review `AGENTS.md` + `knowledge/todos/pending.md`.
|
|
28
|
+
Also check `projects/` and `loops/` if present. Summarize in 2-3 lines what workspace it is.
|
|
29
|
+
- If no workspace, briefly review the current repo (`git status`, `cat README.md` / `pyproject.toml`).
|
|
30
|
+
- Then **stay on standby** and confirm with a short message:
|
|
31
|
+
"Brief analysis done — awaiting your first request. When you provide the task, I will apply `assistant` (discovery) + `workflow-generic-project` (plan -> approval -> implement -> review -> draft PR)."
|
|
32
|
+
- When the user sends the request (via chat or `agent-toolkit swarm handoff create --type artifact --from planner --to implementer --artifact artifacts/task-contract.md --run-id <run-id>`), apply the full flow: discovery per `assistant` (order README -> docs/ -> AGENTS.md -> CONTRIBUTING -> PR templates -> Makefile/package.json -> devcontainer/CI), then `workflow-generic-project` with plan approval gate before implementing, and `github-cli-workflow` for draft PR.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def load_persona_text(persona: str) -> str:
|
|
37
|
+
# Load from bundled data/agents/<persona>/AGENT.md if exists
|
|
38
|
+
try:
|
|
39
|
+
from agent_toolkit._paths import find_toolkit_root
|
|
40
|
+
|
|
41
|
+
root = find_toolkit_root()
|
|
42
|
+
# Try package data
|
|
43
|
+
candidates = [
|
|
44
|
+
Path(root) / "agents" / persona / "AGENT.md",
|
|
45
|
+
Path(__file__).parent.parent / "data" / "agents" / persona / "AGENT.md",
|
|
46
|
+
]
|
|
47
|
+
for p in candidates:
|
|
48
|
+
if p.is_file():
|
|
49
|
+
return p.read_text(encoding="utf-8")[:2000]
|
|
50
|
+
except Exception:
|
|
51
|
+
pass
|
|
52
|
+
return f"# Persona: {persona}\nAct as {persona} per Toolkit guidance."
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def compose_role_prompt(
|
|
56
|
+
recipe: dict[str, Any],
|
|
57
|
+
role: str,
|
|
58
|
+
role_def: dict[str, Any],
|
|
59
|
+
task_contract: str | None,
|
|
60
|
+
handoff: dict[str, Any] | None,
|
|
61
|
+
included_skills: list[str] | None = None,
|
|
62
|
+
) -> tuple[str, dict[str, Any]]:
|
|
63
|
+
persona = role_def.get("persona", role)
|
|
64
|
+
persona_text = load_persona_text(persona)
|
|
65
|
+
recipe_name = (recipe.get("metadata") or {}).get("name", "unknown")
|
|
66
|
+
policy = role_def.get("policy", "read-only")
|
|
67
|
+
parts: list[str] = [GLOBAL_PROTOCOL]
|
|
68
|
+
parts.append(f"# Recipe: {recipe_name} — Role: {role}\nPolicy: {policy}\nPersona: {persona}\n")
|
|
69
|
+
parts.append(persona_text)
|
|
70
|
+
# Recipe workflow snippet
|
|
71
|
+
spec = recipe.get("spec", {})
|
|
72
|
+
workflow = f"Execution: {spec.get('execution', {})}\nWorkspace: {spec.get('workspace', {})}\n"
|
|
73
|
+
parts.append(workflow)
|
|
74
|
+
# Empty / whitespace-only task_contract means interactive bootstrap — do not invent work
|
|
75
|
+
if task_contract and task_contract.strip():
|
|
76
|
+
parts.append(f"# Task Contract\n{task_contract[:3000]}")
|
|
77
|
+
else:
|
|
78
|
+
# No task provided — inject bootstrap: analyze context very briefly, then wait for user
|
|
79
|
+
parts.append(INTERACTIVE_BOOTSTRAP)
|
|
80
|
+
# Also hint workspace context command for faster readiness
|
|
81
|
+
try:
|
|
82
|
+
from agent_toolkit._paths import find_workspace_root
|
|
83
|
+
|
|
84
|
+
ws = find_workspace_root()
|
|
85
|
+
if ws is not None:
|
|
86
|
+
parts.append(
|
|
87
|
+
f"# Workspace context hint\nDetected workspace at `{ws}` — run `agent-toolkit workspace context` to see session state before waiting."
|
|
88
|
+
)
|
|
89
|
+
except Exception:
|
|
90
|
+
pass
|
|
91
|
+
if handoff:
|
|
92
|
+
parts.append(f"# Current Handoff\n{handoff}")
|
|
93
|
+
if included_skills:
|
|
94
|
+
parts.append(f"# Skills: {', '.join(included_skills)}")
|
|
95
|
+
# Handoff instructions — explicit like swarm-forge, per role
|
|
96
|
+
try:
|
|
97
|
+
roles = spec.get("roles", {})
|
|
98
|
+
current = roles.get(role, {})
|
|
99
|
+
produces = current.get("produces", [])
|
|
100
|
+
# Find consumers of what we produce
|
|
101
|
+
next_roles = []
|
|
102
|
+
for other_name, other_def in roles.items():
|
|
103
|
+
if other_name == role:
|
|
104
|
+
continue
|
|
105
|
+
consumes = other_def.get("consumes", [])
|
|
106
|
+
# Check if any of our produces is consumed by other
|
|
107
|
+
for p in produces:
|
|
108
|
+
if p in consumes:
|
|
109
|
+
next_roles.append(other_name)
|
|
110
|
+
break
|
|
111
|
+
# For pair/team/full, also add fallback based on known chain
|
|
112
|
+
if not next_roles:
|
|
113
|
+
# Fallback chain for known recipes
|
|
114
|
+
chain = {
|
|
115
|
+
"pair": {"implementer": ["reviewer"], "reviewer": ["integrator"]},
|
|
116
|
+
"team": {
|
|
117
|
+
"planner": ["implementer"],
|
|
118
|
+
"implementer": ["reviewer"],
|
|
119
|
+
"reviewer": ["architect"],
|
|
120
|
+
},
|
|
121
|
+
"full": {
|
|
122
|
+
"planner": ["implementer"],
|
|
123
|
+
"implementer": ["refactorer"],
|
|
124
|
+
"refactorer": ["architect"],
|
|
125
|
+
"architect": ["hardener"],
|
|
126
|
+
"hardener": ["qa"],
|
|
127
|
+
},
|
|
128
|
+
}.get(recipe_name, {})
|
|
129
|
+
next_roles = chain.get(role, [])
|
|
130
|
+
if next_roles:
|
|
131
|
+
handoff_lines = [
|
|
132
|
+
"## Handoff — delegate to next role when done",
|
|
133
|
+
f"Your role `{role}` produces: {', '.join(produces) if produces else 'artifact'}",
|
|
134
|
+
f"Next role(s): {', '.join(next_roles)}",
|
|
135
|
+
"When you complete your work:",
|
|
136
|
+
"1. If you created/modified code, commit it on your worktree branch (`git add` + `git commit`), then:",
|
|
137
|
+
f" `agent-toolkit swarm handoff create --type commit --from {role} --to {next_roles[0]} --commit <40-hex-sha> --branch <your-branch>`",
|
|
138
|
+
"2. If you created an artifact (e.g., `artifacts/review.md`), then:",
|
|
139
|
+
f" `agent-toolkit swarm handoff create --type artifact --from {role} --to {next_roles[0]} --artifact artifacts/<file>.md`",
|
|
140
|
+
"The next role will run `agent-toolkit swarm task next --role <next> --run-id <run_id>` to pick it up. Do not wait — the handoff is durable and the daemon will notify. The next role's tmux window will be auto-created by the handoff.",
|
|
141
|
+
"IMPORTANT: After you finish writing the artifact or committing code, immediately run the `handoff create` command above — do NOT ask the user for confirmation, do NOT wait for 'do the handoff'.",
|
|
142
|
+
f"Run ID for this swarm: `{role_def.get('_run_id', 'see task contract')}` — if the command says 'No run found', add `--run-id <run_id>` or ensure `AGENT_TOOLKIT_SWARM_RUN_ID` is exported (it is in your tmux env).",
|
|
143
|
+
]
|
|
144
|
+
parts.append("\n".join(handoff_lines))
|
|
145
|
+
else:
|
|
146
|
+
parts.append(
|
|
147
|
+
"## Handoff\nWhen done, create a handoff if your work should be reviewed: `agent-toolkit swarm handoff create --type artifact --from "
|
|
148
|
+
+ role
|
|
149
|
+
+ " --to <next> --artifact artifacts/<file>.md` (or `--type commit` with --commit/--branch for code)."
|
|
150
|
+
)
|
|
151
|
+
except Exception:
|
|
152
|
+
pass
|
|
153
|
+
# Enforce size limit 12k chars
|
|
154
|
+
text = "\n\n".join(parts)
|
|
155
|
+
if len(text) > 12000:
|
|
156
|
+
text = text[:12000] + "\n[truncated]"
|
|
157
|
+
is_interactive = not task_contract or not task_contract.strip()
|
|
158
|
+
manifest = {
|
|
159
|
+
"role": role,
|
|
160
|
+
"persona": persona,
|
|
161
|
+
"policy": policy,
|
|
162
|
+
"recipe": recipe_name,
|
|
163
|
+
"includes": [
|
|
164
|
+
"global_protocol",
|
|
165
|
+
"recipe_workflow",
|
|
166
|
+
"persona",
|
|
167
|
+
"interactive_bootstrap" if is_interactive else None,
|
|
168
|
+
"task_contract" if task_contract and task_contract.strip() else None,
|
|
169
|
+
"handoff" if handoff else None,
|
|
170
|
+
"skills" if included_skills else None,
|
|
171
|
+
],
|
|
172
|
+
"size_chars": len(text),
|
|
173
|
+
"model_profile_task": role_def.get("model_profile"),
|
|
174
|
+
"is_interactive": is_interactive,
|
|
175
|
+
}
|
|
176
|
+
manifest["includes"] = [x for x in manifest["includes"] if x]
|
|
177
|
+
return text, manifest
|