arkaos 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONSTITUTION.md +81 -0
- package/LICENSE +21 -0
- package/README.md +154 -0
- package/VERSION +1 -0
- package/arka/SKILL.md +134 -0
- package/bin/arkaos +107 -0
- package/config/constitution.yaml +168 -0
- package/config/hooks/post-tool-use-v2.sh +116 -0
- package/config/hooks/post-tool-use.sh +188 -0
- package/config/hooks/pre-compact-v2.sh +43 -0
- package/config/hooks/pre-compact.sh +99 -0
- package/config/hooks/user-prompt-submit-v2.sh +119 -0
- package/config/hooks/user-prompt-submit.sh +312 -0
- package/core/__init__.py +3 -0
- package/core/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/agents/__init__.py +14 -0
- package/core/agents/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/registry_gen.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/agents/__pycache__/validator.cpython-313.pyc +0 -0
- package/core/agents/loader.py +88 -0
- package/core/agents/registry_gen.py +118 -0
- package/core/agents/schema.py +265 -0
- package/core/agents/validator.py +141 -0
- package/core/conclave/__init__.py +12 -0
- package/core/conclave/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/advisor_db.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/display.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/matcher.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/persistence.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/profiler.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/prompts.cpython-313.pyc +0 -0
- package/core/conclave/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/conclave/advisor_db.py +373 -0
- package/core/conclave/display.py +104 -0
- package/core/conclave/matcher.py +104 -0
- package/core/conclave/persistence.py +61 -0
- package/core/conclave/profiler.py +298 -0
- package/core/conclave/prompts.py +77 -0
- package/core/conclave/schema.py +132 -0
- package/core/governance/__init__.py +5 -0
- package/core/governance/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/governance/__pycache__/constitution.cpython-313.pyc +0 -0
- package/core/governance/constitution.py +152 -0
- package/core/registry/__init__.py +1 -0
- package/core/registry/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/registry/__pycache__/generator.cpython-313.pyc +0 -0
- package/core/registry/generator.py +199 -0
- package/core/runtime/__init__.py +6 -0
- package/core/runtime/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/base.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/claude_code.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/codex_cli.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/cursor.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/gemini_cli.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/registry.cpython-313.pyc +0 -0
- package/core/runtime/__pycache__/subagent.cpython-313.pyc +0 -0
- package/core/runtime/base.py +143 -0
- package/core/runtime/claude_code.py +104 -0
- package/core/runtime/codex_cli.py +71 -0
- package/core/runtime/cursor.py +71 -0
- package/core/runtime/gemini_cli.py +68 -0
- package/core/runtime/registry.py +86 -0
- package/core/runtime/subagent.py +201 -0
- package/core/specs/__init__.py +10 -0
- package/core/specs/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/manager.cpython-313.pyc +0 -0
- package/core/specs/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/specs/manager.py +164 -0
- package/core/specs/schema.py +199 -0
- package/core/squads/__init__.py +7 -0
- package/core/squads/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/registry.cpython-313.pyc +0 -0
- package/core/squads/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/squads/loader.py +40 -0
- package/core/squads/registry.py +145 -0
- package/core/squads/schema.py +93 -0
- package/core/synapse/__init__.py +11 -0
- package/core/synapse/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/cache.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/synapse/__pycache__/layers.cpython-313.pyc +0 -0
- package/core/synapse/cache.py +82 -0
- package/core/synapse/engine.py +184 -0
- package/core/synapse/layers.py +441 -0
- package/core/tasks/__init__.py +6 -0
- package/core/tasks/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/manager.cpython-313.pyc +0 -0
- package/core/tasks/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/tasks/manager.py +150 -0
- package/core/tasks/schema.py +108 -0
- package/core/workflow/__init__.py +10 -0
- package/core/workflow/__pycache__/__init__.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/engine.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/loader.cpython-313.pyc +0 -0
- package/core/workflow/__pycache__/schema.cpython-313.pyc +0 -0
- package/core/workflow/engine.py +216 -0
- package/core/workflow/loader.py +28 -0
- package/core/workflow/schema.py +129 -0
- package/departments/brand/SKILL.md +85 -0
- package/departments/brand/agents/brand-director.yaml +77 -0
- package/departments/brand/agents/brand-strategist.md +182 -0
- package/departments/brand/agents/brand-strategist.yaml +58 -0
- package/departments/brand/agents/creative-director.md +149 -0
- package/departments/brand/agents/motion-designer.md +113 -0
- package/departments/brand/agents/ux-designer.yaml +60 -0
- package/departments/brand/agents/visual-designer.md +187 -0
- package/departments/brand/agents/visual-designer.yaml +58 -0
- package/departments/brand/references/brand-creation-guide.md +559 -0
- package/departments/brand/scripts/provider-call.sh +262 -0
- package/departments/brand/skills/archetype-finder/SKILL.md +18 -0
- package/departments/brand/skills/colors/SKILL.md +18 -0
- package/departments/brand/skills/design-system/SKILL.md +18 -0
- package/departments/brand/skills/identity-system/SKILL.md +18 -0
- package/departments/brand/skills/logo-brief/SKILL.md +18 -0
- package/departments/brand/skills/mockup-generate/SKILL.md +18 -0
- package/departments/brand/skills/naming-evaluate/SKILL.md +50 -0
- package/departments/brand/skills/positioning-statement/SKILL.md +18 -0
- package/departments/brand/skills/primal-audit/SKILL.md +43 -0
- package/departments/brand/skills/ux-audit/SKILL.md +18 -0
- package/departments/brand/skills/voice-guide/SKILL.md +18 -0
- package/departments/brand/skills/wireframe/SKILL.md +18 -0
- package/departments/brand/squad.yaml +39 -0
- package/departments/brand/workflows/identity.yaml +113 -0
- package/departments/brand/workflows/naming.yaml +58 -0
- package/departments/community/SKILL.md +62 -0
- package/departments/community/agents/community-manager.yaml +57 -0
- package/departments/community/agents/community-strategist.yaml +74 -0
- package/departments/community/agents/engagement-designer.yaml +56 -0
- package/departments/community/skills/ai-community/SKILL.md +18 -0
- package/departments/community/skills/betting-setup/SKILL.md +18 -0
- package/departments/community/skills/business-model/SKILL.md +53 -0
- package/departments/community/skills/content-calendar/SKILL.md +18 -0
- package/departments/community/skills/events-plan/SKILL.md +18 -0
- package/departments/community/skills/gamification-design/SKILL.md +18 -0
- package/departments/community/skills/growth-plan/SKILL.md +18 -0
- package/departments/community/skills/metrics-track/SKILL.md +18 -0
- package/departments/community/skills/moderation/SKILL.md +18 -0
- package/departments/community/skills/monetize-plan/SKILL.md +18 -0
- package/departments/community/skills/niche-setup/SKILL.md +18 -0
- package/departments/community/skills/onboarding-flow/SKILL.md +18 -0
- package/departments/community/skills/platform-select/SKILL.md +18 -0
- package/departments/community/skills/retention-system/SKILL.md +48 -0
- package/departments/community/squad.yaml +32 -0
- package/departments/community/workflows/setup.yaml +62 -0
- package/departments/content/SKILL.md +65 -0
- package/departments/content/agents/content-strategist.yaml +74 -0
- package/departments/content/agents/repurpose-distributor.yaml +57 -0
- package/departments/content/agents/scriptwriter.yaml +56 -0
- package/departments/content/agents/viral-engineer.yaml +56 -0
- package/departments/content/skills/ai-workflow/SKILL.md +18 -0
- package/departments/content/skills/analytics/SKILL.md +18 -0
- package/departments/content/skills/calendar/SKILL.md +18 -0
- package/departments/content/skills/content-system/SKILL.md +75 -0
- package/departments/content/skills/hook-write/SKILL.md +43 -0
- package/departments/content/skills/monetization-plan/SKILL.md +18 -0
- package/departments/content/skills/newsletter-write/SKILL.md +18 -0
- package/departments/content/skills/platform-optimize/SKILL.md +18 -0
- package/departments/content/skills/repurpose-plan/SKILL.md +18 -0
- package/departments/content/skills/script-structure/SKILL.md +18 -0
- package/departments/content/skills/short-form/SKILL.md +18 -0
- package/departments/content/skills/thumbnail-package/SKILL.md +18 -0
- package/departments/content/skills/viral-design/SKILL.md +45 -0
- package/departments/content/skills/youtube-strategy/SKILL.md +18 -0
- package/departments/content/squad.yaml +39 -0
- package/departments/content/workflows/viral.yaml +99 -0
- package/departments/dev/SKILL.md +135 -0
- package/departments/dev/agents/analyst.md +184 -0
- package/departments/dev/agents/architect.md +184 -0
- package/departments/dev/agents/architect.yaml +74 -0
- package/departments/dev/agents/backend-dev.yaml +70 -0
- package/departments/dev/agents/cto.md +140 -0
- package/departments/dev/agents/cto.yaml +77 -0
- package/departments/dev/agents/dba.yaml +72 -0
- package/departments/dev/agents/devops-eng.yaml +72 -0
- package/departments/dev/agents/devops.md +204 -0
- package/departments/dev/agents/frontend-dev.md +213 -0
- package/departments/dev/agents/frontend-dev.yaml +71 -0
- package/departments/dev/agents/qa-eng.yaml +72 -0
- package/departments/dev/agents/qa.md +231 -0
- package/departments/dev/agents/security-eng.yaml +72 -0
- package/departments/dev/agents/security.md +174 -0
- package/departments/dev/agents/senior-dev.md +177 -0
- package/departments/dev/agents/tech-lead.md +188 -0
- package/departments/dev/agents/tech-lead.yaml +72 -0
- package/departments/dev/skills/adversarial-review/SKILL.md +117 -0
- package/departments/dev/skills/agent-design/SKILL.md +127 -0
- package/departments/dev/skills/agent-workflow/SKILL.md +116 -0
- package/departments/dev/skills/ai-assisted-dev/SKILL.md +18 -0
- package/departments/dev/skills/ai-security/SKILL.md +112 -0
- package/departments/dev/skills/api-design/SKILL.md +59 -0
- package/departments/dev/skills/architecture-design/SKILL.md +89 -0
- package/departments/dev/skills/changelog/SKILL.md +110 -0
- package/departments/dev/skills/ci-cd-pipeline/SKILL.md +130 -0
- package/departments/dev/skills/clean-code-review/SKILL.md +65 -0
- package/departments/dev/skills/code-review/SKILL.md +18 -0
- package/departments/dev/skills/codebase-onboard/SKILL.md +109 -0
- package/departments/dev/skills/db-design/SKILL.md +18 -0
- package/departments/dev/skills/db-schema/SKILL.md +130 -0
- package/departments/dev/skills/ddd-model/SKILL.md +18 -0
- package/departments/dev/skills/dependency-audit/SKILL.md +118 -0
- package/departments/dev/skills/deploy/SKILL.md +18 -0
- package/departments/dev/skills/devops-pipeline/SKILL.md +18 -0
- package/departments/dev/skills/docs/SKILL.md +18 -0
- package/departments/dev/skills/env-secrets/SKILL.md +89 -0
- package/departments/dev/skills/incident/SKILL.md +125 -0
- package/departments/dev/skills/mcp/SKILL.md +106 -0
- package/departments/dev/skills/mcp-builder/SKILL.md +121 -0
- package/departments/dev/skills/observability/SKILL.md +119 -0
- package/departments/dev/skills/onboard/SKILL.md +389 -0
- package/departments/dev/skills/onboard/scripts/detect-stack.py +472 -0
- package/departments/dev/skills/performance-audit/SKILL.md +49 -0
- package/departments/dev/skills/performance-profiler/SKILL.md +128 -0
- package/departments/dev/skills/rag-architect/SKILL.md +125 -0
- package/departments/dev/skills/red-team/SKILL.md +112 -0
- package/departments/dev/skills/refactor-plan/SKILL.md +18 -0
- package/departments/dev/skills/release/SKILL.md +130 -0
- package/departments/dev/skills/research/SKILL.md +18 -0
- package/departments/dev/skills/runbook/SKILL.md +103 -0
- package/departments/dev/skills/scaffold/SKILL.md +249 -0
- package/departments/dev/skills/security-audit/SKILL.md +68 -0
- package/departments/dev/skills/skill-audit/SKILL.md +96 -0
- package/departments/dev/skills/spec/SKILL.md +218 -0
- package/departments/dev/skills/stack-check/SKILL.md +18 -0
- package/departments/dev/skills/tdd-cycle/SKILL.md +56 -0
- package/departments/dev/skills/tech-debt/SKILL.md +100 -0
- package/departments/dev/squad.yaml +62 -0
- package/departments/dev/workflows/debug.yaml +63 -0
- package/departments/dev/workflows/feature.yaml +129 -0
- package/departments/dev/workflows/refactor.yaml +64 -0
- package/departments/ecom/SKILL.md +39 -0
- package/departments/ecom/agents/commerce-engineer.yaml +58 -0
- package/departments/ecom/agents/cro-specialist.yaml +56 -0
- package/departments/ecom/agents/ecom-director.yaml +73 -0
- package/departments/ecom/agents/retention-manager.yaml +59 -0
- package/departments/ecom/skills/analytics/SKILL.md +18 -0
- package/departments/ecom/skills/cart-recovery/SKILL.md +18 -0
- package/departments/ecom/skills/cro-optimize/SKILL.md +58 -0
- package/departments/ecom/skills/customer-journey/SKILL.md +18 -0
- package/departments/ecom/skills/fulfillment-plan/SKILL.md +18 -0
- package/departments/ecom/skills/marketplace-manage/SKILL.md +18 -0
- package/departments/ecom/skills/pricing-strategy/SKILL.md +18 -0
- package/departments/ecom/skills/product-launch/SKILL.md +18 -0
- package/departments/ecom/skills/rfm-segment/SKILL.md +44 -0
- package/departments/ecom/skills/social-commerce/SKILL.md +18 -0
- package/departments/ecom/skills/store-audit/SKILL.md +18 -0
- package/departments/ecom/skills/subscription-model/SKILL.md +18 -0
- package/departments/ecom/squad.yaml +39 -0
- package/departments/ecom/workflows/product-page.yaml +62 -0
- package/departments/ecommerce/SKILL.md +363 -0
- package/departments/ecommerce/agents/ecommerce-manager.md +91 -0
- package/departments/finance/SKILL.md +37 -0
- package/departments/finance/agents/cfo.md +85 -0
- package/departments/finance/agents/cfo.yaml +77 -0
- package/departments/finance/agents/financial-analyst.yaml +57 -0
- package/departments/finance/agents/investment-strategist.yaml +58 -0
- package/departments/finance/skills/budget-plan/SKILL.md +18 -0
- package/departments/finance/skills/cashflow-forecast/SKILL.md +18 -0
- package/departments/finance/skills/ciso-advisor/SKILL.md +113 -0
- package/departments/finance/skills/financial-model/SKILL.md +70 -0
- package/departments/finance/skills/pitch-deck/SKILL.md +18 -0
- package/departments/finance/skills/scenario-analysis/SKILL.md +18 -0
- package/departments/finance/skills/unit-economics/SKILL.md +44 -0
- package/departments/finance/skills/valuation-model/SKILL.md +18 -0
- package/departments/finance/squad.yaml +37 -0
- package/departments/finance/workflows/cashflow.yaml +47 -0
- package/departments/finance/workflows/model.yaml +83 -0
- package/departments/kb/SKILL.md +38 -0
- package/departments/kb/agents/knowledge-curator.yaml +60 -0
- package/departments/kb/agents/knowledge-director.yaml +72 -0
- package/departments/kb/agents/research-analyst.yaml +58 -0
- package/departments/kb/skills/ai-research/SKILL.md +18 -0
- package/departments/kb/skills/competitive-intel/SKILL.md +18 -0
- package/departments/kb/skills/knowledge-review/SKILL.md +18 -0
- package/departments/kb/skills/learn-content/SKILL.md +18 -0
- package/departments/kb/skills/moc-create/SKILL.md +18 -0
- package/departments/kb/skills/persona-build/SKILL.md +18 -0
- package/departments/kb/skills/research-plan/SKILL.md +51 -0
- package/departments/kb/skills/search-kb/SKILL.md +18 -0
- package/departments/kb/skills/source-evaluate/SKILL.md +18 -0
- package/departments/kb/skills/taxonomy-manage/SKILL.md +18 -0
- package/departments/kb/skills/write-as-persona/SKILL.md +18 -0
- package/departments/kb/skills/zettelkasten-process/SKILL.md +56 -0
- package/departments/kb/squad.yaml +34 -0
- package/departments/kb/workflows/learn.yaml +63 -0
- package/departments/knowledge/SKILL.md +474 -0
- package/departments/knowledge/agents/knowledge-curator.md +89 -0
- package/departments/knowledge/scripts/kb-check-capabilities.sh +143 -0
- package/departments/knowledge/scripts/kb-cleanup.sh +135 -0
- package/departments/knowledge/scripts/kb-queue.sh +156 -0
- package/departments/knowledge/scripts/kb-status.sh +195 -0
- package/departments/knowledge/scripts/kb-worker.sh +217 -0
- package/departments/landing/SKILL.md +65 -0
- package/departments/landing/agents/affiliate-manager.yaml +57 -0
- package/departments/landing/agents/conversion-strategist.yaml +74 -0
- package/departments/landing/agents/cro-specialist.yaml +58 -0
- package/departments/landing/agents/sales-copywriter.yaml +61 -0
- package/departments/landing/skills/ab-test/SKILL.md +18 -0
- package/departments/landing/skills/affiliate-bridge/SKILL.md +18 -0
- package/departments/landing/skills/awareness-diagnose/SKILL.md +18 -0
- package/departments/landing/skills/copy-framework/SKILL.md +55 -0
- package/departments/landing/skills/email-sequence/SKILL.md +18 -0
- package/departments/landing/skills/funnel-design/SKILL.md +49 -0
- package/departments/landing/skills/funnel-metrics/SKILL.md +18 -0
- package/departments/landing/skills/headline-write/SKILL.md +18 -0
- package/departments/landing/skills/landing-gen/SKILL.md +124 -0
- package/departments/landing/skills/launch-sequence/SKILL.md +18 -0
- package/departments/landing/skills/offer-create/SKILL.md +62 -0
- package/departments/landing/skills/optimize-page/SKILL.md +18 -0
- package/departments/landing/skills/page-architect/SKILL.md +18 -0
- package/departments/landing/skills/persuasion-apply/SKILL.md +18 -0
- package/departments/landing/skills/webinar-funnel/SKILL.md +18 -0
- package/departments/landing/squad.yaml +39 -0
- package/departments/landing/workflows/launch.yaml +72 -0
- package/departments/landing/workflows/offer.yaml +99 -0
- package/departments/leadership/SKILL.md +35 -0
- package/departments/leadership/agents/culture-coach.yaml +59 -0
- package/departments/leadership/agents/hr-specialist.yaml +57 -0
- package/departments/leadership/agents/leadership-director.yaml +72 -0
- package/departments/leadership/skills/change-manage/SKILL.md +18 -0
- package/departments/leadership/skills/conflict-resolve/SKILL.md +18 -0
- package/departments/leadership/skills/culture-audit/SKILL.md +18 -0
- package/departments/leadership/skills/delegation-matrix/SKILL.md +18 -0
- package/departments/leadership/skills/disc-assess/SKILL.md +18 -0
- package/departments/leadership/skills/feedback-give/SKILL.md +18 -0
- package/departments/leadership/skills/hiring-plan/SKILL.md +18 -0
- package/departments/leadership/skills/okr-define/SKILL.md +69 -0
- package/departments/leadership/skills/performance-review/SKILL.md +18 -0
- package/departments/leadership/skills/team-health/SKILL.md +56 -0
- package/departments/leadership/squad.yaml +35 -0
- package/departments/leadership/workflows/team-build.yaml +55 -0
- package/departments/marketing/SKILL.md +61 -0
- package/departments/marketing/agents/content-creator.md +85 -0
- package/departments/marketing/agents/content-marketer.yaml +58 -0
- package/departments/marketing/agents/marketing-director.yaml +75 -0
- package/departments/marketing/agents/paid-specialist.yaml +58 -0
- package/departments/marketing/agents/seo-specialist.yaml +57 -0
- package/departments/marketing/skills/ab-test/SKILL.md +18 -0
- package/departments/marketing/skills/analytics-report/SKILL.md +18 -0
- package/departments/marketing/skills/audience-segment/SKILL.md +18 -0
- package/departments/marketing/skills/calendar-plan/SKILL.md +18 -0
- package/departments/marketing/skills/cold-email/SKILL.md +128 -0
- package/departments/marketing/skills/competitor-analysis/SKILL.md +18 -0
- package/departments/marketing/skills/content-audit/SKILL.md +18 -0
- package/departments/marketing/skills/email-sequence/SKILL.md +18 -0
- package/departments/marketing/skills/growth-loop/SKILL.md +50 -0
- package/departments/marketing/skills/marketing-automation/SKILL.md +18 -0
- package/departments/marketing/skills/paid-campaign/SKILL.md +18 -0
- package/departments/marketing/skills/programmatic-seo/SKILL.md +123 -0
- package/departments/marketing/skills/seo-audit/SKILL.md +48 -0
- package/departments/marketing/skills/social-strategy/SKILL.md +18 -0
- package/departments/marketing/squad.yaml +39 -0
- package/departments/marketing/workflows/campaign.yaml +112 -0
- package/departments/marketing/workflows/social.yaml +56 -0
- package/departments/operations/SKILL.md +422 -0
- package/departments/operations/agents/coo.md +88 -0
- package/departments/ops/SKILL.md +37 -0
- package/departments/ops/agents/automation-engineer.yaml +58 -0
- package/departments/ops/agents/ops-lead.yaml +71 -0
- package/departments/ops/skills/bottleneck-find/SKILL.md +49 -0
- package/departments/ops/skills/dashboard-build/SKILL.md +18 -0
- package/departments/ops/skills/gtd-setup/SKILL.md +18 -0
- package/departments/ops/skills/integration-design/SKILL.md +18 -0
- package/departments/ops/skills/lean-audit/SKILL.md +18 -0
- package/departments/ops/skills/metrics-dashboard/SKILL.md +18 -0
- package/departments/ops/skills/n8n-flow/SKILL.md +18 -0
- package/departments/ops/skills/sop-create/SKILL.md +18 -0
- package/departments/ops/skills/workflow-automate/SKILL.md +39 -0
- package/departments/ops/skills/zapier-flow/SKILL.md +18 -0
- package/departments/ops/squad.yaml +35 -0
- package/departments/ops/workflows/lean-audit.yaml +69 -0
- package/departments/org/SKILL.md +34 -0
- package/departments/org/agents/coo.yaml +80 -0
- package/departments/org/agents/org-designer.yaml +56 -0
- package/departments/org/agents/people-ops.yaml +56 -0
- package/departments/org/skills/compensation-plan/SKILL.md +18 -0
- package/departments/org/skills/culture-define/SKILL.md +18 -0
- package/departments/org/skills/decision-framework/SKILL.md +18 -0
- package/departments/org/skills/hiring-plan/SKILL.md +18 -0
- package/departments/org/skills/meeting-optimize/SKILL.md +18 -0
- package/departments/org/skills/onboarding-design/SKILL.md +18 -0
- package/departments/org/skills/org-design/SKILL.md +18 -0
- package/departments/org/skills/remote-setup/SKILL.md +18 -0
- package/departments/org/skills/sop-process/SKILL.md +18 -0
- package/departments/org/skills/team-assess/SKILL.md +18 -0
- package/departments/org/squad.yaml +33 -0
- package/departments/org/workflows/design.yaml +55 -0
- package/departments/pm/SKILL.md +39 -0
- package/departments/pm/agents/pm-director.yaml +75 -0
- package/departments/pm/agents/product-owner.yaml +59 -0
- package/departments/pm/agents/scrum-master.yaml +59 -0
- package/departments/pm/skills/agile-po/SKILL.md +118 -0
- package/departments/pm/skills/backlog-groom/SKILL.md +18 -0
- package/departments/pm/skills/discovery-plan/SKILL.md +48 -0
- package/departments/pm/skills/estimate-forecast/SKILL.md +18 -0
- package/departments/pm/skills/impact-map/SKILL.md +18 -0
- package/departments/pm/skills/kanban-setup/SKILL.md +18 -0
- package/departments/pm/skills/risk-register/SKILL.md +18 -0
- package/departments/pm/skills/roadmap-build/SKILL.md +18 -0
- package/departments/pm/skills/shape-pitch/SKILL.md +55 -0
- package/departments/pm/skills/sprint-plan/SKILL.md +18 -0
- package/departments/pm/skills/stakeholder-map/SKILL.md +18 -0
- package/departments/pm/skills/standup-run/SKILL.md +18 -0
- package/departments/pm/skills/story-write/SKILL.md +18 -0
- package/departments/pm/squad.yaml +37 -0
- package/departments/pm/workflows/retro.yaml +33 -0
- package/departments/quality/SKILL.md +66 -0
- package/departments/quality/agents/copy-director.md +134 -0
- package/departments/quality/agents/copy-director.yaml +73 -0
- package/departments/quality/agents/cqo.md +134 -0
- package/departments/quality/agents/cqo.yaml +76 -0
- package/departments/quality/agents/tech-director.yaml +79 -0
- package/departments/quality/agents/tech-ux-director.md +193 -0
- package/departments/quality/squad.yaml +25 -0
- package/departments/saas/SKILL.md +64 -0
- package/departments/saas/agents/cs-manager.yaml +57 -0
- package/departments/saas/agents/growth-engineer.yaml +57 -0
- package/departments/saas/agents/metrics-analyst.yaml +57 -0
- package/departments/saas/agents/saas-strategist.yaml +74 -0
- package/departments/saas/skills/benchmark-compare/SKILL.md +18 -0
- package/departments/saas/skills/churn-analysis/SKILL.md +18 -0
- package/departments/saas/skills/customer-success/SKILL.md +18 -0
- package/departments/saas/skills/growth-plan/SKILL.md +18 -0
- package/departments/saas/skills/gtm-strategy/SKILL.md +18 -0
- package/departments/saas/skills/launch-execute/SKILL.md +18 -0
- package/departments/saas/skills/metrics-dashboard/SKILL.md +18 -0
- package/departments/saas/skills/micro-saas-stack/SKILL.md +18 -0
- package/departments/saas/skills/mvp-build/SKILL.md +18 -0
- package/departments/saas/skills/niche-evaluate/SKILL.md +18 -0
- package/departments/saas/skills/onboarding-optimize/SKILL.md +18 -0
- package/departments/saas/skills/plg-setup/SKILL.md +53 -0
- package/departments/saas/skills/pricing-strategy/SKILL.md +48 -0
- package/departments/saas/skills/saas-scaffold/SKILL.md +127 -0
- package/departments/saas/skills/validate-idea/SKILL.md +55 -0
- package/departments/saas/squad.yaml +37 -0
- package/departments/saas/workflows/metrics.yaml +58 -0
- package/departments/saas/workflows/validate.yaml +103 -0
- package/departments/sales/SKILL.md +35 -0
- package/departments/sales/agents/sales-closer.yaml +58 -0
- package/departments/sales/agents/sales-director.yaml +72 -0
- package/departments/sales/agents/sales-ops.yaml +55 -0
- package/departments/sales/skills/challenger-sell/SKILL.md +18 -0
- package/departments/sales/skills/deal-qualify/SKILL.md +18 -0
- package/departments/sales/skills/discovery-call/SKILL.md +18 -0
- package/departments/sales/skills/forecast-revenue/SKILL.md +18 -0
- package/departments/sales/skills/negotiate-plan/SKILL.md +18 -0
- package/departments/sales/skills/objection-handle/SKILL.md +18 -0
- package/departments/sales/skills/pipeline-manage/SKILL.md +18 -0
- package/departments/sales/skills/pricing-negotiate/SKILL.md +18 -0
- package/departments/sales/skills/proposal-write/SKILL.md +54 -0
- package/departments/sales/skills/spin-sell/SKILL.md +50 -0
- package/departments/sales/squad.yaml +35 -0
- package/departments/sales/workflows/pipeline.yaml +49 -0
- package/departments/strategy/SKILL.md +37 -0
- package/departments/strategy/agents/business-model-designer.yaml +58 -0
- package/departments/strategy/agents/market-analyst.yaml +58 -0
- package/departments/strategy/agents/strategist.md +79 -0
- package/departments/strategy/agents/strategy-director.yaml +75 -0
- package/departments/strategy/skills/blue-ocean/SKILL.md +56 -0
- package/departments/strategy/skills/bmc/SKILL.md +18 -0
- package/departments/strategy/skills/board-advisor/SKILL.md +121 -0
- package/departments/strategy/skills/cto-advisor/SKILL.md +113 -0
- package/departments/strategy/skills/five-forces/SKILL.md +74 -0
- package/departments/strategy/skills/growth-strategy/SKILL.md +18 -0
- package/departments/strategy/skills/moat-analysis/SKILL.md +18 -0
- package/departments/strategy/skills/position/SKILL.md +18 -0
- package/departments/strategy/skills/scenario-plan/SKILL.md +18 -0
- package/departments/strategy/squad.yaml +37 -0
- package/departments/strategy/workflows/analysis.yaml +90 -0
- package/departments/strategy/workflows/swot.yaml +47 -0
- package/installer/adapters/claude-code.js +73 -0
- package/installer/adapters/codex-cli.js +34 -0
- package/installer/adapters/cursor.js +34 -0
- package/installer/adapters/gemini-cli.js +37 -0
- package/installer/cli.js +91 -0
- package/installer/detect-runtime.js +122 -0
- package/installer/doctor.js +105 -0
- package/installer/index.js +199 -0
- package/installer/uninstall.js +46 -0
- package/installer/update.js +39 -0
- package/knowledge/agents-registry-v2.json +2702 -0
- package/knowledge/commands-registry-v2.json +3827 -0
- package/package.json +58 -0
- package/pyproject.toml +64 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"""Living Spec schema — specs that evolve with implementation.
|
|
2
|
+
|
|
3
|
+
A Living Spec tracks:
|
|
4
|
+
- Original specification (what was planned)
|
|
5
|
+
- Implementation status per section
|
|
6
|
+
- Deltas (what changed during implementation and why)
|
|
7
|
+
- Acceptance criteria with pass/fail status
|
|
8
|
+
- Reusable patterns extracted from completed specs
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from datetime import datetime
|
|
12
|
+
from enum import Enum
|
|
13
|
+
from typing import Optional, Any
|
|
14
|
+
from pydantic import BaseModel, Field
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class SpecStatus(str, Enum):
|
|
18
|
+
DRAFT = "draft" # Being written
|
|
19
|
+
REVIEW = "review" # Awaiting user approval
|
|
20
|
+
APPROVED = "approved" # User approved, ready for implementation
|
|
21
|
+
IN_PROGRESS = "in_progress" # Implementation started
|
|
22
|
+
COMPLETED = "completed" # Fully implemented and verified
|
|
23
|
+
ARCHIVED = "archived" # No longer active
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class SectionStatus(str, Enum):
|
|
27
|
+
PENDING = "pending"
|
|
28
|
+
IMPLEMENTED = "implemented"
|
|
29
|
+
MODIFIED = "modified" # Implemented but deviated from spec
|
|
30
|
+
SKIPPED = "skipped"
|
|
31
|
+
BLOCKED = "blocked"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class AcceptanceCriterion(BaseModel):
|
|
35
|
+
"""A single acceptance criterion with verification status."""
|
|
36
|
+
id: str
|
|
37
|
+
description: str
|
|
38
|
+
status: str = "pending" # pending, passed, failed
|
|
39
|
+
verified_by: str = "" # Agent that verified
|
|
40
|
+
verified_at: Optional[str] = None
|
|
41
|
+
notes: str = ""
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class SpecSection(BaseModel):
|
|
45
|
+
"""A section of the specification."""
|
|
46
|
+
id: str
|
|
47
|
+
title: str
|
|
48
|
+
content: str = ""
|
|
49
|
+
status: SectionStatus = SectionStatus.PENDING
|
|
50
|
+
acceptance_criteria: list[AcceptanceCriterion] = Field(default_factory=list)
|
|
51
|
+
implementation_notes: str = ""
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
class SpecDelta(BaseModel):
|
|
55
|
+
"""A recorded change between spec and implementation.
|
|
56
|
+
|
|
57
|
+
Deltas track WHY something changed, not just WHAT.
|
|
58
|
+
This builds institutional knowledge for future specs.
|
|
59
|
+
"""
|
|
60
|
+
id: str
|
|
61
|
+
section_id: str
|
|
62
|
+
original: str # What the spec said
|
|
63
|
+
actual: str # What was actually implemented
|
|
64
|
+
reason: str # Why it changed
|
|
65
|
+
decided_by: str = "" # Agent or user who decided
|
|
66
|
+
timestamp: str = ""
|
|
67
|
+
impact: str = "low" # low, medium, high
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class SpecMetadata(BaseModel):
|
|
71
|
+
"""Metadata for a spec."""
|
|
72
|
+
project: str = ""
|
|
73
|
+
department: str = ""
|
|
74
|
+
created_by: str = ""
|
|
75
|
+
created_at: str = ""
|
|
76
|
+
updated_at: str = ""
|
|
77
|
+
approved_by: str = ""
|
|
78
|
+
approved_at: str = ""
|
|
79
|
+
tags: list[str] = Field(default_factory=list)
|
|
80
|
+
obsidian_path: str = ""
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class Spec(BaseModel):
|
|
84
|
+
"""A Living Specification.
|
|
85
|
+
|
|
86
|
+
Unlike traditional specs that become stale, Living Specs
|
|
87
|
+
track their own implementation status and record deltas
|
|
88
|
+
between planned and actual outcomes.
|
|
89
|
+
"""
|
|
90
|
+
id: str
|
|
91
|
+
title: str
|
|
92
|
+
description: str = ""
|
|
93
|
+
status: SpecStatus = SpecStatus.DRAFT
|
|
94
|
+
metadata: SpecMetadata = Field(default_factory=SpecMetadata)
|
|
95
|
+
|
|
96
|
+
# Spec content organized by sections
|
|
97
|
+
sections: list[SpecSection] = Field(default_factory=list)
|
|
98
|
+
|
|
99
|
+
# Changes tracked during implementation
|
|
100
|
+
deltas: list[SpecDelta] = Field(default_factory=list)
|
|
101
|
+
|
|
102
|
+
# Reusable patterns extracted after completion
|
|
103
|
+
patterns: list[str] = Field(default_factory=list)
|
|
104
|
+
|
|
105
|
+
def get_section(self, section_id: str) -> Optional[SpecSection]:
|
|
106
|
+
"""Find a section by ID."""
|
|
107
|
+
for section in self.sections:
|
|
108
|
+
if section.id == section_id:
|
|
109
|
+
return section
|
|
110
|
+
return None
|
|
111
|
+
|
|
112
|
+
def add_delta(
|
|
113
|
+
self,
|
|
114
|
+
section_id: str,
|
|
115
|
+
original: str,
|
|
116
|
+
actual: str,
|
|
117
|
+
reason: str,
|
|
118
|
+
decided_by: str = "",
|
|
119
|
+
) -> SpecDelta:
|
|
120
|
+
"""Record a delta between spec and implementation."""
|
|
121
|
+
delta = SpecDelta(
|
|
122
|
+
id=f"delta-{len(self.deltas) + 1}",
|
|
123
|
+
section_id=section_id,
|
|
124
|
+
original=original,
|
|
125
|
+
actual=actual,
|
|
126
|
+
reason=reason,
|
|
127
|
+
decided_by=decided_by,
|
|
128
|
+
timestamp=datetime.now().isoformat(),
|
|
129
|
+
)
|
|
130
|
+
self.deltas.append(delta)
|
|
131
|
+
|
|
132
|
+
# Mark section as modified
|
|
133
|
+
section = self.get_section(section_id)
|
|
134
|
+
if section:
|
|
135
|
+
section.status = SectionStatus.MODIFIED
|
|
136
|
+
|
|
137
|
+
return delta
|
|
138
|
+
|
|
139
|
+
def mark_section_complete(self, section_id: str, notes: str = "") -> bool:
|
|
140
|
+
"""Mark a section as implemented."""
|
|
141
|
+
section = self.get_section(section_id)
|
|
142
|
+
if section is None:
|
|
143
|
+
return False
|
|
144
|
+
if section.status != SectionStatus.MODIFIED:
|
|
145
|
+
section.status = SectionStatus.IMPLEMENTED
|
|
146
|
+
section.implementation_notes = notes
|
|
147
|
+
return True
|
|
148
|
+
|
|
149
|
+
def verify_criterion(
|
|
150
|
+
self,
|
|
151
|
+
section_id: str,
|
|
152
|
+
criterion_id: str,
|
|
153
|
+
passed: bool,
|
|
154
|
+
verified_by: str = "",
|
|
155
|
+
notes: str = "",
|
|
156
|
+
) -> bool:
|
|
157
|
+
"""Verify an acceptance criterion."""
|
|
158
|
+
section = self.get_section(section_id)
|
|
159
|
+
if section is None:
|
|
160
|
+
return False
|
|
161
|
+
for ac in section.acceptance_criteria:
|
|
162
|
+
if ac.id == criterion_id:
|
|
163
|
+
ac.status = "passed" if passed else "failed"
|
|
164
|
+
ac.verified_by = verified_by
|
|
165
|
+
ac.verified_at = datetime.now().isoformat()
|
|
166
|
+
ac.notes = notes
|
|
167
|
+
return True
|
|
168
|
+
return False
|
|
169
|
+
|
|
170
|
+
@property
|
|
171
|
+
def completion_percentage(self) -> float:
|
|
172
|
+
"""Calculate completion percentage based on sections."""
|
|
173
|
+
if not self.sections:
|
|
174
|
+
return 0.0
|
|
175
|
+
done = sum(
|
|
176
|
+
1 for s in self.sections
|
|
177
|
+
if s.status in (SectionStatus.IMPLEMENTED, SectionStatus.MODIFIED, SectionStatus.SKIPPED)
|
|
178
|
+
)
|
|
179
|
+
return round(done / len(self.sections) * 100, 1)
|
|
180
|
+
|
|
181
|
+
@property
|
|
182
|
+
def criteria_summary(self) -> dict[str, int]:
|
|
183
|
+
"""Summary of acceptance criteria status."""
|
|
184
|
+
counts = {"total": 0, "passed": 0, "failed": 0, "pending": 0}
|
|
185
|
+
for section in self.sections:
|
|
186
|
+
for ac in section.acceptance_criteria:
|
|
187
|
+
counts["total"] += 1
|
|
188
|
+
counts[ac.status] = counts.get(ac.status, 0) + 1
|
|
189
|
+
return counts
|
|
190
|
+
|
|
191
|
+
@property
|
|
192
|
+
def delta_count(self) -> int:
|
|
193
|
+
return len(self.deltas)
|
|
194
|
+
|
|
195
|
+
@property
|
|
196
|
+
def is_fully_verified(self) -> bool:
|
|
197
|
+
"""Check if all acceptance criteria passed."""
|
|
198
|
+
summary = self.criteria_summary
|
|
199
|
+
return summary["total"] > 0 and summary["pending"] == 0 and summary["failed"] == 0
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"""Squad Framework — YAML-based squad definitions and cross-department collaboration."""
|
|
2
|
+
|
|
3
|
+
from core.squads.schema import Squad, SquadMember, SquadType
|
|
4
|
+
from core.squads.registry import SquadRegistry
|
|
5
|
+
from core.squads.loader import load_squad
|
|
6
|
+
|
|
7
|
+
__all__ = ["Squad", "SquadMember", "SquadType", "SquadRegistry", "load_squad"]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"""Squad YAML loader."""
|
|
2
|
+
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import yaml
|
|
5
|
+
|
|
6
|
+
from core.squads.schema import Squad
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def load_squad(path: str | Path) -> Squad:
|
|
10
|
+
"""Load a squad from a YAML file."""
|
|
11
|
+
path = Path(path)
|
|
12
|
+
if not path.exists():
|
|
13
|
+
raise FileNotFoundError(f"Squad file not found: {path}")
|
|
14
|
+
|
|
15
|
+
with open(path) as f:
|
|
16
|
+
data = yaml.safe_load(f)
|
|
17
|
+
|
|
18
|
+
if data is None:
|
|
19
|
+
raise ValueError(f"Empty squad file: {path}")
|
|
20
|
+
|
|
21
|
+
return Squad.model_validate(data)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def load_all_squads(base_dir: str | Path) -> list[Squad]:
|
|
25
|
+
"""Load all squad YAML files from a directory tree.
|
|
26
|
+
|
|
27
|
+
Expects squad.yaml files in department directories.
|
|
28
|
+
"""
|
|
29
|
+
base_dir = Path(base_dir)
|
|
30
|
+
squads = []
|
|
31
|
+
|
|
32
|
+
for squad_file in sorted(base_dir.glob("*/squad.yaml")):
|
|
33
|
+
try:
|
|
34
|
+
squad = load_squad(squad_file)
|
|
35
|
+
squads.append(squad)
|
|
36
|
+
except Exception as e:
|
|
37
|
+
import warnings
|
|
38
|
+
warnings.warn(f"Failed to load squad: {squad_file}: {e}")
|
|
39
|
+
|
|
40
|
+
return squads
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"""Squad registry — manages all squads and enables cross-department collaboration."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
from core.squads.schema import Squad, SquadMember, SquadType, TeamTopologyType
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class SquadRegistry:
|
|
8
|
+
"""Central registry for all squads.
|
|
9
|
+
|
|
10
|
+
Manages department squads (loaded from YAML) and project squads
|
|
11
|
+
(assembled dynamically). Enables the matrix structure:
|
|
12
|
+
agents belong to a department squad but can be borrowed
|
|
13
|
+
into project squads.
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
def __init__(self) -> None:
|
|
17
|
+
self._squads: dict[str, Squad] = {}
|
|
18
|
+
|
|
19
|
+
def register(self, squad: Squad) -> None:
|
|
20
|
+
"""Register a squad."""
|
|
21
|
+
self._squads[squad.id] = squad
|
|
22
|
+
|
|
23
|
+
def get(self, squad_id: str) -> Optional[Squad]:
|
|
24
|
+
"""Get a squad by ID."""
|
|
25
|
+
return self._squads.get(squad_id)
|
|
26
|
+
|
|
27
|
+
def get_by_department(self, department: str) -> Optional[Squad]:
|
|
28
|
+
"""Get the department squad for a given department."""
|
|
29
|
+
for squad in self._squads.values():
|
|
30
|
+
if squad.department == department and squad.squad_type == SquadType.DEPARTMENT:
|
|
31
|
+
return squad
|
|
32
|
+
return None
|
|
33
|
+
|
|
34
|
+
def get_by_prefix(self, prefix: str) -> Optional[Squad]:
|
|
35
|
+
"""Get squad by CLI prefix (e.g., '/dev', '/mkt')."""
|
|
36
|
+
for squad in self._squads.values():
|
|
37
|
+
if squad.skills_prefix == prefix:
|
|
38
|
+
return squad
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
def list_all(self) -> list[Squad]:
|
|
42
|
+
"""List all registered squads."""
|
|
43
|
+
return list(self._squads.values())
|
|
44
|
+
|
|
45
|
+
def list_by_type(self, squad_type: SquadType) -> list[Squad]:
|
|
46
|
+
"""List squads of a specific type."""
|
|
47
|
+
return [s for s in self._squads.values() if s.squad_type == squad_type]
|
|
48
|
+
|
|
49
|
+
def create_project_squad(
|
|
50
|
+
self,
|
|
51
|
+
project_id: str,
|
|
52
|
+
name: str,
|
|
53
|
+
description: str,
|
|
54
|
+
members: list[dict],
|
|
55
|
+
) -> Squad:
|
|
56
|
+
"""Assemble an ad-hoc project squad from agents across departments.
|
|
57
|
+
|
|
58
|
+
This is the matrix structure in action: agents from different
|
|
59
|
+
department squads are borrowed into a temporary project squad.
|
|
60
|
+
|
|
61
|
+
Args:
|
|
62
|
+
project_id: Unique ID for the project squad.
|
|
63
|
+
name: Human-readable name.
|
|
64
|
+
description: What this squad is working on.
|
|
65
|
+
members: List of dicts with agent_id and optional role.
|
|
66
|
+
|
|
67
|
+
Returns:
|
|
68
|
+
The assembled project Squad.
|
|
69
|
+
"""
|
|
70
|
+
squad_members = []
|
|
71
|
+
for m in members:
|
|
72
|
+
agent_id = m["agent_id"]
|
|
73
|
+
role = m.get("role", "")
|
|
74
|
+
|
|
75
|
+
# Find which department this agent belongs to
|
|
76
|
+
source_dept = self._find_agent_department(agent_id)
|
|
77
|
+
|
|
78
|
+
squad_members.append(SquadMember(
|
|
79
|
+
agent_id=agent_id,
|
|
80
|
+
role=role,
|
|
81
|
+
is_lead=m.get("is_lead", False),
|
|
82
|
+
borrowed=True,
|
|
83
|
+
source_department=source_dept,
|
|
84
|
+
availability=m.get("availability", 0.5),
|
|
85
|
+
))
|
|
86
|
+
|
|
87
|
+
squad = Squad(
|
|
88
|
+
id=f"project-{project_id}",
|
|
89
|
+
name=name,
|
|
90
|
+
description=description,
|
|
91
|
+
department="cross-department",
|
|
92
|
+
squad_type=SquadType.PROJECT,
|
|
93
|
+
topology=TeamTopologyType.STREAM_ALIGNED,
|
|
94
|
+
members=squad_members,
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
self.register(squad)
|
|
98
|
+
return squad
|
|
99
|
+
|
|
100
|
+
def disband_project_squad(self, squad_id: str) -> bool:
|
|
101
|
+
"""Disband a project squad, returning agents to their departments."""
|
|
102
|
+
squad = self._squads.get(squad_id)
|
|
103
|
+
if squad is None or squad.squad_type != SquadType.PROJECT:
|
|
104
|
+
return False
|
|
105
|
+
del self._squads[squad_id]
|
|
106
|
+
return True
|
|
107
|
+
|
|
108
|
+
def find_agent_across_squads(self, agent_id: str) -> list[Squad]:
|
|
109
|
+
"""Find all squads an agent belongs to."""
|
|
110
|
+
return [
|
|
111
|
+
s for s in self._squads.values()
|
|
112
|
+
if any(m.agent_id == agent_id for m in s.members)
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
def _find_agent_department(self, agent_id: str) -> str:
|
|
116
|
+
"""Find which department an agent belongs to."""
|
|
117
|
+
for squad in self._squads.values():
|
|
118
|
+
if squad.squad_type == SquadType.DEPARTMENT:
|
|
119
|
+
if any(m.agent_id == agent_id for m in squad.members):
|
|
120
|
+
return squad.department
|
|
121
|
+
return "unknown"
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def total_squads(self) -> int:
|
|
125
|
+
return len(self._squads)
|
|
126
|
+
|
|
127
|
+
@property
|
|
128
|
+
def total_agents(self) -> int:
|
|
129
|
+
"""Count unique agents across all squads."""
|
|
130
|
+
agents = set()
|
|
131
|
+
for squad in self._squads.values():
|
|
132
|
+
for member in squad.members:
|
|
133
|
+
agents.add(member.agent_id)
|
|
134
|
+
return len(agents)
|
|
135
|
+
|
|
136
|
+
def summary(self) -> dict:
|
|
137
|
+
"""Get registry summary stats."""
|
|
138
|
+
dept_squads = self.list_by_type(SquadType.DEPARTMENT)
|
|
139
|
+
project_squads = self.list_by_type(SquadType.PROJECT)
|
|
140
|
+
return {
|
|
141
|
+
"total_squads": self.total_squads,
|
|
142
|
+
"department_squads": len(dept_squads),
|
|
143
|
+
"project_squads": len(project_squads),
|
|
144
|
+
"total_agents": self.total_agents,
|
|
145
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"""Squad schema — Pydantic models for squad definitions.
|
|
2
|
+
|
|
3
|
+
Squads come in two flavors:
|
|
4
|
+
- Department squads: Fixed teams within a department (e.g., Dev squad with 9 agents)
|
|
5
|
+
- Project squads: Ad-hoc cross-department teams assembled for a specific task
|
|
6
|
+
|
|
7
|
+
Inspired by Spotify Model (squads/tribes/chapters) and Team Topologies
|
|
8
|
+
(stream-aligned, platform, enabling, complicated-subsystem).
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from enum import Enum
|
|
12
|
+
from typing import Optional
|
|
13
|
+
from pydantic import BaseModel, Field
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class SquadType(str, Enum):
|
|
17
|
+
DEPARTMENT = "department" # Fixed department squad
|
|
18
|
+
PROJECT = "project" # Ad-hoc cross-department squad
|
|
19
|
+
PLATFORM = "platform" # Internal platform team (Team Topologies)
|
|
20
|
+
ENABLING = "enabling" # Temporary capability boost
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class TeamTopologyType(str, Enum):
|
|
24
|
+
STREAM_ALIGNED = "stream-aligned"
|
|
25
|
+
PLATFORM = "platform"
|
|
26
|
+
ENABLING = "enabling"
|
|
27
|
+
COMPLICATED_SUBSYSTEM = "complicated-subsystem"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class SquadMember(BaseModel):
|
|
31
|
+
"""An agent assigned to a squad."""
|
|
32
|
+
agent_id: str
|
|
33
|
+
role: str = "" # Role within this squad
|
|
34
|
+
is_lead: bool = False # Is this agent the squad lead?
|
|
35
|
+
borrowed: bool = False # Borrowed from another department?
|
|
36
|
+
source_department: str = "" # Original department if borrowed
|
|
37
|
+
availability: float = 1.0 # 0.0-1.0, for shared agents
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class SquadWorkflow(BaseModel):
|
|
41
|
+
"""Reference to a workflow this squad uses."""
|
|
42
|
+
workflow_id: str
|
|
43
|
+
trigger_command: str = "" # CLI command that triggers this workflow
|
|
44
|
+
tier: str = "enterprise" # enterprise, focused, specialist
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class Squad(BaseModel):
|
|
48
|
+
"""A squad of agents working together.
|
|
49
|
+
|
|
50
|
+
Department squads are defined in YAML and loaded at startup.
|
|
51
|
+
Project squads are assembled dynamically from multiple departments.
|
|
52
|
+
"""
|
|
53
|
+
id: str
|
|
54
|
+
name: str
|
|
55
|
+
description: str = ""
|
|
56
|
+
department: str # Primary department
|
|
57
|
+
squad_type: SquadType = SquadType.DEPARTMENT
|
|
58
|
+
topology: TeamTopologyType = TeamTopologyType.STREAM_ALIGNED
|
|
59
|
+
|
|
60
|
+
members: list[SquadMember] = Field(default_factory=list)
|
|
61
|
+
workflows: list[SquadWorkflow] = Field(default_factory=list)
|
|
62
|
+
|
|
63
|
+
# Squad metadata
|
|
64
|
+
max_size: int = 10 # Max members (Two-Pizza Team rule)
|
|
65
|
+
skills_prefix: str = "" # CLI prefix (e.g., "/dev", "/mkt")
|
|
66
|
+
obsidian_path: str = "" # Output path in Obsidian vault
|
|
67
|
+
quality_gate_required: bool = True
|
|
68
|
+
|
|
69
|
+
def get_lead(self) -> Optional[SquadMember]:
|
|
70
|
+
"""Get the squad lead."""
|
|
71
|
+
for member in self.members:
|
|
72
|
+
if member.is_lead:
|
|
73
|
+
return member
|
|
74
|
+
return None
|
|
75
|
+
|
|
76
|
+
def get_member(self, agent_id: str) -> Optional[SquadMember]:
|
|
77
|
+
"""Find a member by agent ID."""
|
|
78
|
+
for member in self.members:
|
|
79
|
+
if member.agent_id == agent_id:
|
|
80
|
+
return member
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
def borrowed_members(self) -> list[SquadMember]:
|
|
84
|
+
"""Get all members borrowed from other departments."""
|
|
85
|
+
return [m for m in self.members if m.borrowed]
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def size(self) -> int:
|
|
89
|
+
return len(self.members)
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def has_lead(self) -> bool:
|
|
93
|
+
return self.get_lead() is not None
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""Synapse v2 — 8-layer context injection engine.
|
|
2
|
+
|
|
3
|
+
Injects relevant context into every prompt with <100ms target latency
|
|
4
|
+
and 65% context reduction through intelligent filtering.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from core.synapse.engine import SynapseEngine
|
|
8
|
+
from core.synapse.layers import Layer, LayerResult
|
|
9
|
+
from core.synapse.cache import LayerCache
|
|
10
|
+
|
|
11
|
+
__all__ = ["SynapseEngine", "Layer", "LayerResult", "LayerCache"]
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""TTL-based cache for Synapse layers.
|
|
2
|
+
|
|
3
|
+
Each layer can have its own cache TTL. The cache stores computed
|
|
4
|
+
layer results to avoid re-computation on every prompt.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import time
|
|
8
|
+
from dataclasses import dataclass, field
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass
|
|
12
|
+
class CacheEntry:
|
|
13
|
+
"""A single cached value with TTL."""
|
|
14
|
+
value: str
|
|
15
|
+
created_at: float
|
|
16
|
+
ttl_seconds: int
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def is_expired(self) -> bool:
|
|
20
|
+
if self.ttl_seconds <= 0:
|
|
21
|
+
return False # TTL 0 = never expires
|
|
22
|
+
return (time.time() - self.created_at) > self.ttl_seconds
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class LayerCache:
|
|
26
|
+
"""TTL-based cache for layer results.
|
|
27
|
+
|
|
28
|
+
Each layer key maps to a cached value with its own TTL.
|
|
29
|
+
Expired entries are evicted on access.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
def __init__(self) -> None:
|
|
33
|
+
self._store: dict[str, CacheEntry] = {}
|
|
34
|
+
self._hits: int = 0
|
|
35
|
+
self._misses: int = 0
|
|
36
|
+
|
|
37
|
+
def get(self, key: str) -> str | None:
|
|
38
|
+
"""Get a cached value, or None if missing/expired."""
|
|
39
|
+
entry = self._store.get(key)
|
|
40
|
+
if entry is None:
|
|
41
|
+
self._misses += 1
|
|
42
|
+
return None
|
|
43
|
+
if entry.is_expired:
|
|
44
|
+
del self._store[key]
|
|
45
|
+
self._misses += 1
|
|
46
|
+
return None
|
|
47
|
+
self._hits += 1
|
|
48
|
+
return entry.value
|
|
49
|
+
|
|
50
|
+
def set(self, key: str, value: str, ttl_seconds: int = 300) -> None:
|
|
51
|
+
"""Cache a value with TTL."""
|
|
52
|
+
self._store[key] = CacheEntry(
|
|
53
|
+
value=value,
|
|
54
|
+
created_at=time.time(),
|
|
55
|
+
ttl_seconds=ttl_seconds,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
def invalidate(self, key: str) -> None:
|
|
59
|
+
"""Remove a specific key from cache."""
|
|
60
|
+
self._store.pop(key, None)
|
|
61
|
+
|
|
62
|
+
def clear(self) -> None:
|
|
63
|
+
"""Clear all cached entries."""
|
|
64
|
+
self._store.clear()
|
|
65
|
+
|
|
66
|
+
def evict_expired(self) -> int:
|
|
67
|
+
"""Remove all expired entries. Returns count of evicted entries."""
|
|
68
|
+
expired = [k for k, v in self._store.items() if v.is_expired]
|
|
69
|
+
for k in expired:
|
|
70
|
+
del self._store[k]
|
|
71
|
+
return len(expired)
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def stats(self) -> dict[str, int]:
|
|
75
|
+
"""Cache hit/miss statistics."""
|
|
76
|
+
total = self._hits + self._misses
|
|
77
|
+
return {
|
|
78
|
+
"hits": self._hits,
|
|
79
|
+
"misses": self._misses,
|
|
80
|
+
"hit_rate": round(self._hits / total * 100) if total > 0 else 0,
|
|
81
|
+
"size": len(self._store),
|
|
82
|
+
}
|