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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Modern Design Patterns Guide (2025 Edition)
|
|
2
|
+
|
|
3
|
+
This guide covers essential software design patterns, updated for modern distributed and cloud-native contexts.
|
|
4
|
+
|
|
5
|
+
## 1. Creational Patterns
|
|
6
|
+
**Focus**: Object creation mechanisms.
|
|
7
|
+
|
|
8
|
+
### Factory Method / Abstract Factory
|
|
9
|
+
- **Concept**: Create objects without specifying the exact class.
|
|
10
|
+
- **Modern Use**: LLM Client factories (OpenAI vs Anthropic clients), Cloud SDK initialization.
|
|
11
|
+
- **When to use**: When the implementation needs to be swappable at runtime based on config.
|
|
12
|
+
|
|
13
|
+
### Builder
|
|
14
|
+
- **Concept**: Construct complex objects step-by-step.
|
|
15
|
+
- **Modern Use**: Constructing complex HTTP requests, prompt chains, or Kubernetes manifests.
|
|
16
|
+
- **When to use**: When an object has >3 optional constructor parameters.
|
|
17
|
+
|
|
18
|
+
### Singleton
|
|
19
|
+
- **Concept**: Ensure a class has only one instance.
|
|
20
|
+
- **Modern Use**: Database connection pools, Configuration managers, Logging services.
|
|
21
|
+
- **Warning**: Avoid for stateful business logic; it makes testing hard.
|
|
22
|
+
|
|
23
|
+
## 2. Structural Patterns
|
|
24
|
+
**Focus**: Class and object composition.
|
|
25
|
+
|
|
26
|
+
### Adapter
|
|
27
|
+
- **Concept**: Make incompatible interfaces work together.
|
|
28
|
+
- **Modern Use**: Standardizing different 3rd party APIs (e.g., Stripe vs PayPal) behind a single `PaymentProvider` interface.
|
|
29
|
+
|
|
30
|
+
### Facade
|
|
31
|
+
- **Concept**: Simple interface to a complex sub-system.
|
|
32
|
+
- **Modern Use**: A `CloudStorage` class that wraps the complexity of S3/GCS SDKs.
|
|
33
|
+
|
|
34
|
+
### Proxy
|
|
35
|
+
- **Concept**: A placeholder for another object to control access.
|
|
36
|
+
- **Modern Use**: Caching proxies, Lazy loading large datasets, Security/Auth gates.
|
|
37
|
+
|
|
38
|
+
## 3. Behavioral Patterns
|
|
39
|
+
**Focus**: Communication between objects.
|
|
40
|
+
|
|
41
|
+
### Strategy (The #1 Pattern)
|
|
42
|
+
- **Concept**: Define a family of algorithms, put each in a separate class, and make them interchangeable.
|
|
43
|
+
- **Modern Use**: Search algorithms (Exact vs Vector), Authentication strategies (OAuth vs API Key).
|
|
44
|
+
- **Why strict?**: It eliminates massive `if/else` or `switch` statements.
|
|
45
|
+
|
|
46
|
+
### Observer / Pub-Sub
|
|
47
|
+
- **Concept**: Notify subscribers of state changes.
|
|
48
|
+
- **Modern Use**: Event-Driven Architecture (receiving logic), UI Reactivity (Redux/MobX).
|
|
49
|
+
|
|
50
|
+
### Command
|
|
51
|
+
- **Concept**: Turn a request into a stand-alone object.
|
|
52
|
+
- **Modern Use**: Job queues (Sidekiq/Celery tasks), Undo/Redo functionality.
|
|
53
|
+
|
|
54
|
+
## 4. Cloud & Microservices Patterns
|
|
55
|
+
|
|
56
|
+
### Circuit Breaker
|
|
57
|
+
- **Problem**: Cascading failures in distributed systems.
|
|
58
|
+
- **Solution**: Stop calling a failing service for a timeout period.
|
|
59
|
+
- **Library**: `Polly` (.NET), `Resilience4j` (Java), `opossum` (Node).
|
|
60
|
+
|
|
61
|
+
### Sidecar
|
|
62
|
+
- **Problem**: Application logic polluted with infra concerns (logging, mTLS).
|
|
63
|
+
- **Solution**: Run a helper process alongside the main app container.
|
|
64
|
+
- **Example**: Envoy, Istio.
|
|
65
|
+
|
|
66
|
+
### Backend for Frontend (BFF)
|
|
67
|
+
- **Problem**: One API doesn't fit Mobile, Web, and IoT needs equally.
|
|
68
|
+
- **Solution**: Create separate API gateways for each client type.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Enterprise Migration Scenario (Guide)
|
|
2
|
+
|
|
3
|
+
This guide documents the common workflow for using GABBE to modernize or migrate a legacy enterprise system to a microservices architecture.
|
|
4
|
+
|
|
5
|
+
## 1. Initial Assessment (Phase 0)
|
|
6
|
+
|
|
7
|
+
Start by instantiating the kit and running a discovery phase.
|
|
8
|
+
**Prompt:**
|
|
9
|
+
> "Activate Loki Mode. Goal: Analyze the massive monolithic application in `src/legacy` and create a migration plan to split it into bounded contexts."
|
|
10
|
+
|
|
11
|
+
### Expected Output:
|
|
12
|
+
- The agent will use `systems-thinking.skill` to map the current state.
|
|
13
|
+
- It will invoke `legacy-modernization.skill` to identify domain boundaries.
|
|
14
|
+
- It will generate `PLAN.md` with an initial C4 container diagram proposing microservices (e.g., Auth Service, Inventory Service, Order Service).
|
|
15
|
+
|
|
16
|
+
## 2. Setting Architectural Governance
|
|
17
|
+
|
|
18
|
+
Once the `PLAN.md` is approved, enforce architectural governance to prevent coupling between the new boundaries.
|
|
19
|
+
**Prompt:**
|
|
20
|
+
> "Use the architecture-governance skill. Define deptrac or ArchUnit rules for the new microservices to ensure the UI layer never directly queries the database layer, and services communicate only via the Event Bus."
|
|
21
|
+
|
|
22
|
+
### Expected Output:
|
|
23
|
+
- Creation of `deptrac.yaml` (if PHP) or equivalent rules (e.g., `.eslintrc` boundary config if node).
|
|
24
|
+
- The `agentic-linter.skill` will enforce these on all subsequent PRs.
|
|
25
|
+
|
|
26
|
+
## 3. The Strangler Fig Pattern Execution
|
|
27
|
+
|
|
28
|
+
Migrate one feature at a time using the Strangler Fig pattern.
|
|
29
|
+
|
|
30
|
+
**Prompt for a single feature:**
|
|
31
|
+
> "Use the strangler-fig pattern. We are extracting the 'User Authentication' module from the monolith. Read the existing legacy routes. Create a new microservice in `services/auth` mapped to the identical API contract."
|
|
32
|
+
|
|
33
|
+
### Execution Flow:
|
|
34
|
+
1. **Spec:** Agent writes OpenAPI spec for the new `/api/v2/auth`.
|
|
35
|
+
2. **Implementation:** Agent uses `tdd-cycle.skill` to build the new service.
|
|
36
|
+
3. **Routing:** Agent updates the API Gateway (e.g., Nginx, Traefik) to route `/auth` traffic to the new service while routing everything else to the monolith.
|
|
37
|
+
|
|
38
|
+
## 4. Dual-Write Data Migration
|
|
39
|
+
|
|
40
|
+
If the database must also be split, the agent will guide a dual-write strategy.
|
|
41
|
+
|
|
42
|
+
**Prompt:**
|
|
43
|
+
> "Design a dual-write migration strategy for the 'Orders' database table. Propose the database schema for the new microservice and write the migration script."
|
|
44
|
+
|
|
45
|
+
### Execution Flow:
|
|
46
|
+
1. **Schema:** Agent defines `schema.sql` for the new `orders_db`.
|
|
47
|
+
2. **Sync:** Agent implements an event listener on the monolith (e.g., CDC using Debezium) to sync old DB writes to the new DB.
|
|
48
|
+
3. **Read Switch:** Once data is verified, Agent modifies the frontend to read from the new microservice APIs.
|
|
49
|
+
|
|
50
|
+
## 5. Security and Compliance
|
|
51
|
+
|
|
52
|
+
Enterprise environments demand rigorous compliance.
|
|
53
|
+
**Prompt:**
|
|
54
|
+
> "Run a full compliance-review skill for SOC2 and GDPR on the newly extracted Auth microservice."
|
|
55
|
+
|
|
56
|
+
### Expected Output:
|
|
57
|
+
- The agent runs `privacy-audit.skill` to check for PII logging.
|
|
58
|
+
- The agent fills out the `SECURITY_CHECKLIST.md` confirming encryption in transit and at rest.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Enterprise Integration Patterns & Modernization
|
|
2
|
+
|
|
3
|
+
Integrating modern AI/Cloud applications with legacy Enterprise systems (ERP, Mainframe, Monoliths) requires specific patterns to ensure stability, data integrity, and decoupling.
|
|
4
|
+
|
|
5
|
+
## 1. Modernization Patterns
|
|
6
|
+
|
|
7
|
+
### Strangler Fig Pattern
|
|
8
|
+
**Goal**: Incrementally migrate a legacy system by replacing specific functionality with new services, "strangling" the old system over time.
|
|
9
|
+
- **Method**: Place a facade (API Gateway) in front of the legacy system. Route specific traffic to the new microservice.
|
|
10
|
+
- **Benefit**: Low risk. Immediate value. No "Big Bang" rewrite.
|
|
11
|
+
|
|
12
|
+
### Anti-Corruption Layer (ACL)
|
|
13
|
+
**Goal**: Prevent the legacy system's confusing (or archaic) data model from polluting your clean modern domain model.
|
|
14
|
+
- **Method**: Create a translation layer (Service or Class) that converts Legacy Data Structures <-> Modern Domain Entities.
|
|
15
|
+
- **Rule**: NEVER let a legacy data object leak into your core business logic.
|
|
16
|
+
|
|
17
|
+
### Change Data Capture (CDC)
|
|
18
|
+
**Goal**: React to data changes in a legacy DB without modifying the legacy app.
|
|
19
|
+
- **Method**: Read the database Transaction Log (WAL). Stream changes to Kafka.
|
|
20
|
+
- **Tools**: Debezium.
|
|
21
|
+
|
|
22
|
+
## 2. Integration Styles
|
|
23
|
+
|
|
24
|
+
### 1. File Transfer (Batch)
|
|
25
|
+
- **Use case**: Nightly sync with Mainframe/Banking systems.
|
|
26
|
+
- **Pros**: Simple, Decoupled.
|
|
27
|
+
- **Cons**: High latency (data is old).
|
|
28
|
+
|
|
29
|
+
### 2. Shared Database
|
|
30
|
+
- **Use case**: "Quick and dirty" reporting.
|
|
31
|
+
- **Pros**: Fast.
|
|
32
|
+
- **Cons**: **HIGH RISK**. Strong coupling. Performance contention. **Avoid whenever possible.**
|
|
33
|
+
|
|
34
|
+
### 3. Remote Procedure Invocation (API)
|
|
35
|
+
- **Use case**: Real-time action (e.g., "Check Inventory").
|
|
36
|
+
- **Pros**: Real-time.
|
|
37
|
+
- **Cons**: Tight coupling (if API is down, you are down). Requires Circuit Breakers.
|
|
38
|
+
|
|
39
|
+
### 4. Messaging (Event-Driven)
|
|
40
|
+
- **Use case**: State synchronization (e.g., "Order Placed").
|
|
41
|
+
- **Pros**: Decoupled. Resilient. Data is eventual consistent.
|
|
42
|
+
- **Cons**: Complexity.
|
|
43
|
+
|
|
44
|
+
## 3. Resilience in Integration
|
|
45
|
+
|
|
46
|
+
### Circuit Breaker
|
|
47
|
+
Stop calling a failing system to prevent cascading failure.
|
|
48
|
+
- **Open**: Fast fail (don't call).
|
|
49
|
+
- **Half-Open**: Try one call to see if it's back.
|
|
50
|
+
- **Closed**: Normal operation.
|
|
51
|
+
|
|
52
|
+
### Bulkhead
|
|
53
|
+
Isolate resources (thread pools) so that one slow integration doesn't exhaust the whole system.
|
|
54
|
+
|
|
55
|
+
### Dead Letter Queue (DLQ)
|
|
56
|
+
Where messages go when they cannot be processed after N retries. **Must be monitored.**
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Software Design & Architecture Patterns — Classical Catalog
|
|
2
|
+
|
|
3
|
+
The foundational (non-agentic) patterns for designing code and systems. These are
|
|
4
|
+
what the agent's *generated code* and *system designs* should use; the agentic
|
|
5
|
+
patterns in the `agentic-design-patterns` guide sit on top of them. Each entry
|
|
6
|
+
notes when to use it and the GABBE skill that implements it.
|
|
7
|
+
|
|
8
|
+
## How to read this catalog
|
|
9
|
+
|
|
10
|
+
A pattern names a recurring problem + a proven solution shape. Prefer the simplest
|
|
11
|
+
pattern that fits; patterns are a vocabulary, not a checklist to maximize. Reach for
|
|
12
|
+
an agentic pattern only where deterministic logic can't express the decision.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## (a) Object & code design — Gang of Four (GoF)
|
|
17
|
+
|
|
18
|
+
Implemented by `design-patterns.skill`. Group by intent:
|
|
19
|
+
|
|
20
|
+
**Creational** — control object creation, decouple "what" from "how it's made":
|
|
21
|
+
- **Factory Method / Abstract Factory** — create families of objects without binding to concrete classes.
|
|
22
|
+
- **Builder** — construct complex objects step by step (good for many optional params).
|
|
23
|
+
- **Prototype** — clone a configured instance instead of rebuilding.
|
|
24
|
+
- **Singleton** — one shared instance (use sparingly; it is global state — prefer dependency injection).
|
|
25
|
+
|
|
26
|
+
**Structural** — compose objects/classes into larger structures:
|
|
27
|
+
- **Adapter** — make an incompatible interface usable. **Bridge** — split abstraction from implementation.
|
|
28
|
+
- **Composite** — treat trees of objects uniformly. **Decorator** — add behavior without subclassing.
|
|
29
|
+
- **Facade** — a simple front over a complex subsystem. **Flyweight** — share fine-grained objects to save memory. **Proxy** — stand-in controlling access (lazy load, remote, protection).
|
|
30
|
+
|
|
31
|
+
**Behavioral** — assign responsibilities + communication:
|
|
32
|
+
- **Strategy** — swap algorithms behind one interface (removes conditionals).
|
|
33
|
+
- **State** — behavior changes with internal state (a clean state machine).
|
|
34
|
+
- **Observer** — publish/subscribe within a process. **Command** — encapsulate an action as an object (undo, queues).
|
|
35
|
+
- **Template Method** — fixed skeleton, overridable steps. **Iterator**, **Mediator**, **Chain of Responsibility**, **Visitor**, **Memento**, **Interpreter**.
|
|
36
|
+
- Smell-to-pattern: many `if/switch` on a type → Strategy/State; tangled producer↔consumer → Observer/Mediator; need undo/replay → Command/Memento.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## (b) Architectural patterns (system shape)
|
|
41
|
+
|
|
42
|
+
- **Layered / n-tier** — responsibilities split into presentation/application/domain/infrastructure layers; the safe default for most line-of-business apps. → `monolith.skill`, `systems-architecture.skill`
|
|
43
|
+
- **Modular monolith** — one deployable with strong internal module boundaries; the right default *before* distributing. → `monolith.skill`
|
|
44
|
+
- **Microservices** — independently deployable services around business capabilities; adopt for team-scaling/independent-deploy needs, not by default (distribution has real cost). → `microservices.skill`
|
|
45
|
+
- **Hexagonal (Ports & Adapters) / Clean / Onion** — domain core isolated from I/O via ports + adapters; framework-independent and highly testable. → `arch-patterns.skill`, `domain-model.skill`
|
|
46
|
+
- **Event-driven** — components decouple via events (pub/sub), with **event sourcing** (state as an event log) and **CQRS** (separate read/write models) as variants. → `event-driven-architecture.skill`, `state-management.skill`
|
|
47
|
+
- **Pipes & filters / streaming** — stage-by-stage data transformation. → `arch-patterns.skill`
|
|
48
|
+
- **Space-based / actor model** — partitioned in-memory state + message passing for elastic scale. → `realtime-comm.skill`, `state-management.skill`
|
|
49
|
+
- **Serverless / FaaS** — event-triggered functions, managed scaling. → `cloud-deploy.skill`
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## (c) Domain-Driven Design (DDD)
|
|
54
|
+
|
|
55
|
+
Strategic + tactical modeling of complex domains: **bounded contexts**, **context
|
|
56
|
+
mapping**, **ubiquitous language**; **aggregates**, **entities**, **value objects**,
|
|
57
|
+
**domain events**, **repositories**, **domain services**. Use when the domain (not the
|
|
58
|
+
tech) is the hard part. → `domain-model.skill`
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## (d) Enterprise integration & distributed-systems patterns
|
|
63
|
+
|
|
64
|
+
- **Saga** — manage a distributed transaction as a sequence of local steps + compensations.
|
|
65
|
+
- **Outbox / Inbox** — reliable event publishing alongside a DB write.
|
|
66
|
+
- **Circuit Breaker** — stop calling a failing dependency; fail fast and recover.
|
|
67
|
+
- **Bulkhead** — isolate resource pools so one failure can't sink the whole system.
|
|
68
|
+
- **Retry with backoff + jitter**, **Timeout**, **Rate Limiting**, **Idempotency key**.
|
|
69
|
+
- **Strangler Fig** — incrementally replace a legacy system. → `enterprise-migration-scenario.skill`, `legacy-modernization.skill`
|
|
70
|
+
- **API Gateway**, **Backend-for-Frontend**, **Sidecar**, **Anti-Corruption Layer**, **Service Mesh**.
|
|
71
|
+
- Implemented by `enterprise-patterns.skill`, `error-handling-strategy.skill`, `middleware-design.skill`, `api-design.skill`.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## (e) Reliability & resilience patterns
|
|
76
|
+
|
|
77
|
+
Circuit Breaker, Bulkhead, Timeout, Retry-with-jitter, Rate Limiting, Load Shedding,
|
|
78
|
+
Graceful Degradation, Health Check, Backpressure, Redundancy/failover. → `reliability-sre.skill`,
|
|
79
|
+
`reliability-engineering.skill`, `error-handling-strategy.skill`
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## (f) Concurrency & data patterns
|
|
84
|
+
|
|
85
|
+
- **Concurrency** — producer/consumer, thread pool, future/promise, read-write lock, immutable data, actor. → `performant-*` skills, `state-management.skill`
|
|
86
|
+
- **Data** — repository, unit of work, identity map, optimistic/pessimistic locking, sharding, read replicas, CQRS read models, caching (cache-aside/write-through). → `data-engineering.skill`, `sql-optimization.skill`, `caching-strategy.skill`, `db-migration.skill`
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Selection cheat-sheet
|
|
91
|
+
|
|
92
|
+
| Problem | Reach for |
|
|
93
|
+
|---|---|
|
|
94
|
+
| Too many `if/switch` on a type code | Strategy / State (GoF) |
|
|
95
|
+
| Add behavior without touching a class | Decorator / Proxy |
|
|
96
|
+
| One deployable, clear modules, ship fast | Modular monolith |
|
|
97
|
+
| Independent team deploys / selective scaling | Microservices + API Gateway |
|
|
98
|
+
| Domain logic is the hard part, keep it testable | Hexagonal + DDD |
|
|
99
|
+
| Decouple producers/consumers, audit history | Event-driven + event sourcing |
|
|
100
|
+
| Split heavy reads from writes | CQRS |
|
|
101
|
+
| Distributed transaction without 2PC | Saga + Outbox |
|
|
102
|
+
| Protect against a failing dependency | Circuit Breaker + Timeout + Retry |
|
|
103
|
+
| Replace a legacy system safely | Strangler Fig + Anti-Corruption Layer |
|
|
104
|
+
|
|
105
|
+
> Honest note: patterns are tools, not goals. Over-applying them (pattern-itis) adds
|
|
106
|
+
> accidental complexity. Start simple; introduce a pattern when a real force demands it.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Time Complexity Analysis Guide
|
|
2
|
+
|
|
3
|
+
A reference guide for understanding, detecting, and remediating algorithmic complexity issues found by the **time-complexity-mcp** static analysis server.
|
|
4
|
+
|
|
5
|
+
## 1. Big-O Quick Reference
|
|
6
|
+
|
|
7
|
+
| Complexity | Name | Example | Growth at n=1000 |
|
|
8
|
+
|---|---|---|---|
|
|
9
|
+
| O(1) | Constant | Hash lookup, `.push()` | 1 |
|
|
10
|
+
| O(log n) | Logarithmic | Binary search | ~10 |
|
|
11
|
+
| O(n) | Linear | Single loop, `.map()`, `.filter()` | 1,000 |
|
|
12
|
+
| O(n log n) | Linearithmic | `.sort()`, merge sort | ~10,000 |
|
|
13
|
+
| O(n²) | Quadratic | Nested loops | 1,000,000 |
|
|
14
|
+
| O(n³) | Cubic | Triple-nested loops | 1,000,000,000 |
|
|
15
|
+
| O(2^n) | Exponential | Branching recursion (Fibonacci) | ~10^301 |
|
|
16
|
+
|
|
17
|
+
## 2. Detection Patterns
|
|
18
|
+
|
|
19
|
+
### Loop Nesting
|
|
20
|
+
The tool tracks nesting depth of `for`, `while`, and `do-while` loops:
|
|
21
|
+
- **Depth 1** → O(n)
|
|
22
|
+
- **Depth 2** → O(n²)
|
|
23
|
+
- **Depth 3** → O(n³)
|
|
24
|
+
|
|
25
|
+
Constant-bound loops (e.g., `for i in range(10)`) are correctly recognized as O(1) and do not increase nesting depth.
|
|
26
|
+
|
|
27
|
+
### Recursion
|
|
28
|
+
- **Linear recursion** (single recursive call) → O(n)
|
|
29
|
+
- **Branching recursion** (multiple recursive calls, e.g., Fibonacci) → O(2^n)
|
|
30
|
+
- **Tail recursion** may be reported as O(n) depending on language support
|
|
31
|
+
|
|
32
|
+
### Known Standard Library Methods
|
|
33
|
+
Each language has its own pattern map:
|
|
34
|
+
- **O(n log n)**: `.sort()`, `Arrays.sort()`, `sorted()`
|
|
35
|
+
- **O(n)**: `.filter()`, `.map()`, `.find()`, `.includes()`, `in` operator
|
|
36
|
+
- **O(1)**: `.push()`, `.pop()`, `.get()`, bracket access
|
|
37
|
+
|
|
38
|
+
### Combined Complexity
|
|
39
|
+
When an O(n) stdlib call appears inside an O(n) loop, the tool correctly reports O(n²). Example:
|
|
40
|
+
```python
|
|
41
|
+
for item in items: # O(n)
|
|
42
|
+
if item in blacklist: # O(n) — linear search
|
|
43
|
+
... # Combined: O(n²)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 3. Common Anti-Patterns & Fixes
|
|
47
|
+
|
|
48
|
+
### Anti-Pattern: Nested Linear Search
|
|
49
|
+
```javascript
|
|
50
|
+
// O(n²) — items.includes() is O(n) inside O(n) loop
|
|
51
|
+
for (const user of users) {
|
|
52
|
+
if (blockedIds.includes(user.id)) { ... }
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
**Fix**: Convert to Set for O(1) lookup:
|
|
56
|
+
```javascript
|
|
57
|
+
const blockedSet = new Set(blockedIds); // O(n) once
|
|
58
|
+
for (const user of users) {
|
|
59
|
+
if (blockedSet.has(user.id)) { ... } // O(1) lookup → O(n) total
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Anti-Pattern: Sort Inside Loop
|
|
64
|
+
```python
|
|
65
|
+
# O(n² log n) — sorting inside a loop
|
|
66
|
+
for batch in batches:
|
|
67
|
+
batch.sort() # O(n log n) × O(n) iterations
|
|
68
|
+
```
|
|
69
|
+
**Fix**: Sort once before the loop, or use a data structure that maintains order (e.g., `heapq`, `SortedList`).
|
|
70
|
+
|
|
71
|
+
### Anti-Pattern: Naive Fibonacci (Exponential Recursion)
|
|
72
|
+
```python
|
|
73
|
+
# O(2^n) — branching recursion
|
|
74
|
+
def fib(n):
|
|
75
|
+
if n <= 1: return n
|
|
76
|
+
return fib(n-1) + fib(n-2)
|
|
77
|
+
```
|
|
78
|
+
**Fix**: Use memoization (`@functools.lru_cache`) or iterative approach for O(n).
|
|
79
|
+
|
|
80
|
+
### Anti-Pattern: Cartesian Product via Triple Loop
|
|
81
|
+
```go
|
|
82
|
+
// O(n³) — three nested variable-bound loops
|
|
83
|
+
for _, a := range listA {
|
|
84
|
+
for _, b := range listB {
|
|
85
|
+
for _, c := range listC {
|
|
86
|
+
process(a, b, c)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
**Fix**: Evaluate whether all combinations are truly needed. Often, pre-filtering or indexing reduces the search space.
|
|
92
|
+
|
|
93
|
+
## 4. Integration Workflow
|
|
94
|
+
|
|
95
|
+
### During Code Review
|
|
96
|
+
1. Run `analyze_file` on changed files before approving a PR.
|
|
97
|
+
2. Flag any function that regressed in complexity (e.g., O(n) → O(n²)).
|
|
98
|
+
3. Document findings using `TIME_COMPLEXITY_REPORT_TEMPLATE.md`.
|
|
99
|
+
|
|
100
|
+
### During Architecture Review
|
|
101
|
+
1. Run `analyze_directory` on the entire `src/` directory.
|
|
102
|
+
2. Identify the **top 5 hotspots** — functions with the highest complexity.
|
|
103
|
+
3. Cross-reference with production profiling data to prioritize optimization.
|
|
104
|
+
|
|
105
|
+
### During Refactoring
|
|
106
|
+
1. Use `analyze_function` to baseline the target function's complexity.
|
|
107
|
+
2. Apply the fix.
|
|
108
|
+
3. Re-run `analyze_function` to verify improvement.
|
|
109
|
+
4. Document before/after in the report template.
|
|
110
|
+
|
|
111
|
+
## 5. Limitations
|
|
112
|
+
|
|
113
|
+
- **Static estimates only**: Cannot account for runtime data distributions, early returns, or caching.
|
|
114
|
+
- **No inter-procedural analysis**: If function A calls function B which is O(n), and A loops n times, the tool reports A as O(n) for the loop but may not combine with B's complexity.
|
|
115
|
+
- **Language coverage**: Currently supports JS/TS, Python, Java, Go, PHP, Dart, and Kotlin. Other languages require custom tree-sitter grammars.
|
|
116
|
+
- **Amortized complexity**: Data structures like dynamic arrays have O(1) amortized insert but O(n) worst case — the tool reports worst case.
|