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,472 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
ARKA OS — Project Stack Detector
|
|
4
|
+
|
|
5
|
+
Analyzes an existing project directory and outputs a JSON report with:
|
|
6
|
+
- Framework detection (Laravel, Nuxt, Vue, React, Next.js, Python, etc.)
|
|
7
|
+
- Database, cache, queue, auth, payments detection
|
|
8
|
+
- Architecture patterns (monolith, API-only, monorepo, services/repos)
|
|
9
|
+
- Convention detection (TypeScript, linting, strict mode, etc.)
|
|
10
|
+
- Codebase metrics (models, routes, migrations, components, tests)
|
|
11
|
+
- Recommended MCP profile
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
python3 detect-stack.py /path/to/project
|
|
15
|
+
python3 detect-stack.py /path/to/project --json (machine-readable output)
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
import json
|
|
19
|
+
import os
|
|
20
|
+
import sys
|
|
21
|
+
import glob
|
|
22
|
+
import re
|
|
23
|
+
from pathlib import Path
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def detect_stack(project_path: str) -> dict:
|
|
27
|
+
"""Analyze a project directory and return a comprehensive stack report."""
|
|
28
|
+
p = Path(project_path).resolve()
|
|
29
|
+
if not p.is_dir():
|
|
30
|
+
return {"error": f"Directory not found: {project_path}"}
|
|
31
|
+
|
|
32
|
+
result = {
|
|
33
|
+
"project_path": str(p),
|
|
34
|
+
"project_name": p.name,
|
|
35
|
+
"framework": None,
|
|
36
|
+
"language": None,
|
|
37
|
+
"stack": [],
|
|
38
|
+
"database": [],
|
|
39
|
+
"cache": [],
|
|
40
|
+
"queue": [],
|
|
41
|
+
"auth": [],
|
|
42
|
+
"payments": [],
|
|
43
|
+
"css": [],
|
|
44
|
+
"testing": [],
|
|
45
|
+
"architecture": {
|
|
46
|
+
"type": None,
|
|
47
|
+
"patterns": []
|
|
48
|
+
},
|
|
49
|
+
"conventions": {
|
|
50
|
+
"typescript": False,
|
|
51
|
+
"strict_types": False,
|
|
52
|
+
"eslint": False,
|
|
53
|
+
"prettier": False,
|
|
54
|
+
"phpstan": False,
|
|
55
|
+
"conventional_commits": False,
|
|
56
|
+
"docker": False
|
|
57
|
+
},
|
|
58
|
+
"metrics": {
|
|
59
|
+
"models": 0,
|
|
60
|
+
"controllers": 0,
|
|
61
|
+
"routes_files": 0,
|
|
62
|
+
"migrations": 0,
|
|
63
|
+
"components": 0,
|
|
64
|
+
"pages": 0,
|
|
65
|
+
"tests": 0,
|
|
66
|
+
"api_endpoints": 0
|
|
67
|
+
},
|
|
68
|
+
"mcp_profile": "base",
|
|
69
|
+
"files_found": {}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
# ── Check for key config files ──────────────────────────────────────────
|
|
73
|
+
config_files = {
|
|
74
|
+
"composer.json": p / "composer.json",
|
|
75
|
+
"package.json": p / "package.json",
|
|
76
|
+
"nuxt.config.ts": p / "nuxt.config.ts",
|
|
77
|
+
"nuxt.config.js": p / "nuxt.config.js",
|
|
78
|
+
"next.config.ts": p / "next.config.ts",
|
|
79
|
+
"next.config.js": p / "next.config.js",
|
|
80
|
+
"next.config.mjs": p / "next.config.mjs",
|
|
81
|
+
"vite.config.ts": p / "vite.config.ts",
|
|
82
|
+
"vite.config.js": p / "vite.config.js",
|
|
83
|
+
"tsconfig.json": p / "tsconfig.json",
|
|
84
|
+
".env": p / ".env",
|
|
85
|
+
".env.example": p / ".env.example",
|
|
86
|
+
"docker-compose.yml": p / "docker-compose.yml",
|
|
87
|
+
"docker-compose.yaml": p / "docker-compose.yaml",
|
|
88
|
+
"Dockerfile": p / "Dockerfile",
|
|
89
|
+
"pyproject.toml": p / "pyproject.toml",
|
|
90
|
+
"requirements.txt": p / "requirements.txt",
|
|
91
|
+
".eslintrc.json": p / ".eslintrc.json",
|
|
92
|
+
".eslintrc.js": p / ".eslintrc.js",
|
|
93
|
+
"eslint.config.js": p / "eslint.config.js",
|
|
94
|
+
"eslint.config.mjs": p / "eslint.config.mjs",
|
|
95
|
+
".prettierrc": p / ".prettierrc",
|
|
96
|
+
".prettierrc.json": p / ".prettierrc.json",
|
|
97
|
+
"prettier.config.js": p / "prettier.config.js",
|
|
98
|
+
"phpstan.neon": p / "phpstan.neon",
|
|
99
|
+
"phpstan.neon.dist": p / "phpstan.neon.dist",
|
|
100
|
+
"tailwind.config.js": p / "tailwind.config.js",
|
|
101
|
+
"tailwind.config.ts": p / "tailwind.config.ts",
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
for name, path in config_files.items():
|
|
105
|
+
if path.exists():
|
|
106
|
+
result["files_found"][name] = True
|
|
107
|
+
|
|
108
|
+
# ── Laravel / PHP Detection ─────────────────────────────────────────────
|
|
109
|
+
composer_path = p / "composer.json"
|
|
110
|
+
if composer_path.exists():
|
|
111
|
+
try:
|
|
112
|
+
composer = json.loads(composer_path.read_text())
|
|
113
|
+
require = {**composer.get("require", {}), **composer.get("require-dev", {})}
|
|
114
|
+
|
|
115
|
+
if "laravel/framework" in require:
|
|
116
|
+
result["framework"] = "Laravel"
|
|
117
|
+
result["language"] = "PHP"
|
|
118
|
+
version = require.get("laravel/framework", "")
|
|
119
|
+
result["stack"].append(f"Laravel {version}")
|
|
120
|
+
|
|
121
|
+
# Auth
|
|
122
|
+
if "laravel/sanctum" in require:
|
|
123
|
+
result["auth"].append("Sanctum")
|
|
124
|
+
if "laravel/passport" in require:
|
|
125
|
+
result["auth"].append("Passport")
|
|
126
|
+
if "laravel/fortify" in require:
|
|
127
|
+
result["auth"].append("Fortify")
|
|
128
|
+
if "laravel/breeze" in require:
|
|
129
|
+
result["auth"].append("Breeze")
|
|
130
|
+
if "laravel/jetstream" in require:
|
|
131
|
+
result["auth"].append("Jetstream")
|
|
132
|
+
|
|
133
|
+
# Queue
|
|
134
|
+
if "laravel/horizon" in require:
|
|
135
|
+
result["queue"].append("Horizon")
|
|
136
|
+
|
|
137
|
+
# Payments
|
|
138
|
+
if "laravel/cashier" in require:
|
|
139
|
+
result["payments"].append("Stripe (Cashier)")
|
|
140
|
+
if "laravel/cashier-paddle" in require:
|
|
141
|
+
result["payments"].append("Paddle (Cashier)")
|
|
142
|
+
|
|
143
|
+
# Testing
|
|
144
|
+
if "pestphp/pest" in require:
|
|
145
|
+
result["testing"].append("Pest")
|
|
146
|
+
if "phpunit/phpunit" in require:
|
|
147
|
+
result["testing"].append("PHPUnit")
|
|
148
|
+
|
|
149
|
+
# AI
|
|
150
|
+
if "echolabs/prism" in require:
|
|
151
|
+
result["stack"].append("Prism (AI SDK)")
|
|
152
|
+
if "laravel/boost" in require:
|
|
153
|
+
result["stack"].append("Laravel Boost")
|
|
154
|
+
|
|
155
|
+
# MCP
|
|
156
|
+
if "php-mcp/laravel" in require:
|
|
157
|
+
result["stack"].append("MCP Server")
|
|
158
|
+
|
|
159
|
+
# Check for strict_types
|
|
160
|
+
app_path = p / "app"
|
|
161
|
+
if app_path.exists():
|
|
162
|
+
php_files = list(app_path.rglob("*.php"))[:5]
|
|
163
|
+
for pf in php_files:
|
|
164
|
+
try:
|
|
165
|
+
content = pf.read_text(errors="ignore")[:200]
|
|
166
|
+
if "declare(strict_types=1)" in content:
|
|
167
|
+
result["conventions"]["strict_types"] = True
|
|
168
|
+
break
|
|
169
|
+
except Exception:
|
|
170
|
+
pass
|
|
171
|
+
|
|
172
|
+
except (json.JSONDecodeError, Exception):
|
|
173
|
+
pass
|
|
174
|
+
|
|
175
|
+
# ── Node.js / Frontend Detection ────────────────────────────────────────
|
|
176
|
+
package_path = p / "package.json"
|
|
177
|
+
if package_path.exists():
|
|
178
|
+
try:
|
|
179
|
+
pkg = json.loads(package_path.read_text())
|
|
180
|
+
deps = {**pkg.get("dependencies", {}), **pkg.get("devDependencies", {})}
|
|
181
|
+
|
|
182
|
+
# Nuxt
|
|
183
|
+
if "nuxt" in deps:
|
|
184
|
+
result["framework"] = result["framework"] or "Nuxt"
|
|
185
|
+
result["stack"].append(f"Nuxt {deps.get('nuxt', '')}")
|
|
186
|
+
result["language"] = result["language"] or "TypeScript"
|
|
187
|
+
|
|
188
|
+
# Next.js
|
|
189
|
+
if "next" in deps:
|
|
190
|
+
result["framework"] = result["framework"] or "Next.js"
|
|
191
|
+
result["stack"].append(f"Next.js {deps.get('next', '')}")
|
|
192
|
+
result["language"] = result["language"] or "TypeScript"
|
|
193
|
+
|
|
194
|
+
# Vue
|
|
195
|
+
if "vue" in deps and "nuxt" not in deps:
|
|
196
|
+
result["framework"] = result["framework"] or "Vue"
|
|
197
|
+
result["stack"].append(f"Vue {deps.get('vue', '')}")
|
|
198
|
+
|
|
199
|
+
# React (without Next)
|
|
200
|
+
if "react" in deps and "next" not in deps:
|
|
201
|
+
result["framework"] = result["framework"] or "React"
|
|
202
|
+
result["stack"].append(f"React {deps.get('react', '')}")
|
|
203
|
+
|
|
204
|
+
# TypeScript
|
|
205
|
+
if "typescript" in deps:
|
|
206
|
+
result["conventions"]["typescript"] = True
|
|
207
|
+
result["stack"].append("TypeScript")
|
|
208
|
+
|
|
209
|
+
# CSS
|
|
210
|
+
if "tailwindcss" in deps:
|
|
211
|
+
result["css"].append("Tailwind CSS")
|
|
212
|
+
if "sass" in deps or "node-sass" in deps:
|
|
213
|
+
result["css"].append("Sass")
|
|
214
|
+
if "@nuxt/ui" in deps:
|
|
215
|
+
result["css"].append("Nuxt UI")
|
|
216
|
+
if "shadcn" in str(deps) or "@radix-ui" in str(deps):
|
|
217
|
+
result["css"].append("shadcn/ui")
|
|
218
|
+
|
|
219
|
+
# Auth
|
|
220
|
+
if "next-auth" in deps or "@auth/core" in deps:
|
|
221
|
+
result["auth"].append("NextAuth")
|
|
222
|
+
if "@supabase/supabase-js" in deps or "@supabase/ssr" in deps:
|
|
223
|
+
result["auth"].append("Supabase Auth")
|
|
224
|
+
result["database"].append("Supabase")
|
|
225
|
+
|
|
226
|
+
# State
|
|
227
|
+
if "pinia" in deps:
|
|
228
|
+
result["stack"].append("Pinia")
|
|
229
|
+
if "@tanstack/react-query" in deps:
|
|
230
|
+
result["stack"].append("TanStack Query")
|
|
231
|
+
if "zustand" in deps:
|
|
232
|
+
result["stack"].append("Zustand")
|
|
233
|
+
|
|
234
|
+
# Testing
|
|
235
|
+
if "vitest" in deps:
|
|
236
|
+
result["testing"].append("Vitest")
|
|
237
|
+
if "jest" in deps:
|
|
238
|
+
result["testing"].append("Jest")
|
|
239
|
+
if "@playwright/test" in deps:
|
|
240
|
+
result["testing"].append("Playwright")
|
|
241
|
+
if "cypress" in deps:
|
|
242
|
+
result["testing"].append("Cypress")
|
|
243
|
+
|
|
244
|
+
# Payments
|
|
245
|
+
if "stripe" in deps or "@stripe/stripe-js" in deps:
|
|
246
|
+
result["payments"].append("Stripe")
|
|
247
|
+
|
|
248
|
+
except (json.JSONDecodeError, Exception):
|
|
249
|
+
pass
|
|
250
|
+
|
|
251
|
+
# ── Python Detection ────────────────────────────────────────────────────
|
|
252
|
+
if (p / "pyproject.toml").exists() or (p / "requirements.txt").exists():
|
|
253
|
+
if not result["framework"]:
|
|
254
|
+
result["language"] = "Python"
|
|
255
|
+
if (p / "manage.py").exists():
|
|
256
|
+
result["framework"] = "Django"
|
|
257
|
+
result["stack"].append("Django")
|
|
258
|
+
elif (p / "app.py").exists() or (p / "main.py").exists():
|
|
259
|
+
# Check for FastAPI or Flask
|
|
260
|
+
for f in ["app.py", "main.py"]:
|
|
261
|
+
fp = p / f
|
|
262
|
+
if fp.exists():
|
|
263
|
+
try:
|
|
264
|
+
content = fp.read_text(errors="ignore")[:2000]
|
|
265
|
+
if "fastapi" in content.lower() or "FastAPI" in content:
|
|
266
|
+
result["framework"] = "FastAPI"
|
|
267
|
+
result["stack"].append("FastAPI")
|
|
268
|
+
elif "flask" in content.lower() or "Flask" in content:
|
|
269
|
+
result["framework"] = "Flask"
|
|
270
|
+
result["stack"].append("Flask")
|
|
271
|
+
except Exception:
|
|
272
|
+
pass
|
|
273
|
+
|
|
274
|
+
# ── Database Detection (from .env or docker-compose) ────────────────────
|
|
275
|
+
env_file = p / ".env.example" if (p / ".env.example").exists() else p / ".env"
|
|
276
|
+
if env_file.exists():
|
|
277
|
+
try:
|
|
278
|
+
env_content = env_file.read_text(errors="ignore")
|
|
279
|
+
if "DB_CONNECTION=pgsql" in env_content or "DATABASE_URL=postgres" in env_content:
|
|
280
|
+
result["database"].append("PostgreSQL")
|
|
281
|
+
elif "DB_CONNECTION=mysql" in env_content:
|
|
282
|
+
result["database"].append("MySQL")
|
|
283
|
+
elif "DB_CONNECTION=sqlite" in env_content:
|
|
284
|
+
result["database"].append("SQLite")
|
|
285
|
+
|
|
286
|
+
if "REDIS_HOST" in env_content or "REDIS_URL" in env_content:
|
|
287
|
+
result["cache"].append("Redis")
|
|
288
|
+
if "CACHE_DRIVER=redis" in env_content:
|
|
289
|
+
result["cache"].append("Redis Cache")
|
|
290
|
+
if "QUEUE_CONNECTION=redis" in env_content:
|
|
291
|
+
result["queue"].append("Redis Queue")
|
|
292
|
+
|
|
293
|
+
if "MAIL_MAILER" in env_content:
|
|
294
|
+
result["stack"].append("Mail")
|
|
295
|
+
if "STRIPE_KEY" in env_content or "STRIPE_SECRET" in env_content:
|
|
296
|
+
if "Stripe" not in result["payments"] and "Stripe (Cashier)" not in result["payments"]:
|
|
297
|
+
result["payments"].append("Stripe")
|
|
298
|
+
except Exception:
|
|
299
|
+
pass
|
|
300
|
+
|
|
301
|
+
# ── Convention Detection ────────────────────────────────────────────────
|
|
302
|
+
if any(k.startswith(".eslint") or k.startswith("eslint.config") for k in result["files_found"]):
|
|
303
|
+
result["conventions"]["eslint"] = True
|
|
304
|
+
if any(k.startswith(".prettier") or k == "prettier.config.js" for k in result["files_found"]):
|
|
305
|
+
result["conventions"]["prettier"] = True
|
|
306
|
+
if any(k.startswith("phpstan") for k in result["files_found"]):
|
|
307
|
+
result["conventions"]["phpstan"] = True
|
|
308
|
+
if any(k.startswith("docker") or k == "Dockerfile" for k in result["files_found"]):
|
|
309
|
+
result["conventions"]["docker"] = True
|
|
310
|
+
|
|
311
|
+
# Check for conventional commits (commitlint or similar)
|
|
312
|
+
if (p / ".commitlintrc.json").exists() or (p / "commitlint.config.js").exists():
|
|
313
|
+
result["conventions"]["conventional_commits"] = True
|
|
314
|
+
|
|
315
|
+
# ── Tailwind Detection ──────────────────────────────────────────────────
|
|
316
|
+
if any(k.startswith("tailwind.config") for k in result["files_found"]):
|
|
317
|
+
if "Tailwind CSS" not in result["css"]:
|
|
318
|
+
result["css"].append("Tailwind CSS")
|
|
319
|
+
|
|
320
|
+
# ── Architecture Analysis ───────────────────────────────────────────────
|
|
321
|
+
# Check for monorepo
|
|
322
|
+
has_api = (p / "api").is_dir()
|
|
323
|
+
has_frontend = (p / "frontend").is_dir()
|
|
324
|
+
has_packages = (p / "packages").is_dir()
|
|
325
|
+
has_apps = (p / "apps").is_dir()
|
|
326
|
+
|
|
327
|
+
if (has_api and has_frontend) or has_packages or has_apps:
|
|
328
|
+
result["architecture"]["type"] = "monorepo"
|
|
329
|
+
elif composer_path.exists() and not package_path.exists():
|
|
330
|
+
# Pure backend
|
|
331
|
+
if (p / "resources" / "views").is_dir():
|
|
332
|
+
result["architecture"]["type"] = "monolith"
|
|
333
|
+
else:
|
|
334
|
+
result["architecture"]["type"] = "api-only"
|
|
335
|
+
elif package_path.exists() and not composer_path.exists():
|
|
336
|
+
result["architecture"]["type"] = "frontend-spa"
|
|
337
|
+
else:
|
|
338
|
+
result["architecture"]["type"] = "standard"
|
|
339
|
+
|
|
340
|
+
# Check for services/repositories pattern (Laravel)
|
|
341
|
+
if (p / "app" / "Services").is_dir():
|
|
342
|
+
result["architecture"]["patterns"].append("Services")
|
|
343
|
+
if (p / "app" / "Repositories").is_dir():
|
|
344
|
+
result["architecture"]["patterns"].append("Repositories")
|
|
345
|
+
if (p / "app" / "Actions").is_dir():
|
|
346
|
+
result["architecture"]["patterns"].append("Actions")
|
|
347
|
+
if (p / "app" / "DTOs").is_dir() or (p / "app" / "Data").is_dir():
|
|
348
|
+
result["architecture"]["patterns"].append("DTOs")
|
|
349
|
+
|
|
350
|
+
# ── Codebase Metrics ────────────────────────────────────────────────────
|
|
351
|
+
def count_files(pattern: str) -> int:
|
|
352
|
+
return len(list(p.rglob(pattern)))
|
|
353
|
+
|
|
354
|
+
# Laravel metrics
|
|
355
|
+
if result["framework"] == "Laravel":
|
|
356
|
+
result["metrics"]["models"] = count_files("app/Models/*.php")
|
|
357
|
+
result["metrics"]["controllers"] = count_files("app/Http/Controllers/**/*.php")
|
|
358
|
+
result["metrics"]["migrations"] = count_files("database/migrations/*.php")
|
|
359
|
+
result["metrics"]["routes_files"] = count_files("routes/*.php")
|
|
360
|
+
result["metrics"]["tests"] = count_files("tests/**/*.php")
|
|
361
|
+
|
|
362
|
+
# Frontend metrics
|
|
363
|
+
if result["framework"] in ("Nuxt", "Vue", "React", "Next.js"):
|
|
364
|
+
result["metrics"]["components"] = (
|
|
365
|
+
count_files("components/**/*.vue") +
|
|
366
|
+
count_files("components/**/*.tsx") +
|
|
367
|
+
count_files("components/**/*.jsx") +
|
|
368
|
+
count_files("src/components/**/*.vue") +
|
|
369
|
+
count_files("src/components/**/*.tsx") +
|
|
370
|
+
count_files("src/components/**/*.jsx")
|
|
371
|
+
)
|
|
372
|
+
result["metrics"]["pages"] = (
|
|
373
|
+
count_files("pages/**/*.vue") +
|
|
374
|
+
count_files("pages/**/*.tsx") +
|
|
375
|
+
count_files("app/**/*.tsx") +
|
|
376
|
+
count_files("src/pages/**/*.vue") +
|
|
377
|
+
count_files("src/pages/**/*.tsx")
|
|
378
|
+
)
|
|
379
|
+
result["metrics"]["tests"] = (
|
|
380
|
+
count_files("tests/**/*.test.*") +
|
|
381
|
+
count_files("__tests__/**/*.*") +
|
|
382
|
+
count_files("*.test.*") +
|
|
383
|
+
count_files("*.spec.*")
|
|
384
|
+
)
|
|
385
|
+
|
|
386
|
+
# ── MCP Profile Recommendation ──────────────────────────────────────────
|
|
387
|
+
fw = result["framework"]
|
|
388
|
+
if result["architecture"]["type"] == "monorepo" and "Laravel" in str(result["stack"]):
|
|
389
|
+
result["mcp_profile"] = "full-stack"
|
|
390
|
+
elif fw == "Laravel":
|
|
391
|
+
# Check for ecommerce indicators
|
|
392
|
+
if any(x in str(result.get("stack", [])) for x in ["Shopify", "Mirakl"]):
|
|
393
|
+
result["mcp_profile"] = "ecommerce"
|
|
394
|
+
else:
|
|
395
|
+
result["mcp_profile"] = "laravel"
|
|
396
|
+
elif fw == "Nuxt":
|
|
397
|
+
result["mcp_profile"] = "nuxt"
|
|
398
|
+
elif fw == "Vue":
|
|
399
|
+
result["mcp_profile"] = "vue"
|
|
400
|
+
elif fw == "React":
|
|
401
|
+
result["mcp_profile"] = "react"
|
|
402
|
+
elif fw == "Next.js":
|
|
403
|
+
result["mcp_profile"] = "nextjs"
|
|
404
|
+
else:
|
|
405
|
+
result["mcp_profile"] = "base"
|
|
406
|
+
|
|
407
|
+
return result
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def format_report(data: dict) -> str:
|
|
411
|
+
"""Format the detection result as a human-readable report."""
|
|
412
|
+
lines = []
|
|
413
|
+
lines.append(f"Project: {data['project_name']}")
|
|
414
|
+
lines.append(f"Path: {data['project_path']}")
|
|
415
|
+
lines.append(f"Framework: {data.get('framework') or 'Unknown'}")
|
|
416
|
+
lines.append(f"Language: {data.get('language') or 'Unknown'}")
|
|
417
|
+
lines.append(f"Architecture: {data['architecture']['type'] or 'Unknown'}")
|
|
418
|
+
|
|
419
|
+
if data["stack"]:
|
|
420
|
+
lines.append(f"Stack: {', '.join(data['stack'])}")
|
|
421
|
+
if data["database"]:
|
|
422
|
+
lines.append(f"Database: {', '.join(data['database'])}")
|
|
423
|
+
if data["cache"]:
|
|
424
|
+
lines.append(f"Cache: {', '.join(data['cache'])}")
|
|
425
|
+
if data["queue"]:
|
|
426
|
+
lines.append(f"Queue: {', '.join(data['queue'])}")
|
|
427
|
+
if data["auth"]:
|
|
428
|
+
lines.append(f"Auth: {', '.join(data['auth'])}")
|
|
429
|
+
if data["payments"]:
|
|
430
|
+
lines.append(f"Payments: {', '.join(data['payments'])}")
|
|
431
|
+
if data["css"]:
|
|
432
|
+
lines.append(f"CSS: {', '.join(data['css'])}")
|
|
433
|
+
if data["testing"]:
|
|
434
|
+
lines.append(f"Testing: {', '.join(data['testing'])}")
|
|
435
|
+
if data["architecture"]["patterns"]:
|
|
436
|
+
lines.append(f"Patterns: {', '.join(data['architecture']['patterns'])}")
|
|
437
|
+
|
|
438
|
+
# Conventions
|
|
439
|
+
conventions = [k for k, v in data["conventions"].items() if v]
|
|
440
|
+
if conventions:
|
|
441
|
+
lines.append(f"Conventions: {', '.join(conventions)}")
|
|
442
|
+
|
|
443
|
+
# Metrics
|
|
444
|
+
m = data["metrics"]
|
|
445
|
+
active_metrics = {k: v for k, v in m.items() if v > 0}
|
|
446
|
+
if active_metrics:
|
|
447
|
+
metrics_str = ", ".join(f"{v} {k.replace('_', ' ')}" for k, v in active_metrics.items())
|
|
448
|
+
lines.append(f"Metrics: {metrics_str}")
|
|
449
|
+
|
|
450
|
+
lines.append(f"MCP Profile: {data['mcp_profile']}")
|
|
451
|
+
|
|
452
|
+
return "\n".join(lines)
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
if __name__ == "__main__":
|
|
456
|
+
if len(sys.argv) < 2:
|
|
457
|
+
print("Usage: python3 detect-stack.py <project-path> [--json]")
|
|
458
|
+
sys.exit(1)
|
|
459
|
+
|
|
460
|
+
project_path = sys.argv[1]
|
|
461
|
+
json_mode = "--json" in sys.argv
|
|
462
|
+
|
|
463
|
+
result = detect_stack(project_path)
|
|
464
|
+
|
|
465
|
+
if "error" in result:
|
|
466
|
+
print(f"Error: {result['error']}", file=sys.stderr)
|
|
467
|
+
sys.exit(1)
|
|
468
|
+
|
|
469
|
+
if json_mode:
|
|
470
|
+
print(json.dumps(result, indent=2))
|
|
471
|
+
else:
|
|
472
|
+
print(format_report(result))
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/performance-audit
|
|
3
|
+
description: >
|
|
4
|
+
Performance audit covering Core Web Vitals, API latency, database queries,
|
|
5
|
+
and caching strategy. Targets and budgets based on Google/industry standards.
|
|
6
|
+
allowed-tools: [Read, Bash, Grep, Glob, Agent, WebFetch]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Performance Audit — `/dev performance <target>`
|
|
10
|
+
|
|
11
|
+
> **Agent:** Carlos (DevOps) + Vasco (DBA)
|
|
12
|
+
> **Standards:** Core Web Vitals (Google), SLO best practices
|
|
13
|
+
|
|
14
|
+
## Performance Targets
|
|
15
|
+
|
|
16
|
+
### Frontend (Core Web Vitals)
|
|
17
|
+
| Metric | Target | What |
|
|
18
|
+
|--------|--------|------|
|
|
19
|
+
| LCP | < 2.5s | Largest Contentful Paint |
|
|
20
|
+
| INP | < 200ms | Interaction to Next Paint |
|
|
21
|
+
| CLS | < 0.1 | Cumulative Layout Shift |
|
|
22
|
+
| JS Bundle | < 300KB gzipped | Total JavaScript |
|
|
23
|
+
| First Load | < 1.5s on 3G | Time to usable |
|
|
24
|
+
|
|
25
|
+
### Backend (API)
|
|
26
|
+
| Metric | Target |
|
|
27
|
+
|--------|--------|
|
|
28
|
+
| p50 latency | < 100ms |
|
|
29
|
+
| p95 latency | < 500ms |
|
|
30
|
+
| p99 latency | < 1000ms |
|
|
31
|
+
| Error rate | < 0.1% |
|
|
32
|
+
|
|
33
|
+
### Database
|
|
34
|
+
| Metric | Target |
|
|
35
|
+
|--------|--------|
|
|
36
|
+
| Query p95 | < 50ms |
|
|
37
|
+
| N+1 queries | 0 |
|
|
38
|
+
| Missing indexes | 0 on queried columns |
|
|
39
|
+
| Connection pool | Properly sized |
|
|
40
|
+
|
|
41
|
+
## Audit Steps
|
|
42
|
+
|
|
43
|
+
1. **Frontend:** Lighthouse audit, bundle analysis, CWV measurement
|
|
44
|
+
2. **API:** Response time profiling per endpoint, error rate check
|
|
45
|
+
3. **Database:** `EXPLAIN ANALYZE` on slow queries, index review, N+1 detection
|
|
46
|
+
4. **Caching:** Cache hit rates, TTL appropriateness, stale data risk
|
|
47
|
+
5. **Infrastructure:** CDN coverage, compression (gzip/brotli), HTTP/2
|
|
48
|
+
|
|
49
|
+
## Output: Performance Report with actionable fixes and priority ranking
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: dev/performance-profiler
|
|
3
|
+
description: >
|
|
4
|
+
Performance profiling with bottleneck identification, before/after measurement,
|
|
5
|
+
optimization checklists, and load testing guidance.
|
|
6
|
+
allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Agent]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Performance Profiler — `/dev performance-profiler`
|
|
10
|
+
|
|
11
|
+
> **Agent:** Andre (Backend Dev) | **Framework:** DORA, Web Vitals, APM Best Practices
|
|
12
|
+
|
|
13
|
+
## Golden Rule: Measure First
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
WRONG: "I think the N+1 query is slow, let me fix it"
|
|
17
|
+
RIGHT: Profile -> confirm bottleneck -> fix -> measure again -> verify improvement
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Profiling Workflow
|
|
21
|
+
|
|
22
|
+
| Step | Action | Output |
|
|
23
|
+
|------|--------|--------|
|
|
24
|
+
| 1 | Establish baseline | P50, P95, P99 latency + RPS + error rate + memory |
|
|
25
|
+
| 2 | Identify bottleneck | Flamegraph, slow query log, or heap snapshot |
|
|
26
|
+
| 3 | Apply single fix | One change at a time to isolate causation |
|
|
27
|
+
| 4 | Re-measure | Same conditions as baseline |
|
|
28
|
+
| 5 | Compare delta | Before/after table with % improvement |
|
|
29
|
+
| 6 | Document | Before/after in PR description |
|
|
30
|
+
|
|
31
|
+
## Quick Wins Checklist
|
|
32
|
+
|
|
33
|
+
### Database
|
|
34
|
+
- [ ] Missing indexes on WHERE / ORDER BY columns
|
|
35
|
+
- [ ] N+1 queries (check query count per request)
|
|
36
|
+
- [ ] SELECT * when only 2-3 columns needed
|
|
37
|
+
- [ ] No LIMIT on unbounded queries
|
|
38
|
+
- [ ] Missing connection pool (new connection per request)
|
|
39
|
+
|
|
40
|
+
### Backend
|
|
41
|
+
- [ ] Sync I/O in hot path (readFileSync, blocking calls)
|
|
42
|
+
- [ ] JSON parse/stringify of large objects in loops
|
|
43
|
+
- [ ] Missing caching for expensive computations
|
|
44
|
+
- [ ] No compression (gzip/brotli) on responses
|
|
45
|
+
- [ ] Serial awaits that could be parallel (Promise.all)
|
|
46
|
+
|
|
47
|
+
### Frontend Bundle
|
|
48
|
+
- [ ] Moment.js -> dayjs or date-fns
|
|
49
|
+
- [ ] Full lodash -> individual imports
|
|
50
|
+
- [ ] Static imports of heavy components -> dynamic imports
|
|
51
|
+
- [ ] Images not optimized or not using next/image
|
|
52
|
+
- [ ] No code splitting on routes
|
|
53
|
+
|
|
54
|
+
### API
|
|
55
|
+
- [ ] No pagination on list endpoints
|
|
56
|
+
- [ ] No Cache-Control headers
|
|
57
|
+
- [ ] Fetching related data in loop instead of JOIN / eager load
|
|
58
|
+
- [ ] Missing HTTP/2 or CDN coverage
|
|
59
|
+
|
|
60
|
+
## Profiling Tools by Stack
|
|
61
|
+
|
|
62
|
+
| Stack | CPU | Memory | Database | Load Test |
|
|
63
|
+
|-------|-----|--------|----------|-----------|
|
|
64
|
+
| Node.js | `--prof` + flamegraph | `--inspect` heap snapshot | `EXPLAIN ANALYZE` | k6 |
|
|
65
|
+
| Python | py-spy flamegraph | tracemalloc | `EXPLAIN ANALYZE` | locust |
|
|
66
|
+
| Go | pprof CPU profile | pprof heap | `EXPLAIN ANALYZE` | k6 |
|
|
67
|
+
| PHP/Laravel | Clockwork / Telescope | Blackfire | `EXPLAIN ANALYZE` | Artillery |
|
|
68
|
+
|
|
69
|
+
## Performance Budgets
|
|
70
|
+
|
|
71
|
+
| Metric | Budget | Enforcement |
|
|
72
|
+
|--------|--------|-------------|
|
|
73
|
+
| P95 API latency | < 200ms | CI gate with k6 |
|
|
74
|
+
| P99 API latency | < 1000ms | Alerting threshold |
|
|
75
|
+
| DB queries per request | < 10 | N+1 detection in tests |
|
|
76
|
+
| JS bundle (gzipped) | < 300KB | Webpack budget plugin |
|
|
77
|
+
| First load (3G) | < 1.5s | Lighthouse CI |
|
|
78
|
+
|
|
79
|
+
## Common Pitfalls
|
|
80
|
+
|
|
81
|
+
| Pitfall | Why It Fails |
|
|
82
|
+
|---------|-------------|
|
|
83
|
+
| Optimizing without measuring | You fix the wrong thing |
|
|
84
|
+
| Testing with dev data | 10 rows vs millions = different bottlenecks |
|
|
85
|
+
| Ignoring P99 | P50 looks fine while P99 is catastrophic |
|
|
86
|
+
| Premature optimization | Fix correctness first, then performance |
|
|
87
|
+
| Not re-measuring after fix | Cannot verify improvement without delta |
|
|
88
|
+
| Load testing production | Use staging with production-size data |
|
|
89
|
+
|
|
90
|
+
## Proactive Triggers
|
|
91
|
+
|
|
92
|
+
Surface these issues WITHOUT being asked:
|
|
93
|
+
|
|
94
|
+
- N+1 query detected → flag database performance
|
|
95
|
+
- Bundle size >500KB → flag load time impact
|
|
96
|
+
- No CDN for static assets → flag latency for global users
|
|
97
|
+
|
|
98
|
+
## Output
|
|
99
|
+
|
|
100
|
+
```markdown
|
|
101
|
+
## Performance Profile: <Target>
|
|
102
|
+
|
|
103
|
+
### Baseline
|
|
104
|
+
| Metric | Value | Budget | Status |
|
|
105
|
+
|--------|-------|--------|--------|
|
|
106
|
+
| P50 latency | 480ms | < 100ms | OVER |
|
|
107
|
+
| P95 latency | 1240ms | < 200ms | OVER |
|
|
108
|
+
| P99 latency | 3100ms | < 1000ms | OVER |
|
|
109
|
+
| DB queries/req | 23 | < 10 | OVER |
|
|
110
|
+
|
|
111
|
+
### Root Cause
|
|
112
|
+
[What the profiler revealed]
|
|
113
|
+
|
|
114
|
+
### Fix Applied
|
|
115
|
+
[What changed]
|
|
116
|
+
|
|
117
|
+
### After
|
|
118
|
+
| Metric | Before | After | Delta |
|
|
119
|
+
|--------|--------|-------|-------|
|
|
120
|
+
| P50 | 480ms | 48ms | -90% |
|
|
121
|
+
| P95 | 1240ms | 120ms | -90% |
|
|
122
|
+
| P99 | 3100ms | 280ms | -91% |
|
|
123
|
+
| Queries | 23 | 1 | -96% |
|
|
124
|
+
|
|
125
|
+
### Recommendations
|
|
126
|
+
| Priority | Action | Expected Impact |
|
|
127
|
+
|----------|--------|----------------|
|
|
128
|
+
```
|