gabbe-kit 1.0.0
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/LICENSE +25 -0
- package/LICENSE-CODE +202 -0
- package/README.md +817 -0
- package/agents/AGENTS.md +542 -0
- package/agents/CONSTITUTION.md +188 -0
- package/agents/guides/00-index.md +142 -0
- package/agents/guides/ai/a2ui-protocols.md +71 -0
- package/agents/guides/ai/actor-agent-frameworks.md +82 -0
- package/agents/guides/ai/agent-communication.md +146 -0
- package/agents/guides/ai/agent-identity-trust.md +69 -0
- package/agents/guides/ai/agent-only-cognition.md +73 -0
- package/agents/guides/ai/agent-only-swarms.md +70 -0
- package/agents/guides/ai/agent-operating-ergonomics.md +52 -0
- package/agents/guides/ai/agent-ui.md +106 -0
- package/agents/guides/ai/ai-agentic.md +309 -0
- package/agents/guides/ai/beyond-llms.md +60 -0
- package/agents/guides/ai/dynamic-capability-loading.md +121 -0
- package/agents/guides/ai/gabbe-innovations.md +111 -0
- package/agents/guides/ai/model-customization-decisions.md +78 -0
- package/agents/guides/ai/multi-agent-systems.md +85 -0
- package/agents/guides/ai/self-evolving-skills.md +137 -0
- package/agents/guides/ai/self-healing-summary.md +21 -0
- package/agents/guides/ai/visual-mcp-integration.md +106 -0
- package/agents/guides/architecture/api-standards.md +61 -0
- package/agents/guides/architecture/blockchain-dlt.md +36 -0
- package/agents/guides/architecture/critical-systems-arch.md +66 -0
- package/agents/guides/architecture/event-driven-architecture.md +39 -0
- package/agents/guides/architecture/microservices.md +292 -0
- package/agents/guides/architecture/monolith.md +303 -0
- package/agents/guides/architecture/orchestration.md +75 -0
- package/agents/guides/architecture/system-qualities.md +51 -0
- package/agents/guides/architecture/system-scalability.md +47 -0
- package/agents/guides/architecture/systems-architecture.md +506 -0
- package/agents/guides/data/semantic-web.md +23 -0
- package/agents/guides/data/sql-nosql.md +305 -0
- package/agents/guides/industry/engineering-standards.md +36 -0
- package/agents/guides/industry/global-standards.md +24 -0
- package/agents/guides/industry/healthcare-fhir.md +33 -0
- package/agents/guides/industry/industrial-iot.md +33 -0
- package/agents/guides/industry/telecom-networks.md +34 -0
- package/agents/guides/languages/c-sharp.md +66 -0
- package/agents/guides/languages/go-lang.md +251 -0
- package/agents/guides/languages/java.md +73 -0
- package/agents/guides/languages/js-ts-nodejs.md +361 -0
- package/agents/guides/languages/nodejs-advanced.md +56 -0
- package/agents/guides/languages/php-laravel.md +376 -0
- package/agents/guides/languages/python-fastapi-ai.md +257 -0
- package/agents/guides/languages/rust.md +73 -0
- package/agents/guides/ops/compliance-audit.md +177 -0
- package/agents/guides/ops/cost-optimization.md +57 -0
- package/agents/guides/ops/dev-environments.md +67 -0
- package/agents/guides/ops/dev-workflow.md +44 -0
- package/agents/guides/ops/gabbe-cli-workflows.md +252 -0
- package/agents/guides/ops/production-health.md +62 -0
- package/agents/guides/ops/troubleshooting-guide.md +69 -0
- package/agents/guides/patterns/agentic-design-patterns.md +308 -0
- package/agents/guides/patterns/agentic-patterns.md +43 -0
- package/agents/guides/patterns/ai-native-scenarios.md +71 -0
- package/agents/guides/patterns/autonomous-swarm-patterns.md +42 -0
- package/agents/guides/patterns/design-patterns.md +68 -0
- package/agents/guides/patterns/enterprise-migration-scenario.md +58 -0
- package/agents/guides/patterns/enterprise-patterns.md +56 -0
- package/agents/guides/patterns/software-design-patterns.md +106 -0
- package/agents/guides/patterns/time-complexity-analysis.md +116 -0
- package/agents/guides/planning/product-requirements.md +407 -0
- package/agents/guides/planning/strategic-analysis.md +98 -0
- package/agents/guides/planning/visual-product-specs.md +162 -0
- package/agents/guides/principles/clean-code-standards.md +51 -0
- package/agents/guides/principles/computing-foundations.md +87 -0
- package/agents/guides/principles/diagramming-standards.md +568 -0
- package/agents/guides/principles/evaluation-strategy.md +103 -0
- package/agents/guides/principles/future-tech.md +35 -0
- package/agents/guides/principles/human-agent-collaboration.md +54 -0
- package/agents/guides/principles/legacy-tech.md +61 -0
- package/agents/guides/principles/mathematical-foundations.md +103 -0
- package/agents/guides/principles/modeling-methods.md +97 -0
- package/agents/guides/principles/no-code-integration.md +84 -0
- package/agents/guides/principles/testing-strategy.md +97 -0
- package/agents/guides/principles/visual-design-system.md +44 -0
- package/agents/guides/processes/RARV_CYCLE.md +262 -0
- package/agents/guides/processes/extension-protocol.md +183 -0
- package/agents/guides/processes/full-system-lifecycle.md +47 -0
- package/agents/guides/processes/knowledge-integration.md +82 -0
- package/agents/guides/processes/loki-sdlc-phases.md +446 -0
- package/agents/guides/product/green-software.md +38 -0
- package/agents/guides/product/sustainability-checks.md +29 -0
- package/agents/guides/security/ai-risk-standards-map.md +98 -0
- package/agents/guides/security/api-security.md +51 -0
- package/agents/guides/security/cryptography-standards.md +38 -0
- package/agents/guides/security/privacy-data-protection.md +41 -0
- package/agents/guides/security/secure-architecture.md +43 -0
- package/agents/guides/security/threat-modeling.md +46 -0
- package/agents/memory/AUDIT_LOG.md +48 -0
- package/agents/memory/CONTINUITY.md +49 -0
- package/agents/memory/PROJECT_STATE.md +134 -0
- package/agents/memory/RESUME_POINTER.md +15 -0
- package/agents/memory/episodic/DECISION_LOG_TEMPLATE.md +104 -0
- package/agents/memory/semantic/PROJECT_KNOWLEDGE_TEMPLATE.md +194 -0
- package/agents/memory/semantic/VECTOR_DB_CONFIG_TEMPLATE.json +46 -0
- package/agents/personas/00-index.md +148 -0
- package/agents/personas/biz-compliance.md +112 -0
- package/agents/personas/biz-legal.md +131 -0
- package/agents/personas/eng-api.md +110 -0
- package/agents/personas/eng-backend.md +113 -0
- package/agents/personas/eng-data.md +50 -0
- package/agents/personas/eng-database.md +95 -0
- package/agents/personas/eng-frontend.md +75 -0
- package/agents/personas/eng-infra.md +105 -0
- package/agents/personas/eng-messaging.md +50 -0
- package/agents/personas/eng-ml.md +50 -0
- package/agents/personas/eng-mobile.md +75 -0
- package/agents/personas/eng-perf.md +90 -0
- package/agents/personas/eng-qa.md +125 -0
- package/agents/personas/eng-tooling.md +49 -0
- package/agents/personas/ops-compliance.md +109 -0
- package/agents/personas/ops-cost.md +92 -0
- package/agents/personas/ops-devops.md +85 -0
- package/agents/personas/ops-incident.md +123 -0
- package/agents/personas/ops-monitor.md +89 -0
- package/agents/personas/ops-release.md +91 -0
- package/agents/personas/ops-security.md +104 -0
- package/agents/personas/ops-sre.md +85 -0
- package/agents/personas/orch-coordinator.md +140 -0
- package/agents/personas/orch-judge.md +135 -0
- package/agents/personas/orch-planner.md +114 -0
- package/agents/personas/orch-researcher.md +165 -0
- package/agents/personas/prod-architect.md +110 -0
- package/agents/personas/prod-design.md +112 -0
- package/agents/personas/prod-ethicist.md +50 -0
- package/agents/personas/prod-integration.md +120 -0
- package/agents/personas/prod-pm.md +115 -0
- package/agents/personas/prod-product-ops.md +128 -0
- package/agents/personas/prod-research.md +49 -0
- package/agents/personas/prod-safety-engineer.md +28 -0
- package/agents/personas/prod-tech-lead.md +119 -0
- package/agents/personas/ui-design.md +81 -0
- package/agents/scripts/check_skills_docs.py +120 -0
- package/agents/scripts/compile_skills.py +284 -0
- package/agents/scripts/comprehensive_checker.py +187 -0
- package/agents/scripts/dump-context.sh +37 -0
- package/agents/scripts/eval_skills.py +268 -0
- package/agents/scripts/preflight_summary.sh +80 -0
- package/agents/scripts/report_duplicates.py +125 -0
- package/agents/scripts/setup-context.ps1 +250 -0
- package/agents/scripts/setup-context.sh +398 -0
- package/agents/scripts/state_export.sh +84 -0
- package/agents/scripts/state_import.sh +99 -0
- package/agents/scripts/validate_integrity.py +98 -0
- package/agents/scripts/validate_links.py +96 -0
- package/agents/scripts/validate_methodology_graph.py +194 -0
- package/agents/scripts/validate_skills.py +81 -0
- package/agents/scripts/verify_e2e_init_flows.py +246 -0
- package/agents/scripts/verify_setup_simulation.py +104 -0
- package/agents/scripts/verify_triggers_and_mcps.py +159 -0
- package/agents/scripts/verify_use_cases.py +498 -0
- package/agents/skills/00-index.md +322 -0
- package/agents/skills/ai/a2ui-protocols.skill.md +31 -0
- package/agents/skills/ai/actor-agent-frameworks.skill.md +31 -0
- package/agents/skills/ai/agent-communication.skill.md +36 -0
- package/agents/skills/ai/agent-ui.skill.md +31 -0
- package/agents/skills/ai/autonomous-swarm-patterns.skill.md +31 -0
- package/agents/skills/ai/beyond-llms.skill.md +31 -0
- package/agents/skills/ai/context-engineering.skill.md +79 -0
- package/agents/skills/ai/llm-as-judge.skill.md +97 -0
- package/agents/skills/ai/multi-agent-systems.skill.md +31 -0
- package/agents/skills/ai/rag-evaluation.skill.md +93 -0
- package/agents/skills/ai/reasoning-patterns.skill.md +125 -0
- package/agents/skills/architecture/adaptive-architecture.skill.md +51 -0
- package/agents/skills/architecture/api-design.skill.md +92 -0
- package/agents/skills/architecture/api-standards.skill.md +31 -0
- package/agents/skills/architecture/arch-debt.skill.md +180 -0
- package/agents/skills/architecture/arch-design.skill.md +304 -0
- package/agents/skills/architecture/arch-patterns.skill.md +52 -0
- package/agents/skills/architecture/arch-review.skill.md +326 -0
- package/agents/skills/architecture/architecture-governance.skill.md +62 -0
- package/agents/skills/architecture/attribute-driven-design.skill.md +108 -0
- package/agents/skills/architecture/blockchain-dlt.skill.md +28 -0
- package/agents/skills/architecture/compatibility-design.skill.md +51 -0
- package/agents/skills/architecture/critical-systems-arch.skill.md +31 -0
- package/agents/skills/architecture/design-patterns.skill.md +59 -0
- package/agents/skills/architecture/diagramming.skill.md +380 -0
- package/agents/skills/architecture/domain-model.skill.md +294 -0
- package/agents/skills/architecture/enterprise-migration-scenario.skill.md +31 -0
- package/agents/skills/architecture/enterprise-patterns.skill.md +31 -0
- package/agents/skills/architecture/error-handling-strategy.skill.md +58 -0
- package/agents/skills/architecture/event-driven-architecture.skill.md +31 -0
- package/agents/skills/architecture/event-governance.skill.md +55 -0
- package/agents/skills/architecture/fitness-functions.skill.md +111 -0
- package/agents/skills/architecture/graphql-schema.skill.md +64 -0
- package/agents/skills/architecture/legacy-modernization.skill.md +51 -0
- package/agents/skills/architecture/microservices.skill.md +31 -0
- package/agents/skills/architecture/middleware-design.skill.md +59 -0
- package/agents/skills/architecture/monolith.skill.md +31 -0
- package/agents/skills/architecture/realtime-comm.skill.md +52 -0
- package/agents/skills/architecture/state-management.skill.md +72 -0
- package/agents/skills/architecture/system-qualities.skill.md +31 -0
- package/agents/skills/architecture/system-scalability.skill.md +31 -0
- package/agents/skills/architecture/systems-architecture.skill.md +31 -0
- package/agents/skills/architecture/visual-whiteboarding.skill.md +33 -0
- package/agents/skills/brain/README.md +70 -0
- package/agents/skills/brain/active-inference.skill.md +74 -0
- package/agents/skills/brain/brain-mode.skill.md +125 -0
- package/agents/skills/brain/cognitive-architectures.skill.md +53 -0
- package/agents/skills/brain/cognitive-testing.skill.md +62 -0
- package/agents/skills/brain/consciousness-loop.skill.md +68 -0
- package/agents/skills/brain/cost-benefit-router.skill.md +89 -0
- package/agents/skills/brain/episodic-consolidation.skill.md +43 -0
- package/agents/skills/brain/epistemology-knowledge.skill.md +54 -0
- package/agents/skills/brain/global-workspace.skill.md +77 -0
- package/agents/skills/brain/learning-adaptation.skill.md +68 -0
- package/agents/skills/brain/loki-mode.skill.md +267 -0
- package/agents/skills/brain/neuroscience-foundations.skill.md +52 -0
- package/agents/skills/brain/scripts/active_inference_loop.py +92 -0
- package/agents/skills/brain/scripts/cognition_test.py +80 -0
- package/agents/skills/brain/scripts/global_workspace.py +104 -0
- package/agents/skills/brain/self-improvement.skill.md +80 -0
- package/agents/skills/brain/sensory-motor.skill.md +61 -0
- package/agents/skills/brain/sequential-thinking.skill.md +48 -0
- package/agents/skills/brain/working-memory.skill.md +47 -0
- package/agents/skills/coding/agent-trajectory-eval.skill.md +92 -0
- package/agents/skills/coding/artisan-commands.skill.md +52 -0
- package/agents/skills/coding/browser-tdd.skill.md +131 -0
- package/agents/skills/coding/chaos-fault-injection.skill.md +116 -0
- package/agents/skills/coding/ci-autofix.skill.md +53 -0
- package/agents/skills/coding/clean-coder.skill.md +58 -0
- package/agents/skills/coding/code-review.skill.md +100 -0
- package/agents/skills/coding/debug.skill.md +100 -0
- package/agents/skills/coding/documentation.skill.md +149 -0
- package/agents/skills/coding/eval-driven-development.skill.md +107 -0
- package/agents/skills/coding/evals/code-review.eval.yaml +29 -0
- package/agents/skills/coding/excalidraw.skill.md +90 -0
- package/agents/skills/coding/file-processing.skill.md +55 -0
- package/agents/skills/coding/git-workflow.skill.md +153 -0
- package/agents/skills/coding/metamorphic-testing.skill.md +113 -0
- package/agents/skills/coding/mobile-dev.skill.md +41 -0
- package/agents/skills/coding/nodejs-expert.skill.md +23 -0
- package/agents/skills/coding/output-validation.skill.md +57 -0
- package/agents/skills/coding/pbt-strategy.skill.md +117 -0
- package/agents/skills/coding/performant-ai.skill.md +62 -0
- package/agents/skills/coding/performant-go.skill.md +61 -0
- package/agents/skills/coding/performant-laravel.skill.md +70 -0
- package/agents/skills/coding/performant-nodejs.skill.md +67 -0
- package/agents/skills/coding/performant-php.skill.md +53 -0
- package/agents/skills/coding/performant-python.skill.md +62 -0
- package/agents/skills/coding/refactor.skill.md +124 -0
- package/agents/skills/coding/secure-coding.skill.md +57 -0
- package/agents/skills/coding/sketch-to-diagram.skill.md +106 -0
- package/agents/skills/coding/spec-driven-development.skill.md +110 -0
- package/agents/skills/coding/tdd-cycle.skill.md +92 -0
- package/agents/skills/coding/testing-strategy.skill.md +74 -0
- package/agents/skills/coding/time-complexity.skill.md +112 -0
- package/agents/skills/coding/tldraw-canvas.skill.md +109 -0
- package/agents/skills/coding/tool-construction.skill.md +47 -0
- package/agents/skills/coding/ui-gen.skill.md +64 -0
- package/agents/skills/coding/vibe-coding.skill.md +63 -0
- package/agents/skills/coding/visual-design.skill.md +65 -0
- package/agents/skills/coordination/agent-interop.skill.md +72 -0
- package/agents/skills/coordination/agent-protocol.skill.md +62 -0
- package/agents/skills/coordination/agent-workflow-patterns.skill.md +123 -0
- package/agents/skills/coordination/agentic-linter.skill.md +134 -0
- package/agents/skills/coordination/agentic-patterns.skill.md +79 -0
- package/agents/skills/coordination/meta-optimize.skill.md +62 -0
- package/agents/skills/coordination/meta-prompting.skill.md +46 -0
- package/agents/skills/coordination/multi-agent-orch.skill.md +78 -0
- package/agents/skills/coordination/persona-selector.skill.md +78 -0
- package/agents/skills/coordination/self-optimize.skill.md +81 -0
- package/agents/skills/coordination/swarm-consensus.skill.md +52 -0
- package/agents/skills/core/agent-analytics.skill.md +74 -0
- package/agents/skills/core/audit-trail.skill.md +122 -0
- package/agents/skills/core/clarify.skill.md +89 -0
- package/agents/skills/core/emerging-tech.skill.md +52 -0
- package/agents/skills/core/empirical-methods.skill.md +101 -0
- package/agents/skills/core/evals/clarify.eval.yaml +29 -0
- package/agents/skills/core/evals/integrity-check.eval.yaml +23 -0
- package/agents/skills/core/evals/research.eval.yaml +23 -0
- package/agents/skills/core/final-review.skill.md +66 -0
- package/agents/skills/core/integrity-check.skill.md +149 -0
- package/agents/skills/core/knowledge-connect.skill.md +77 -0
- package/agents/skills/core/knowledge-gap.skill.md +123 -0
- package/agents/skills/core/preflight.skill.md +106 -0
- package/agents/skills/core/research.skill.md +107 -0
- package/agents/skills/core/retrospective.skill.md +59 -0
- package/agents/skills/core/sdlc-checkpoint.skill.md +151 -0
- package/agents/skills/core/self-heal.skill.md +163 -0
- package/agents/skills/core/session-resume.skill.md +125 -0
- package/agents/skills/core/skills-registry.skill.md +65 -0
- package/agents/skills/core/state-portability.skill.md +89 -0
- package/agents/skills/core/state-preserve.skill.md +76 -0
- package/agents/skills/core/system-lifecycle.skill.md +51 -0
- package/agents/skills/core/update-scan.skill.md +92 -0
- package/agents/skills/data/data-engineering.skill.md +56 -0
- package/agents/skills/data/data-governance.skill.md +49 -0
- package/agents/skills/data/db-migration.skill.md +136 -0
- package/agents/skills/data/semantic-web.skill.md +28 -0
- package/agents/skills/data/sql-optimization.skill.md +78 -0
- package/agents/skills/industry/engineering-standards.skill.md +31 -0
- package/agents/skills/industry/global-standards.skill.md +30 -0
- package/agents/skills/industry/healthcare-fhir.skill.md +28 -0
- package/agents/skills/industry/industrial-iot.skill.md +30 -0
- package/agents/skills/industry/telecom-networks.skill.md +30 -0
- package/agents/skills/ops/caching-strategy.skill.md +77 -0
- package/agents/skills/ops/capacity-planning.skill.md +67 -0
- package/agents/skills/ops/cloud-deploy.skill.md +55 -0
- package/agents/skills/ops/configuration-management.skill.md +107 -0
- package/agents/skills/ops/cost-optimization.skill.md +39 -0
- package/agents/skills/ops/decommission-sunset.skill.md +64 -0
- package/agents/skills/ops/dependency-lifecycle.skill.md +63 -0
- package/agents/skills/ops/deployment.skill.md +217 -0
- package/agents/skills/ops/dev-environments.skill.md +31 -0
- package/agents/skills/ops/dev-workflow.skill.md +28 -0
- package/agents/skills/ops/docker-dev.skill.md +52 -0
- package/agents/skills/ops/enterprise-integration.skill.md +53 -0
- package/agents/skills/ops/feature-flag-management.skill.md +59 -0
- package/agents/skills/ops/incident-response.skill.md +40 -0
- package/agents/skills/ops/infra-devops.skill.md +53 -0
- package/agents/skills/ops/k8s-dev.skill.md +51 -0
- package/agents/skills/ops/memory-optimization.skill.md +45 -0
- package/agents/skills/ops/observability-stack-setup.skill.md +62 -0
- package/agents/skills/ops/performance-audit.skill.md +178 -0
- package/agents/skills/ops/performance-optimization.skill.md +51 -0
- package/agents/skills/ops/production-health.skill.md +85 -0
- package/agents/skills/ops/production-verifier.skill.md +50 -0
- package/agents/skills/ops/queue-management.skill.md +52 -0
- package/agents/skills/ops/release-management.skill.md +39 -0
- package/agents/skills/ops/release-validation.skill.md +51 -0
- package/agents/skills/ops/reliability-sre.skill.md +51 -0
- package/agents/skills/ops/runbook-authoring.skill.md +64 -0
- package/agents/skills/ops/system-benchmark.skill.md +69 -0
- package/agents/skills/ops/tech-debt.skill.md +143 -0
- package/agents/skills/ops/troubleshooting-guide.skill.md +31 -0
- package/agents/skills/product/accessibility.skill.md +143 -0
- package/agents/skills/product/adr-writer.skill.md +110 -0
- package/agents/skills/product/business-case.skill.md +70 -0
- package/agents/skills/product/change-management.skill.md +90 -0
- package/agents/skills/product/decompose.skill.md +75 -0
- package/agents/skills/product/design-thinking.skill.md +62 -0
- package/agents/skills/product/estimation-sizing.skill.md +87 -0
- package/agents/skills/product/evals/spec-writer.eval.yaml +22 -0
- package/agents/skills/product/financial-governance.skill.md +88 -0
- package/agents/skills/product/green-software.skill.md +46 -0
- package/agents/skills/product/ideation-facilitation.skill.md +87 -0
- package/agents/skills/product/market-analysis.skill.md +56 -0
- package/agents/skills/product/opportunity-assessment.skill.md +89 -0
- package/agents/skills/product/product-analytics.skill.md +92 -0
- package/agents/skills/product/professional-practice.skill.md +105 -0
- package/agents/skills/product/req-elicitation.skill.md +292 -0
- package/agents/skills/product/req-review.skill.md +280 -0
- package/agents/skills/product/spec-analyze.skill.md +98 -0
- package/agents/skills/product/spec-writer.skill.md +114 -0
- package/agents/skills/product/stakeholder-management.skill.md +54 -0
- package/agents/skills/product/sustainability-checks.skill.md +29 -0
- package/agents/skills/product/systems-thinking.skill.md +56 -0
- package/agents/skills/product/user-research-synthesis.skill.md +85 -0
- package/agents/skills/product/user-story-mapping.skill.md +54 -0
- package/agents/skills/product/visual-specs.skill.md +112 -0
- package/agents/skills/security/access-control.skill.md +45 -0
- package/agents/skills/security/agent-sandboxing.skill.md +69 -0
- package/agents/skills/security/ai-ethics-compliance.skill.md +46 -0
- package/agents/skills/security/ai-red-teaming.skill.md +74 -0
- package/agents/skills/security/ai-safety-guardrails.skill.md +60 -0
- package/agents/skills/security/api-security.skill.md +31 -0
- package/agents/skills/security/backup-recovery.skill.md +49 -0
- package/agents/skills/security/compliance-review.skill.md +152 -0
- package/agents/skills/security/cryptography-standards.skill.md +31 -0
- package/agents/skills/security/dependency-security.skill.md +47 -0
- package/agents/skills/security/hazard-analysis.skill.md +53 -0
- package/agents/skills/security/legal-review.skill.md +41 -0
- package/agents/skills/security/log-analysis.skill.md +68 -0
- package/agents/skills/security/network-security.skill.md +64 -0
- package/agents/skills/security/privacy-audit.skill.md +137 -0
- package/agents/skills/security/privacy-data-protection.skill.md +31 -0
- package/agents/skills/security/prompt-injection-defense.skill.md +67 -0
- package/agents/skills/security/reliability-engineering.skill.md +47 -0
- package/agents/skills/security/safety-scan.skill.md +49 -0
- package/agents/skills/security/secrets-management.skill.md +65 -0
- package/agents/skills/security/secure-architecture.skill.md +31 -0
- package/agents/skills/security/security-audit.skill.md +164 -0
- package/agents/skills/security/threat-model.skill.md +120 -0
- package/agents/skills/security/traceability-audit.skill.md +48 -0
- package/agents/templates/00-index.md +162 -0
- package/agents/templates/architecture/ADAPTIVE_SYSTEM_TEMPLATE.md +35 -0
- package/agents/templates/architecture/ADD_WORKBOOK_TEMPLATE.md +81 -0
- package/agents/templates/architecture/ADR_TEMPLATE.md +136 -0
- package/agents/templates/architecture/ARCHITECTURE_DECISION_MATRIX.md +169 -0
- package/agents/templates/architecture/ARCHITECTURE_REVIEW_TEMPLATE.md +241 -0
- package/agents/templates/architecture/ARCHITECTURE_VIEWS_TEMPLATE.md +353 -0
- package/agents/templates/architecture/ARCH_DECISION_FRAMEWORK.md +32 -0
- package/agents/templates/architecture/C4_ARCHITECTURE_TEMPLATE.md +185 -0
- package/agents/templates/architecture/CAPABILITY_MAP_TEMPLATE.md +153 -0
- package/agents/templates/architecture/CONTEXT_MAP_TEMPLATE.md +196 -0
- package/agents/templates/architecture/DESIGN_PATTERN_USAGE.md +24 -0
- package/agents/templates/architecture/DOMAIN_MODEL_TEMPLATE.md +254 -0
- package/agents/templates/architecture/FITNESS_FUNCTION_TEMPLATE.md +59 -0
- package/agents/templates/architecture/INTEGRATION_SPEC_TEMPLATE.md +38 -0
- package/agents/templates/architecture/LEGACY_AUDIT_TEMPLATE.md +34 -0
- package/agents/templates/architecture/QUALITY_ATTRIBUTES_TEMPLATE.md +210 -0
- package/agents/templates/architecture/SCALABILITY_ANALYSIS_TEMPLATE.md +46 -0
- package/agents/templates/architecture/SMART_CONTRACT_TEMPLATE.md +44 -0
- package/agents/templates/architecture/SYSTEM_CONTEXT_TEMPLATE.md +197 -0
- package/agents/templates/brain/ACTIVE_INFERENCE_LOOP_TEMPLATE.md +42 -0
- package/agents/templates/brain/EPISODIC_MEMORY_LOG_TEMPLATE.md +28 -0
- package/agents/templates/brain/GLOBAL_WORKSPACE_CONFIG_TEMPLATE.md +44 -0
- package/agents/templates/brain/KNOWLEDGE_MAP_TEMPLATE.md +53 -0
- package/agents/templates/brain/OODA_LOOP_TRACE_TEMPLATE.md +44 -0
- package/agents/templates/brain/PREDICTION_ERROR_LOG_TEMPLATE.md +33 -0
- package/agents/templates/brain/PROJECT_CONTEXT_TEMPLATE.md +36 -0
- package/agents/templates/brain/SELF_IMPROVEMENT_LOG_TEMPLATE.md +39 -0
- package/agents/templates/brain/WORKING_MEMORY_TEMPLATE.md +34 -0
- package/agents/templates/coding/CLEAN_CODE_CHECKLIST.md +30 -0
- package/agents/templates/coding/DESIGN_TOKENS_TEMPLATE.json +54 -0
- package/agents/templates/coding/DEVCONTAINER_TEMPLATE.json +42 -0
- package/agents/templates/coding/DEV_SPACE_TEMPLATE.yaml +48 -0
- package/agents/templates/coding/E2E_TEST_SUITE_TEMPLATE.md +36 -0
- package/agents/templates/coding/EVAL_PLAN_TEMPLATE.md +85 -0
- package/agents/templates/coding/EVAL_RUBRIC_TEMPLATE.md +57 -0
- package/agents/templates/coding/GOLDEN_DATASET_TEMPLATE.md +73 -0
- package/agents/templates/coding/PROPERTY_TEST_CHECKLIST.md +77 -0
- package/agents/templates/coding/SKETCH_TO_DIAGRAM_TEMPLATE.md +56 -0
- package/agents/templates/coding/TEST_CASE_TEMPLATE.md +28 -0
- package/agents/templates/coding/TEST_PLAN_TEMPLATE.md +36 -0
- package/agents/templates/coding/TIME_COMPLEXITY_REPORT_TEMPLATE.md +61 -0
- package/agents/templates/coordination/AGENTS_TEMPLATE.md +540 -0
- package/agents/templates/coordination/AGENT_HANDSHAKE_TEMPLATE.json +37 -0
- package/agents/templates/coordination/AGENT_PROFILE_TEMPLATE.md +28 -0
- package/agents/templates/coordination/SWARM_ARCHITECTURE_TEMPLATE.md +53 -0
- package/agents/templates/coordination/SWARM_CONFIG_TEMPLATE.json +45 -0
- package/agents/templates/core/AUDIT_LOG_TEMPLATE.md +75 -0
- package/agents/templates/core/BUG_REPORT_TEMPLATE.md +136 -0
- package/agents/templates/core/DEPENDENCY_GRAPH_TEMPLATE.md +63 -0
- package/agents/templates/core/ESTIMATION_TEMPLATE.md +70 -0
- package/agents/templates/core/MCP_CONFIG_TEMPLATE.json +807 -0
- package/agents/templates/core/PLAN_TEMPLATE.md +162 -0
- package/agents/templates/core/PROJECT_RETROSPECTIVE_TEMPLATE.md +67 -0
- package/agents/templates/core/SDLC_TRACKER.md +217 -0
- package/agents/templates/core/SESSION_SNAPSHOT_TEMPLATE.md +168 -0
- package/agents/templates/core/SYSTEM_ANALYSIS_TEMPLATE.md +52 -0
- package/agents/templates/core/TASKS_TEMPLATE.md +104 -0
- package/agents/templates/core/TRACEABILITY_MATRIX_TEMPLATE.md +18 -0
- package/agents/templates/core/WHITEBOARD_DESIGN_TEMPLATE.md +46 -0
- package/agents/templates/data/DATABASE_SCHEMA_TEMPLATE.md +38 -0
- package/agents/templates/data/DATA_PIPELINE_TEMPLATE.md +44 -0
- package/agents/templates/data/ONTOLOGY_TEMPLATE.md +52 -0
- package/agents/templates/industry/ENGINEERING_STANDARDS_REVIEW_TEMPLATE.md +43 -0
- package/agents/templates/industry/FHIR_INTEGRATION_TEMPLATE.md +53 -0
- package/agents/templates/industry/GLOBAL_STANDARDS_AUDIT_TEMPLATE.md +45 -0
- package/agents/templates/industry/IOT_TELEMETRY_TEMPLATE.md +59 -0
- package/agents/templates/industry/TELECOM_API_TEMPLATE.md +50 -0
- package/agents/templates/ops/BENCHMARK_REPORT_TEMPLATE.md +48 -0
- package/agents/templates/ops/CAPACITY_PLAN_TEMPLATE.md +41 -0
- package/agents/templates/ops/COST_OPTIMIZATION_REPORT_TEMPLATE.md +40 -0
- package/agents/templates/ops/DECOMMISSION_PLAN_TEMPLATE.md +102 -0
- package/agents/templates/ops/DEPLOY_CONFIG_TEMPLATE.md +88 -0
- package/agents/templates/ops/INCIDENT_POSTMORTEM_TEMPLATE.md +39 -0
- package/agents/templates/ops/INFRA_PLAN_TEMPLATE.md +37 -0
- package/agents/templates/ops/RELEASE_READINESS_REPORT.md +35 -0
- package/agents/templates/ops/RUNBOOK_TEMPLATE.md +103 -0
- package/agents/templates/ops/TECH_DEBT_TEMPLATE.md +102 -0
- package/agents/templates/product/BUSINESS_CASE_TEMPLATE.md +42 -0
- package/agents/templates/product/CHANGE_MANAGEMENT_PLAN_TEMPLATE.md +68 -0
- package/agents/templates/product/EMPATHY_MAP_TEMPLATE.md +47 -0
- package/agents/templates/product/EXPERIMENT_PLAN_TEMPLATE.md +84 -0
- package/agents/templates/product/GREEN_SOFTWARE_REPORT_TEMPLATE.md +42 -0
- package/agents/templates/product/IDEATION_LOG_TEMPLATE.md +42 -0
- package/agents/templates/product/NFR_TEMPLATE.md +31 -0
- package/agents/templates/product/PRD_TEMPLATE.md +222 -0
- package/agents/templates/product/PROBLEM_STATEMENT_TEMPLATE.md +32 -0
- package/agents/templates/product/REQUIREMENTS_REVIEW_TEMPLATE.md +173 -0
- package/agents/templates/product/SPEC_TEMPLATE.md +259 -0
- package/agents/templates/product/STAKEHOLDER_REGISTER_TEMPLATE.md +127 -0
- package/agents/templates/product/USER_STORY_MAP_TEMPLATE.md +35 -0
- package/agents/templates/product/VISUAL_SPEC_PACKAGE_TEMPLATE.md +207 -0
- package/agents/templates/security/DATASHEET_TEMPLATE.md +95 -0
- package/agents/templates/security/ETHICAL_IMPACT_ASSESSMENT.md +32 -0
- package/agents/templates/security/HAZARD_LOG.md +17 -0
- package/agents/templates/security/MODEL_CARD_TEMPLATE.md +120 -0
- package/agents/templates/security/SAFETY_CASE.md +39 -0
- package/agents/templates/security/SAFETY_POLICY.md +25 -0
- package/agents/templates/security/SECURITY_CHECKLIST.md +157 -0
- package/agents/templates/security/SYSTEM_CARD_TEMPLATE.md +139 -0
- package/agents/templates/security/THREAT_MODEL_TEMPLATE.md +171 -0
- package/bin/install.js +572 -0
- package/docs/CLI_REFERENCE.md +527 -0
- package/docs/INSTALL.md +68 -0
- package/docs/MCP_CONFIGURATIONS.md +1765 -0
- package/docs/PLATFORM_CONTROLS.md +324 -0
- package/docs/POST_INSTALL.md +75 -0
- package/docs/QUICK_COMMANDS.md +131 -0
- package/docs/QUICK_GUIDE.md +914 -0
- package/docs/README_FULL.md +1451 -0
- package/docs/SCHEMA.md +164 -0
- package/docs/V1_RELEASE_CHECKLIST.md +144 -0
- package/docs/VERIFICATION_GUIDE.md +283 -0
- package/docs/adr/0001-record-architecture-decisions.md +26 -0
- package/docs/adr/0002-brain-active-inference-runtime.md +27 -0
- package/docs/adr/0003-additive-only-emitter-schema-evolution.md +33 -0
- package/docs/assets/GABBE.png +0 -0
- package/docs/gabbe.config.example.json +9 -0
- package/docs/reports/duplication-report.md +30 -0
- package/install.ps1 +90 -0
- package/install.sh +89 -0
- package/package.json +49 -0
- package/scripts/init.py +1036 -0
package/scripts/init.py
ADDED
|
@@ -0,0 +1,1036 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import json
|
|
4
|
+
import os
|
|
5
|
+
import shutil
|
|
6
|
+
import sys
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Any
|
|
9
|
+
|
|
10
|
+
# --- Configuration ---
|
|
11
|
+
# KIT_SOURCE: Where the script and correct agents folder currently live
|
|
12
|
+
KIT_SOURCE = Path(__file__).parent.parent.absolute()
|
|
13
|
+
SOURCE_AGENTS_DIR = KIT_SOURCE / "agents"
|
|
14
|
+
|
|
15
|
+
# PROJECT_ROOT: Where the user is running the script from (the project they want to configure)
|
|
16
|
+
PROJECT_ROOT = Path.cwd()
|
|
17
|
+
|
|
18
|
+
# Colors
|
|
19
|
+
GREEN = "\033[0;32m"
|
|
20
|
+
YELLOW = "\033[1;33m"
|
|
21
|
+
BLUE = "\033[0;34m"
|
|
22
|
+
RED = "\033[0;31m"
|
|
23
|
+
NC = "\033[0m"
|
|
24
|
+
|
|
25
|
+
# --- Knowledge Base (Dynamic Discovery) ---
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def build_tech_map_from_skills(agents_dir):
|
|
29
|
+
"""
|
|
30
|
+
Scans all .skill.md files in agents_dir/skills and builds a TECH_MAP
|
|
31
|
+
based on the 'tags' frontmatter field.
|
|
32
|
+
"""
|
|
33
|
+
tech_map = {}
|
|
34
|
+
skills_dir = agents_dir / "skills"
|
|
35
|
+
|
|
36
|
+
if not skills_dir.exists():
|
|
37
|
+
return tech_map
|
|
38
|
+
|
|
39
|
+
for skill_file in skills_dir.rglob("*.skill.md"):
|
|
40
|
+
try:
|
|
41
|
+
content = skill_file.read_text()
|
|
42
|
+
meta, _ = ensure_yaml_frontmatter(content, skill_file.name)
|
|
43
|
+
|
|
44
|
+
# Get tags (list of strings)
|
|
45
|
+
tags = meta.get("tags", [])
|
|
46
|
+
# Also support 'tech' or 'stack' as aliases
|
|
47
|
+
if not tags:
|
|
48
|
+
tags = meta.get("tech", [])
|
|
49
|
+
if not tags:
|
|
50
|
+
tags = meta.get("stack", [])
|
|
51
|
+
|
|
52
|
+
# Normalize to list
|
|
53
|
+
if isinstance(tags, str):
|
|
54
|
+
# Remove brackets first if present
|
|
55
|
+
tags = tags.strip("[]")
|
|
56
|
+
tags = [t.strip() for t in tags.split(",")]
|
|
57
|
+
|
|
58
|
+
skill_name = meta.get("name", skill_file.stem.replace(".skill", ""))
|
|
59
|
+
|
|
60
|
+
for tag in tags:
|
|
61
|
+
tag = tag.lower().strip()
|
|
62
|
+
if tag not in tech_map:
|
|
63
|
+
tech_map[tag] = {"skills": [], "guides": [], "templates": []}
|
|
64
|
+
|
|
65
|
+
if skill_name not in tech_map[tag]["skills"]:
|
|
66
|
+
tech_map[tag]["skills"].append(skill_name)
|
|
67
|
+
|
|
68
|
+
except Exception:
|
|
69
|
+
# print(f"Warning: Failed to parse {skill_file.name}: {e}")
|
|
70
|
+
pass
|
|
71
|
+
|
|
72
|
+
# Hardcoded Guides/Templates mapping (logic removed as unused)
|
|
73
|
+
|
|
74
|
+
return tech_map
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Initial placeholders - will be populated in main()
|
|
78
|
+
TECH_MAP: dict[str, Any] = {}
|
|
79
|
+
|
|
80
|
+
# --- Helper Functions ---
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def clear_screen():
|
|
84
|
+
os.system("cls" if os.name == "nt" else "clear")
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def print_header():
|
|
88
|
+
print(f"{BLUE}" + "=" * 60 + f"{NC}")
|
|
89
|
+
print(f"{BLUE}🤖 Agentic Engineering Kit - Setup & Install Wizard v2.2{NC}")
|
|
90
|
+
print(f"{BLUE}" + "=" * 60 + f"{NC}")
|
|
91
|
+
print("This script will:")
|
|
92
|
+
print(" 1. Install the Kit (Locally or Globally)")
|
|
93
|
+
print(" 2. Configure Project Identity, Stack, & Type (Legacy/Enterprise)")
|
|
94
|
+
print(" 3. Wire up AI tools & MCPs")
|
|
95
|
+
print(" 4. Generate a 'Research Mission' for your AI")
|
|
96
|
+
print()
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def ask(question, default=None):
|
|
100
|
+
prompt = f"{question}"
|
|
101
|
+
if default:
|
|
102
|
+
prompt += f" [{default}]"
|
|
103
|
+
prompt += ": "
|
|
104
|
+
response = input(prompt).strip()
|
|
105
|
+
return response if response else default
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def select_index(question, options):
|
|
109
|
+
print(f"\n{question}")
|
|
110
|
+
for i, opt in enumerate(options):
|
|
111
|
+
print(f" {i + 1}) {opt}")
|
|
112
|
+
while True:
|
|
113
|
+
choice = input(f"Select (1-{len(options)}): ").strip()
|
|
114
|
+
if choice.isdigit():
|
|
115
|
+
idx = int(choice) - 1
|
|
116
|
+
if 0 <= idx < len(options):
|
|
117
|
+
return idx
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
def select(question, options):
|
|
121
|
+
idx = select_index(question, options)
|
|
122
|
+
return options[idx]
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def ask_multiselect(question, options):
|
|
126
|
+
print(f"\n{question} (comma separated, e.g. 1,3)")
|
|
127
|
+
for i, opt in enumerate(options):
|
|
128
|
+
print(f" {i + 1}) {opt}")
|
|
129
|
+
choice = input("Select: ").strip()
|
|
130
|
+
selected = []
|
|
131
|
+
if not choice:
|
|
132
|
+
return selected
|
|
133
|
+
try:
|
|
134
|
+
indices = [int(x.strip()) - 1 for x in choice.split(",") if x.strip().isdigit()]
|
|
135
|
+
for idx in indices:
|
|
136
|
+
if 0 <= idx < len(options):
|
|
137
|
+
selected.append(options[idx])
|
|
138
|
+
except Exception:
|
|
139
|
+
pass
|
|
140
|
+
return selected
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
def safe_merge_directory(src_root, dst_root, is_kit_root=False):
|
|
144
|
+
PRESERVE_FILES = {"AGENTS.md", "CONSTITUTION.md", "TASKS.md", "policies.yml", "config.json"}
|
|
145
|
+
notified_preservations = set()
|
|
146
|
+
|
|
147
|
+
for src_dir, dirs, files in os.walk(src_root):
|
|
148
|
+
rel_path = os.path.relpath(src_dir, src_root)
|
|
149
|
+
dst_dir = Path(dst_root) / (rel_path if rel_path != "." else "")
|
|
150
|
+
|
|
151
|
+
dst_dir.mkdir(parents=True, exist_ok=True)
|
|
152
|
+
in_memory = "memory" in Path(rel_path).parts
|
|
153
|
+
in_project = "project" in Path(rel_path).parts
|
|
154
|
+
|
|
155
|
+
for file_ in files:
|
|
156
|
+
src_file = Path(src_dir) / file_
|
|
157
|
+
dst_file = dst_dir / file_
|
|
158
|
+
|
|
159
|
+
preserve = False
|
|
160
|
+
# Honor the preserve-set unconditionally. Previously this only ran
|
|
161
|
+
# when is_kit_root=True, so the symlink-fallback path (is_kit_root
|
|
162
|
+
# defaults to False) clobbered existing user files. User content
|
|
163
|
+
# must never be overwritten regardless of how the merge was reached.
|
|
164
|
+
if dst_file.exists():
|
|
165
|
+
if in_memory:
|
|
166
|
+
preserve = True
|
|
167
|
+
elif in_project:
|
|
168
|
+
preserve = True
|
|
169
|
+
elif file_ in PRESERVE_FILES:
|
|
170
|
+
preserve = True
|
|
171
|
+
elif file_.startswith("PROJECT") and file_.endswith(".md"):
|
|
172
|
+
preserve = True
|
|
173
|
+
|
|
174
|
+
if preserve:
|
|
175
|
+
log_path = str(dst_file.relative_to(dst_root))
|
|
176
|
+
if in_memory:
|
|
177
|
+
log_path = "memory/*"
|
|
178
|
+
elif in_project:
|
|
179
|
+
log_path = "project/*"
|
|
180
|
+
if log_path not in notified_preservations:
|
|
181
|
+
print(
|
|
182
|
+
f" {YELLOW}→ Preserved user file(s): {log_path} (check kit templates to update manually){NC}"
|
|
183
|
+
)
|
|
184
|
+
notified_preservations.add(log_path)
|
|
185
|
+
continue
|
|
186
|
+
|
|
187
|
+
if dst_file.exists():
|
|
188
|
+
try:
|
|
189
|
+
dst_file.unlink()
|
|
190
|
+
except Exception:
|
|
191
|
+
pass
|
|
192
|
+
shutil.copy2(src_file, dst_file)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def create_symlink(source, target):
|
|
196
|
+
"""Creates a symlink from target to source, backing up if exists."""
|
|
197
|
+
if target.is_symlink():
|
|
198
|
+
target.unlink()
|
|
199
|
+
elif target.exists():
|
|
200
|
+
if target.is_dir():
|
|
201
|
+
print(
|
|
202
|
+
f" {YELLOW}! Backing up existing directory {target.name} to {target.name}.bak{NC}"
|
|
203
|
+
)
|
|
204
|
+
shutil.move(str(target), str(target) + ".bak")
|
|
205
|
+
else:
|
|
206
|
+
print(f" {YELLOW}! Backing up existing file {target.name} to {target.name}.bak{NC}")
|
|
207
|
+
target.rename(Path(str(target) + ".bak"))
|
|
208
|
+
|
|
209
|
+
# Ensure parent dir exists
|
|
210
|
+
target.parent.mkdir(parents=True, exist_ok=True)
|
|
211
|
+
|
|
212
|
+
# Calculate relative path if source is inside PROJECT_ROOT, else absolute
|
|
213
|
+
try:
|
|
214
|
+
source.absolute().relative_to(PROJECT_ROOT.resolve()) # raises ValueError if not inside
|
|
215
|
+
link_path = os.path.relpath(source, target.parent)
|
|
216
|
+
except ValueError:
|
|
217
|
+
link_path = source.absolute()
|
|
218
|
+
try:
|
|
219
|
+
os.symlink(link_path, target)
|
|
220
|
+
print(f" {GREEN}✓ Linked {target.name} -> {link_path}{NC}")
|
|
221
|
+
except OSError as e:
|
|
222
|
+
# Fallback for Windows (no admin rights) or restricted environments
|
|
223
|
+
print(f" {YELLOW}! Symlink failed ({e}), falling back to copy...{NC}")
|
|
224
|
+
try:
|
|
225
|
+
if source.is_dir():
|
|
226
|
+
safe_merge_directory(source, target)
|
|
227
|
+
else:
|
|
228
|
+
if target.exists():
|
|
229
|
+
target.unlink()
|
|
230
|
+
shutil.copy2(source, target)
|
|
231
|
+
print(f" {GREEN}✓ Copied {target.name} (Symlink fallback){NC}")
|
|
232
|
+
except Exception as e2:
|
|
233
|
+
print(f" {RED}x Failed to copy {target}: {e2}{NC}")
|
|
234
|
+
except Exception as e:
|
|
235
|
+
print(f" {RED}x Failed to link {target}: {e}{NC}")
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def ensure_yaml_frontmatter(content, filename):
|
|
239
|
+
"""Ensures content has valid YAML frontmatter using PyYAML. Returns (frontmatter_dict, content)."""
|
|
240
|
+
try:
|
|
241
|
+
import yaml
|
|
242
|
+
|
|
243
|
+
if content.startswith("---"):
|
|
244
|
+
end_yaml = content.find("---", 3)
|
|
245
|
+
if end_yaml != -1:
|
|
246
|
+
yaml_text = content[3:end_yaml]
|
|
247
|
+
data = yaml.safe_load(yaml_text)
|
|
248
|
+
if isinstance(data, dict):
|
|
249
|
+
return data, content
|
|
250
|
+
except ImportError:
|
|
251
|
+
print(f"{YELLOW}Warning: PyYAML not installed. Falling back to simple parsing.{NC}")
|
|
252
|
+
# Fallback to simple parser if PyYAML is missing (bootstrapping edge case)
|
|
253
|
+
if content.startswith("---"):
|
|
254
|
+
end_yaml = content.find("---", 3)
|
|
255
|
+
if end_yaml != -1:
|
|
256
|
+
yaml_text = content[3:end_yaml]
|
|
257
|
+
data = {}
|
|
258
|
+
for line in yaml_text.strip().split("\n"):
|
|
259
|
+
if ":" in line:
|
|
260
|
+
k, v = line.split(":", 1)
|
|
261
|
+
data[k.strip()] = v.strip().strip("\"'")
|
|
262
|
+
return data, content
|
|
263
|
+
except Exception:
|
|
264
|
+
# print(f"Warning: Failed to parse YAML for {filename}: {e}")
|
|
265
|
+
pass
|
|
266
|
+
|
|
267
|
+
# Default frontmatter if missing or failed
|
|
268
|
+
name = filename.replace(".skill.md", "").replace(".md", "").replace(".mdc", "")
|
|
269
|
+
frontmatter = f"""---
|
|
270
|
+
name: {name}
|
|
271
|
+
description: AI Skill for {name}
|
|
272
|
+
version: 1.0
|
|
273
|
+
author: GABBE-Kit
|
|
274
|
+
---
|
|
275
|
+
"""
|
|
276
|
+
return {"name": name}, frontmatter + content
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
def setup_skills_for_platform(platform, agents_dir, target_dir):
|
|
280
|
+
"""
|
|
281
|
+
Setup Skills for selected platform using the external compiler script.
|
|
282
|
+
"""
|
|
283
|
+
print(f"\n{BLUE}→ Setting up skills used by {platform}...{NC}")
|
|
284
|
+
|
|
285
|
+
# Use external script for skill compilation to ensure consistency with setup-context.sh
|
|
286
|
+
compile_script = agents_dir / "scripts" / "compile_skills.py"
|
|
287
|
+
if compile_script.exists():
|
|
288
|
+
try:
|
|
289
|
+
import subprocess
|
|
290
|
+
|
|
291
|
+
cmd = [
|
|
292
|
+
sys.executable,
|
|
293
|
+
str(compile_script),
|
|
294
|
+
"--platform",
|
|
295
|
+
platform,
|
|
296
|
+
"--skills-dir",
|
|
297
|
+
str(agents_dir / "skills"),
|
|
298
|
+
# For Cursor, target is .cursor/rules. For others, .github/skills usually.
|
|
299
|
+
# However, the init logic passes specific target_dir.
|
|
300
|
+
# We need to respect that or map it.
|
|
301
|
+
# compile_skills.py expects a specific structure for 'All' or specific for others.
|
|
302
|
+
# The arguments passed to this function in main() are:
|
|
303
|
+
# Cursor: cursor_rules_dir (.cursor/rules)
|
|
304
|
+
# VS Code: gh_dir / "skills" (.github/skills)
|
|
305
|
+
# Claude: .claude/skills (symlinked, so maybe skipped here or handled by script)
|
|
306
|
+
"--target-dir",
|
|
307
|
+
str(target_dir),
|
|
308
|
+
"--project-root",
|
|
309
|
+
str(PROJECT_ROOT),
|
|
310
|
+
]
|
|
311
|
+
subprocess.run(cmd, check=True)
|
|
312
|
+
print(f" {GREEN}✓ Processed skills for {platform}{NC}")
|
|
313
|
+
except Exception as e:
|
|
314
|
+
print(f"{RED}Error running skill compiler: {e}{NC}")
|
|
315
|
+
else:
|
|
316
|
+
print(f"{RED}Warning: compile_skills.py not found at {compile_script}{NC}")
|
|
317
|
+
# Fallback logic could go here, but we want to enforce the script usage.
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
# --- Main Logic ---
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
def run_bench():
|
|
324
|
+
"""R13: time a full skill-catalogue emit per platform (Pillar 8 regression
|
|
325
|
+
gate). Non-interactive; prints a JSON report and exits. Invoked with
|
|
326
|
+
`python scripts/init.py --bench`."""
|
|
327
|
+
import json as _json
|
|
328
|
+
import tempfile
|
|
329
|
+
import time
|
|
330
|
+
|
|
331
|
+
platforms = {
|
|
332
|
+
"cursor": "Cursor",
|
|
333
|
+
"copilot": "GitHub Copilot",
|
|
334
|
+
"claude": "Claude Code",
|
|
335
|
+
}
|
|
336
|
+
results = {}
|
|
337
|
+
skill_count = len(list((SOURCE_AGENTS_DIR / "skills").rglob("*.skill.md")))
|
|
338
|
+
for key, platform in platforms.items():
|
|
339
|
+
with tempfile.TemporaryDirectory(prefix=f"gabbe-bench-{key}-") as tmp:
|
|
340
|
+
target = Path(tmp) / "out"
|
|
341
|
+
t0 = time.perf_counter()
|
|
342
|
+
setup_skills_for_platform(platform, SOURCE_AGENTS_DIR, target)
|
|
343
|
+
results[key] = round(time.perf_counter() - t0, 4)
|
|
344
|
+
report = {"skill_count": skill_count, "emit_seconds": results}
|
|
345
|
+
print(_json.dumps(report, indent=2))
|
|
346
|
+
return report
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
def main():
|
|
350
|
+
global PROJECT_ROOT
|
|
351
|
+
if "--bench" in sys.argv:
|
|
352
|
+
run_bench()
|
|
353
|
+
return
|
|
354
|
+
if not SOURCE_AGENTS_DIR.exists():
|
|
355
|
+
if (KIT_SOURCE / "AGENTS.md").exists():
|
|
356
|
+
pass
|
|
357
|
+
else:
|
|
358
|
+
print(f"{RED}Error: Could not find source agents directory at {SOURCE_AGENTS_DIR}{NC}")
|
|
359
|
+
sys.exit(1)
|
|
360
|
+
|
|
361
|
+
# Validate required subdirectories exist before proceeding
|
|
362
|
+
for subdir in ["guides", "skills", "templates", "personas", "memory", "scripts"]:
|
|
363
|
+
if not (SOURCE_AGENTS_DIR / subdir).exists():
|
|
364
|
+
print(f"{RED}Error: Missing required subdirectory: agents/{subdir}/{NC}")
|
|
365
|
+
sys.exit(1)
|
|
366
|
+
|
|
367
|
+
# Initialize Dynamic Tech Map
|
|
368
|
+
global TECH_MAP
|
|
369
|
+
TECH_MAP = build_tech_map_from_skills(SOURCE_AGENTS_DIR)
|
|
370
|
+
|
|
371
|
+
clear_screen()
|
|
372
|
+
print_header()
|
|
373
|
+
|
|
374
|
+
# --- Step 1: Install Location ---
|
|
375
|
+
print(f"{YELLOW}Part 1: Installation{NC}")
|
|
376
|
+
print("Where should the Agent Kit be installed?")
|
|
377
|
+
|
|
378
|
+
install_opts = [
|
|
379
|
+
f"Local (Recommended) - Installs to {PROJECT_ROOT}/agents",
|
|
380
|
+
f"Global - Installs to {Path.home()}/agents (All projects share this)",
|
|
381
|
+
"Custom Path",
|
|
382
|
+
]
|
|
383
|
+
|
|
384
|
+
choice_idx = select_index("Select Install Location", install_opts)
|
|
385
|
+
|
|
386
|
+
target_agents_dir = None
|
|
387
|
+
|
|
388
|
+
if choice_idx == 0:
|
|
389
|
+
target_agents_dir = PROJECT_ROOT / "agents"
|
|
390
|
+
elif choice_idx == 1:
|
|
391
|
+
target_agents_dir = Path.home() / "agents"
|
|
392
|
+
else:
|
|
393
|
+
path_str = ask("Enter absolute path")
|
|
394
|
+
user_path = Path(path_str).resolve()
|
|
395
|
+
|
|
396
|
+
if user_path.name == "agents":
|
|
397
|
+
target_agents_dir = user_path
|
|
398
|
+
PROJECT_ROOT = user_path.parent
|
|
399
|
+
else:
|
|
400
|
+
target_agents_dir = user_path / "agents"
|
|
401
|
+
PROJECT_ROOT = user_path
|
|
402
|
+
|
|
403
|
+
# Perform Install / Copy
|
|
404
|
+
IS_UPDATE = False
|
|
405
|
+
if target_agents_dir.exists():
|
|
406
|
+
if target_agents_dir.resolve() == SOURCE_AGENTS_DIR.resolve():
|
|
407
|
+
print(
|
|
408
|
+
f" {BLUE}→ Target is the same as source directory ({target_agents_dir}), skipping copy.{NC}"
|
|
409
|
+
)
|
|
410
|
+
IS_UPDATE = True
|
|
411
|
+
else:
|
|
412
|
+
print(f"\n{YELLOW}! Directory {target_agents_dir} already exists.{NC}")
|
|
413
|
+
update = ask("Install/Merge kit files into this directory? (y/n)", "y")
|
|
414
|
+
if update.lower() == "y":
|
|
415
|
+
IS_UPDATE = True
|
|
416
|
+
safe_merge_directory(SOURCE_AGENTS_DIR, target_agents_dir, is_kit_root=True)
|
|
417
|
+
print(f" {GREEN}✓ Kit merged/updated at {target_agents_dir}{NC}")
|
|
418
|
+
else:
|
|
419
|
+
IS_UPDATE = True
|
|
420
|
+
print(f" {BLUE}→ Using existing files at {target_agents_dir}{NC}")
|
|
421
|
+
else:
|
|
422
|
+
shutil.copytree(SOURCE_AGENTS_DIR, target_agents_dir)
|
|
423
|
+
print(f" {GREEN}✓ Kit installed to {target_agents_dir}{NC}")
|
|
424
|
+
|
|
425
|
+
AGENTS_DIR = target_agents_dir
|
|
426
|
+
|
|
427
|
+
# --- Step 2: Interview ---
|
|
428
|
+
print(f"\n{YELLOW}Part 2: Project Context{NC}")
|
|
429
|
+
|
|
430
|
+
project_name = ask("Project Name", PROJECT_ROOT.name)
|
|
431
|
+
description = ask("One-line Description", "A new software project")
|
|
432
|
+
|
|
433
|
+
# Team & Type
|
|
434
|
+
team_size_idx = select_index(
|
|
435
|
+
"Team Size", ["Solo (1 dev)", "Small (2-5 devs)", "Large (6+ devs, Enterprise)"]
|
|
436
|
+
)
|
|
437
|
+
team_size = ["Solo", "Small", "Large"][team_size_idx]
|
|
438
|
+
|
|
439
|
+
project_type = select(
|
|
440
|
+
"Project Type",
|
|
441
|
+
[
|
|
442
|
+
"Greenfield (New)",
|
|
443
|
+
"Legacy Modernization",
|
|
444
|
+
"Enterprise / Regulated",
|
|
445
|
+
"R&D / Prototype",
|
|
446
|
+
],
|
|
447
|
+
)
|
|
448
|
+
|
|
449
|
+
compliance = []
|
|
450
|
+
if project_type == "Enterprise / Regulated":
|
|
451
|
+
compliance = ask_multiselect(
|
|
452
|
+
"Compliance Requirements", ["GDPR", "HIPAA", "PCI-DSS", "SOC2", "ISO 27001"]
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
# Tech Stack
|
|
456
|
+
print(f"\n{YELLOW}Part 3: Technology Stack{NC}")
|
|
457
|
+
language_choice = select(
|
|
458
|
+
"Primary Language",
|
|
459
|
+
[
|
|
460
|
+
"TypeScript",
|
|
461
|
+
"JavaScript",
|
|
462
|
+
"Python",
|
|
463
|
+
"PHP",
|
|
464
|
+
"Go",
|
|
465
|
+
"Rust",
|
|
466
|
+
"Java",
|
|
467
|
+
"C#",
|
|
468
|
+
"Other",
|
|
469
|
+
],
|
|
470
|
+
)
|
|
471
|
+
language = language_choice
|
|
472
|
+
if language_choice == "Other":
|
|
473
|
+
language = ask("Enter Language")
|
|
474
|
+
|
|
475
|
+
framework = ask("Primary Framework (e.g. Next.js, FastAPI, Laravel)", "None")
|
|
476
|
+
|
|
477
|
+
db_options = ["PostgreSQL", "MySQL/MariaDB", "MongoDB", "SQLite", "Redis", "None"]
|
|
478
|
+
databases = ask_multiselect("Databases used", db_options)
|
|
479
|
+
|
|
480
|
+
cloud_options = [
|
|
481
|
+
"AWS",
|
|
482
|
+
"Google Cloud",
|
|
483
|
+
"Azure",
|
|
484
|
+
"Vercel",
|
|
485
|
+
"Railway",
|
|
486
|
+
"DigitalOcean",
|
|
487
|
+
"On-Prem",
|
|
488
|
+
]
|
|
489
|
+
clouds = ask_multiselect("Infrastructure / Cloud", cloud_options) # noqa: F841
|
|
490
|
+
|
|
491
|
+
# --- Dynamic Setup Check ---
|
|
492
|
+
dynamic_setup = False
|
|
493
|
+
problem_statement = ""
|
|
494
|
+
print(f"\n{YELLOW}Part 3.1: Dynamic Agent Capabilities{NC}")
|
|
495
|
+
if (
|
|
496
|
+
ask(
|
|
497
|
+
"Enable Dynamic Agent Setup (Live Research & Auto-Configuration)? (y/n)",
|
|
498
|
+
"y",
|
|
499
|
+
).lower()
|
|
500
|
+
== "y"
|
|
501
|
+
):
|
|
502
|
+
dynamic_setup = True
|
|
503
|
+
while True:
|
|
504
|
+
problem_statement = ask(
|
|
505
|
+
"What specific problem is this system solving? (e.g. 'High-frequency trading bot', 'Medical image analysis')"
|
|
506
|
+
)
|
|
507
|
+
if problem_statement.strip():
|
|
508
|
+
break
|
|
509
|
+
print(
|
|
510
|
+
f"{RED}⚠ Problem statement cannot be empty. Please describe the problem this system solves.{NC}"
|
|
511
|
+
)
|
|
512
|
+
|
|
513
|
+
# --- Analytics Check ---
|
|
514
|
+
enable_analytics = False
|
|
515
|
+
if (
|
|
516
|
+
ask(
|
|
517
|
+
"Enable Agent Analytics (Track tokens, loops, and success rates)? (y/n)",
|
|
518
|
+
"y",
|
|
519
|
+
).lower()
|
|
520
|
+
== "y"
|
|
521
|
+
):
|
|
522
|
+
enable_analytics = True
|
|
523
|
+
|
|
524
|
+
# --- Meta-Evolution Check ---
|
|
525
|
+
enable_meta = False
|
|
526
|
+
if ask("Enable Self-Evolving Capabilities (Meta-Optimization)? (y/n)", "y").lower() == "y":
|
|
527
|
+
enable_meta = True # noqa: F841
|
|
528
|
+
|
|
529
|
+
# --- GABBE CLI Integration ---
|
|
530
|
+
enable_gabbe_cli = False
|
|
531
|
+
gabbe_cli_mode = "manual" # "manual" | "mcp"
|
|
532
|
+
print(f"\n{YELLOW}Part 3.2: GABBE CLI Platform Controls{NC}")
|
|
533
|
+
print("The GABBE CLI provides optional budget enforcement, audit trails,")
|
|
534
|
+
print("replay, escalation, and cost routing for agent runs.")
|
|
535
|
+
print("It can be used manually or enforced through the MCP server.")
|
|
536
|
+
if (
|
|
537
|
+
ask(
|
|
538
|
+
"Enable GABBE CLI platform controls? (y/n)",
|
|
539
|
+
"n",
|
|
540
|
+
).lower()
|
|
541
|
+
== "y"
|
|
542
|
+
):
|
|
543
|
+
enable_gabbe_cli = True
|
|
544
|
+
mode_idx = select_index(
|
|
545
|
+
"CLI Integration Mode",
|
|
546
|
+
[
|
|
547
|
+
"Manual Only — You run gabbe commands yourself when needed",
|
|
548
|
+
"MCP Enforced — Agents use gabbe exclusively through the MCP server",
|
|
549
|
+
],
|
|
550
|
+
)
|
|
551
|
+
gabbe_cli_mode = ["manual", "mcp"][mode_idx]
|
|
552
|
+
|
|
553
|
+
# --- Step 3: Gap Analysis ---
|
|
554
|
+
|
|
555
|
+
missing_skills = []
|
|
556
|
+
# Framework gap
|
|
557
|
+
fw_key = framework.lower()
|
|
558
|
+
if fw_key not in TECH_MAP and fw_key != "none":
|
|
559
|
+
missing_skills.append(f"{fw_key}-best-practices")
|
|
560
|
+
|
|
561
|
+
# Language gap
|
|
562
|
+
lang_key = language.lower()
|
|
563
|
+
if lang_key not in TECH_MAP and lang_key != "other":
|
|
564
|
+
missing_skills.append(f"{lang_key}-idioms")
|
|
565
|
+
|
|
566
|
+
# Domain gap
|
|
567
|
+
if project_type == "Legacy Modernization":
|
|
568
|
+
missing_skills.extend(TECH_MAP.get("legacy", {}).get("skills", []))
|
|
569
|
+
if project_type == "Enterprise / Regulated":
|
|
570
|
+
missing_skills.extend(TECH_MAP.get("enterprise", {}).get("skills", []))
|
|
571
|
+
if compliance:
|
|
572
|
+
missing_skills.extend(TECH_MAP.get("regulated", {}).get("skills", []))
|
|
573
|
+
|
|
574
|
+
# --- Step 4: Generate AGENTS.md ---
|
|
575
|
+
print(f"\n{YELLOW}Part 4: Configuring Installed Kit{NC}")
|
|
576
|
+
|
|
577
|
+
target_agents_md = AGENTS_DIR / "AGENTS.md"
|
|
578
|
+
template_path = AGENTS_DIR / "templates/coordination/AGENTS_TEMPLATE.md"
|
|
579
|
+
|
|
580
|
+
skip_step_4 = False
|
|
581
|
+
if IS_UPDATE and target_agents_md.exists():
|
|
582
|
+
print(
|
|
583
|
+
f" {BLUE}→ AGENTS.md already exists. Skipping auto-generation to preserve user modifications.{NC}"
|
|
584
|
+
)
|
|
585
|
+
print(f" {BLUE}→ Check {template_path.name} for any new additions.{NC}")
|
|
586
|
+
skip_step_4 = True
|
|
587
|
+
|
|
588
|
+
if not skip_step_4 and template_path.exists():
|
|
589
|
+
content = template_path.read_text()
|
|
590
|
+
|
|
591
|
+
# Replacements
|
|
592
|
+
content = content.replace("{{ project_name }}", project_name)
|
|
593
|
+
content = content.replace("{{ description }}", description)
|
|
594
|
+
content = content.replace("{{ language }}", language)
|
|
595
|
+
content = content.replace("{{ framework }}", framework)
|
|
596
|
+
content = content.replace("{{ runtime }}", "Latest")
|
|
597
|
+
content = content.replace("{{ database }}", ", ".join(databases) if databases else "None")
|
|
598
|
+
|
|
599
|
+
# Package Manager
|
|
600
|
+
pm = "npm"
|
|
601
|
+
if language.lower() in ["python"]:
|
|
602
|
+
pm = "pip"
|
|
603
|
+
if language.lower() in ["php"]:
|
|
604
|
+
pm = "composer"
|
|
605
|
+
if language.lower() in ["go"]:
|
|
606
|
+
pm = "go mod"
|
|
607
|
+
if language.lower() in ["rust"]:
|
|
608
|
+
pm = "cargo"
|
|
609
|
+
elif language_choice == "Other":
|
|
610
|
+
pm = ask("Which package manager? (e.g. cargo, mix, gradle, make, none)", "none")
|
|
611
|
+
|
|
612
|
+
if language.lower() in ["javascript", "typescript"]:
|
|
613
|
+
pm_choice = select("Package Manager", ["npm", "pnpm", "yarn"])
|
|
614
|
+
pm = pm_choice
|
|
615
|
+
|
|
616
|
+
content = content.replace("{{ package_manager }}", pm)
|
|
617
|
+
|
|
618
|
+
# Commands
|
|
619
|
+
install_cmd = f"{pm} install"
|
|
620
|
+
test_cmd = f"{pm} test"
|
|
621
|
+
if pm == "pip":
|
|
622
|
+
install_cmd = "pip install -r requirements.txt"
|
|
623
|
+
test_cmd = "pytest"
|
|
624
|
+
if pm == "go mod":
|
|
625
|
+
install_cmd = "go mod download"
|
|
626
|
+
test_cmd = "go test ./..."
|
|
627
|
+
if pm == "cargo":
|
|
628
|
+
install_cmd = "cargo build"
|
|
629
|
+
test_cmd = "cargo test"
|
|
630
|
+
|
|
631
|
+
lines = content.splitlines()
|
|
632
|
+
new_lines = []
|
|
633
|
+
for line in lines:
|
|
634
|
+
if "install:" in line and "{{" in line:
|
|
635
|
+
new_lines.append(f'install: "{install_cmd}"')
|
|
636
|
+
elif (
|
|
637
|
+
("test:" in line or "test_cmd" in line)
|
|
638
|
+
and "{{" in line
|
|
639
|
+
and "test_single" not in line
|
|
640
|
+
):
|
|
641
|
+
new_lines.append(f'test: "{test_cmd}"')
|
|
642
|
+
elif "security_scan:" in line and "{{" in line:
|
|
643
|
+
audit_cmd = f"{pm} audit"
|
|
644
|
+
if pm == "pip":
|
|
645
|
+
audit_cmd = "pip-audit"
|
|
646
|
+
if pm == "go mod":
|
|
647
|
+
audit_cmd = "govulncheck ./..."
|
|
648
|
+
if pm == "cargo":
|
|
649
|
+
audit_cmd = "cargo audit"
|
|
650
|
+
new_lines.append(f'security_scan: "{audit_cmd}"')
|
|
651
|
+
elif "build:" in line and "{{" in line:
|
|
652
|
+
build_cmd = f"{pm} run build"
|
|
653
|
+
if pm == "go mod":
|
|
654
|
+
build_cmd = "go build -o app"
|
|
655
|
+
if pm == "cargo":
|
|
656
|
+
build_cmd = "cargo build --release"
|
|
657
|
+
if pm == "pip":
|
|
658
|
+
build_cmd = "# No build step for Python"
|
|
659
|
+
new_lines.append(f'build: "{build_cmd}"')
|
|
660
|
+
else:
|
|
661
|
+
new_lines.append(line)
|
|
662
|
+
|
|
663
|
+
content = "\n".join(new_lines)
|
|
664
|
+
|
|
665
|
+
# --- Conditional GABBE CLI Section ---
|
|
666
|
+
cli_start = "<!-- GABBE_CLI_START -->"
|
|
667
|
+
cli_end = "<!-- GABBE_CLI_END -->"
|
|
668
|
+
if not enable_gabbe_cli:
|
|
669
|
+
# Strip the entire CLI section
|
|
670
|
+
if cli_start in content and cli_end in content:
|
|
671
|
+
before = content[: content.find(cli_start)]
|
|
672
|
+
after = content[content.find(cli_end) + len(cli_end) :]
|
|
673
|
+
content = before + after
|
|
674
|
+
print(f" {BLUE}→ GABBE CLI section removed (disabled){NC}")
|
|
675
|
+
else:
|
|
676
|
+
# Keep the section, inject mode-specific notice
|
|
677
|
+
if gabbe_cli_mode == "mcp":
|
|
678
|
+
mcp_notice = (
|
|
679
|
+
"\n> [!IMPORTANT]\n"
|
|
680
|
+
"> **MCP Enforced Mode**: All gabbe CLI commands MUST be executed through the `gabbe serve-mcp` MCP server.\n"
|
|
681
|
+
"> Agents must NOT run `gabbe` commands directly. Use the MCP `tools/call` JSON-RPC method instead.\n"
|
|
682
|
+
)
|
|
683
|
+
content = content.replace(cli_start, cli_start + mcp_notice)
|
|
684
|
+
print(f" {GREEN}✓ GABBE CLI enabled (MCP Enforced mode){NC}")
|
|
685
|
+
else:
|
|
686
|
+
manual_notice = (
|
|
687
|
+
"\n> [!NOTE]\n"
|
|
688
|
+
"> **Manual Mode**: The gabbe CLI is available for human use. Run commands directly when needed.\n"
|
|
689
|
+
"> Agents are NOT required to use these commands but may reference them.\n"
|
|
690
|
+
)
|
|
691
|
+
content = content.replace(cli_start, cli_start + manual_notice)
|
|
692
|
+
print(f" {GREEN}✓ GABBE CLI enabled (Manual mode){NC}")
|
|
693
|
+
# Strip the marker comments themselves for clean output
|
|
694
|
+
content = content.replace(cli_start, "").replace(cli_end, "")
|
|
695
|
+
|
|
696
|
+
target_agents_md = AGENTS_DIR / "AGENTS.md"
|
|
697
|
+
target_agents_md.write_text(content)
|
|
698
|
+
print(f" {GREEN}✓ Configured {target_agents_md}{NC}")
|
|
699
|
+
else:
|
|
700
|
+
print(f" {RED}x Template not found: {template_path}{NC}")
|
|
701
|
+
|
|
702
|
+
# --- Step 4.1: Append to CONSTITUTION.md ---
|
|
703
|
+
if not IS_UPDATE and (compliance or project_type == "Legacy Modernization"):
|
|
704
|
+
const_path = AGENTS_DIR / "CONSTITUTION.md"
|
|
705
|
+
if const_path.exists():
|
|
706
|
+
with open(const_path, "a") as f:
|
|
707
|
+
f.write("\n\n## Project-Specific Articles (Auto-Generated)\n")
|
|
708
|
+
# Number project-specific articles after the universal set
|
|
709
|
+
# (I–XI) to avoid colliding with Articles VIII/IX/X.
|
|
710
|
+
if "Legacy Modernization" in project_type:
|
|
711
|
+
f.write("\n### Article XII. The Modernization Mandate\n")
|
|
712
|
+
f.write(
|
|
713
|
+
"All new code must adhere to modern patterns. Legacy code touched must be refactored to >99% coverage (Boy Scout Rule).\n"
|
|
714
|
+
)
|
|
715
|
+
if compliance:
|
|
716
|
+
f.write(
|
|
717
|
+
f"\n### Article XIII. Regulatory Compliance ({', '.join(compliance)})\n"
|
|
718
|
+
)
|
|
719
|
+
f.write(
|
|
720
|
+
"No PII shall be logged. All data at rest must be encrypted. Security audit is mandatory before Release.\n"
|
|
721
|
+
)
|
|
722
|
+
print(f" {GREEN}✓ Updated CONSTITUTION.md with specific Articles{NC}")
|
|
723
|
+
|
|
724
|
+
# --- Step 5: Directory Wiring ---
|
|
725
|
+
print(f"\n{YELLOW}Part 5: Wiring Agent Context{NC}")
|
|
726
|
+
|
|
727
|
+
loki_mem = AGENTS_DIR / "memory"
|
|
728
|
+
(loki_mem / "episodic/SESSION_SNAPSHOT").mkdir(parents=True, exist_ok=True)
|
|
729
|
+
(loki_mem / "semantic").mkdir(parents=True, exist_ok=True)
|
|
730
|
+
|
|
731
|
+
if enable_analytics:
|
|
732
|
+
(loki_mem / "metrics").mkdir(parents=True, exist_ok=True)
|
|
733
|
+
print(f" {GREEN}✓ Initialized Analytics Directory{NC}")
|
|
734
|
+
|
|
735
|
+
(loki_mem / "PROJECT_STATE.md").write_text("# PROJECT_STATE.md\n\nPhase: S00_INITIALIZED\n")
|
|
736
|
+
print(f" {GREEN}✓ Initialized Loki Memory{NC}")
|
|
737
|
+
|
|
738
|
+
_is_windows = sys.platform == "win32"
|
|
739
|
+
_is_unix = not _is_windows
|
|
740
|
+
|
|
741
|
+
# Copy setup-context.sh (Linux / macOS)
|
|
742
|
+
if _is_unix:
|
|
743
|
+
setup_src = AGENTS_DIR / "scripts/setup-context.sh"
|
|
744
|
+
setup_dest = PROJECT_ROOT / "setup-context.sh"
|
|
745
|
+
if setup_src.exists():
|
|
746
|
+
shutil.copy2(setup_src, setup_dest)
|
|
747
|
+
setup_dest.chmod(0o755)
|
|
748
|
+
print(f" {GREEN}✓ Installed setup-context.sh{NC}")
|
|
749
|
+
else:
|
|
750
|
+
print(f" {YELLOW}! Could not find {setup_src}, skipping setup-context.sh install{NC}")
|
|
751
|
+
|
|
752
|
+
# Copy setup-context.ps1 (Windows)
|
|
753
|
+
if _is_windows:
|
|
754
|
+
setup_ps1_src = AGENTS_DIR / "scripts/setup-context.ps1"
|
|
755
|
+
setup_ps1_dest = PROJECT_ROOT / "setup-context.ps1"
|
|
756
|
+
if setup_ps1_src.exists():
|
|
757
|
+
shutil.copy2(setup_ps1_src, setup_ps1_dest)
|
|
758
|
+
print(f" {GREEN}✓ Installed setup-context.ps1 (Windows Support){NC}")
|
|
759
|
+
else:
|
|
760
|
+
print(
|
|
761
|
+
f" {YELLOW}! Could not find {setup_ps1_src}, skipping setup-context.ps1 install{NC}"
|
|
762
|
+
)
|
|
763
|
+
|
|
764
|
+
# Symlinks
|
|
765
|
+
skills_src = AGENTS_DIR / "skills"
|
|
766
|
+
agents_md_src = AGENTS_DIR / "AGENTS.md"
|
|
767
|
+
|
|
768
|
+
agents = ask_multiselect(
|
|
769
|
+
"Which AI Agents are you using?",
|
|
770
|
+
[
|
|
771
|
+
"Claude Code",
|
|
772
|
+
"Cursor",
|
|
773
|
+
"Windsurf",
|
|
774
|
+
"Cline",
|
|
775
|
+
"Aider",
|
|
776
|
+
"Devin / Cognition",
|
|
777
|
+
"Gemini",
|
|
778
|
+
"Antigravity",
|
|
779
|
+
"OpenCode",
|
|
780
|
+
"Zed",
|
|
781
|
+
"Continue",
|
|
782
|
+
"Roo Code",
|
|
783
|
+
"Kilo Code",
|
|
784
|
+
"OpenAI / Codex",
|
|
785
|
+
"GitHub Copilot",
|
|
786
|
+
"VS Code",
|
|
787
|
+
],
|
|
788
|
+
)
|
|
789
|
+
|
|
790
|
+
if "Claude Code" in agents:
|
|
791
|
+
claude_dir = PROJECT_ROOT / ".claude"
|
|
792
|
+
claude_dir.mkdir(exist_ok=True)
|
|
793
|
+
create_symlink(agents_md_src, claude_dir / "CLAUDE.md")
|
|
794
|
+
# Generate real .claude/skills/<slug>/SKILL.md directories (the agent-skills
|
|
795
|
+
# open standard). Claude Code only discovers <name>/SKILL.md directories,
|
|
796
|
+
# not the legacy <name>.skill.md file tree, so we must NOT symlink the
|
|
797
|
+
# source skills/ dir here.
|
|
798
|
+
setup_skills_for_platform("Claude Code", AGENTS_DIR, claude_dir / "skills")
|
|
799
|
+
|
|
800
|
+
if "Cursor" in agents:
|
|
801
|
+
cursor_dir = PROJECT_ROOT / ".cursor"
|
|
802
|
+
cursor_rules_dir = cursor_dir / "rules"
|
|
803
|
+
create_symlink(agents_md_src, PROJECT_ROOT / ".cursorrules")
|
|
804
|
+
setup_skills_for_platform("Cursor", AGENTS_DIR, cursor_rules_dir)
|
|
805
|
+
|
|
806
|
+
if "Windsurf" in agents:
|
|
807
|
+
create_symlink(agents_md_src, PROJECT_ROOT / ".windsurfrules")
|
|
808
|
+
windsurf_dir = PROJECT_ROOT / ".windsurf"
|
|
809
|
+
windsurf_dir.mkdir(exist_ok=True)
|
|
810
|
+
create_symlink(skills_src, windsurf_dir / "skills")
|
|
811
|
+
|
|
812
|
+
if "Cline" in agents:
|
|
813
|
+
create_symlink(agents_md_src, PROJECT_ROOT / ".clinerules")
|
|
814
|
+
cline_dir = PROJECT_ROOT / ".cline"
|
|
815
|
+
if not cline_dir.exists():
|
|
816
|
+
cline_dir.mkdir(exist_ok=True)
|
|
817
|
+
create_symlink(skills_src, cline_dir / "skills")
|
|
818
|
+
|
|
819
|
+
if "Devin / Cognition" in agents:
|
|
820
|
+
create_symlink(agents_md_src, PROJECT_ROOT / ".devinrules")
|
|
821
|
+
devin_dir = PROJECT_ROOT / ".devin"
|
|
822
|
+
devin_dir.mkdir(exist_ok=True)
|
|
823
|
+
create_symlink(skills_src, devin_dir / "skills")
|
|
824
|
+
|
|
825
|
+
if "Aider" in agents:
|
|
826
|
+
aider_conf = PROJECT_ROOT / ".aider.conf.yml"
|
|
827
|
+
if not aider_conf.exists():
|
|
828
|
+
aider_conf.write_text("read:\n - agents/AGENTS.md\n - agents/skills/\n")
|
|
829
|
+
print(f" {GREEN}✓ Wired .aider.conf.yml{NC}")
|
|
830
|
+
|
|
831
|
+
# "Gemini" is the split-out target; "Gemini / Antigravity" kept for backward
|
|
832
|
+
# compatibility with older saved selections and the emitter golden harness.
|
|
833
|
+
if "Gemini" in agents or "Gemini / Antigravity" in agents:
|
|
834
|
+
gemini_dir = PROJECT_ROOT / ".gemini"
|
|
835
|
+
gemini_dir.mkdir(exist_ok=True)
|
|
836
|
+
try:
|
|
837
|
+
# Use paths relative to PROJECT_ROOT for cleaner config
|
|
838
|
+
rel_agents = os.path.relpath(agents_md_src, PROJECT_ROOT)
|
|
839
|
+
rel_skills = os.path.relpath(skills_src, PROJECT_ROOT)
|
|
840
|
+
except Exception:
|
|
841
|
+
rel_agents = str(agents_md_src.absolute())
|
|
842
|
+
rel_skills = str(skills_src.absolute())
|
|
843
|
+
|
|
844
|
+
settings_content = {
|
|
845
|
+
"agent_instructions_file": rel_agents,
|
|
846
|
+
"skills_directory": rel_skills,
|
|
847
|
+
"contextFileName": "GEMINI.md",
|
|
848
|
+
"gabbe-schema-version": 1,
|
|
849
|
+
"notes": "Managed by init.py",
|
|
850
|
+
}
|
|
851
|
+
(gemini_dir / "settings.json").write_text(json.dumps(settings_content, indent=2))
|
|
852
|
+
# Gemini CLI natively reads a GEMINI.md context file; point it at AGENTS.md.
|
|
853
|
+
create_symlink(agents_md_src, PROJECT_ROOT / "GEMINI.md")
|
|
854
|
+
print(f" {GREEN}✓ Wired .gemini/settings.json + GEMINI.md{NC}")
|
|
855
|
+
|
|
856
|
+
# Universal agentskills.io target: .agents/skills/<slug>/SKILL.md is read by
|
|
857
|
+
# Antigravity, OpenCode, GitHub Copilot CLI, ~/.agents/skills, and any
|
|
858
|
+
# agentskills.io-conformant tool — emitted once when any such agent is selected.
|
|
859
|
+
if "Antigravity" in agents:
|
|
860
|
+
# Antigravity (v1.20.3+) reads the root AGENTS.md (emitted below) and
|
|
861
|
+
# discovers skills at .agents/skills/<slug>/SKILL.md.
|
|
862
|
+
setup_skills_for_platform("Antigravity", AGENTS_DIR, PROJECT_ROOT / ".agents" / "skills")
|
|
863
|
+
print(f" {GREEN}✓ Wired Antigravity (.agents/skills + root AGENTS.md){NC}")
|
|
864
|
+
|
|
865
|
+
if "OpenCode" in agents:
|
|
866
|
+
# OpenCode reads the root AGENTS.md and an opencode.json `instructions` array.
|
|
867
|
+
opencode_conf = PROJECT_ROOT / "opencode.json"
|
|
868
|
+
if not opencode_conf.exists():
|
|
869
|
+
opencode_conf.write_text(
|
|
870
|
+
json.dumps(
|
|
871
|
+
{
|
|
872
|
+
"$schema": "https://opencode.ai/config.json",
|
|
873
|
+
"instructions": ["AGENTS.md", "agents/skills/"],
|
|
874
|
+
},
|
|
875
|
+
indent=2,
|
|
876
|
+
)
|
|
877
|
+
+ "\n"
|
|
878
|
+
)
|
|
879
|
+
setup_skills_for_platform("OpenCode", AGENTS_DIR, PROJECT_ROOT / ".agents" / "skills")
|
|
880
|
+
print(f" {GREEN}✓ Wired opencode.json + .agents/skills{NC}")
|
|
881
|
+
|
|
882
|
+
if "Zed" in agents:
|
|
883
|
+
# Zed reads the root AGENTS.md natively; also wire its `.rules` convention.
|
|
884
|
+
create_symlink(agents_md_src, PROJECT_ROOT / ".rules")
|
|
885
|
+
|
|
886
|
+
if "Continue" in agents:
|
|
887
|
+
cont_dir = PROJECT_ROOT / ".continue" / "rules"
|
|
888
|
+
cont_dir.mkdir(parents=True, exist_ok=True)
|
|
889
|
+
create_symlink(agents_md_src, cont_dir / "agents.md")
|
|
890
|
+
|
|
891
|
+
if "Roo Code" in agents:
|
|
892
|
+
roo_dir = PROJECT_ROOT / ".roo" / "rules"
|
|
893
|
+
roo_dir.mkdir(parents=True, exist_ok=True)
|
|
894
|
+
create_symlink(agents_md_src, roo_dir / "agents.md")
|
|
895
|
+
|
|
896
|
+
if "Kilo Code" in agents:
|
|
897
|
+
kilo_dir = PROJECT_ROOT / ".kilocode" / "rules"
|
|
898
|
+
kilo_dir.mkdir(parents=True, exist_ok=True)
|
|
899
|
+
create_symlink(agents_md_src, kilo_dir / "agents.md")
|
|
900
|
+
|
|
901
|
+
if "OpenAI / Codex" in agents:
|
|
902
|
+
codex_dir = PROJECT_ROOT / ".codex"
|
|
903
|
+
codex_dir.mkdir(exist_ok=True)
|
|
904
|
+
create_symlink(agents_md_src, codex_dir / "AGENTS.md")
|
|
905
|
+
|
|
906
|
+
if "GitHub Copilot" in agents:
|
|
907
|
+
gh_dir = PROJECT_ROOT / ".github"
|
|
908
|
+
gh_dir.mkdir(exist_ok=True)
|
|
909
|
+
create_symlink(agents_md_src, gh_dir / "copilot-instructions.md")
|
|
910
|
+
setup_skills_for_platform("GitHub Copilot", AGENTS_DIR, gh_dir / "skills")
|
|
911
|
+
|
|
912
|
+
if "VS Code" in agents: # Added VS Code explicitly if requested, reusing logic
|
|
913
|
+
gh_dir = PROJECT_ROOT / ".github"
|
|
914
|
+
setup_skills_for_platform("VS Code", AGENTS_DIR, gh_dir / "skills")
|
|
915
|
+
|
|
916
|
+
# Root AGENTS.md (the agents.md open standard, read by Codex, Cursor,
|
|
917
|
+
# Gemini CLI, and the Copilot coding agent). Emitted once for all agents.
|
|
918
|
+
root_agents_md = PROJECT_ROOT / "AGENTS.md"
|
|
919
|
+
if root_agents_md.resolve() != agents_md_src.resolve():
|
|
920
|
+
create_symlink(agents_md_src, root_agents_md)
|
|
921
|
+
print(f" {GREEN}✓ Wired root AGENTS.md (agents.md standard){NC}")
|
|
922
|
+
|
|
923
|
+
# --- Step 6: Gitignore ---
|
|
924
|
+
gitignore = PROJECT_ROOT / ".gitignore"
|
|
925
|
+
if gitignore.exists():
|
|
926
|
+
content = gitignore.read_text()
|
|
927
|
+
if ".env" not in content:
|
|
928
|
+
with open(gitignore, "a") as f:
|
|
929
|
+
f.write("\n.env\n.env.local\n")
|
|
930
|
+
print(f" {GREEN}✓ Added .env to .gitignore{NC}")
|
|
931
|
+
|
|
932
|
+
# --- Step 7: Mission Generation ---
|
|
933
|
+
print(f"\n{YELLOW}Part 6: Agent Mission Generation{NC}")
|
|
934
|
+
|
|
935
|
+
if dynamic_setup:
|
|
936
|
+
mission = f"""
|
|
937
|
+
# BOOTSTRAP MISSION: Dynamic Agent Setup
|
|
938
|
+
**Goal**: Research, Configure, and Build a robust {project_type} system for "{project_name}".
|
|
939
|
+
|
|
940
|
+
## Context
|
|
941
|
+
- **Problem**: {problem_statement}
|
|
942
|
+
- **Stack**: {language} / {framework}
|
|
943
|
+
- **Constraints**: {", ".join(compliance) if compliance else "None"}
|
|
944
|
+
- **Missing Skills**: {", ".join(missing_skills) if missing_skills else "Standard Set"}
|
|
945
|
+
|
|
946
|
+
## Agent instructions
|
|
947
|
+
- Read AGENTS.md and CONSTITUTION.md for more information on this agentic system.
|
|
948
|
+
- Make sure that the project state, audit, gates, human-in-the-loop, and workflows, are always taken into account.
|
|
949
|
+
- Read agents/guides/ skills/ templates/ for any relevant information discovered during research and added by you or other agents.
|
|
950
|
+
|
|
951
|
+
## Phase 1: Dynamic Research (The "Search" Phase)
|
|
952
|
+
You are authorized to use `search_web` and `run_command` freely.
|
|
953
|
+
1. **Landscape Analysis**: Search for "best {language} libraries for {problem_statement} in 2026".
|
|
954
|
+
2. **Skill Acquisition**:
|
|
955
|
+
- Check `github.com/heilcheng/awesome-agent-skills` or similar repos.
|
|
956
|
+
- Download relevant skill templates or create new `.skill.md` files for discovered tools.
|
|
957
|
+
- Example: If building a trading bot, create `financial-analysis.skill.md`.
|
|
958
|
+
|
|
959
|
+
## Phase 2: Rigorous "Definition of Done" Setup
|
|
960
|
+
You MUST NOT write implementation code until these artifacts are approved:
|
|
961
|
+
1. **Requirements**: `PRD.md` with clear User Stories.
|
|
962
|
+
2. **Architecture**: `PLAN.md` with C4 diagrams and "System Context".
|
|
963
|
+
3. **Specs**: `SPEC.md` with API schemas and Database models.
|
|
964
|
+
4. **Acceptance Criteria**: E2E test scenarios defined in `features/` or `tests/`.
|
|
965
|
+
|
|
966
|
+
## Phase 3: Execution Strategy
|
|
967
|
+
- Run `init` on the project framework (e.g., `npm init`, `cargo new`).
|
|
968
|
+
- Install the dependencies found in Phase 1.
|
|
969
|
+
- Execute the **Loki Loop** (Plan -> Test -> Code -> Verify).
|
|
970
|
+
|
|
971
|
+
## Mandatory Checkpoints
|
|
972
|
+
- [ ] Research completed & Skills added
|
|
973
|
+
- [ ] Architecture approved by Human
|
|
974
|
+
- [ ] CI/CD Pipeline configured
|
|
975
|
+
- [ ] Compliance Audit passed (if regulated)
|
|
976
|
+
|
|
977
|
+
Start by running: `setup-context.sh` to confirm your environment.
|
|
978
|
+
"""
|
|
979
|
+
mission_file = PROJECT_ROOT / "BOOTSTRAP_MISSION.md"
|
|
980
|
+
mission_file.write_text(mission)
|
|
981
|
+
print(f"\n{GREEN}✓ Generated Dynamic BOOTSTRAP_MISSION.md{NC}")
|
|
982
|
+
print(
|
|
983
|
+
f"{BLUE}>> INSTRUCTION: Agent, please read BOOTSTRAP_MISSION.md and begin Phase 1 immediately.{NC}"
|
|
984
|
+
)
|
|
985
|
+
|
|
986
|
+
else:
|
|
987
|
+
# Standard Static Mission
|
|
988
|
+
mission = f"""
|
|
989
|
+
I have initialized the GABBE Agentic Engineering Kit for this project.
|
|
990
|
+
Here is your mission to finalize the setup:
|
|
991
|
+
|
|
992
|
+
0. Agent instructions
|
|
993
|
+
- Read AGENTS.md and CONSTITUTION.md for more information on this agentic system.
|
|
994
|
+
- Make sure that the project state, audit, gates, human-in-the-loop, and workflows, are always taken into account.
|
|
995
|
+
- Read agents/guides/ skills/ templates/ for any relevant information discovered during research and added by you or other agents.
|
|
996
|
+
|
|
997
|
+
1. **Analyze the Gap**: We are using {language} and {framework}.
|
|
998
|
+
- Missing Skills: {", ".join(missing_skills) if missing_skills else "None detected"}.
|
|
999
|
+
- Project Type: {project_type}.
|
|
1000
|
+
- Compliance: {", ".join(compliance) if compliance else "None"}.
|
|
1001
|
+
|
|
1002
|
+
2. **MCP Configuration**:
|
|
1003
|
+
- Review `agents/templates/core/MCP_CONFIG_TEMPLATE.json`.
|
|
1004
|
+
- Install "Context-7 MCP" (Essential for docs).
|
|
1005
|
+
- If we are using Postgres, install "PostgreSQL MCP".
|
|
1006
|
+
|
|
1007
|
+
3. **Research & Create (Deep Context Mode)**:
|
|
1008
|
+
- **Standards Check**: Research SWEBOK/ISO/IEEE standards relevant to a {project_type} project in {language}.
|
|
1009
|
+
- **Gap Analysis**: Compare the installed skills against the specific needs of {framework} in 2026.
|
|
1010
|
+
- **Generate**: Create key missing skills. Example: `agents/skills/{framework.lower()}-best-practices.skill.md`.
|
|
1011
|
+
- **Architectural Pattern**: Identify the best pattern (e.g., Clean Arch, Hexagonal, Vertical Slice) for this stack and document it in `AGENTS.md`.
|
|
1012
|
+
"""
|
|
1013
|
+
if team_size == "Large":
|
|
1014
|
+
mission += "\n4. **Loki Mode Activation**:\n - Review `agents/skills/brain/README_ORCHESTRATORS.md`.\n - Deploy the Personas from `agents/personas/` to my active tool context.\n"
|
|
1015
|
+
|
|
1016
|
+
mission += """
|
|
1017
|
+
5. **Mandatory Guardrails**:
|
|
1018
|
+
- **Ethics**: Run `ai-ethics-compliance` skill on the initial specs.
|
|
1019
|
+
- **Safety**: Install `ai-safety-guardrails` hooks.
|
|
1020
|
+
"""
|
|
1021
|
+
|
|
1022
|
+
mission += "\n6. **Verify**:\n - Run `integrity-check` skill to ensure all symlinks and configs are valid.\n"
|
|
1023
|
+
|
|
1024
|
+
print("-" * 60)
|
|
1025
|
+
print(mission)
|
|
1026
|
+
print("-" * 60)
|
|
1027
|
+
|
|
1028
|
+
mission_file = PROJECT_ROOT / "SETUP_MISSION.md"
|
|
1029
|
+
mission_file.write_text(mission)
|
|
1030
|
+
print(f"\n{GREEN}✓ Mission saved to SETUP_MISSION.md{NC}")
|
|
1031
|
+
|
|
1032
|
+
print(f"{BLUE}Setup Complete! The kit is installed at: {AGENTS_DIR}{NC}")
|
|
1033
|
+
|
|
1034
|
+
|
|
1035
|
+
if __name__ == "__main__":
|
|
1036
|
+
main()
|