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,110 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Canonical lifecycle hook registry loader.
|
|
3
|
+
|
|
4
|
+
Loads hook definitions from capabilities/hooks/*.yaml and validates
|
|
5
|
+
them against schemas/hook.schema.yaml.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass, field
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class HookDefinition:
|
|
17
|
+
"""A canonical lifecycle hook definition."""
|
|
18
|
+
|
|
19
|
+
id: str
|
|
20
|
+
event: str
|
|
21
|
+
handler_type: str
|
|
22
|
+
blocking: bool
|
|
23
|
+
failure_policy: str
|
|
24
|
+
default_enabled: bool
|
|
25
|
+
security_classification: str
|
|
26
|
+
platform_support: dict[str, str] = field(default_factory=dict)
|
|
27
|
+
command: list[str] = field(default_factory=list)
|
|
28
|
+
timeout_ms: int = 5000
|
|
29
|
+
|
|
30
|
+
def is_supported_for(self, target_id: str) -> bool:
|
|
31
|
+
status = self.platform_support.get(target_id, "unknown-blocked")
|
|
32
|
+
return status in ("native", "native-experimental")
|
|
33
|
+
|
|
34
|
+
def is_safe(self) -> bool:
|
|
35
|
+
return self.security_classification == "safe"
|
|
36
|
+
|
|
37
|
+
@classmethod
|
|
38
|
+
def from_dict(cls, data: dict[str, Any]) -> "HookDefinition":
|
|
39
|
+
handler = data.get("handler", {})
|
|
40
|
+
security = data.get("security", {})
|
|
41
|
+
return cls(
|
|
42
|
+
id=data["id"],
|
|
43
|
+
event=data["event"],
|
|
44
|
+
handler_type=handler.get("type", "command"),
|
|
45
|
+
blocking=data.get("blocking", True),
|
|
46
|
+
failure_policy=data.get("failure_policy", "abort"),
|
|
47
|
+
default_enabled=security.get("default_enabled", False),
|
|
48
|
+
security_classification=security.get("classification", "safe"),
|
|
49
|
+
platform_support=data.get("platforms", {}),
|
|
50
|
+
command=handler.get("command", []),
|
|
51
|
+
timeout_ms=handler.get("timeout_ms", 5000),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def load_hooks(hooks_dir: Path) -> tuple[dict[str, HookDefinition], list[str]]:
|
|
56
|
+
"""Load all hook definitions from capabilities/hooks/*.yaml.
|
|
57
|
+
|
|
58
|
+
Returns (hooks, errors). Malformed files are skipped and reported.
|
|
59
|
+
"""
|
|
60
|
+
hooks: dict[str, HookDefinition] = {}
|
|
61
|
+
errors: list[str] = []
|
|
62
|
+
if not hooks_dir.is_dir():
|
|
63
|
+
return hooks, errors
|
|
64
|
+
|
|
65
|
+
try:
|
|
66
|
+
import yaml
|
|
67
|
+
except ImportError:
|
|
68
|
+
return hooks, ["PyYAML is required to load hook definitions"]
|
|
69
|
+
|
|
70
|
+
for yaml_file in sorted(hooks_dir.glob("*.yaml")):
|
|
71
|
+
try:
|
|
72
|
+
data = yaml.safe_load(yaml_file.read_text())
|
|
73
|
+
except Exception as exc:
|
|
74
|
+
errors.append(f"{yaml_file}: invalid YAML: {exc}")
|
|
75
|
+
continue
|
|
76
|
+
if not data or "id" not in data:
|
|
77
|
+
errors.append(f"{yaml_file}: missing required 'id' field")
|
|
78
|
+
continue
|
|
79
|
+
try:
|
|
80
|
+
hooks[data["id"]] = HookDefinition.from_dict(data)
|
|
81
|
+
except Exception as exc:
|
|
82
|
+
errors.append(f"{yaml_file}: {exc}")
|
|
83
|
+
|
|
84
|
+
return hooks, errors
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def generate_parity_document(hooks: dict[str, HookDefinition]) -> str:
|
|
88
|
+
"""Generate a hook parity document from canonical hook definitions."""
|
|
89
|
+
targets = [
|
|
90
|
+
"claude-code",
|
|
91
|
+
"cursor",
|
|
92
|
+
"gemini-cli",
|
|
93
|
+
"copilot-cli",
|
|
94
|
+
"opencode",
|
|
95
|
+
"pi",
|
|
96
|
+
"windsurf",
|
|
97
|
+
"codex",
|
|
98
|
+
]
|
|
99
|
+
|
|
100
|
+
lines = ["# Hook Parity", "", "| Hook | Event | " + " | ".join(targets) + " |"]
|
|
101
|
+
lines.append("|------|-------|" + "|".join(["---"] * len(targets)) + "|")
|
|
102
|
+
|
|
103
|
+
for hook in sorted(hooks.values(), key=lambda h: h.id):
|
|
104
|
+
row_parts = [hook.id, hook.event]
|
|
105
|
+
for target in targets:
|
|
106
|
+
status = hook.platform_support.get(target, "unknown-blocked")
|
|
107
|
+
row_parts.append(status)
|
|
108
|
+
lines.append("| " + " | ".join(row_parts) + " |")
|
|
109
|
+
|
|
110
|
+
return "\n".join(lines) + "\n"
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Loads canonical sources (SKILL.md, AGENT.md, products.yaml) into the CanonicalGraph IR.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
import re
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from typing import Any
|
|
10
|
+
|
|
11
|
+
from agent_toolkit.compiler.model import (
|
|
12
|
+
AbstractTool,
|
|
13
|
+
Agent,
|
|
14
|
+
CanonicalGraph,
|
|
15
|
+
ModelClass,
|
|
16
|
+
Product,
|
|
17
|
+
SecurityPolicy,
|
|
18
|
+
Skill,
|
|
19
|
+
Stability,
|
|
20
|
+
)
|
|
21
|
+
from agent_toolkit.compiler.tool_mapping import (
|
|
22
|
+
infer_read_only,
|
|
23
|
+
map_claude_tools,
|
|
24
|
+
parse_abstract_tool_list,
|
|
25
|
+
parse_claude_tool_names,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
import yaml
|
|
30
|
+
|
|
31
|
+
_YAML = True
|
|
32
|
+
except ImportError:
|
|
33
|
+
_YAML = False
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def _parse_frontmatter(text: str) -> tuple[dict[str, Any], str, str | None]:
|
|
37
|
+
"""Parse YAML frontmatter from a Markdown file.
|
|
38
|
+
|
|
39
|
+
Returns (frontmatter, body, error). On YAML parse failure, frontmatter is
|
|
40
|
+
empty and error describes the failure (fail-closed — callers must not treat
|
|
41
|
+
the file as valid metadata).
|
|
42
|
+
"""
|
|
43
|
+
m = re.match(r"^---[ \t]*\n(.*?)\n---[ \t]*\n?(.*)", text, re.DOTALL)
|
|
44
|
+
if not m:
|
|
45
|
+
return {}, text, None
|
|
46
|
+
fm_text = m.group(1)
|
|
47
|
+
body = m.group(2)
|
|
48
|
+
if _YAML:
|
|
49
|
+
try:
|
|
50
|
+
loaded = yaml.safe_load(fm_text)
|
|
51
|
+
except Exception as exc:
|
|
52
|
+
return {}, body, f"invalid YAML frontmatter: {exc}"
|
|
53
|
+
if loaded is None:
|
|
54
|
+
fm: dict[str, Any] = {}
|
|
55
|
+
elif not isinstance(loaded, dict):
|
|
56
|
+
return {}, body, f"frontmatter must be a mapping, got {type(loaded).__name__}"
|
|
57
|
+
else:
|
|
58
|
+
fm = loaded
|
|
59
|
+
else:
|
|
60
|
+
fm = _simple_yaml(fm_text)
|
|
61
|
+
return fm, body, None
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _simple_yaml(text: str) -> dict[str, Any]:
|
|
65
|
+
"""Minimal YAML parser for simple key: value frontmatter (no PyYAML)."""
|
|
66
|
+
result: dict[str, Any] = {}
|
|
67
|
+
for line in text.splitlines():
|
|
68
|
+
m = re.match(r"^(\w[\w-]*):\s*(.*)$", line.strip())
|
|
69
|
+
if m:
|
|
70
|
+
result[m.group(1)] = m.group(2).strip().strip('"').strip("'")
|
|
71
|
+
return result
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def load_skills(skills_root: Path) -> tuple[dict[str, Skill], list[str]]:
|
|
75
|
+
"""Load all SKILL.md files from skills/<domain>/<name>/SKILL.md."""
|
|
76
|
+
skills: dict[str, Skill] = {}
|
|
77
|
+
errors: list[str] = []
|
|
78
|
+
|
|
79
|
+
for skill_md in sorted(skills_root.rglob("SKILL.md")):
|
|
80
|
+
domain_dir = skill_md.parent.parent
|
|
81
|
+
domain = domain_dir.name
|
|
82
|
+
skill_name = skill_md.parent.name
|
|
83
|
+
skill_id = f"{domain}/{skill_name}"
|
|
84
|
+
|
|
85
|
+
fm, _body, fm_err = _parse_frontmatter(skill_md.read_text(errors="replace"))
|
|
86
|
+
if fm_err:
|
|
87
|
+
errors.append(f"{skill_md}: {fm_err}")
|
|
88
|
+
continue
|
|
89
|
+
|
|
90
|
+
declared_name = fm.get("name", "")
|
|
91
|
+
if declared_name and declared_name != skill_name:
|
|
92
|
+
errors.append(
|
|
93
|
+
f"Skill name mismatch: directory '{skill_name}' vs "
|
|
94
|
+
f"frontmatter name '{declared_name}' in {skill_md}"
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
# Handle YAML block scalars in description (>-, |-, etc.)
|
|
98
|
+
raw_desc = fm.get("description", "")
|
|
99
|
+
if isinstance(raw_desc, str) and raw_desc.strip() in (">-", ">", "|-", "|", ">+", "|+"):
|
|
100
|
+
# Extract from raw frontmatter text
|
|
101
|
+
raw_text = skill_md.read_text(errors="replace")
|
|
102
|
+
fm_match = re.search(r"^---[ \t]*\n(.*?)\n---", raw_text, re.DOTALL)
|
|
103
|
+
if fm_match:
|
|
104
|
+
fm_text = fm_match.group(1)
|
|
105
|
+
block = re.search(
|
|
106
|
+
r"^description:[ \t]*[|>][\-+]?[ \t]*\n((?:[ \t]+.+\n?)+)",
|
|
107
|
+
fm_text,
|
|
108
|
+
re.MULTILINE,
|
|
109
|
+
)
|
|
110
|
+
if block:
|
|
111
|
+
lines = [line.strip() for line in block.group(1).splitlines() if line.strip()]
|
|
112
|
+
raw_desc = " ".join(lines)
|
|
113
|
+
description = str(raw_desc).strip()[:120]
|
|
114
|
+
|
|
115
|
+
skills[skill_id] = Skill(
|
|
116
|
+
id=skill_id,
|
|
117
|
+
name=skill_name,
|
|
118
|
+
domain=domain,
|
|
119
|
+
description=str(description).strip()[:120],
|
|
120
|
+
stability=Stability(fm.get("stability", "stable"))
|
|
121
|
+
if fm.get("stability") in ("stable", "experimental", "deprecated")
|
|
122
|
+
else Stability.STABLE,
|
|
123
|
+
source_path=skill_md,
|
|
124
|
+
tags=fm.get("tags", []) if isinstance(fm.get("tags"), list) else [],
|
|
125
|
+
compatibility=str(fm.get("compatibility", "")),
|
|
126
|
+
metadata=fm,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
return skills, errors
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def _parse_string_list(value: Any) -> list[str]:
|
|
133
|
+
if value is None:
|
|
134
|
+
return []
|
|
135
|
+
if isinstance(value, list):
|
|
136
|
+
return [str(v).strip() for v in value if str(v).strip()]
|
|
137
|
+
return [v.strip() for v in str(value).split(",") if v.strip()]
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
def _parse_bool(value: Any, default: bool = False) -> bool:
|
|
141
|
+
if value is None:
|
|
142
|
+
return default
|
|
143
|
+
if isinstance(value, bool):
|
|
144
|
+
return value
|
|
145
|
+
return str(value).strip().lower() in ("true", "yes", "1")
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def load_agents(agents_root: Path) -> tuple[dict[str, Agent], list[str]]:
|
|
149
|
+
"""Load all AGENT.md files from agents/<name>/AGENT.md."""
|
|
150
|
+
agents: dict[str, Agent] = {}
|
|
151
|
+
errors: list[str] = []
|
|
152
|
+
|
|
153
|
+
for agent_md in sorted(agents_root.rglob("AGENT.md")):
|
|
154
|
+
agent_name = agent_md.parent.name
|
|
155
|
+
fm, body, fm_err = _parse_frontmatter(agent_md.read_text(errors="replace"))
|
|
156
|
+
if fm_err:
|
|
157
|
+
errors.append(f"{agent_md}: {fm_err}")
|
|
158
|
+
continue
|
|
159
|
+
|
|
160
|
+
declared_name = fm.get("name", "")
|
|
161
|
+
if declared_name and declared_name != agent_name:
|
|
162
|
+
errors.append(
|
|
163
|
+
f"Agent name mismatch: directory '{agent_name}' vs "
|
|
164
|
+
f"frontmatter name '{declared_name}' in {agent_md}"
|
|
165
|
+
)
|
|
166
|
+
continue
|
|
167
|
+
|
|
168
|
+
allowed_tools: list[AbstractTool]
|
|
169
|
+
denied_tools: list[AbstractTool]
|
|
170
|
+
|
|
171
|
+
if fm.get("allowed_tools") is not None:
|
|
172
|
+
allowed_tools, invalid_allowed = parse_abstract_tool_list(fm.get("allowed_tools"))
|
|
173
|
+
if invalid_allowed:
|
|
174
|
+
errors.append(f"{agent_md}: invalid allowed_tools: {', '.join(invalid_allowed)}")
|
|
175
|
+
continue
|
|
176
|
+
else:
|
|
177
|
+
claude_names = parse_claude_tool_names(fm.get("tools"))
|
|
178
|
+
allowed_tools, unknown_tools = map_claude_tools(claude_names)
|
|
179
|
+
if unknown_tools:
|
|
180
|
+
errors.append(f"{agent_md}: unknown Claude tool(s): {', '.join(unknown_tools)}")
|
|
181
|
+
continue
|
|
182
|
+
|
|
183
|
+
denied_tools, invalid_denied = parse_abstract_tool_list(fm.get("denied_tools"))
|
|
184
|
+
if invalid_denied:
|
|
185
|
+
errors.append(f"{agent_md}: invalid denied_tools: {', '.join(invalid_denied)}")
|
|
186
|
+
continue
|
|
187
|
+
|
|
188
|
+
delegates_to = _parse_string_list(fm.get("delegates_to"))
|
|
189
|
+
|
|
190
|
+
if "read_only" in fm:
|
|
191
|
+
read_only = _parse_bool(fm.get("read_only"))
|
|
192
|
+
else:
|
|
193
|
+
read_only = infer_read_only(allowed_tools)
|
|
194
|
+
|
|
195
|
+
background_eligible = _parse_bool(fm.get("background_eligible"))
|
|
196
|
+
|
|
197
|
+
mc_str = fm.get("model_class", "inherit")
|
|
198
|
+
mc = (
|
|
199
|
+
ModelClass(mc_str)
|
|
200
|
+
if mc_str in ("fast", "balanced", "deep", "inherit")
|
|
201
|
+
else ModelClass.INHERIT
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
agents[agent_name] = Agent(
|
|
205
|
+
id=agent_name,
|
|
206
|
+
name=agent_name,
|
|
207
|
+
description=str(fm.get("description", ""))[:200],
|
|
208
|
+
instructions=body.strip(),
|
|
209
|
+
model_class=mc,
|
|
210
|
+
allowed_tools=allowed_tools,
|
|
211
|
+
denied_tools=denied_tools,
|
|
212
|
+
delegates_to=delegates_to,
|
|
213
|
+
read_only=read_only,
|
|
214
|
+
background_eligible=background_eligible,
|
|
215
|
+
source_path=agent_md,
|
|
216
|
+
metadata=fm,
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
return agents, errors
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
def validate_agent_contracts(graph: CanonicalGraph) -> None:
|
|
223
|
+
"""Validate agent tool requirements and delegation references."""
|
|
224
|
+
agent_ids = set(graph.agents)
|
|
225
|
+
|
|
226
|
+
for agent_id, agent in graph.agents.items():
|
|
227
|
+
overlap = {t.value for t in agent.allowed_tools} & {t.value for t in agent.denied_tools}
|
|
228
|
+
if overlap:
|
|
229
|
+
graph.errors.append(
|
|
230
|
+
f"Agent '{agent_id}' lists the same tool in allowed_tools and denied_tools: "
|
|
231
|
+
f"{', '.join(sorted(overlap))}"
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
for delegate_id in agent.delegates_to:
|
|
235
|
+
if delegate_id not in agent_ids:
|
|
236
|
+
graph.errors.append(
|
|
237
|
+
f"Agent '{agent_id}' delegates_to unknown agent '{delegate_id}'"
|
|
238
|
+
)
|
|
239
|
+
elif delegate_id == agent_id:
|
|
240
|
+
graph.errors.append(f"Agent '{agent_id}' cannot delegate_to itself")
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
def load_products(products_yaml: Path) -> tuple[dict[str, Product], list[str]]:
|
|
244
|
+
"""Load products from distributions/products.yaml."""
|
|
245
|
+
products: dict[str, Product] = {}
|
|
246
|
+
errors: list[str] = []
|
|
247
|
+
|
|
248
|
+
if not products_yaml.exists():
|
|
249
|
+
return products, [f"products.yaml not found: {products_yaml}"]
|
|
250
|
+
|
|
251
|
+
if _YAML:
|
|
252
|
+
data = yaml.safe_load(products_yaml.read_text()) or {}
|
|
253
|
+
else:
|
|
254
|
+
return products, ["PyYAML required to load products.yaml"]
|
|
255
|
+
|
|
256
|
+
for p in data.get("products", []):
|
|
257
|
+
pid = p.get("id", "")
|
|
258
|
+
if not pid:
|
|
259
|
+
errors.append("Product missing 'id' field")
|
|
260
|
+
continue
|
|
261
|
+
|
|
262
|
+
inc = p.get("includes", {})
|
|
263
|
+
sec_data = p.get("security", {})
|
|
264
|
+
sec = SecurityPolicy(
|
|
265
|
+
approval_required=sec_data.get("approval_required", False),
|
|
266
|
+
default_enabled=sec_data.get("default_enabled", True),
|
|
267
|
+
rationale=sec_data.get("rationale", ""),
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
products[pid] = Product(
|
|
271
|
+
id=pid,
|
|
272
|
+
name=p.get("name", pid),
|
|
273
|
+
description=p.get("description", ""),
|
|
274
|
+
stability=Stability(p.get("stability", "stable"))
|
|
275
|
+
if p.get("stability") in ("stable", "experimental", "deprecated")
|
|
276
|
+
else Stability.STABLE,
|
|
277
|
+
included_skills=inc.get("skills", []),
|
|
278
|
+
included_agents=inc.get("agents", []),
|
|
279
|
+
included_hooks=inc.get("hooks", []),
|
|
280
|
+
included_mcp=inc.get("mcp", []),
|
|
281
|
+
security=sec,
|
|
282
|
+
target_overrides=p.get("targets", {}),
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
return products, errors
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
def load_graph(repo_root: Path) -> CanonicalGraph:
|
|
289
|
+
"""Load all canonical sources into a CanonicalGraph."""
|
|
290
|
+
graph = CanonicalGraph()
|
|
291
|
+
|
|
292
|
+
skills, errs = load_skills(repo_root / "skills")
|
|
293
|
+
graph.skills.update(skills)
|
|
294
|
+
graph.errors.extend(errs)
|
|
295
|
+
|
|
296
|
+
agents, errs = load_agents(repo_root / "agents")
|
|
297
|
+
graph.agents.update(agents)
|
|
298
|
+
graph.errors.extend(errs)
|
|
299
|
+
|
|
300
|
+
products_yaml = repo_root / "distributions" / "products.yaml"
|
|
301
|
+
products, errs = load_products(products_yaml)
|
|
302
|
+
graph.products.update(products)
|
|
303
|
+
graph.errors.extend(errs)
|
|
304
|
+
|
|
305
|
+
validate_agent_contracts(graph)
|
|
306
|
+
|
|
307
|
+
from agent_toolkit.compiler.hook_registry import load_hooks
|
|
308
|
+
from agent_toolkit.compiler.mcp_registry import load_registry
|
|
309
|
+
|
|
310
|
+
hooks_registry, hook_errs = load_hooks(repo_root / "capabilities" / "hooks")
|
|
311
|
+
mcp_registry, mcp_errs = load_registry(repo_root / "mcp" / "registry")
|
|
312
|
+
graph.errors.extend(hook_errs)
|
|
313
|
+
graph.errors.extend(mcp_errs)
|
|
314
|
+
|
|
315
|
+
# Validate references
|
|
316
|
+
for pid, product in graph.products.items():
|
|
317
|
+
for skill_id in product.included_skills:
|
|
318
|
+
if skill_id not in graph.skills:
|
|
319
|
+
graph.warnings.append(
|
|
320
|
+
f"Product '{pid}' references skill '{skill_id}' not found in skills/"
|
|
321
|
+
)
|
|
322
|
+
for agent_id in product.included_agents:
|
|
323
|
+
if agent_id not in graph.agents:
|
|
324
|
+
graph.warnings.append(
|
|
325
|
+
f"Product '{pid}' references agent '{agent_id}' not found in agents/"
|
|
326
|
+
)
|
|
327
|
+
for hook_id in product.included_hooks:
|
|
328
|
+
if hook_id not in hooks_registry:
|
|
329
|
+
graph.warnings.append(
|
|
330
|
+
f"Product '{pid}' references hook '{hook_id}' not found in capabilities/hooks/"
|
|
331
|
+
)
|
|
332
|
+
for mcp_id in product.included_mcp:
|
|
333
|
+
if mcp_id not in mcp_registry:
|
|
334
|
+
graph.warnings.append(
|
|
335
|
+
f"Product '{pid}' references MCP provider '{mcp_id}' not found in mcp/registry/"
|
|
336
|
+
)
|
|
337
|
+
|
|
338
|
+
return graph
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Canonical MCP provider registry loader.
|
|
3
|
+
|
|
4
|
+
Loads provider metadata from mcp/registry/*.yaml and provides
|
|
5
|
+
a registry for the compiler to use when rendering MCP configurations.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import dataclass, field
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
from typing import Any
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@dataclass
|
|
16
|
+
class McpProvider:
|
|
17
|
+
"""Canonical MCP provider definition."""
|
|
18
|
+
|
|
19
|
+
id: str
|
|
20
|
+
display_name: str
|
|
21
|
+
purpose: str
|
|
22
|
+
provenance: str
|
|
23
|
+
package: str
|
|
24
|
+
env_vars: list[str]
|
|
25
|
+
read_tools: list[str] = field(default_factory=list)
|
|
26
|
+
write_tools: list[str] = field(default_factory=list)
|
|
27
|
+
destructive_tools: list[str] = field(default_factory=list)
|
|
28
|
+
default_approval: str = "read-only"
|
|
29
|
+
security_notes: str = ""
|
|
30
|
+
platform_support: dict[str, str] = field(default_factory=dict)
|
|
31
|
+
|
|
32
|
+
@classmethod
|
|
33
|
+
def from_dict(cls, data: dict[str, Any]) -> "McpProvider":
|
|
34
|
+
auth = data.get("auth", {})
|
|
35
|
+
tools = data.get("tools", {})
|
|
36
|
+
impl = data.get("implementation", {})
|
|
37
|
+
security = data.get("security", {})
|
|
38
|
+
return cls(
|
|
39
|
+
id=data["id"],
|
|
40
|
+
display_name=data.get("display_name", data["id"]),
|
|
41
|
+
purpose=data.get("purpose", ""),
|
|
42
|
+
provenance=impl.get("provenance", "unknown"),
|
|
43
|
+
package=impl.get("package", ""),
|
|
44
|
+
env_vars=auth.get("env", []),
|
|
45
|
+
read_tools=tools.get("read", []),
|
|
46
|
+
write_tools=tools.get("write", []),
|
|
47
|
+
destructive_tools=tools.get("destructive", []),
|
|
48
|
+
default_approval=data.get("approval", {}).get("default", "read-only"),
|
|
49
|
+
security_notes=security.get("notes", ""),
|
|
50
|
+
platform_support=data.get("platforms", {}),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
def is_supported_for(self, target_id: str) -> bool:
|
|
54
|
+
status = self.platform_support.get(target_id, "unknown-blocked")
|
|
55
|
+
return status in ("native", "bridged", "generated")
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def load_registry(registry_dir: Path) -> tuple[dict[str, McpProvider], list[str]]:
|
|
59
|
+
"""Load all providers from mcp/registry/*.yaml.
|
|
60
|
+
|
|
61
|
+
Returns (providers, errors). Malformed files are skipped and reported.
|
|
62
|
+
"""
|
|
63
|
+
providers: dict[str, McpProvider] = {}
|
|
64
|
+
errors: list[str] = []
|
|
65
|
+
if not registry_dir.is_dir():
|
|
66
|
+
return providers, errors
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
import yaml
|
|
70
|
+
except ImportError:
|
|
71
|
+
return providers, ["PyYAML is required to load MCP registry"]
|
|
72
|
+
|
|
73
|
+
for yaml_file in sorted(registry_dir.glob("*.yaml")):
|
|
74
|
+
try:
|
|
75
|
+
data = yaml.safe_load(yaml_file.read_text())
|
|
76
|
+
except Exception as exc:
|
|
77
|
+
errors.append(f"{yaml_file}: invalid YAML: {exc}")
|
|
78
|
+
continue
|
|
79
|
+
if not data or "id" not in data:
|
|
80
|
+
errors.append(f"{yaml_file}: missing required 'id' field")
|
|
81
|
+
continue
|
|
82
|
+
try:
|
|
83
|
+
providers[data["id"]] = McpProvider.from_dict(data)
|
|
84
|
+
except Exception as exc:
|
|
85
|
+
errors.append(f"{yaml_file}: {exc}")
|
|
86
|
+
|
|
87
|
+
return providers, errors
|