claude-flow-novice 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/.claude/agents/MIGRATION_SUMMARY.md +222 -0
- package/.claude/agents/README.md +89 -0
- package/.claude/agents/analysis/code-analyzer.md +209 -0
- package/.claude/agents/analysis/code-review/analyze-code-quality.md +180 -0
- package/.claude/agents/architecture/system-design/arch-system-design.md +156 -0
- package/.claude/agents/base-template-generator.md +42 -0
- package/.claude/agents/consensus/README.md +253 -0
- package/.claude/agents/consensus/byzantine-coordinator.md +63 -0
- package/.claude/agents/consensus/consensus-builder.md +242 -0
- package/.claude/agents/consensus/crdt-synchronizer.md +997 -0
- package/.claude/agents/consensus/gossip-coordinator.md +63 -0
- package/.claude/agents/consensus/performance-benchmarker.md +851 -0
- package/.claude/agents/consensus/quorum-manager.md +823 -0
- package/.claude/agents/consensus/raft-manager.md +63 -0
- package/.claude/agents/consensus/security-manager.md +622 -0
- package/.claude/agents/core/coder.md +211 -0
- package/.claude/agents/core/planner.md +116 -0
- package/.claude/agents/core/researcher.md +136 -0
- package/.claude/agents/core/reviewer.md +272 -0
- package/.claude/agents/core/tester.md +266 -0
- package/.claude/agents/data/ml/data-ml-model.md +193 -0
- package/.claude/agents/development/backend/dev-backend-api.md +142 -0
- package/.claude/agents/devops/ci-cd/ops-cicd-github.md +164 -0
- package/.claude/agents/documentation/api-docs/docs-api-openapi.md +174 -0
- package/.claude/agents/flow-nexus/app-store.md +88 -0
- package/.claude/agents/flow-nexus/authentication.md +69 -0
- package/.claude/agents/flow-nexus/challenges.md +81 -0
- package/.claude/agents/flow-nexus/neural-network.md +88 -0
- package/.claude/agents/flow-nexus/payments.md +83 -0
- package/.claude/agents/flow-nexus/sandbox.md +76 -0
- package/.claude/agents/flow-nexus/swarm.md +76 -0
- package/.claude/agents/flow-nexus/user-tools.md +96 -0
- package/.claude/agents/flow-nexus/workflow.md +84 -0
- package/.claude/agents/github/code-review-swarm.md +538 -0
- package/.claude/agents/github/github-modes.md +173 -0
- package/.claude/agents/github/issue-tracker.md +319 -0
- package/.claude/agents/github/multi-repo-swarm.md +553 -0
- package/.claude/agents/github/pr-manager.md +191 -0
- package/.claude/agents/github/project-board-sync.md +509 -0
- package/.claude/agents/github/release-manager.md +367 -0
- package/.claude/agents/github/release-swarm.md +583 -0
- package/.claude/agents/github/repo-architect.md +398 -0
- package/.claude/agents/github/swarm-issue.md +573 -0
- package/.claude/agents/github/swarm-pr.md +428 -0
- package/.claude/agents/github/sync-coordinator.md +452 -0
- package/.claude/agents/github/workflow-automation.md +635 -0
- package/.claude/agents/goal/goal-planner.md +73 -0
- package/.claude/agents/neural/safla-neural.md +74 -0
- package/.claude/agents/optimization/README.md +250 -0
- package/.claude/agents/optimization/benchmark-suite.md +665 -0
- package/.claude/agents/optimization/load-balancer.md +431 -0
- package/.claude/agents/optimization/performance-monitor.md +672 -0
- package/.claude/agents/optimization/resource-allocator.md +674 -0
- package/.claude/agents/optimization/topology-optimizer.md +808 -0
- package/.claude/agents/sparc/architecture.md +472 -0
- package/.claude/agents/sparc/pseudocode.md +318 -0
- package/.claude/agents/sparc/refinement.md +525 -0
- package/.claude/agents/sparc/specification.md +276 -0
- package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +226 -0
- package/.claude/agents/sublinear/consciousness-evolution-agent.md +499 -0
- package/.claude/agents/sublinear/matrix-solver-agent.md +113 -0
- package/.claude/agents/sublinear/nanosecond-scheduler-agent.md +644 -0
- package/.claude/agents/sublinear/pagerank-agent.md +699 -0
- package/.claude/agents/sublinear/phi-calculator-agent.md +749 -0
- package/.claude/agents/sublinear/psycho-symbolic-agent.md +543 -0
- package/.claude/agents/sublinear/sublinear.md +816 -0
- package/.claude/agents/sublinear/temporal-advantage-agent.md +360 -0
- package/.claude/agents/swarm/README.md +190 -0
- package/.claude/agents/swarm/adaptive-coordinator.md +396 -0
- package/.claude/agents/swarm/hierarchical-coordinator.md +300 -0
- package/.claude/agents/swarm/mesh-coordinator.md +435 -0
- package/.claude/agents/templates/automation-smart-agent.md +205 -0
- package/.claude/agents/templates/coordinator-swarm-init.md +90 -0
- package/.claude/agents/templates/github-pr-manager.md +177 -0
- package/.claude/agents/templates/implementer-sparc-coder.md +259 -0
- package/.claude/agents/templates/memory-coordinator.md +187 -0
- package/.claude/agents/templates/migration-plan.md +746 -0
- package/.claude/agents/templates/orchestrator-task.md +139 -0
- package/.claude/agents/templates/performance-analyzer.md +199 -0
- package/.claude/agents/templates/sparc-coordinator.md +183 -0
- package/.claude/agents/testing/e2e/playwright-agent.md +249 -0
- package/.claude/agents/testing/unit/tdd-london-swarm.md +244 -0
- package/.claude/agents/testing/validation/production-validator.md +395 -0
- package/.claude/commands/agents/README.md +10 -0
- package/.claude/commands/agents/agent-capabilities.md +21 -0
- package/.claude/commands/agents/agent-coordination.md +28 -0
- package/.claude/commands/agents/agent-spawning.md +28 -0
- package/.claude/commands/agents/agent-types.md +26 -0
- package/.claude/commands/analysis/COMMAND_COMPLIANCE_REPORT.md +54 -0
- package/.claude/commands/analysis/README.md +9 -0
- package/.claude/commands/analysis/bottleneck-detect.md +162 -0
- package/.claude/commands/analysis/performance-bottlenecks.md +59 -0
- package/.claude/commands/analysis/performance-report.md +25 -0
- package/.claude/commands/analysis/token-efficiency.md +45 -0
- package/.claude/commands/analysis/token-usage.md +25 -0
- package/.claude/commands/automation/README.md +9 -0
- package/.claude/commands/automation/auto-agent.md +122 -0
- package/.claude/commands/automation/self-healing.md +106 -0
- package/.claude/commands/automation/session-memory.md +90 -0
- package/.claude/commands/automation/smart-agents.md +73 -0
- package/.claude/commands/automation/smart-spawn.md +25 -0
- package/.claude/commands/automation/workflow-select.md +25 -0
- package/.claude/commands/coordination/README.md +9 -0
- package/.claude/commands/coordination/agent-spawn.md +25 -0
- package/.claude/commands/coordination/init.md +44 -0
- package/.claude/commands/coordination/orchestrate.md +43 -0
- package/.claude/commands/coordination/spawn.md +45 -0
- package/.claude/commands/coordination/swarm-init.md +85 -0
- package/.claude/commands/coordination/task-orchestrate.md +25 -0
- package/.claude/commands/flow-nexus/app-store.md +124 -0
- package/.claude/commands/flow-nexus/challenges.md +120 -0
- package/.claude/commands/flow-nexus/login-registration.md +65 -0
- package/.claude/commands/flow-nexus/neural-network.md +134 -0
- package/.claude/commands/flow-nexus/payments.md +116 -0
- package/.claude/commands/flow-nexus/sandbox.md +83 -0
- package/.claude/commands/flow-nexus/swarm.md +87 -0
- package/.claude/commands/flow-nexus/user-tools.md +152 -0
- package/.claude/commands/flow-nexus/workflow.md +115 -0
- package/.claude/commands/github/README.md +11 -0
- package/.claude/commands/github/code-review-swarm.md +514 -0
- package/.claude/commands/github/code-review.md +25 -0
- package/.claude/commands/github/github-modes.md +147 -0
- package/.claude/commands/github/github-swarm.md +121 -0
- package/.claude/commands/github/issue-tracker.md +292 -0
- package/.claude/commands/github/issue-triage.md +25 -0
- package/.claude/commands/github/multi-repo-swarm.md +519 -0
- package/.claude/commands/github/pr-enhance.md +26 -0
- package/.claude/commands/github/pr-manager.md +170 -0
- package/.claude/commands/github/project-board-sync.md +471 -0
- package/.claude/commands/github/release-manager.md +338 -0
- package/.claude/commands/github/release-swarm.md +544 -0
- package/.claude/commands/github/repo-analyze.md +25 -0
- package/.claude/commands/github/repo-architect.md +367 -0
- package/.claude/commands/github/swarm-issue.md +482 -0
- package/.claude/commands/github/swarm-pr.md +285 -0
- package/.claude/commands/github/sync-coordinator.md +301 -0
- package/.claude/commands/github/workflow-automation.md +442 -0
- package/.claude/commands/hive-mind/README.md +17 -0
- package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
- package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
- package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
- package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
- package/.claude/commands/hive-mind/hive-mind.md +27 -0
- package/.claude/commands/hooks/README.md +11 -0
- package/.claude/commands/hooks/overview.md +58 -0
- package/.claude/commands/hooks/post-edit.md +117 -0
- package/.claude/commands/hooks/post-task.md +112 -0
- package/.claude/commands/hooks/pre-edit.md +113 -0
- package/.claude/commands/hooks/pre-task.md +111 -0
- package/.claude/commands/hooks/session-end.md +118 -0
- package/.claude/commands/hooks/setup.md +103 -0
- package/.claude/commands/memory/README.md +9 -0
- package/.claude/commands/memory/memory-persist.md +25 -0
- package/.claude/commands/memory/memory-search.md +25 -0
- package/.claude/commands/memory/memory-usage.md +25 -0
- package/.claude/commands/memory/neural.md +47 -0
- package/.claude/commands/memory/usage.md +46 -0
- package/.claude/commands/monitoring/README.md +9 -0
- package/.claude/commands/monitoring/agent-metrics.md +25 -0
- package/.claude/commands/monitoring/agents.md +44 -0
- package/.claude/commands/monitoring/real-time-view.md +25 -0
- package/.claude/commands/monitoring/status.md +46 -0
- package/.claude/commands/monitoring/swarm-monitor.md +25 -0
- package/.claude/commands/optimization/README.md +9 -0
- package/.claude/commands/optimization/auto-topology.md +62 -0
- package/.claude/commands/optimization/cache-manage.md +25 -0
- package/.claude/commands/optimization/parallel-execute.md +25 -0
- package/.claude/commands/optimization/parallel-execution.md +50 -0
- package/.claude/commands/optimization/topology-optimize.md +25 -0
- package/.claude/commands/pair/README.md +261 -0
- package/.claude/commands/pair/commands.md +546 -0
- package/.claude/commands/pair/config.md +510 -0
- package/.claude/commands/pair/examples.md +512 -0
- package/.claude/commands/pair/modes.md +348 -0
- package/.claude/commands/pair/session.md +407 -0
- package/.claude/commands/pair/start.md +209 -0
- package/.claude/commands/sparc/analyzer.md +52 -0
- package/.claude/commands/sparc/architect.md +53 -0
- package/.claude/commands/sparc/batch-executor.md +54 -0
- package/.claude/commands/sparc/coder.md +54 -0
- package/.claude/commands/sparc/debugger.md +54 -0
- package/.claude/commands/sparc/designer.md +53 -0
- package/.claude/commands/sparc/documenter.md +54 -0
- package/.claude/commands/sparc/innovator.md +54 -0
- package/.claude/commands/sparc/memory-manager.md +54 -0
- package/.claude/commands/sparc/optimizer.md +54 -0
- package/.claude/commands/sparc/orchestrator.md +132 -0
- package/.claude/commands/sparc/researcher.md +54 -0
- package/.claude/commands/sparc/reviewer.md +54 -0
- package/.claude/commands/sparc/sparc-modes.md +174 -0
- package/.claude/commands/sparc/swarm-coordinator.md +54 -0
- package/.claude/commands/sparc/tdd.md +54 -0
- package/.claude/commands/sparc/tester.md +54 -0
- package/.claude/commands/sparc/workflow-manager.md +54 -0
- package/.claude/commands/stream-chain/pipeline.md +121 -0
- package/.claude/commands/stream-chain/run.md +70 -0
- package/.claude/commands/swarm/README.md +15 -0
- package/.claude/commands/swarm/analysis.md +95 -0
- package/.claude/commands/swarm/development.md +96 -0
- package/.claude/commands/swarm/examples.md +168 -0
- package/.claude/commands/swarm/maintenance.md +102 -0
- package/.claude/commands/swarm/optimization.md +117 -0
- package/.claude/commands/swarm/research.md +136 -0
- package/.claude/commands/swarm/swarm-analysis.md +8 -0
- package/.claude/commands/swarm/swarm-background.md +8 -0
- package/.claude/commands/swarm/swarm-init.md +19 -0
- package/.claude/commands/swarm/swarm-modes.md +8 -0
- package/.claude/commands/swarm/swarm-monitor.md +8 -0
- package/.claude/commands/swarm/swarm-spawn.md +19 -0
- package/.claude/commands/swarm/swarm-status.md +8 -0
- package/.claude/commands/swarm/swarm-strategies.md +8 -0
- package/.claude/commands/swarm/swarm.md +27 -0
- package/.claude/commands/swarm/testing.md +131 -0
- package/.claude/commands/testing/playwright-e2e.md +288 -0
- package/.claude/commands/training/README.md +9 -0
- package/.claude/commands/training/model-update.md +25 -0
- package/.claude/commands/training/neural-patterns.md +74 -0
- package/.claude/commands/training/neural-train.md +25 -0
- package/.claude/commands/training/pattern-learn.md +25 -0
- package/.claude/commands/training/specialization.md +63 -0
- package/.claude/commands/truth/start.md +143 -0
- package/.claude/commands/verify/check.md +50 -0
- package/.claude/commands/verify/start.md +128 -0
- package/.claude/commands/workflows/README.md +9 -0
- package/.claude/commands/workflows/development.md +78 -0
- package/.claude/commands/workflows/research.md +63 -0
- package/.claude/commands/workflows/workflow-create.md +25 -0
- package/.claude/commands/workflows/workflow-execute.md +25 -0
- package/.claude/commands/workflows/workflow-export.md +25 -0
- package/.claude/helpers/checkpoint-manager.sh +251 -0
- package/.claude/helpers/github-safe.js +106 -0
- package/.claude/helpers/github-setup.sh +28 -0
- package/.claude/helpers/quick-start.sh +19 -0
- package/.claude/helpers/setup-mcp.sh +18 -0
- package/.claude/helpers/standard-checkpoint-hooks.sh +179 -0
- package/.claude/settings.json +112 -0
- package/.claude/settings.local.json +10 -0
- package/CHANGELOG.md +1517 -0
- package/LICENSE +21 -0
- package/README.md +338 -0
- package/dist/src/adapters/cliffy-node.js +70 -0
- package/dist/src/adapters/cliffy-node.js.map +1 -0
- package/dist/src/agents/agent-loader.js +208 -0
- package/dist/src/agents/agent-loader.js.map +1 -0
- package/dist/src/agents/agent-manager.js +1786 -0
- package/dist/src/agents/agent-manager.js.map +1 -0
- package/dist/src/agents/agent-registry.js +356 -0
- package/dist/src/agents/agent-registry.js.map +1 -0
- package/dist/src/agents/agent-validator.js +273 -0
- package/dist/src/agents/agent-validator.js.map +1 -0
- package/dist/src/agents/github/agent-factory.js +553 -0
- package/dist/src/agents/github/agent-factory.js.map +1 -0
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js +307 -0
- package/dist/src/agents/github/compatibility/legacy-agent-mappings.js.map +1 -0
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js +334 -0
- package/dist/src/agents/github/compatibility/legacy-agent-proxy.js.map +1 -0
- package/dist/src/agents/github/core/github-collaboration-manager.js +796 -0
- package/dist/src/agents/github/core/github-collaboration-manager.js.map +1 -0
- package/dist/src/agents/github/core/github-integration-manager.js +546 -0
- package/dist/src/agents/github/core/github-integration-manager.js.map +1 -0
- package/dist/src/agents/github/core/github-release-coordinator.js +718 -0
- package/dist/src/agents/github/core/github-release-coordinator.js.map +1 -0
- package/dist/src/agents/github/index.js +68 -0
- package/dist/src/agents/github/index.js.map +1 -0
- package/dist/src/agents/github/types/index.js +6 -0
- package/dist/src/agents/github/types/index.js.map +1 -0
- package/dist/src/agents/github/utils/error-handling.js +496 -0
- package/dist/src/agents/github/utils/error-handling.js.map +1 -0
- package/dist/src/agents/github/utils/github-client.js +158 -0
- package/dist/src/agents/github/utils/github-client.js.map +1 -0
- package/dist/src/agents/github/utils/hook-integration.js +450 -0
- package/dist/src/agents/github/utils/hook-integration.js.map +1 -0
- package/dist/src/agents/github/utils/performance-optimizer.js +501 -0
- package/dist/src/agents/github/utils/performance-optimizer.js.map +1 -0
- package/dist/src/agents/hierarchical-coordinator.js +775 -0
- package/dist/src/agents/hierarchical-coordinator.js.map +1 -0
- package/dist/src/agents/lifecycle-manager.js +613 -0
- package/dist/src/agents/lifecycle-manager.js.map +1 -0
- package/dist/src/agents/mesh-coordinator.js +580 -0
- package/dist/src/agents/mesh-coordinator.js.map +1 -0
- package/dist/src/agents/simple-agent.js +89 -0
- package/dist/src/agents/simple-agent.js.map +1 -0
- package/dist/src/agents/task-agent-integration.js +240 -0
- package/dist/src/agents/task-agent-integration.js.map +1 -0
- package/dist/src/api/auth-service.js +474 -0
- package/dist/src/api/auth-service.js.map +1 -0
- package/dist/src/api/claude-api-errors.js +171 -0
- package/dist/src/api/claude-api-errors.js.map +1 -0
- package/dist/src/api/claude-client-enhanced.js +473 -0
- package/dist/src/api/claude-client-enhanced.js.map +1 -0
- package/dist/src/api/claude-client.js +527 -0
- package/dist/src/api/claude-client.js.map +1 -0
- package/dist/src/api/database-service.js +666 -0
- package/dist/src/api/database-service.js.map +1 -0
- package/dist/src/api/swarm-api.js +585 -0
- package/dist/src/api/swarm-api.js.map +1 -0
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js +448 -0
- package/dist/src/automation/test-pipeline/E2ETestGenerator.js.map +1 -0
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js +572 -0
- package/dist/src/automation/test-pipeline/PerformanceMonitor.js.map +1 -0
- package/dist/src/automation/test-pipeline/PipelineValidator.js +654 -0
- package/dist/src/automation/test-pipeline/PipelineValidator.js.map +1 -0
- package/dist/src/automation/test-pipeline/RegressionTestManager.js +545 -0
- package/dist/src/automation/test-pipeline/RegressionTestManager.js.map +1 -0
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js +450 -0
- package/dist/src/automation/test-pipeline/SwarmTestCoordinator.js.map +1 -0
- package/dist/src/automation/test-pipeline/TestDataManager.js +708 -0
- package/dist/src/automation/test-pipeline/TestDataManager.js.map +1 -0
- package/dist/src/automation/test-pipeline/TestReportingSystem.js +527 -0
- package/dist/src/automation/test-pipeline/TestReportingSystem.js.map +1 -0
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js +353 -0
- package/dist/src/automation/test-pipeline/utils/chrome-mcp-integration.js.map +1 -0
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js +448 -0
- package/dist/src/automation/test-pipeline/utils/swarm-coordinator.js.map +1 -0
- package/dist/src/ci-cd/deployment-orchestrator.js +477 -0
- package/dist/src/ci-cd/deployment-orchestrator.js.map +1 -0
- package/dist/src/ci-cd/github-actions-templates.js +972 -0
- package/dist/src/ci-cd/github-actions-templates.js.map +1 -0
- package/dist/src/ci-cd/performance/PerformanceGate.js +383 -0
- package/dist/src/ci-cd/performance/PerformanceGate.js.map +1 -0
- package/dist/src/cli/agents/analyst.js +788 -0
- package/dist/src/cli/agents/analyst.js.map +1 -0
- package/dist/src/cli/agents/architect.js +846 -0
- package/dist/src/cli/agents/architect.js.map +1 -0
- package/dist/src/cli/agents/base-agent.js +437 -0
- package/dist/src/cli/agents/base-agent.js.map +1 -0
- package/dist/src/cli/agents/capabilities.js +701 -0
- package/dist/src/cli/agents/capabilities.js.map +1 -0
- package/dist/src/cli/agents/coder.js +936 -0
- package/dist/src/cli/agents/coder.js.map +1 -0
- package/dist/src/cli/agents/coordinator.js +489 -0
- package/dist/src/cli/agents/coordinator.js.map +1 -0
- package/dist/src/cli/agents/hive-agents.js +708 -0
- package/dist/src/cli/agents/hive-agents.js.map +1 -0
- package/dist/src/cli/agents/index.js +299 -0
- package/dist/src/cli/agents/index.js.map +1 -0
- package/dist/src/cli/agents/researcher.js +388 -0
- package/dist/src/cli/agents/researcher.js.map +1 -0
- package/dist/src/cli/agents/tester.js +634 -0
- package/dist/src/cli/agents/tester.js.map +1 -0
- package/dist/src/cli/cli-core.js +264 -0
- package/dist/src/cli/cli-core.js.map +1 -0
- package/dist/src/cli/commands/advanced-memory-commands.js +834 -0
- package/dist/src/cli/commands/advanced-memory-commands.js.map +1 -0
- package/dist/src/cli/commands/agent-simple.js +346 -0
- package/dist/src/cli/commands/agent-simple.js.map +1 -0
- package/dist/src/cli/commands/agent.js +368 -0
- package/dist/src/cli/commands/agent.js.map +1 -0
- package/dist/src/cli/commands/claude-api.js +237 -0
- package/dist/src/cli/commands/claude-api.js.map +1 -0
- package/dist/src/cli/commands/claude.js +132 -0
- package/dist/src/cli/commands/claude.js.map +1 -0
- package/dist/src/cli/commands/config-integration.js +395 -0
- package/dist/src/cli/commands/config-integration.js.map +1 -0
- package/dist/src/cli/commands/config.js +67 -0
- package/dist/src/cli/commands/config.js.map +1 -0
- package/dist/src/cli/commands/enterprise.js +1523 -0
- package/dist/src/cli/commands/enterprise.js.map +1 -0
- package/dist/src/cli/commands/goal-init.js +262 -0
- package/dist/src/cli/commands/goal-init.js.map +1 -0
- package/dist/src/cli/commands/help-new.js +276 -0
- package/dist/src/cli/commands/help-new.js.map +1 -0
- package/dist/src/cli/commands/help.js +1055 -0
- package/dist/src/cli/commands/help.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/index.js +20 -0
- package/dist/src/cli/commands/hive-mind/index.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/init.js +58 -0
- package/dist/src/cli/commands/hive-mind/init.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/optimize-memory.js +362 -0
- package/dist/src/cli/commands/hive-mind/optimize-memory.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/pause.js +73 -0
- package/dist/src/cli/commands/hive-mind/pause.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/ps.js +104 -0
- package/dist/src/cli/commands/hive-mind/ps.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/resume.js +56 -0
- package/dist/src/cli/commands/hive-mind/resume.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/spawn.js +242 -0
- package/dist/src/cli/commands/hive-mind/spawn.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/status.js +250 -0
- package/dist/src/cli/commands/hive-mind/status.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/stop.js +116 -0
- package/dist/src/cli/commands/hive-mind/stop.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/task.js +302 -0
- package/dist/src/cli/commands/hive-mind/task.js.map +1 -0
- package/dist/src/cli/commands/hive-mind/wizard.js +705 -0
- package/dist/src/cli/commands/hive-mind/wizard.js.map +1 -0
- package/dist/src/cli/commands/hive.js +506 -0
- package/dist/src/cli/commands/hive.js.map +1 -0
- package/dist/src/cli/commands/hook-types.js +5 -0
- package/dist/src/cli/commands/hook-types.js.map +1 -0
- package/dist/src/cli/commands/hook-validator.js +177 -0
- package/dist/src/cli/commands/hook-validator.js.map +1 -0
- package/dist/src/cli/commands/hook.js +303 -0
- package/dist/src/cli/commands/hook.js.map +1 -0
- package/dist/src/cli/commands/index.js +2745 -0
- package/dist/src/cli/commands/index.js.map +1 -0
- package/dist/src/cli/commands/maestro.js +242 -0
- package/dist/src/cli/commands/maestro.js.map +1 -0
- package/dist/src/cli/commands/mcp.js +148 -0
- package/dist/src/cli/commands/mcp.js.map +1 -0
- package/dist/src/cli/commands/memory.js +193 -0
- package/dist/src/cli/commands/memory.js.map +1 -0
- package/dist/src/cli/commands/migrate.js +107 -0
- package/dist/src/cli/commands/migrate.js.map +1 -0
- package/dist/src/cli/commands/monitor.js +574 -0
- package/dist/src/cli/commands/monitor.js.map +1 -0
- package/dist/src/cli/commands/neural-init.js +211 -0
- package/dist/src/cli/commands/neural-init.js.map +1 -0
- package/dist/src/cli/commands/ruv-swarm.js +555 -0
- package/dist/src/cli/commands/ruv-swarm.js.map +1 -0
- package/dist/src/cli/commands/session.js +517 -0
- package/dist/src/cli/commands/session.js.map +1 -0
- package/dist/src/cli/commands/sparc.js +486 -0
- package/dist/src/cli/commands/sparc.js.map +1 -0
- package/dist/src/cli/commands/start/event-emitter.js +35 -0
- package/dist/src/cli/commands/start/event-emitter.js.map +1 -0
- package/dist/src/cli/commands/start/index.js +9 -0
- package/dist/src/cli/commands/start/index.js.map +1 -0
- package/dist/src/cli/commands/start/process-manager.js +294 -0
- package/dist/src/cli/commands/start/process-manager.js.map +1 -0
- package/dist/src/cli/commands/start/process-ui-simple.js +322 -0
- package/dist/src/cli/commands/start/process-ui-simple.js.map +1 -0
- package/dist/src/cli/commands/start/process-ui.js +5 -0
- package/dist/src/cli/commands/start/process-ui.js.map +1 -0
- package/dist/src/cli/commands/start/start-command.js +463 -0
- package/dist/src/cli/commands/start/start-command.js.map +1 -0
- package/dist/src/cli/commands/start/system-monitor.js +268 -0
- package/dist/src/cli/commands/start/system-monitor.js.map +1 -0
- package/dist/src/cli/commands/start/types.js +22 -0
- package/dist/src/cli/commands/start/types.js.map +1 -0
- package/dist/src/cli/commands/start.js +6 -0
- package/dist/src/cli/commands/start.js.map +1 -0
- package/dist/src/cli/commands/status.js +328 -0
- package/dist/src/cli/commands/status.js.map +1 -0
- package/dist/src/cli/commands/swarm-spawn.js +56 -0
- package/dist/src/cli/commands/swarm-spawn.js.map +1 -0
- package/dist/src/cli/commands/swarm.js +567 -0
- package/dist/src/cli/commands/swarm.js.map +1 -0
- package/dist/src/cli/commands/task.js +44 -0
- package/dist/src/cli/commands/task.js.map +1 -0
- package/dist/src/cli/commands/validate-integration.js +122 -0
- package/dist/src/cli/commands/validate-integration.js.map +1 -0
- package/dist/src/cli/commands/verification.js +351 -0
- package/dist/src/cli/commands/verification.js.map +1 -0
- package/dist/src/cli/commands/workflow.js +615 -0
- package/dist/src/cli/commands/workflow.js.map +1 -0
- package/dist/src/cli/completion.js +578 -0
- package/dist/src/cli/completion.js.map +1 -0
- package/dist/src/cli/consolidated/ConsolidatedCLI.js +379 -0
- package/dist/src/cli/consolidated/ConsolidatedCLI.js.map +1 -0
- package/dist/src/cli/consolidated/core/CommandHandlers.js +833 -0
- package/dist/src/cli/consolidated/core/CommandHandlers.js.map +1 -0
- package/dist/src/cli/consolidated/core/TierManager.js +291 -0
- package/dist/src/cli/consolidated/core/TierManager.js.map +1 -0
- package/dist/src/cli/consolidated/help/InteractiveHelp.js +714 -0
- package/dist/src/cli/consolidated/help/InteractiveHelp.js.map +1 -0
- package/dist/src/cli/consolidated/index.js +62 -0
- package/dist/src/cli/consolidated/index.js.map +1 -0
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js +457 -0
- package/dist/src/cli/consolidated/intelligence/IntelligenceEngine.js.map +1 -0
- package/dist/src/cli/consolidated/routing/CommandRouter.js +526 -0
- package/dist/src/cli/consolidated/routing/CommandRouter.js.map +1 -0
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js +729 -0
- package/dist/src/cli/consolidated/utils/IntelligentDefaults.js.map +1 -0
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js +416 -0
- package/dist/src/cli/consolidated/utils/PerformanceOptimizer.js.map +1 -0
- package/dist/src/cli/formatter.js +284 -0
- package/dist/src/cli/formatter.js.map +1 -0
- package/dist/src/cli/help-formatter.js +111 -0
- package/dist/src/cli/help-formatter.js.map +1 -0
- package/dist/src/cli/index-remote.js +125 -0
- package/dist/src/cli/index-remote.js.map +1 -0
- package/dist/src/cli/index.js +159 -0
- package/dist/src/cli/index.js.map +1 -0
- package/dist/src/cli/init/batch-tools.js +388 -0
- package/dist/src/cli/init/batch-tools.js.map +1 -0
- package/dist/src/cli/init/claude-config.js +401 -0
- package/dist/src/cli/init/claude-config.js.map +1 -0
- package/dist/src/cli/init/directory-structure.js +146 -0
- package/dist/src/cli/init/directory-structure.js.map +1 -0
- package/dist/src/cli/init/index.js +52 -0
- package/dist/src/cli/init/index.js.map +1 -0
- package/dist/src/cli/init/sparc-environment.js +543 -0
- package/dist/src/cli/init/sparc-environment.js.map +1 -0
- package/dist/src/cli/init/swarm-commands.js +796 -0
- package/dist/src/cli/init/swarm-commands.js.map +1 -0
- package/dist/src/cli/init/utils.js +15 -0
- package/dist/src/cli/init/utils.js.map +1 -0
- package/dist/src/cli/maestro-cli-bridge.js +426 -0
- package/dist/src/cli/maestro-cli-bridge.js.map +1 -0
- package/dist/src/cli/main.js +26 -0
- package/dist/src/cli/main.js.map +1 -0
- package/dist/src/cli/node-repl.js +652 -0
- package/dist/src/cli/node-repl.js.map +1 -0
- package/dist/src/cli/repl.js +1078 -0
- package/dist/src/cli/repl.js.map +1 -0
- package/dist/src/cli/simple-cli.js +3026 -0
- package/dist/src/cli/simple-cli.js.map +1 -0
- package/dist/src/cli/simple-mcp.js +87 -0
- package/dist/src/cli/simple-mcp.js.map +1 -0
- package/dist/src/cli/simple-orchestrator.js +857 -0
- package/dist/src/cli/simple-orchestrator.js.map +1 -0
- package/dist/src/cli/ui/compatible-ui.js +322 -0
- package/dist/src/cli/ui/compatible-ui.js.map +1 -0
- package/dist/src/cli/ui/fallback-handler.js +156 -0
- package/dist/src/cli/ui/fallback-handler.js.map +1 -0
- package/dist/src/cli/ui/index.js +32 -0
- package/dist/src/cli/ui/index.js.map +1 -0
- package/dist/src/cli/utils/environment-detector.js +228 -0
- package/dist/src/cli/utils/environment-detector.js.map +1 -0
- package/dist/src/cli/utils/prompt-defaults.js +234 -0
- package/dist/src/cli/utils/prompt-defaults.js.map +1 -0
- package/dist/src/cli/validation-helper.js +66 -0
- package/dist/src/cli/validation-helper.js.map +1 -0
- package/dist/src/communication/message-bus.js +1007 -0
- package/dist/src/communication/message-bus.js.map +1 -0
- package/dist/src/communication/reliable-communication-manager.js +374 -0
- package/dist/src/communication/reliable-communication-manager.js.map +1 -0
- package/dist/src/config/ai/decision-tree-generator.js +763 -0
- package/dist/src/config/ai/decision-tree-generator.js.map +1 -0
- package/dist/src/config/ai/project-detection-engine.js +1081 -0
- package/dist/src/config/ai/project-detection-engine.js.map +1 -0
- package/dist/src/config/config-manager.js +1285 -0
- package/dist/src/config/config-manager.js.map +1 -0
- package/dist/src/config/consent-manager.js +433 -0
- package/dist/src/config/consent-manager.js.map +1 -0
- package/dist/src/config/core/intelligent-configuration-manager.js +674 -0
- package/dist/src/config/core/intelligent-configuration-manager.js.map +1 -0
- package/dist/src/config/index.js +110 -0
- package/dist/src/config/index.js.map +1 -0
- package/dist/src/config/integration/hooks-integration.js +548 -0
- package/dist/src/config/integration/hooks-integration.js.map +1 -0
- package/dist/src/config/migration/config-migration.js +285 -0
- package/dist/src/config/migration/config-migration.js.map +1 -0
- package/dist/src/config/migration/version-migration-engine.js +984 -0
- package/dist/src/config/migration/version-migration-engine.js.map +1 -0
- package/dist/src/config/migration-manager.js +529 -0
- package/dist/src/config/migration-manager.js.map +1 -0
- package/dist/src/config/ruv-swarm-config.js +332 -0
- package/dist/src/config/ruv-swarm-config.js.map +1 -0
- package/dist/src/config/ruv-swarm-integration.js +285 -0
- package/dist/src/config/ruv-swarm-integration.js.map +1 -0
- package/dist/src/config/storage/multi-tier-storage.js +626 -0
- package/dist/src/config/storage/multi-tier-storage.js.map +1 -0
- package/dist/src/config/test-migration-fixer.js +332 -0
- package/dist/src/config/test-migration-fixer.js.map +1 -0
- package/dist/src/config/ui/progressive-disclosure-engine.js +876 -0
- package/dist/src/config/ui/progressive-disclosure-engine.js.map +1 -0
- package/dist/src/config/utils/config-export-import.js +454 -0
- package/dist/src/config/utils/config-export-import.js.map +1 -0
- package/dist/src/config/utils/zero-config-setup.js +238 -0
- package/dist/src/config/utils/zero-config-setup.js.map +1 -0
- package/dist/src/config/validation/config-validator.js +462 -0
- package/dist/src/config/validation/config-validator.js.map +1 -0
- package/dist/src/config/web-portal-config.js +343 -0
- package/dist/src/config/web-portal-config.js.map +1 -0
- package/dist/src/config/zero-config-setup.js +294 -0
- package/dist/src/config/zero-config-setup.js.map +1 -0
- package/dist/src/constants/agent-types.js +51 -0
- package/dist/src/constants/agent-types.js.map +1 -0
- package/dist/src/coordination/advanced-scheduler.js +370 -0
- package/dist/src/coordination/advanced-scheduler.js.map +1 -0
- package/dist/src/coordination/advanced-task-executor.js +481 -0
- package/dist/src/coordination/advanced-task-executor.js.map +1 -0
- package/dist/src/coordination/background-executor.js +366 -0
- package/dist/src/coordination/background-executor.js.map +1 -0
- package/dist/src/coordination/circuit-breaker.js +286 -0
- package/dist/src/coordination/circuit-breaker.js.map +1 -0
- package/dist/src/coordination/conflict-resolution.js +348 -0
- package/dist/src/coordination/conflict-resolution.js.map +1 -0
- package/dist/src/coordination/dependency-graph.js +398 -0
- package/dist/src/coordination/dependency-graph.js.map +1 -0
- package/dist/src/coordination/hive-orchestrator.js +309 -0
- package/dist/src/coordination/hive-orchestrator.js.map +1 -0
- package/dist/src/coordination/hive-protocol.js +363 -0
- package/dist/src/coordination/hive-protocol.js.map +1 -0
- package/dist/src/coordination/index.js +21 -0
- package/dist/src/coordination/index.js.map +1 -0
- package/dist/src/coordination/load-balancer.js +737 -0
- package/dist/src/coordination/load-balancer.js.map +1 -0
- package/dist/src/coordination/manager.js +360 -0
- package/dist/src/coordination/manager.js.map +1 -0
- package/dist/src/coordination/messaging.js +221 -0
- package/dist/src/coordination/messaging.js.map +1 -0
- package/dist/src/coordination/metrics.js +415 -0
- package/dist/src/coordination/metrics.js.map +1 -0
- package/dist/src/coordination/resources.js +276 -0
- package/dist/src/coordination/resources.js.map +1 -0
- package/dist/src/coordination/scheduler.js +322 -0
- package/dist/src/coordination/scheduler.js.map +1 -0
- package/dist/src/coordination/swarm-coordinator.js +585 -0
- package/dist/src/coordination/swarm-coordinator.js.map +1 -0
- package/dist/src/coordination/swarm-monitor.js +359 -0
- package/dist/src/coordination/swarm-monitor.js.map +1 -0
- package/dist/src/coordination/work-stealing.js +164 -0
- package/dist/src/coordination/work-stealing.js.map +1 -0
- package/dist/src/core/agent-manager.js +80 -0
- package/dist/src/core/agent-manager.js.map +1 -0
- package/dist/src/core/config.js +1221 -0
- package/dist/src/core/config.js.map +1 -0
- package/dist/src/core/event-bus.js +136 -0
- package/dist/src/core/event-bus.js.map +1 -0
- package/dist/src/core/index.js +6 -0
- package/dist/src/core/index.js.map +1 -0
- package/dist/src/core/json-persistence.js +112 -0
- package/dist/src/core/json-persistence.js.map +1 -0
- package/dist/src/core/logger.js +245 -0
- package/dist/src/core/logger.js.map +1 -0
- package/dist/src/core/orchestrator-fixed.js +236 -0
- package/dist/src/core/orchestrator-fixed.js.map +1 -0
- package/dist/src/core/orchestrator.js +1136 -0
- package/dist/src/core/orchestrator.js.map +1 -0
- package/dist/src/core/persistence.js +185 -0
- package/dist/src/core/persistence.js.map +1 -0
- package/dist/src/core/project-manager.js +80 -0
- package/dist/src/core/project-manager.js.map +1 -0
- package/dist/src/core/version.js +35 -0
- package/dist/src/core/version.js.map +1 -0
- package/dist/src/crdt/types.js +509 -0
- package/dist/src/crdt/types.js.map +1 -0
- package/dist/src/enterprise/analytics-manager.js +1133 -0
- package/dist/src/enterprise/analytics-manager.js.map +1 -0
- package/dist/src/enterprise/audit-manager.js +1112 -0
- package/dist/src/enterprise/audit-manager.js.map +1 -0
- package/dist/src/enterprise/cloud-manager.js +886 -0
- package/dist/src/enterprise/cloud-manager.js.map +1 -0
- package/dist/src/enterprise/deployment-manager.js +963 -0
- package/dist/src/enterprise/deployment-manager.js.map +1 -0
- package/dist/src/enterprise/index.js +8 -0
- package/dist/src/enterprise/index.js.map +1 -0
- package/dist/src/enterprise/project-manager.js +577 -0
- package/dist/src/enterprise/project-manager.js.map +1 -0
- package/dist/src/enterprise/security-manager.js +987 -0
- package/dist/src/enterprise/security-manager.js.map +1 -0
- package/dist/src/feature-flags/cli/Phase4CLI.js +463 -0
- package/dist/src/feature-flags/cli/Phase4CLI.js.map +1 -0
- package/dist/src/feature-flags/core/FeatureFlagManager.js +324 -0
- package/dist/src/feature-flags/core/FeatureFlagManager.js.map +1 -0
- package/dist/src/feature-flags/index.js +237 -0
- package/dist/src/feature-flags/index.js.map +1 -0
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js +275 -0
- package/dist/src/feature-flags/monitoring/RolloutMonitor.js.map +1 -0
- package/dist/src/feature-flags/rollout/RolloutController.js +301 -0
- package/dist/src/feature-flags/rollout/RolloutController.js.map +1 -0
- package/dist/src/feature-flags/validation/HookInterceptor.js +310 -0
- package/dist/src/feature-flags/validation/HookInterceptor.js.map +1 -0
- package/dist/src/feature-flags/validation/TruthBasedValidator.js +263 -0
- package/dist/src/feature-flags/validation/TruthBasedValidator.js.map +1 -0
- package/dist/src/hive-mind/core/Agent.js +569 -0
- package/dist/src/hive-mind/core/Agent.js.map +1 -0
- package/dist/src/hive-mind/core/Communication.js +411 -0
- package/dist/src/hive-mind/core/Communication.js.map +1 -0
- package/dist/src/hive-mind/core/DatabaseManager.js +599 -0
- package/dist/src/hive-mind/core/DatabaseManager.js.map +1 -0
- package/dist/src/hive-mind/core/HiveMind.js +575 -0
- package/dist/src/hive-mind/core/HiveMind.js.map +1 -0
- package/dist/src/hive-mind/core/Memory.js +1159 -0
- package/dist/src/hive-mind/core/Memory.js.map +1 -0
- package/dist/src/hive-mind/core/MemoryMonitor.js +525 -0
- package/dist/src/hive-mind/core/MemoryMonitor.js.map +1 -0
- package/dist/src/hive-mind/core/Queen.js +753 -0
- package/dist/src/hive-mind/core/Queen.js.map +1 -0
- package/dist/src/hive-mind/index.js +21 -0
- package/dist/src/hive-mind/index.js.map +1 -0
- package/dist/src/hive-mind/integration/ConsensusEngine.js +460 -0
- package/dist/src/hive-mind/integration/ConsensusEngine.js.map +1 -0
- package/dist/src/hive-mind/integration/MCPToolWrapper.js +243 -0
- package/dist/src/hive-mind/integration/MCPToolWrapper.js.map +1 -0
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js +812 -0
- package/dist/src/hive-mind/integration/SwarmOrchestrator.js.map +1 -0
- package/dist/src/hive-mind/types.js +9 -0
- package/dist/src/hive-mind/types.js.map +1 -0
- package/dist/src/hooks/index.js +197 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/index.js +11 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/integration/mock-components.js +362 -0
- package/dist/src/integration/mock-components.js.map +1 -0
- package/dist/src/integration/system-integration.js +428 -0
- package/dist/src/integration/system-integration.js.map +1 -0
- package/dist/src/integration/types.js +5 -0
- package/dist/src/integration/types.js.map +1 -0
- package/dist/src/lifecycle/communication-protocols.js +568 -0
- package/dist/src/lifecycle/communication-protocols.js.map +1 -0
- package/dist/src/lifecycle/dependency-tracker.js +799 -0
- package/dist/src/lifecycle/dependency-tracker.js.map +1 -0
- package/dist/src/lifecycle/memory-schema.js +622 -0
- package/dist/src/lifecycle/memory-schema.js.map +1 -0
- package/dist/src/maestro/maestro-swarm-coordinator.js +504 -0
- package/dist/src/maestro/maestro-swarm-coordinator.js.map +1 -0
- package/dist/src/maestro/maestro-types.js +3 -0
- package/dist/src/maestro/maestro-types.js.map +1 -0
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js +382 -0
- package/dist/src/maestro/tests/native-hive-mind-integration.test.js.map +1 -0
- package/dist/src/mcp/auth.js +347 -0
- package/dist/src/mcp/auth.js.map +1 -0
- package/dist/src/mcp/claude-code-wrapper.js +717 -0
- package/dist/src/mcp/claude-code-wrapper.js.map +1 -0
- package/dist/src/mcp/claude-flow-tools.js +1365 -0
- package/dist/src/mcp/claude-flow-tools.js.map +1 -0
- package/dist/src/mcp/client.js +201 -0
- package/dist/src/mcp/client.js.map +1 -0
- package/dist/src/mcp/index.js +192 -0
- package/dist/src/mcp/index.js.map +1 -0
- package/dist/src/mcp/integrate-wrapper.js +85 -0
- package/dist/src/mcp/integrate-wrapper.js.map +1 -0
- package/dist/src/mcp/lifecycle-manager.js +348 -0
- package/dist/src/mcp/lifecycle-manager.js.map +1 -0
- package/dist/src/mcp/load-balancer.js +386 -0
- package/dist/src/mcp/load-balancer.js.map +1 -0
- package/dist/src/mcp/orchestration-integration.js +800 -0
- package/dist/src/mcp/orchestration-integration.js.map +1 -0
- package/dist/src/mcp/performance-monitor.js +489 -0
- package/dist/src/mcp/performance-monitor.js.map +1 -0
- package/dist/src/mcp/protocol-manager.js +376 -0
- package/dist/src/mcp/protocol-manager.js.map +1 -0
- package/dist/src/mcp/recovery/connection-health-monitor.js +240 -0
- package/dist/src/mcp/recovery/connection-health-monitor.js.map +1 -0
- package/dist/src/mcp/recovery/connection-state-manager.js +309 -0
- package/dist/src/mcp/recovery/connection-state-manager.js.map +1 -0
- package/dist/src/mcp/recovery/fallback-coordinator.js +288 -0
- package/dist/src/mcp/recovery/fallback-coordinator.js.map +1 -0
- package/dist/src/mcp/recovery/index.js +10 -0
- package/dist/src/mcp/recovery/index.js.map +1 -0
- package/dist/src/mcp/recovery/reconnection-manager.js +219 -0
- package/dist/src/mcp/recovery/reconnection-manager.js.map +1 -0
- package/dist/src/mcp/recovery/recovery-manager.js +262 -0
- package/dist/src/mcp/recovery/recovery-manager.js.map +1 -0
- package/dist/src/mcp/router.js +220 -0
- package/dist/src/mcp/router.js.map +1 -0
- package/dist/src/mcp/ruv-swarm-tools.js +671 -0
- package/dist/src/mcp/ruv-swarm-tools.js.map +1 -0
- package/dist/src/mcp/server-with-wrapper.js +32 -0
- package/dist/src/mcp/server-with-wrapper.js.map +1 -0
- package/dist/src/mcp/server-wrapper-mode.js +26 -0
- package/dist/src/mcp/server-wrapper-mode.js.map +1 -0
- package/dist/src/mcp/server.js +539 -0
- package/dist/src/mcp/server.js.map +1 -0
- package/dist/src/mcp/session-manager.js +338 -0
- package/dist/src/mcp/session-manager.js.map +1 -0
- package/dist/src/mcp/sparc-modes.js +455 -0
- package/dist/src/mcp/sparc-modes.js.map +1 -0
- package/dist/src/mcp/swarm-tools.js +903 -0
- package/dist/src/mcp/swarm-tools.js.map +1 -0
- package/dist/src/mcp/tests/mcp-integration.test.js +493 -0
- package/dist/src/mcp/tests/mcp-integration.test.js.map +1 -0
- package/dist/src/mcp/tools.js +426 -0
- package/dist/src/mcp/tools.js.map +1 -0
- package/dist/src/mcp/transports/base.js +5 -0
- package/dist/src/mcp/transports/base.js.map +1 -0
- package/dist/src/mcp/transports/http.js +414 -0
- package/dist/src/mcp/transports/http.js.map +1 -0
- package/dist/src/mcp/transports/stdio.js +217 -0
- package/dist/src/mcp/transports/stdio.js.map +1 -0
- package/dist/src/memory/advanced-memory-manager.js +1522 -0
- package/dist/src/memory/advanced-memory-manager.js.map +1 -0
- package/dist/src/memory/backends/base.js +5 -0
- package/dist/src/memory/backends/base.js.map +1 -0
- package/dist/src/memory/backends/markdown.js +235 -0
- package/dist/src/memory/backends/markdown.js.map +1 -0
- package/dist/src/memory/backends/sqlite.js +295 -0
- package/dist/src/memory/backends/sqlite.js.map +1 -0
- package/dist/src/memory/cache.js +177 -0
- package/dist/src/memory/cache.js.map +1 -0
- package/dist/src/memory/distributed-memory.js +745 -0
- package/dist/src/memory/distributed-memory.js.map +1 -0
- package/dist/src/memory/indexer.js +184 -0
- package/dist/src/memory/indexer.js.map +1 -0
- package/dist/src/memory/manager.js +457 -0
- package/dist/src/memory/manager.js.map +1 -0
- package/dist/src/memory/sqlite-enhanced-backend.js +529 -0
- package/dist/src/memory/sqlite-enhanced-backend.js.map +1 -0
- package/dist/src/memory/swarm-memory.js +446 -0
- package/dist/src/memory/swarm-memory.js.map +1 -0
- package/dist/src/migration/index.js +94 -0
- package/dist/src/migration/index.js.map +1 -0
- package/dist/src/migration/logger.js +110 -0
- package/dist/src/migration/logger.js.map +1 -0
- package/dist/src/migration/migration-analyzer.js +255 -0
- package/dist/src/migration/migration-analyzer.js.map +1 -0
- package/dist/src/migration/migration-runner.js +511 -0
- package/dist/src/migration/migration-runner.js.map +1 -0
- package/dist/src/migration/migration-validator.js +272 -0
- package/dist/src/migration/migration-validator.js.map +1 -0
- package/dist/src/migration/progress-reporter.js +139 -0
- package/dist/src/migration/progress-reporter.js.map +1 -0
- package/dist/src/migration/rollback-manager.js +310 -0
- package/dist/src/migration/rollback-manager.js.map +1 -0
- package/dist/src/migration/tests/migration-system.test.js +9 -0
- package/dist/src/migration/tests/migration-system.test.js.map +1 -0
- package/dist/src/migration/types.js +5 -0
- package/dist/src/migration/types.js.map +1 -0
- package/dist/src/monitoring/diagnostics.js +532 -0
- package/dist/src/monitoring/diagnostics.js.map +1 -0
- package/dist/src/monitoring/health-check.js +355 -0
- package/dist/src/monitoring/health-check.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js +764 -0
- package/dist/src/monitoring/phase4/analytics/consensus-tracker.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js +859 -0
- package/dist/src/monitoring/phase4/analytics/performance-assessor.js.map +1 -0
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js +667 -0
- package/dist/src/monitoring/phase4/analytics/truth-score-analyzer.js.map +1 -0
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js +1008 -0
- package/dist/src/monitoring/phase4/dashboard/monitoring-dashboard.js.map +1 -0
- package/dist/src/monitoring/phase4/rollout-decision-engine.js +849 -0
- package/dist/src/monitoring/phase4/rollout-decision-engine.js.map +1 -0
- package/dist/src/monitoring/real-time-feedback-system.js +688 -0
- package/dist/src/monitoring/real-time-feedback-system.js.map +1 -0
- package/dist/src/monitoring/real-time-monitor.js +981 -0
- package/dist/src/monitoring/real-time-monitor.js.map +1 -0
- package/dist/src/monitoring/regression/RegressionDetector.js +525 -0
- package/dist/src/monitoring/regression/RegressionDetector.js.map +1 -0
- package/dist/src/neural/NeuralDomainMapper.js +1137 -0
- package/dist/src/neural/NeuralDomainMapper.js.map +1 -0
- package/dist/src/neural/index.js +418 -0
- package/dist/src/neural/index.js.map +1 -0
- package/dist/src/neural/integration.js +590 -0
- package/dist/src/neural/integration.js.map +1 -0
- package/dist/src/providers/anthropic-provider.js +245 -0
- package/dist/src/providers/anthropic-provider.js.map +1 -0
- package/dist/src/providers/base-provider.js +389 -0
- package/dist/src/providers/base-provider.js.map +1 -0
- package/dist/src/providers/cohere-provider.js +405 -0
- package/dist/src/providers/cohere-provider.js.map +1 -0
- package/dist/src/providers/google-provider.js +376 -0
- package/dist/src/providers/google-provider.js.map +1 -0
- package/dist/src/providers/index.js +18 -0
- package/dist/src/providers/index.js.map +1 -0
- package/dist/src/providers/ollama-provider.js +400 -0
- package/dist/src/providers/ollama-provider.js.map +1 -0
- package/dist/src/providers/openai-provider.js +364 -0
- package/dist/src/providers/openai-provider.js.map +1 -0
- package/dist/src/providers/provider-manager.js +487 -0
- package/dist/src/providers/provider-manager.js.map +1 -0
- package/dist/src/providers/types.js +55 -0
- package/dist/src/providers/types.js.map +1 -0
- package/dist/src/providers/utils.js +343 -0
- package/dist/src/providers/utils.js.map +1 -0
- package/dist/src/quality-gates/automated-review-system.js +645 -0
- package/dist/src/quality-gates/automated-review-system.js.map +1 -0
- package/dist/src/resources/resource-manager.js +1275 -0
- package/dist/src/resources/resource-manager.js.map +1 -0
- package/dist/src/rollback/recovery-manager.js +1065 -0
- package/dist/src/rollback/recovery-manager.js.map +1 -0
- package/dist/src/services/agent-manager.js +308 -0
- package/dist/src/services/agent-manager.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/hook-manager.js +506 -0
- package/dist/src/services/agentic-flow-hooks/hook-manager.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/index.js +322 -0
- package/dist/src/services/agentic-flow-hooks/index.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js +445 -0
- package/dist/src/services/agentic-flow-hooks/llm-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js +558 -0
- package/dist/src/services/agentic-flow-hooks/memory-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js +595 -0
- package/dist/src/services/agentic-flow-hooks/neural-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js +640 -0
- package/dist/src/services/agentic-flow-hooks/performance-hooks.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/types.js +8 -0
- package/dist/src/services/agentic-flow-hooks/types.js.map +1 -0
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js +746 -0
- package/dist/src/services/agentic-flow-hooks/workflow-hooks.js.map +1 -0
- package/dist/src/services/performance-metrics-collector.js +529 -0
- package/dist/src/services/performance-metrics-collector.js.map +1 -0
- package/dist/src/services/swarm-coordinator.js +431 -0
- package/dist/src/services/swarm-coordinator.js.map +1 -0
- package/dist/src/services/swarm-memory-manager.js +513 -0
- package/dist/src/services/swarm-memory-manager.js.map +1 -0
- package/dist/src/services/swarm-relaunch-manager.js +408 -0
- package/dist/src/services/swarm-relaunch-manager.js.map +1 -0
- package/dist/src/services/task-handoff-service.js +361 -0
- package/dist/src/services/task-handoff-service.js.map +1 -0
- package/dist/src/swarm/__tests__/integration.test.js +229 -0
- package/dist/src/swarm/__tests__/integration.test.js.map +1 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js +346 -0
- package/dist/src/swarm/__tests__/prompt-copier.test.js.map +1 -0
- package/dist/src/swarm/advanced-orchestrator.js +1093 -0
- package/dist/src/swarm/advanced-orchestrator.js.map +1 -0
- package/dist/src/swarm/claude-code-interface.js +959 -0
- package/dist/src/swarm/claude-code-interface.js.map +1 -0
- package/dist/src/swarm/claude-flow-executor.js +218 -0
- package/dist/src/swarm/claude-flow-executor.js.map +1 -0
- package/dist/src/swarm/coordinator.js +3001 -0
- package/dist/src/swarm/coordinator.js.map +1 -0
- package/dist/src/swarm/direct-executor.js +1169 -0
- package/dist/src/swarm/direct-executor.js.map +1 -0
- package/dist/src/swarm/executor-v2.js +312 -0
- package/dist/src/swarm/executor-v2.js.map +1 -0
- package/dist/src/swarm/executor.js +813 -0
- package/dist/src/swarm/executor.js.map +1 -0
- package/dist/src/swarm/hive-mind-integration.js +700 -0
- package/dist/src/swarm/hive-mind-integration.js.map +1 -0
- package/dist/src/swarm/index.js +43 -0
- package/dist/src/swarm/index.js.map +1 -0
- package/dist/src/swarm/json-output-aggregator.js +269 -0
- package/dist/src/swarm/json-output-aggregator.js.map +1 -0
- package/dist/src/swarm/mcp-integration-wrapper.js +623 -0
- package/dist/src/swarm/mcp-integration-wrapper.js.map +1 -0
- package/dist/src/swarm/memory.js +1119 -0
- package/dist/src/swarm/memory.js.map +1 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js +350 -0
- package/dist/src/swarm/optimizations/__tests__/optimization.test.js.map +1 -0
- package/dist/src/swarm/optimizations/async-file-manager.js +273 -0
- package/dist/src/swarm/optimizations/async-file-manager.js.map +1 -0
- package/dist/src/swarm/optimizations/circular-buffer.js +148 -0
- package/dist/src/swarm/optimizations/circular-buffer.js.map +1 -0
- package/dist/src/swarm/optimizations/connection-pool.js +239 -0
- package/dist/src/swarm/optimizations/connection-pool.js.map +1 -0
- package/dist/src/swarm/optimizations/index.js +30 -0
- package/dist/src/swarm/optimizations/index.js.map +1 -0
- package/dist/src/swarm/optimizations/optimized-executor.js +318 -0
- package/dist/src/swarm/optimizations/optimized-executor.js.map +1 -0
- package/dist/src/swarm/optimizations/ttl-map.js +223 -0
- package/dist/src/swarm/optimizations/ttl-map.js.map +1 -0
- package/dist/src/swarm/prompt-cli.js +202 -0
- package/dist/src/swarm/prompt-cli.js.map +1 -0
- package/dist/src/swarm/prompt-copier-enhanced.js +193 -0
- package/dist/src/swarm/prompt-copier-enhanced.js.map +1 -0
- package/dist/src/swarm/prompt-copier.js +376 -0
- package/dist/src/swarm/prompt-copier.js.map +1 -0
- package/dist/src/swarm/prompt-manager.js +287 -0
- package/dist/src/swarm/prompt-manager.js.map +1 -0
- package/dist/src/swarm/prompt-utils.js +299 -0
- package/dist/src/swarm/prompt-utils.js.map +1 -0
- package/dist/src/swarm/result-aggregator.js +713 -0
- package/dist/src/swarm/result-aggregator.js.map +1 -0
- package/dist/src/swarm/sparc-executor.js +1557 -0
- package/dist/src/swarm/sparc-executor.js.map +1 -0
- package/dist/src/swarm/strategies/auto.js +751 -0
- package/dist/src/swarm/strategies/auto.js.map +1 -0
- package/dist/src/swarm/strategies/base.js +117 -0
- package/dist/src/swarm/strategies/base.js.map +1 -0
- package/dist/src/swarm/strategies/research.js +911 -0
- package/dist/src/swarm/strategies/research.js.map +1 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js +4 -0
- package/dist/src/swarm/strategies/strategy-metrics-patch.js.map +1 -0
- package/dist/src/swarm/types.js +54 -0
- package/dist/src/swarm/types.js.map +1 -0
- package/dist/src/swarm/workers/copy-worker.js +58 -0
- package/dist/src/swarm/workers/copy-worker.js.map +1 -0
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js +412 -0
- package/dist/src/swarm-fullstack/adapters/chrome-mcp-adapter.js.map +1 -0
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js +560 -0
- package/dist/src/swarm-fullstack/adapters/shadcn-mcp-adapter.js.map +1 -0
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js +582 -0
- package/dist/src/swarm-fullstack/cli/fullstack-cli.js.map +1 -0
- package/dist/src/swarm-fullstack/config/fullstack-config.js +369 -0
- package/dist/src/swarm-fullstack/config/fullstack-config.js.map +1 -0
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js +687 -0
- package/dist/src/swarm-fullstack/core/dynamic-agent-spawner.js.map +1 -0
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js +589 -0
- package/dist/src/swarm-fullstack/core/enhanced-swarm-message-router.js.map +1 -0
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js +538 -0
- package/dist/src/swarm-fullstack/core/fullstack-orchestrator.js.map +1 -0
- package/dist/src/swarm-fullstack/types/index.js +8 -0
- package/dist/src/swarm-fullstack/types/index.js.map +1 -0
- package/dist/src/task/commands.js +130 -0
- package/dist/src/task/commands.js.map +1 -0
- package/dist/src/task/coordination.js +737 -0
- package/dist/src/task/coordination.js.map +1 -0
- package/dist/src/task/engine.js +490 -0
- package/dist/src/task/engine.js.map +1 -0
- package/dist/src/task/index.js +269 -0
- package/dist/src/task/index.js.map +1 -0
- package/dist/src/task/types.js +5 -0
- package/dist/src/task/types.js.map +1 -0
- package/dist/src/terminal/adapters/base.js +5 -0
- package/dist/src/terminal/adapters/base.js.map +1 -0
- package/dist/src/terminal/adapters/native.js +473 -0
- package/dist/src/terminal/adapters/native.js.map +1 -0
- package/dist/src/terminal/adapters/vscode.js +285 -0
- package/dist/src/terminal/adapters/vscode.js.map +1 -0
- package/dist/src/terminal/manager.js +237 -0
- package/dist/src/terminal/manager.js.map +1 -0
- package/dist/src/terminal/pool.js +209 -0
- package/dist/src/terminal/pool.js.map +1 -0
- package/dist/src/terminal/session.js +211 -0
- package/dist/src/terminal/session.js.map +1 -0
- package/dist/src/terminal/vscode-bridge.js +186 -0
- package/dist/src/terminal/vscode-bridge.js.map +1 -0
- package/dist/src/testing/performance/PerformanceTestRunner.js +401 -0
- package/dist/src/testing/performance/PerformanceTestRunner.js.map +1 -0
- package/dist/src/testing-integration/chrome-mcp-integration.js +556 -0
- package/dist/src/testing-integration/chrome-mcp-integration.js.map +1 -0
- package/dist/src/testing-integration/continuous-test-runner.js +509 -0
- package/dist/src/testing-integration/continuous-test-runner.js.map +1 -0
- package/dist/src/tests/validation-consistency.test.js +52 -0
- package/dist/src/tests/validation-consistency.test.js.map +1 -0
- package/dist/src/topology/adaptive-coordinator.js +691 -0
- package/dist/src/topology/adaptive-coordinator.js.map +1 -0
- package/dist/src/topology/communication-bridge.js +551 -0
- package/dist/src/topology/communication-bridge.js.map +1 -0
- package/dist/src/topology/enhanced-hierarchical-coordinator.js +1732 -0
- package/dist/src/topology/enhanced-hierarchical-coordinator.js.map +1 -0
- package/dist/src/topology/enhanced-mesh-coordinator.js +1271 -0
- package/dist/src/topology/enhanced-mesh-coordinator.js.map +1 -0
- package/dist/src/topology/topology-manager.js +797 -0
- package/dist/src/topology/topology-manager.js.map +1 -0
- package/dist/src/topology/types.js +8 -0
- package/dist/src/topology/types.js.map +1 -0
- package/dist/src/types/agent-lifecycle-types.js +172 -0
- package/dist/src/types/agent-lifecycle-types.js.map +1 -0
- package/dist/src/types/agent-types.js +11 -0
- package/dist/src/types/agent-types.js.map +1 -0
- package/dist/src/types/cliffy.d.js +9 -0
- package/dist/src/types/cliffy.d.js.map +1 -0
- package/dist/src/types/global.d.js +5 -0
- package/dist/src/types/global.d.js.map +1 -0
- package/dist/src/types/index.js +16 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/types/mcp.d.js +3 -0
- package/dist/src/types/mcp.d.js.map +1 -0
- package/dist/src/types/vscode.d.js +4 -0
- package/dist/src/types/vscode.d.js.map +1 -0
- package/dist/src/ui/hive-dashboard.js +284 -0
- package/dist/src/ui/hive-dashboard.js.map +1 -0
- package/dist/src/utils/error-handler.js +27 -0
- package/dist/src/utils/error-handler.js.map +1 -0
- package/dist/src/utils/errors.js +195 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/formatters.js +66 -0
- package/dist/src/utils/formatters.js.map +1 -0
- package/dist/src/utils/helpers.js +451 -0
- package/dist/src/utils/helpers.js.map +1 -0
- package/dist/src/utils/paths.js +43 -0
- package/dist/src/utils/paths.js.map +1 -0
- package/dist/src/utils/type-guards.js +119 -0
- package/dist/src/utils/type-guards.js.map +1 -0
- package/dist/src/utils/types.js +38 -0
- package/dist/src/utils/types.js.map +1 -0
- package/dist/src/verification/agent-scorer.js +633 -0
- package/dist/src/verification/agent-scorer.js.map +1 -0
- package/dist/src/verification/alert-manager.js +1126 -0
- package/dist/src/verification/alert-manager.js.map +1 -0
- package/dist/src/verification/api/types/index.js +6 -0
- package/dist/src/verification/api/types/index.js.map +1 -0
- package/dist/src/verification/checkpoint-manager.js +519 -0
- package/dist/src/verification/checkpoint-manager.js.map +1 -0
- package/dist/src/verification/cli-integration.js +500 -0
- package/dist/src/verification/cli-integration.js.map +1 -0
- package/dist/src/verification/conflict-resolver.js +534 -0
- package/dist/src/verification/conflict-resolver.js.map +1 -0
- package/dist/src/verification/crdt-coordinator.js +506 -0
- package/dist/src/verification/crdt-coordinator.js.map +1 -0
- package/dist/src/verification/dashboard-exporter.js +876 -0
- package/dist/src/verification/dashboard-exporter.js.map +1 -0
- package/dist/src/verification/demo.js +320 -0
- package/dist/src/verification/demo.js.map +1 -0
- package/dist/src/verification/examples.js +508 -0
- package/dist/src/verification/examples.js.map +1 -0
- package/dist/src/verification/hooks.js +961 -0
- package/dist/src/verification/hooks.js.map +1 -0
- package/dist/src/verification/index.js +73 -0
- package/dist/src/verification/index.js.map +1 -0
- package/dist/src/verification/interfaces.js +7 -0
- package/dist/src/verification/interfaces.js.map +1 -0
- package/dist/src/verification/memory-manager.js +510 -0
- package/dist/src/verification/memory-manager.js.map +1 -0
- package/dist/src/verification/middleware.js +579 -0
- package/dist/src/verification/middleware.js.map +1 -0
- package/dist/src/verification/rollback-engine.js +511 -0
- package/dist/src/verification/rollback-engine.js.map +1 -0
- package/dist/src/verification/rollback.js +1710 -0
- package/dist/src/verification/rollback.js.map +1 -0
- package/dist/src/verification/security-bypass-test.js +704 -0
- package/dist/src/verification/security-bypass-test.js.map +1 -0
- package/dist/src/verification/security.js +1125 -0
- package/dist/src/verification/security.js.map +1 -0
- package/dist/src/verification/simple-hooks.js +189 -0
- package/dist/src/verification/simple-hooks.js.map +1 -0
- package/dist/src/verification/system-tracker.js +657 -0
- package/dist/src/verification/system-tracker.js.map +1 -0
- package/dist/src/verification/telemetry.js +922 -0
- package/dist/src/verification/telemetry.js.map +1 -0
- package/dist/src/verification/test-verification.js +43 -0
- package/dist/src/verification/test-verification.js.map +1 -0
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js +1027 -0
- package/dist/src/verification/tests/e2e/verification-pipeline.test.js.map +1 -0
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js +638 -0
- package/dist/src/verification/tests/integration/cross-agent-communication.test.js.map +1 -0
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js +1029 -0
- package/dist/src/verification/tests/mocks/false-reporting-scenarios.test.js.map +1 -0
- package/dist/src/verification/tests/performance/verification-overhead.test.js +587 -0
- package/dist/src/verification/tests/performance/verification-overhead.test.js.map +1 -0
- package/dist/src/verification/tests/unit/truth-scoring.test.js +579 -0
- package/dist/src/verification/tests/unit/truth-scoring.test.js.map +1 -0
- package/dist/src/verification/tests.js +611 -0
- package/dist/src/verification/tests.js.map +1 -0
- package/dist/src/verification/truth-scorer.js +584 -0
- package/dist/src/verification/truth-scorer.js.map +1 -0
- package/dist/src/verification/types.js +56 -0
- package/dist/src/verification/types.js.map +1 -0
- package/dist/src/verification/verification-pipeline.js +884 -0
- package/dist/src/verification/verification-pipeline.js.map +1 -0
- package/dist/src/web/messaging/agent-status-tracker.js +447 -0
- package/dist/src/web/messaging/agent-status-tracker.js.map +1 -0
- package/dist/src/web/messaging/human-intervention-system.js +298 -0
- package/dist/src/web/messaging/human-intervention-system.js.map +1 -0
- package/dist/src/web/messaging/message-filter.js +289 -0
- package/dist/src/web/messaging/message-filter.js.map +1 -0
- package/dist/src/web/messaging/swarm-message-router.js +320 -0
- package/dist/src/web/messaging/swarm-message-router.js.map +1 -0
- package/dist/src/web/messaging/transparency-logger.js +415 -0
- package/dist/src/web/messaging/transparency-logger.js.map +1 -0
- package/dist/src/web/portal-server.js +440 -0
- package/dist/src/web/portal-server.js.map +1 -0
- package/dist/src/web/server.js +311 -0
- package/dist/src/web/server.js.map +1 -0
- package/dist/src/web/websocket/websocket-manager.js +509 -0
- package/dist/src/web/websocket/websocket-manager.js.map +1 -0
- package/dist/src/workflows/feature-lifecycle-manager.js +386 -0
- package/dist/src/workflows/feature-lifecycle-manager.js.map +1 -0
- package/dist/src/workflows/fullstack-coordination-manager.js +801 -0
- package/dist/src/workflows/fullstack-coordination-manager.js.map +1 -0
- package/dist/src/workflows/iterative-development-orchestrator.js +1128 -0
- package/dist/src/workflows/iterative-development-orchestrator.js.map +1 -0
- package/dist/src/workflows/progressive-rollout-manager.js +710 -0
- package/dist/src/workflows/progressive-rollout-manager.js.map +1 -0
- package/package.json +264 -0
- package/scripts/README.md +339 -0
- package/scripts/post-install-claude-md.js +50 -0
- package/src/commands/dependency-recommendations.js +551 -0
- package/src/commands/suggest-improvements.js +492 -0
- package/src/commands/suggest-templates.js +916 -0
- package/src/npx/claude-md-protection.js +169 -0
- package/wiki/INDEX.md +264 -0
- package/wiki/NAVIGATION.md +270 -0
- package/wiki/README.md +101 -0
- package/wiki/accessibility/README.md +103 -0
- package/wiki/accessibility/assistive-tech/screen-reader-support.md +912 -0
- package/wiki/accessibility/automation/agent-testing-automation.md +880 -0
- package/wiki/accessibility/guidelines/wcag-compliance.md +278 -0
- package/wiki/accessibility/i18n/internationalization-strategies.md +1022 -0
- package/wiki/accessibility/motor-accessibility/keyboard-navigation.md +1182 -0
- package/wiki/accessibility/patterns/inclusive-design-patterns.md +715 -0
- package/wiki/accessibility/testing/automated-testing.md +665 -0
- package/wiki/accessibility/visual-design/color-contrast.md +926 -0
- package/wiki/accessibility/workflows/accessibility-first-development.md +916 -0
- package/wiki/accessibility/workflows/inclusive-design-review.md +835 -0
- package/wiki/api-reference/README.md +565 -0
- package/wiki/api-reference/agent-management-api.md +931 -0
- package/wiki/api-reference/cli-api.md +630 -0
- package/wiki/api-reference/configuration-api.md +1355 -0
- package/wiki/api-reference/examples-code-samples.md +2241 -0
- package/wiki/api-reference/hooks-coordination-api.md +1406 -0
- package/wiki/api-reference/mcp-tool-specifications.md +944 -0
- package/wiki/api-reference/plugin-development.md +1695 -0
- package/wiki/api-reference/technical-architecture.md +1729 -0
- package/wiki/command-reference/README.md +305 -0
- package/wiki/command-reference/agent-commands.md +571 -0
- package/wiki/command-reference/cli-commands.md +516 -0
- package/wiki/command-reference/command-syntax.md +676 -0
- package/wiki/command-reference/expert/README.md +616 -0
- package/wiki/command-reference/expert-tier.md +791 -0
- package/wiki/command-reference/intermediate/README.md +628 -0
- package/wiki/command-reference/intermediate-tier.md +1024 -0
- package/wiki/command-reference/mcp-integration.md +412 -0
- package/wiki/command-reference/mcp-tools/README.md +1743 -0
- package/wiki/command-reference/mcp-tools/dual-access-workflows.md +911 -0
- package/wiki/command-reference/mcp-tools/index.md +201 -0
- package/wiki/command-reference/mcp-tools/integration-patterns.md +830 -0
- package/wiki/command-reference/mcp-tools/quick-reference.md +383 -0
- package/wiki/command-reference/mcp-tools/session-management.md +1183 -0
- package/wiki/command-reference/mcp-tools/task-tool-integration.md +827 -0
- package/wiki/command-reference/novice/README.md +661 -0
- package/wiki/command-reference/novice-tier.md +1142 -0
- package/wiki/command-reference/progression-guide.md +772 -0
- package/wiki/command-reference/troubleshooting.md +803 -0
- package/wiki/command-reference/workflows.md +752 -0
- package/wiki/community/README.md +328 -0
- package/wiki/community/contributing/README.md +623 -0
- package/wiki/community/contributing/code-of-conduct.md +388 -0
- package/wiki/community/contributing/collaboration-workflows.md +1 -0
- package/wiki/community/contributing/issue-reporting.md +1 -0
- package/wiki/community/contributing/onboarding-guide.md +1 -0
- package/wiki/community/contributing/recognition-system.md +1 -0
- package/wiki/community/discussions/README.md +54 -0
- package/wiki/community/learning-resources.md +476 -0
- package/wiki/community/showcase/README.md +1 -0
- package/wiki/core-concepts/README.md +656 -0
- package/wiki/core-concepts/agent-feedback-hooks/README.md +298 -0
- package/wiki/core-concepts/agents/README.md +392 -0
- package/wiki/core-concepts/agents/agent-creation-guide.md +431 -0
- package/wiki/core-concepts/agents.md +301 -0
- package/wiki/core-concepts/architecture.md +227 -0
- package/wiki/core-concepts/hooks-lifecycle/README.md +543 -0
- package/wiki/core-concepts/integration.md +507 -0
- package/wiki/core-concepts/memory-system/README.md +521 -0
- package/wiki/core-concepts/performance.md +463 -0
- package/wiki/core-concepts/sparc-methodology/README.md +465 -0
- package/wiki/core-concepts/sparc-workflow.md +407 -0
- package/wiki/core-concepts/swarm-coordination/README.md +525 -0
- package/wiki/core-concepts/swarm-coordination.md +453 -0
- package/wiki/cost-optimization/enterprise-cost-management.md +1356 -0
- package/wiki/deployment/enterprise-deployment-patterns.md +1739 -0
- package/wiki/enterprise-architecture/enterprise-architecture-overview.md +348 -0
- package/wiki/enterprise-architecture/enterprise-scaling-patterns.md +1184 -0
- package/wiki/examples/README.md +288 -0
- package/wiki/examples/automation/cicd-pipeline/README.md +1265 -0
- package/wiki/examples/basic/hello-world/README.md +434 -0
- package/wiki/examples/basic-projects/README.md +427 -0
- package/wiki/examples/enterprise-integration/README.md +602 -0
- package/wiki/examples/integration-patterns.md +825 -0
- package/wiki/examples/legacy-migration/README.md +656 -0
- package/wiki/examples/multi-cloud/README.md +1071 -0
- package/wiki/examples/performance-benchmarks.md +729 -0
- package/wiki/examples/performance-optimization/README.md +1214 -0
- package/wiki/examples/projects/rest-api/README.md +845 -0
- package/wiki/examples/real-time-collaboration/README.md +1092 -0
- package/wiki/examples/scenarios/ecommerce/README.md +1273 -0
- package/wiki/examples/swarm-patterns.md +1026 -0
- package/wiki/examples/templates/download-system.md +993 -0
- package/wiki/examples/templates/javascript/README.md +487 -0
- package/wiki/examples/templates/javascript/package.json +119 -0
- package/wiki/examples/troubleshooting/README.md +1317 -0
- package/wiki/examples/utilities/patterns/README.md +1347 -0
- package/wiki/examples/videos/01-setup.md +403 -0
- package/wiki/examples/workflow-automation/README.md +1023 -0
- package/wiki/getting-started/README.md +398 -0
- package/wiki/getting-started/benefits.md +451 -0
- package/wiki/getting-started/claude-code-mcp/README.md +319 -0
- package/wiki/getting-started/claude-code-mcp/setup.md +431 -0
- package/wiki/getting-started/claude-code-mcp/usage-examples.md +501 -0
- package/wiki/getting-started/cli-access/README.md +300 -0
- package/wiki/getting-started/cli-access/first-commands.md +319 -0
- package/wiki/getting-started/installation/README.md +469 -0
- package/wiki/getting-started/installation/troubleshooting.md +617 -0
- package/wiki/getting-started/learning-path.md +494 -0
- package/wiki/getting-started/learning-plan-generator.md +434 -0
- package/wiki/getting-started/quick-start/README.md +255 -0
- package/wiki/getting-started/quick-start/cli-tutorial.md +680 -0
- package/wiki/getting-started/quick-start/mcp-tutorial.md +544 -0
- package/wiki/governance/multi-project-coordination.md +820 -0
- package/wiki/languages/README.md +349 -0
- package/wiki/languages/go/README.md +124 -0
- package/wiki/languages/go/examples/README.md +1066 -0
- package/wiki/languages/go/frameworks/README.md +708 -0
- package/wiki/languages/go/integration/README.md +748 -0
- package/wiki/languages/go/microservices/README.md +1185 -0
- package/wiki/languages/go/performance/README.md +1310 -0
- package/wiki/languages/go/setup/README.md +397 -0
- package/wiki/languages/go/systems/README.md +1116 -0
- package/wiki/languages/go/testing/README.md +999 -0
- package/wiki/languages/java/README.md +217 -0
- package/wiki/languages/java/claude-flow-integration.md +1220 -0
- package/wiki/languages/java/enterprise-java.md +1247 -0
- package/wiki/languages/java/examples.md +1712 -0
- package/wiki/languages/java/microservices.md +1600 -0
- package/wiki/languages/java/performance.md +1122 -0
- package/wiki/languages/java/project-setup.md +504 -0
- package/wiki/languages/java/spring-boot.md +756 -0
- package/wiki/languages/java/testing.md +1323 -0
- package/wiki/languages/javascript/README.md +575 -0
- package/wiki/languages/javascript/api/README.md +1445 -0
- package/wiki/languages/javascript/backend/README.md +748 -0
- package/wiki/languages/javascript/frontend/README.md +1048 -0
- package/wiki/languages/javascript/integration.md +1107 -0
- package/wiki/languages/javascript/setup/README.md +438 -0
- package/wiki/languages/javascript/testing/README.md +1775 -0
- package/wiki/languages/python/README.md +1002 -0
- package/wiki/languages/python/data-science/README.md +1317 -0
- package/wiki/languages/python/examples/README.md +911 -0
- package/wiki/languages/python/integration.md +1515 -0
- package/wiki/languages/python/mcp-integration.md +843 -0
- package/wiki/languages/python/setup/README.md +622 -0
- package/wiki/languages/python/testing/README.md +1680 -0
- package/wiki/languages/python/web-development/README.md +974 -0
- package/wiki/languages/rust/README.md +936 -0
- package/wiki/languages/rust/examples/cli-mcp-workflows.md +850 -0
- package/wiki/languages/rust/examples/rest-api.md +1927 -0
- package/wiki/languages/rust/setup/cargo-integration.md +780 -0
- package/wiki/languages/rust/testing/quality-validation.md +1098 -0
- package/wiki/languages/rust/web-development/axum.md +1497 -0
- package/wiki/languages/rust/workflows/systems-programming.md +1189 -0
- package/wiki/languages/typescript/README.md +581 -0
- package/wiki/languages/typescript/automation.md +1070 -0
- package/wiki/languages/typescript/coordination.md +971 -0
- package/wiki/languages/typescript/enterprise.md +1368 -0
- package/wiki/languages/typescript/frameworks.md +970 -0
- package/wiki/languages/typescript/migration.md +1384 -0
- package/wiki/languages/typescript/patterns.md +694 -0
- package/wiki/languages/typescript/performance.md +1195 -0
- package/wiki/languages/typescript/setup.md +516 -0
- package/wiki/languages/typescript/workflows.md +481 -0
- package/wiki/monitoring/enterprise-observability.md +1141 -0
- package/wiki/security/enterprise-security-framework.md +1174 -0
- package/wiki/team-coordination/team-scaling-strategies.md +1486 -0
- package/wiki/troubleshooting/README.md +654 -0
- package/wiki/troubleshooting/common-issues/README.md +659 -0
- package/wiki/troubleshooting/common-issues.md +458 -0
- package/wiki/troubleshooting/error-resolution.md +763 -0
- package/wiki/troubleshooting/performance-optimization.md +540 -0
- package/wiki/tutorials/README.md +607 -0
- package/wiki/tutorials/advanced/01-multi-agent-orchestration-patterns.md +585 -0
- package/wiki/tutorials/advanced/02-enterprise-architecture-development.md +661 -0
- package/wiki/tutorials/advanced/03-advanced-sparc-methodology.md +595 -0
- package/wiki/tutorials/advanced/04-performance-optimization-workflows.md +613 -0
- package/wiki/tutorials/advanced/05-custom-agent-development.md +681 -0
- package/wiki/tutorials/advanced/06-legacy-system-integration.md +574 -0
- package/wiki/tutorials/advanced/07-production-deployment-monitoring.md +684 -0
- package/wiki/tutorials/advanced/08-enterprise-scenarios.md +700 -0
- package/wiki/tutorials/advanced/README.md +577 -0
- package/wiki/tutorials/advanced/performance-optimization.md +476 -0
- package/wiki/tutorials/advanced/swarm-orchestration.md +627 -0
- package/wiki/tutorials/beginner/01-first-project.md +532 -0
- package/wiki/tutorials/beginner/02-basic-workflows.md +523 -0
- package/wiki/tutorials/beginner/03-simple-automation.md +641 -0
- package/wiki/tutorials/beginner/04-quality-testing.md +984 -0
- package/wiki/tutorials/beginner/README.md +388 -0
- package/wiki/tutorials/exercises/ecommerce-platform.md +1370 -0
- package/wiki/tutorials/intermediate/01-multi-agent-teams.md +961 -0
- package/wiki/tutorials/intermediate/README.md +452 -0
- package/wiki/tutorials/intermediate/optimization.md +402 -0
- package/wiki/tutorials/skill-assessment.md +522 -0
- package/wiki/tutorials/skill-competency-matrix.md +548 -0
- package/wiki/tutorials/troubleshooting/command-cheatsheet.md +425 -0
- package/wiki/tutorials/troubleshooting/setup-issues.md +717 -0
- package/wiki/video-tutorials/README.md +202 -0
- package/wiki/video-tutorials/accessibility/README.md +1349 -0
- package/wiki/video-tutorials/community/README.md +1366 -0
- package/wiki/video-tutorials/content-organization/README.md +1295 -0
- package/wiki/video-tutorials/distribution/README.md +1093 -0
- package/wiki/video-tutorials/editing/README.md +751 -0
- package/wiki/video-tutorials/interactive/README.md +1151 -0
- package/wiki/video-tutorials/multi-language/README.md +1384 -0
- package/wiki/video-tutorials/planning/README.md +461 -0
- package/wiki/video-tutorials/recording/README.md +619 -0
- package/wiki/video-tutorials/technical-specs/README.md +1018 -0
|
@@ -0,0 +1,1712 @@
|
|
|
1
|
+
# Java Ecosystem Integration Examples
|
|
2
|
+
|
|
3
|
+
This comprehensive guide provides practical examples of integrating Java applications with various ecosystem tools, frameworks, and Claude Flow agents for real-world enterprise development scenarios.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
### Basic Integration Example
|
|
8
|
+
|
|
9
|
+
```java
|
|
10
|
+
@SpringBootApplication
|
|
11
|
+
@EnableJpaRepositories
|
|
12
|
+
@EnableEurekaClient
|
|
13
|
+
public class EcommerceApplication {
|
|
14
|
+
public static void main(String[] args) {
|
|
15
|
+
SpringApplication.run(EcommerceApplication.class, args);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### With Claude Flow
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Generate complete e-commerce system
|
|
24
|
+
npx claude-flow sparc batch architect,coder,tester "Build e-commerce platform with Spring Boot, React, and PostgreSQL"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Enterprise E-Commerce Platform
|
|
28
|
+
|
|
29
|
+
### 1. Project Structure
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
ecommerce-platform/
|
|
33
|
+
├── user-service/
|
|
34
|
+
│ ├── src/main/java/
|
|
35
|
+
│ ├── src/test/java/
|
|
36
|
+
│ └── pom.xml
|
|
37
|
+
├── product-service/
|
|
38
|
+
│ ├── src/main/java/
|
|
39
|
+
│ ├── src/test/java/
|
|
40
|
+
│ └── pom.xml
|
|
41
|
+
├── order-service/
|
|
42
|
+
│ ├── src/main/java/
|
|
43
|
+
│ ├── src/test/java/
|
|
44
|
+
│ └── pom.xml
|
|
45
|
+
├── payment-service/
|
|
46
|
+
│ ├── src/main/java/
|
|
47
|
+
│ ├── src/test/java/
|
|
48
|
+
│ └── pom.xml
|
|
49
|
+
├── api-gateway/
|
|
50
|
+
│ ├── src/main/java/
|
|
51
|
+
│ └── pom.xml
|
|
52
|
+
├── config-server/
|
|
53
|
+
│ ├── src/main/java/
|
|
54
|
+
│ └── pom.xml
|
|
55
|
+
├── discovery-server/
|
|
56
|
+
│ ├── src/main/java/
|
|
57
|
+
│ └── pom.xml
|
|
58
|
+
├── docker-compose.yml
|
|
59
|
+
├── kubernetes/
|
|
60
|
+
└── README.md
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### 2. User Service Implementation
|
|
64
|
+
|
|
65
|
+
```java
|
|
66
|
+
// User Entity
|
|
67
|
+
@Entity
|
|
68
|
+
@Table(name = "users", indexes = {
|
|
69
|
+
@Index(name = "idx_user_email", columnList = "email"),
|
|
70
|
+
@Index(name = "idx_user_status", columnList = "status, createdAt")
|
|
71
|
+
})
|
|
72
|
+
public class User {
|
|
73
|
+
|
|
74
|
+
@Id
|
|
75
|
+
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
76
|
+
private Long id;
|
|
77
|
+
|
|
78
|
+
@Column(nullable = false, unique = true)
|
|
79
|
+
@Email
|
|
80
|
+
private String email;
|
|
81
|
+
|
|
82
|
+
@Column(nullable = false)
|
|
83
|
+
@Size(min = 2, max = 100)
|
|
84
|
+
private String firstName;
|
|
85
|
+
|
|
86
|
+
@Column(nullable = false)
|
|
87
|
+
@Size(min = 2, max = 100)
|
|
88
|
+
private String lastName;
|
|
89
|
+
|
|
90
|
+
@Column(nullable = false)
|
|
91
|
+
private String password;
|
|
92
|
+
|
|
93
|
+
@Enumerated(EnumType.STRING)
|
|
94
|
+
private UserStatus status = UserStatus.ACTIVE;
|
|
95
|
+
|
|
96
|
+
@ElementCollection(fetch = FetchType.EAGER)
|
|
97
|
+
@Enumerated(EnumType.STRING)
|
|
98
|
+
private Set<Role> roles = new HashSet<>();
|
|
99
|
+
|
|
100
|
+
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
|
101
|
+
private List<Address> addresses = new ArrayList<>();
|
|
102
|
+
|
|
103
|
+
@CreatedDate
|
|
104
|
+
private LocalDateTime createdAt;
|
|
105
|
+
|
|
106
|
+
@LastModifiedDate
|
|
107
|
+
private LocalDateTime updatedAt;
|
|
108
|
+
|
|
109
|
+
// Constructors, getters, setters
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// User Service with comprehensive features
|
|
113
|
+
@Service
|
|
114
|
+
@Transactional
|
|
115
|
+
@Validated
|
|
116
|
+
public class UserService {
|
|
117
|
+
|
|
118
|
+
private final UserRepository userRepository;
|
|
119
|
+
private final PasswordEncoder passwordEncoder;
|
|
120
|
+
private final JwtTokenProvider tokenProvider;
|
|
121
|
+
private final ApplicationEventPublisher eventPublisher;
|
|
122
|
+
private final EmailService emailService;
|
|
123
|
+
|
|
124
|
+
public UserService(UserRepository userRepository,
|
|
125
|
+
PasswordEncoder passwordEncoder,
|
|
126
|
+
JwtTokenProvider tokenProvider,
|
|
127
|
+
ApplicationEventPublisher eventPublisher,
|
|
128
|
+
EmailService emailService) {
|
|
129
|
+
this.userRepository = userRepository;
|
|
130
|
+
this.passwordEncoder = passwordEncoder;
|
|
131
|
+
this.tokenProvider = tokenProvider;
|
|
132
|
+
this.eventPublisher = eventPublisher;
|
|
133
|
+
this.emailService = emailService;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
@Cacheable(value = "users", key = "#id")
|
|
137
|
+
public Optional<UserDto> findById(Long id) {
|
|
138
|
+
return userRepository.findById(id)
|
|
139
|
+
.map(this::convertToDto);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public UserDto registerUser(RegisterUserRequest request) {
|
|
143
|
+
validateUniqueEmail(request.getEmail());
|
|
144
|
+
|
|
145
|
+
User user = User.builder()
|
|
146
|
+
.email(request.getEmail())
|
|
147
|
+
.firstName(request.getFirstName())
|
|
148
|
+
.lastName(request.getLastName())
|
|
149
|
+
.password(passwordEncoder.encode(request.getPassword()))
|
|
150
|
+
.status(UserStatus.PENDING_VERIFICATION)
|
|
151
|
+
.roles(Set.of(Role.CUSTOMER))
|
|
152
|
+
.build();
|
|
153
|
+
|
|
154
|
+
User savedUser = userRepository.save(user);
|
|
155
|
+
|
|
156
|
+
// Send verification email
|
|
157
|
+
String verificationToken = tokenProvider.generateVerificationToken(savedUser.getId());
|
|
158
|
+
emailService.sendVerificationEmail(savedUser.getEmail(), verificationToken);
|
|
159
|
+
|
|
160
|
+
// Publish event
|
|
161
|
+
eventPublisher.publishEvent(new UserRegisteredEvent(savedUser.getId(), savedUser.getEmail()));
|
|
162
|
+
|
|
163
|
+
return convertToDto(savedUser);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public AuthenticationResponse authenticateUser(LoginRequest request) {
|
|
167
|
+
User user = userRepository.findByEmail(request.getEmail())
|
|
168
|
+
.orElseThrow(() -> new BadCredentialsException("Invalid credentials"));
|
|
169
|
+
|
|
170
|
+
if (!passwordEncoder.matches(request.getPassword(), user.getPassword())) {
|
|
171
|
+
throw new BadCredentialsException("Invalid credentials");
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (user.getStatus() != UserStatus.ACTIVE) {
|
|
175
|
+
throw new AccountNotActiveException("Account is not active");
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
String accessToken = tokenProvider.generateAccessToken(user);
|
|
179
|
+
String refreshToken = tokenProvider.generateRefreshToken(user);
|
|
180
|
+
|
|
181
|
+
// Update last login
|
|
182
|
+
user.setLastLoginAt(LocalDateTime.now());
|
|
183
|
+
userRepository.save(user);
|
|
184
|
+
|
|
185
|
+
return AuthenticationResponse.builder()
|
|
186
|
+
.accessToken(accessToken)
|
|
187
|
+
.refreshToken(refreshToken)
|
|
188
|
+
.tokenType("Bearer")
|
|
189
|
+
.expiresIn(tokenProvider.getAccessTokenExpirationTime())
|
|
190
|
+
.user(convertToDto(user))
|
|
191
|
+
.build();
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
@CacheEvict(value = "users", key = "#userId")
|
|
195
|
+
public UserDto updateProfile(Long userId, UpdateProfileRequest request) {
|
|
196
|
+
User user = userRepository.findById(userId)
|
|
197
|
+
.orElseThrow(() -> new UserNotFoundException("User not found"));
|
|
198
|
+
|
|
199
|
+
user.setFirstName(request.getFirstName());
|
|
200
|
+
user.setLastName(request.getLastName());
|
|
201
|
+
|
|
202
|
+
User updatedUser = userRepository.save(user);
|
|
203
|
+
eventPublisher.publishEvent(new UserProfileUpdatedEvent(userId));
|
|
204
|
+
|
|
205
|
+
return convertToDto(updatedUser);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
private void validateUniqueEmail(String email) {
|
|
209
|
+
if (userRepository.existsByEmail(email)) {
|
|
210
|
+
throw new EmailAlreadyExistsException("Email already exists: " + email);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
private UserDto convertToDto(User user) {
|
|
215
|
+
return UserDto.builder()
|
|
216
|
+
.id(user.getId())
|
|
217
|
+
.email(user.getEmail())
|
|
218
|
+
.firstName(user.getFirstName())
|
|
219
|
+
.lastName(user.getLastName())
|
|
220
|
+
.status(user.getStatus())
|
|
221
|
+
.roles(user.getRoles())
|
|
222
|
+
.createdAt(user.getCreatedAt())
|
|
223
|
+
.build();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// User Controller with comprehensive API
|
|
228
|
+
@RestController
|
|
229
|
+
@RequestMapping("/api/users")
|
|
230
|
+
@Validated
|
|
231
|
+
@SecurityRequirement(name = "bearer-key")
|
|
232
|
+
public class UserController {
|
|
233
|
+
|
|
234
|
+
private final UserService userService;
|
|
235
|
+
|
|
236
|
+
public UserController(UserService userService) {
|
|
237
|
+
this.userService = userService;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@PostMapping("/register")
|
|
241
|
+
@Operation(summary = "Register new user", description = "Register a new user account")
|
|
242
|
+
@ApiResponses({
|
|
243
|
+
@ApiResponse(responseCode = "201", description = "User registered successfully"),
|
|
244
|
+
@ApiResponse(responseCode = "400", description = "Invalid request data"),
|
|
245
|
+
@ApiResponse(responseCode = "409", description = "Email already exists")
|
|
246
|
+
})
|
|
247
|
+
public ResponseEntity<UserDto> registerUser(@Valid @RequestBody RegisterUserRequest request) {
|
|
248
|
+
UserDto user = userService.registerUser(request);
|
|
249
|
+
return ResponseEntity.status(HttpStatus.CREATED).body(user);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
@PostMapping("/login")
|
|
253
|
+
@Operation(summary = "User login", description = "Authenticate user and return JWT tokens")
|
|
254
|
+
public ResponseEntity<AuthenticationResponse> login(@Valid @RequestBody LoginRequest request) {
|
|
255
|
+
AuthenticationResponse response = userService.authenticateUser(request);
|
|
256
|
+
return ResponseEntity.ok(response);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
@GetMapping("/profile")
|
|
260
|
+
@PreAuthorize("hasRole('CUSTOMER') or hasRole('ADMIN')")
|
|
261
|
+
@Operation(summary = "Get user profile", description = "Get current user's profile information")
|
|
262
|
+
public ResponseEntity<UserDto> getProfile(Authentication authentication) {
|
|
263
|
+
Long userId = extractUserIdFromAuthentication(authentication);
|
|
264
|
+
return userService.findById(userId)
|
|
265
|
+
.map(user -> ResponseEntity.ok(user))
|
|
266
|
+
.orElse(ResponseEntity.notFound().build());
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
@PutMapping("/profile")
|
|
270
|
+
@PreAuthorize("hasRole('CUSTOMER') or hasRole('ADMIN')")
|
|
271
|
+
@Operation(summary = "Update user profile", description = "Update current user's profile information")
|
|
272
|
+
public ResponseEntity<UserDto> updateProfile(
|
|
273
|
+
Authentication authentication,
|
|
274
|
+
@Valid @RequestBody UpdateProfileRequest request) {
|
|
275
|
+
Long userId = extractUserIdFromAuthentication(authentication);
|
|
276
|
+
UserDto updatedUser = userService.updateProfile(userId, request);
|
|
277
|
+
return ResponseEntity.ok(updatedUser);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
private Long extractUserIdFromAuthentication(Authentication authentication) {
|
|
281
|
+
JwtAuthenticationToken jwtAuth = (JwtAuthenticationToken) authentication;
|
|
282
|
+
return Long.valueOf(jwtAuth.getToken().getClaimAsString("user_id"));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Generated with:
|
|
287
|
+
// npx claude-flow sparc run coder "Create comprehensive user service with authentication, authorization, and profile management"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### 3. Product Service with Search Integration
|
|
291
|
+
|
|
292
|
+
```java
|
|
293
|
+
// Product Entity with Elasticsearch integration
|
|
294
|
+
@Entity
|
|
295
|
+
@Table(name = "products")
|
|
296
|
+
@Document(indexName = "products")
|
|
297
|
+
public class Product {
|
|
298
|
+
|
|
299
|
+
@Id
|
|
300
|
+
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
301
|
+
@org.springframework.data.annotation.Id
|
|
302
|
+
private Long id;
|
|
303
|
+
|
|
304
|
+
@Column(nullable = false)
|
|
305
|
+
@Field(type = FieldType.Text, analyzer = "standard")
|
|
306
|
+
private String name;
|
|
307
|
+
|
|
308
|
+
@Column(length = 2000)
|
|
309
|
+
@Field(type = FieldType.Text, analyzer = "standard")
|
|
310
|
+
private String description;
|
|
311
|
+
|
|
312
|
+
@Column(nullable = false, precision = 10, scale = 2)
|
|
313
|
+
@Field(type = FieldType.Double)
|
|
314
|
+
private BigDecimal price;
|
|
315
|
+
|
|
316
|
+
@ManyToOne(fetch = FetchType.LAZY)
|
|
317
|
+
@JoinColumn(name = "category_id")
|
|
318
|
+
@Field(type = FieldType.Object)
|
|
319
|
+
private Category category;
|
|
320
|
+
|
|
321
|
+
@Column(nullable = false)
|
|
322
|
+
@Field(type = FieldType.Integer)
|
|
323
|
+
private Integer stockQuantity;
|
|
324
|
+
|
|
325
|
+
@Enumerated(EnumType.STRING)
|
|
326
|
+
@Field(type = FieldType.Keyword)
|
|
327
|
+
private ProductStatus status;
|
|
328
|
+
|
|
329
|
+
@ElementCollection
|
|
330
|
+
@CollectionTable(name = "product_images")
|
|
331
|
+
@Field(type = FieldType.Keyword)
|
|
332
|
+
private List<String> imageUrls = new ArrayList<>();
|
|
333
|
+
|
|
334
|
+
@ElementCollection
|
|
335
|
+
@CollectionTable(name = "product_attributes")
|
|
336
|
+
@MapKeyColumn(name = "attribute_name")
|
|
337
|
+
@Column(name = "attribute_value")
|
|
338
|
+
@Field(type = FieldType.Object)
|
|
339
|
+
private Map<String, String> attributes = new HashMap<>();
|
|
340
|
+
|
|
341
|
+
@Field(type = FieldType.Double)
|
|
342
|
+
private Double rating;
|
|
343
|
+
|
|
344
|
+
@Field(type = FieldType.Integer)
|
|
345
|
+
private Integer reviewCount;
|
|
346
|
+
|
|
347
|
+
// Constructors, getters, setters
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Product Service with search capabilities
|
|
351
|
+
@Service
|
|
352
|
+
@Transactional
|
|
353
|
+
public class ProductService {
|
|
354
|
+
|
|
355
|
+
private final ProductRepository productRepository;
|
|
356
|
+
private final ElasticsearchRepository elasticsearchRepository;
|
|
357
|
+
private final CategoryService categoryService;
|
|
358
|
+
private final RedisTemplate<String, Object> redisTemplate;
|
|
359
|
+
|
|
360
|
+
public ProductService(ProductRepository productRepository,
|
|
361
|
+
ElasticsearchRepository elasticsearchRepository,
|
|
362
|
+
CategoryService categoryService,
|
|
363
|
+
RedisTemplate<String, Object> redisTemplate) {
|
|
364
|
+
this.productRepository = productRepository;
|
|
365
|
+
this.elasticsearchRepository = elasticsearchRepository;
|
|
366
|
+
this.categoryService = categoryService;
|
|
367
|
+
this.redisTemplate = redisTemplate;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
public Page<ProductDto> searchProducts(ProductSearchCriteria criteria, Pageable pageable) {
|
|
371
|
+
// Try cache first
|
|
372
|
+
String cacheKey = generateCacheKey(criteria, pageable);
|
|
373
|
+
Page<ProductDto> cachedResult = (Page<ProductDto>) redisTemplate.opsForValue().get(cacheKey);
|
|
374
|
+
if (cachedResult != null) {
|
|
375
|
+
return cachedResult;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// Build Elasticsearch query
|
|
379
|
+
BoolQueryBuilder query = QueryBuilders.boolQuery();
|
|
380
|
+
|
|
381
|
+
if (StringUtils.hasText(criteria.getKeyword())) {
|
|
382
|
+
query.must(QueryBuilders.multiMatchQuery(criteria.getKeyword())
|
|
383
|
+
.field("name", 2.0f) // Boost name matches
|
|
384
|
+
.field("description", 1.0f)
|
|
385
|
+
.type(MultiMatchQueryBuilder.Type.BEST_FIELDS));
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (criteria.getCategoryId() != null) {
|
|
389
|
+
query.filter(QueryBuilders.termQuery("category.id", criteria.getCategoryId()));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (criteria.getMinPrice() != null || criteria.getMaxPrice() != null) {
|
|
393
|
+
RangeQueryBuilder priceRange = QueryBuilders.rangeQuery("price");
|
|
394
|
+
if (criteria.getMinPrice() != null) {
|
|
395
|
+
priceRange.gte(criteria.getMinPrice());
|
|
396
|
+
}
|
|
397
|
+
if (criteria.getMaxPrice() != null) {
|
|
398
|
+
priceRange.lte(criteria.getMaxPrice());
|
|
399
|
+
}
|
|
400
|
+
query.filter(priceRange);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
query.filter(QueryBuilders.termQuery("status", ProductStatus.ACTIVE.name()));
|
|
404
|
+
|
|
405
|
+
// Execute search
|
|
406
|
+
SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder()
|
|
407
|
+
.query(query)
|
|
408
|
+
.from((int) pageable.getOffset())
|
|
409
|
+
.size(pageable.getPageSize());
|
|
410
|
+
|
|
411
|
+
// Add sorting
|
|
412
|
+
if (pageable.getSort().isSorted()) {
|
|
413
|
+
pageable.getSort().forEach(order -> {
|
|
414
|
+
SortBuilder<?> sortBuilder = SortBuilders.fieldSort(order.getProperty())
|
|
415
|
+
.order(order.getDirection() == Sort.Direction.ASC ?
|
|
416
|
+
SortOrder.ASC : SortOrder.DESC);
|
|
417
|
+
searchSourceBuilder.sort(sortBuilder);
|
|
418
|
+
});
|
|
419
|
+
} else {
|
|
420
|
+
// Default sort by relevance, then by rating
|
|
421
|
+
searchSourceBuilder.sort(SortBuilders.scoreSort().order(SortOrder.DESC))
|
|
422
|
+
.sort(SortBuilders.fieldSort("rating").order(SortOrder.DESC));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
SearchResponse response = elasticsearchRepository.search(searchSourceBuilder);
|
|
426
|
+
|
|
427
|
+
List<ProductDto> products = Arrays.stream(response.getHits().getHits())
|
|
428
|
+
.map(hit -> convertToDto(parseProduct(hit.getSourceAsString())))
|
|
429
|
+
.collect(Collectors.toList());
|
|
430
|
+
|
|
431
|
+
Page<ProductDto> result = new PageImpl<>(products, pageable, response.getHits().getTotalHits().value);
|
|
432
|
+
|
|
433
|
+
// Cache result for 5 minutes
|
|
434
|
+
redisTemplate.opsForValue().set(cacheKey, result, Duration.ofMinutes(5));
|
|
435
|
+
|
|
436
|
+
return result;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
public ProductDto getProductDetails(Long productId) {
|
|
440
|
+
return productRepository.findById(productId)
|
|
441
|
+
.map(this::convertToDto)
|
|
442
|
+
.orElseThrow(() -> new ProductNotFoundException("Product not found: " + productId));
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
@Cacheable(value = "featured-products")
|
|
446
|
+
public List<ProductDto> getFeaturedProducts(int limit) {
|
|
447
|
+
List<Product> products = productRepository.findFeaturedProducts(PageRequest.of(0, limit));
|
|
448
|
+
return products.stream()
|
|
449
|
+
.map(this::convertToDto)
|
|
450
|
+
.collect(Collectors.toList());
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
public List<ProductDto> getRecommendations(Long userId, int limit) {
|
|
454
|
+
// Simple recommendation based on user's purchase history and popular products
|
|
455
|
+
List<Product> recommendations = productRepository.findRecommendationsForUser(userId, limit);
|
|
456
|
+
return recommendations.stream()
|
|
457
|
+
.map(this::convertToDto)
|
|
458
|
+
.collect(Collectors.toList());
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
@EventListener
|
|
462
|
+
@Async
|
|
463
|
+
public void handleProductUpdated(ProductUpdatedEvent event) {
|
|
464
|
+
// Update Elasticsearch index
|
|
465
|
+
Product product = productRepository.findById(event.getProductId())
|
|
466
|
+
.orElse(null);
|
|
467
|
+
if (product != null) {
|
|
468
|
+
elasticsearchRepository.save(product);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// Invalidate related caches
|
|
472
|
+
redisTemplate.delete("featured-products");
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
private ProductDto convertToDto(Product product) {
|
|
476
|
+
return ProductDto.builder()
|
|
477
|
+
.id(product.getId())
|
|
478
|
+
.name(product.getName())
|
|
479
|
+
.description(product.getDescription())
|
|
480
|
+
.price(product.getPrice())
|
|
481
|
+
.categoryName(product.getCategory().getName())
|
|
482
|
+
.stockQuantity(product.getStockQuantity())
|
|
483
|
+
.status(product.getStatus())
|
|
484
|
+
.imageUrls(product.getImageUrls())
|
|
485
|
+
.attributes(product.getAttributes())
|
|
486
|
+
.rating(product.getRating())
|
|
487
|
+
.reviewCount(product.getReviewCount())
|
|
488
|
+
.build();
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
private String generateCacheKey(ProductSearchCriteria criteria, Pageable pageable) {
|
|
492
|
+
return String.format("product-search:%s:%d:%d",
|
|
493
|
+
criteria.hashCode(), pageable.getPageNumber(), pageable.getPageSize());
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// Generated with:
|
|
498
|
+
// npx claude-flow sparc run coder "Create product service with Elasticsearch search, Redis caching, and recommendations"
|
|
499
|
+
```
|
|
500
|
+
|
|
501
|
+
### 4. Order Service with Saga Pattern
|
|
502
|
+
|
|
503
|
+
```java
|
|
504
|
+
// Order Entity with state management
|
|
505
|
+
@Entity
|
|
506
|
+
@Table(name = "orders")
|
|
507
|
+
public class Order {
|
|
508
|
+
|
|
509
|
+
@Id
|
|
510
|
+
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
511
|
+
private Long id;
|
|
512
|
+
|
|
513
|
+
@Column(nullable = false, unique = true)
|
|
514
|
+
private String orderNumber;
|
|
515
|
+
|
|
516
|
+
@Column(nullable = false)
|
|
517
|
+
private Long userId;
|
|
518
|
+
|
|
519
|
+
@OneToMany(mappedBy = "order", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
|
|
520
|
+
private List<OrderItem> items = new ArrayList<>();
|
|
521
|
+
|
|
522
|
+
@Enumerated(EnumType.STRING)
|
|
523
|
+
private OrderStatus status;
|
|
524
|
+
|
|
525
|
+
@Column(nullable = false, precision = 10, scale = 2)
|
|
526
|
+
private BigDecimal totalAmount;
|
|
527
|
+
|
|
528
|
+
@Embedded
|
|
529
|
+
private Address shippingAddress;
|
|
530
|
+
|
|
531
|
+
@Embedded
|
|
532
|
+
@AttributeOverrides({
|
|
533
|
+
@AttributeOverride(name = "street", column = @Column(name = "billing_street")),
|
|
534
|
+
@AttributeOverride(name = "city", column = @Column(name = "billing_city")),
|
|
535
|
+
@AttributeOverride(name = "state", column = @Column(name = "billing_state")),
|
|
536
|
+
@AttributeOverride(name = "zipCode", column = @Column(name = "billing_zip_code")),
|
|
537
|
+
@AttributeOverride(name = "country", column = @Column(name = "billing_country"))
|
|
538
|
+
})
|
|
539
|
+
private Address billingAddress;
|
|
540
|
+
|
|
541
|
+
@Column
|
|
542
|
+
private String paymentId;
|
|
543
|
+
|
|
544
|
+
@CreatedDate
|
|
545
|
+
private LocalDateTime createdAt;
|
|
546
|
+
|
|
547
|
+
@LastModifiedDate
|
|
548
|
+
private LocalDateTime updatedAt;
|
|
549
|
+
|
|
550
|
+
// Constructors, getters, setters
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// Order Service with distributed transaction management
|
|
554
|
+
@Service
|
|
555
|
+
@Transactional
|
|
556
|
+
public class OrderService {
|
|
557
|
+
|
|
558
|
+
private final OrderRepository orderRepository;
|
|
559
|
+
private final InventoryServiceClient inventoryServiceClient;
|
|
560
|
+
private final PaymentServiceClient paymentServiceClient;
|
|
561
|
+
private final OrderSagaOrchestrator sagaOrchestrator;
|
|
562
|
+
private final ApplicationEventPublisher eventPublisher;
|
|
563
|
+
|
|
564
|
+
public OrderService(OrderRepository orderRepository,
|
|
565
|
+
InventoryServiceClient inventoryServiceClient,
|
|
566
|
+
PaymentServiceClient paymentServiceClient,
|
|
567
|
+
OrderSagaOrchestrator sagaOrchestrator,
|
|
568
|
+
ApplicationEventPublisher eventPublisher) {
|
|
569
|
+
this.orderRepository = orderRepository;
|
|
570
|
+
this.inventoryServiceClient = inventoryServiceClient;
|
|
571
|
+
this.paymentServiceClient = paymentServiceClient;
|
|
572
|
+
this.sagaOrchestrator = sagaOrchestrator;
|
|
573
|
+
this.eventPublisher = eventPublisher;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
public OrderDto createOrder(Long userId, CreateOrderRequest request) {
|
|
577
|
+
// Validate request
|
|
578
|
+
validateOrderRequest(request);
|
|
579
|
+
|
|
580
|
+
// Create order entity
|
|
581
|
+
Order order = Order.builder()
|
|
582
|
+
.orderNumber(generateOrderNumber())
|
|
583
|
+
.userId(userId)
|
|
584
|
+
.status(OrderStatus.PENDING)
|
|
585
|
+
.shippingAddress(request.getShippingAddress())
|
|
586
|
+
.billingAddress(request.getBillingAddress())
|
|
587
|
+
.build();
|
|
588
|
+
|
|
589
|
+
// Add order items
|
|
590
|
+
List<OrderItem> items = request.getItems().stream()
|
|
591
|
+
.map(itemRequest -> OrderItem.builder()
|
|
592
|
+
.order(order)
|
|
593
|
+
.productId(itemRequest.getProductId())
|
|
594
|
+
.quantity(itemRequest.getQuantity())
|
|
595
|
+
.unitPrice(itemRequest.getUnitPrice())
|
|
596
|
+
.build())
|
|
597
|
+
.collect(Collectors.toList());
|
|
598
|
+
|
|
599
|
+
order.setItems(items);
|
|
600
|
+
order.setTotalAmount(calculateTotalAmount(items));
|
|
601
|
+
|
|
602
|
+
// Save order
|
|
603
|
+
Order savedOrder = orderRepository.save(order);
|
|
604
|
+
|
|
605
|
+
// Start saga for distributed transaction
|
|
606
|
+
sagaOrchestrator.startOrderProcessingSaga(savedOrder.getId());
|
|
607
|
+
|
|
608
|
+
return convertToDto(savedOrder);
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
@EventListener
|
|
612
|
+
@Async
|
|
613
|
+
public void handleInventoryReserved(InventoryReservedEvent event) {
|
|
614
|
+
Order order = orderRepository.findById(event.getOrderId())
|
|
615
|
+
.orElseThrow(() -> new OrderNotFoundException("Order not found: " + event.getOrderId()));
|
|
616
|
+
|
|
617
|
+
order.setStatus(OrderStatus.INVENTORY_RESERVED);
|
|
618
|
+
orderRepository.save(order);
|
|
619
|
+
|
|
620
|
+
// Continue saga - process payment
|
|
621
|
+
sagaOrchestrator.processPayment(order.getId(), order.getTotalAmount());
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
@EventListener
|
|
625
|
+
@Async
|
|
626
|
+
public void handlePaymentProcessed(PaymentProcessedEvent event) {
|
|
627
|
+
Order order = orderRepository.findById(event.getOrderId())
|
|
628
|
+
.orElseThrow(() -> new OrderNotFoundException("Order not found: " + event.getOrderId()));
|
|
629
|
+
|
|
630
|
+
order.setStatus(OrderStatus.PAID);
|
|
631
|
+
order.setPaymentId(event.getPaymentId());
|
|
632
|
+
orderRepository.save(order);
|
|
633
|
+
|
|
634
|
+
// Complete saga - confirm order
|
|
635
|
+
sagaOrchestrator.confirmOrder(order.getId());
|
|
636
|
+
|
|
637
|
+
// Send confirmation email
|
|
638
|
+
eventPublisher.publishEvent(new OrderConfirmedEvent(order.getId(), order.getUserId()));
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
@EventListener
|
|
642
|
+
@Async
|
|
643
|
+
public void handlePaymentFailed(PaymentFailedEvent event) {
|
|
644
|
+
Order order = orderRepository.findById(event.getOrderId())
|
|
645
|
+
.orElseThrow(() -> new OrderNotFoundException("Order not found: " + event.getOrderId()));
|
|
646
|
+
|
|
647
|
+
order.setStatus(OrderStatus.PAYMENT_FAILED);
|
|
648
|
+
orderRepository.save(order);
|
|
649
|
+
|
|
650
|
+
// Compensate - release inventory
|
|
651
|
+
sagaOrchestrator.releaseInventory(order.getId());
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
public Page<OrderDto> getUserOrders(Long userId, Pageable pageable) {
|
|
655
|
+
Page<Order> orders = orderRepository.findByUserIdOrderByCreatedAtDesc(userId, pageable);
|
|
656
|
+
return orders.map(this::convertToDto);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
public OrderDto getOrderDetails(Long orderId, Long userId) {
|
|
660
|
+
Order order = orderRepository.findByIdAndUserId(orderId, userId)
|
|
661
|
+
.orElseThrow(() -> new OrderNotFoundException("Order not found: " + orderId));
|
|
662
|
+
|
|
663
|
+
return convertToDto(order);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
private void validateOrderRequest(CreateOrderRequest request) {
|
|
667
|
+
if (request.getItems().isEmpty()) {
|
|
668
|
+
throw new InvalidOrderException("Order must contain at least one item");
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
// Validate product availability
|
|
672
|
+
for (CreateOrderItemRequest item : request.getItems()) {
|
|
673
|
+
if (item.getQuantity() <= 0) {
|
|
674
|
+
throw new InvalidOrderException("Item quantity must be positive");
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
private String generateOrderNumber() {
|
|
680
|
+
return "ORD-" + System.currentTimeMillis() + "-" +
|
|
681
|
+
ThreadLocalRandom.current().nextInt(1000, 9999);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
private BigDecimal calculateTotalAmount(List<OrderItem> items) {
|
|
685
|
+
return items.stream()
|
|
686
|
+
.map(item -> item.getUnitPrice().multiply(BigDecimal.valueOf(item.getQuantity())))
|
|
687
|
+
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
private OrderDto convertToDto(Order order) {
|
|
691
|
+
return OrderDto.builder()
|
|
692
|
+
.id(order.getId())
|
|
693
|
+
.orderNumber(order.getOrderNumber())
|
|
694
|
+
.status(order.getStatus())
|
|
695
|
+
.totalAmount(order.getTotalAmount())
|
|
696
|
+
.items(order.getItems().stream()
|
|
697
|
+
.map(this::convertItemToDto)
|
|
698
|
+
.collect(Collectors.toList()))
|
|
699
|
+
.shippingAddress(order.getShippingAddress())
|
|
700
|
+
.createdAt(order.getCreatedAt())
|
|
701
|
+
.build();
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
private OrderItemDto convertItemToDto(OrderItem item) {
|
|
705
|
+
return OrderItemDto.builder()
|
|
706
|
+
.productId(item.getProductId())
|
|
707
|
+
.quantity(item.getQuantity())
|
|
708
|
+
.unitPrice(item.getUnitPrice())
|
|
709
|
+
.build();
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// Saga Orchestrator for distributed transactions
|
|
714
|
+
@Component
|
|
715
|
+
public class OrderSagaOrchestrator {
|
|
716
|
+
|
|
717
|
+
private final InventoryServiceClient inventoryServiceClient;
|
|
718
|
+
private final PaymentServiceClient paymentServiceClient;
|
|
719
|
+
private final ApplicationEventPublisher eventPublisher;
|
|
720
|
+
|
|
721
|
+
public OrderSagaOrchestrator(InventoryServiceClient inventoryServiceClient,
|
|
722
|
+
PaymentServiceClient paymentServiceClient,
|
|
723
|
+
ApplicationEventPublisher eventPublisher) {
|
|
724
|
+
this.inventoryServiceClient = inventoryServiceClient;
|
|
725
|
+
this.paymentServiceClient = paymentServiceClient;
|
|
726
|
+
this.eventPublisher = eventPublisher;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
@Async
|
|
730
|
+
public void startOrderProcessingSaga(Long orderId) {
|
|
731
|
+
try {
|
|
732
|
+
// Step 1: Reserve inventory
|
|
733
|
+
inventoryServiceClient.reserveInventory(orderId);
|
|
734
|
+
} catch (Exception e) {
|
|
735
|
+
eventPublisher.publishEvent(new OrderProcessingFailedEvent(orderId, "Inventory reservation failed"));
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
@Async
|
|
740
|
+
public void processPayment(Long orderId, BigDecimal amount) {
|
|
741
|
+
try {
|
|
742
|
+
// Step 2: Process payment
|
|
743
|
+
paymentServiceClient.processPayment(orderId, amount);
|
|
744
|
+
} catch (Exception e) {
|
|
745
|
+
// Compensate - release inventory
|
|
746
|
+
inventoryServiceClient.releaseInventory(orderId);
|
|
747
|
+
eventPublisher.publishEvent(new OrderProcessingFailedEvent(orderId, "Payment processing failed"));
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
@Async
|
|
752
|
+
public void confirmOrder(Long orderId) {
|
|
753
|
+
try {
|
|
754
|
+
// Step 3: Confirm order (no external service call needed)
|
|
755
|
+
eventPublisher.publishEvent(new OrderConfirmedEvent(orderId));
|
|
756
|
+
} catch (Exception e) {
|
|
757
|
+
eventPublisher.publishEvent(new OrderProcessingFailedEvent(orderId, "Order confirmation failed"));
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
@Async
|
|
762
|
+
public void releaseInventory(Long orderId) {
|
|
763
|
+
try {
|
|
764
|
+
inventoryServiceClient.releaseInventory(orderId);
|
|
765
|
+
} catch (Exception e) {
|
|
766
|
+
log.error("Failed to release inventory for order: {}", orderId, e);
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
// Generated with:
|
|
772
|
+
// npx claude-flow sparc run coder "Create order service with saga pattern for distributed transactions"
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
## Integration with External Systems
|
|
776
|
+
|
|
777
|
+
### 1. Payment Service Integration
|
|
778
|
+
|
|
779
|
+
```java
|
|
780
|
+
// Payment Service with multiple providers
|
|
781
|
+
@Service
|
|
782
|
+
public class PaymentService {
|
|
783
|
+
|
|
784
|
+
private final Map<PaymentProvider, PaymentProcessor> processors;
|
|
785
|
+
private final PaymentRepository paymentRepository;
|
|
786
|
+
private final EncryptionService encryptionService;
|
|
787
|
+
|
|
788
|
+
public PaymentService(List<PaymentProcessor> processorList,
|
|
789
|
+
PaymentRepository paymentRepository,
|
|
790
|
+
EncryptionService encryptionService) {
|
|
791
|
+
this.processors = processorList.stream()
|
|
792
|
+
.collect(Collectors.toMap(
|
|
793
|
+
PaymentProcessor::getProvider,
|
|
794
|
+
processor -> processor
|
|
795
|
+
));
|
|
796
|
+
this.paymentRepository = paymentRepository;
|
|
797
|
+
this.encryptionService = encryptionService;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
@Transactional
|
|
801
|
+
public PaymentResult processPayment(PaymentRequest request) {
|
|
802
|
+
// Validate payment request
|
|
803
|
+
validatePaymentRequest(request);
|
|
804
|
+
|
|
805
|
+
// Create payment record
|
|
806
|
+
Payment payment = Payment.builder()
|
|
807
|
+
.orderId(request.getOrderId())
|
|
808
|
+
.amount(request.getAmount())
|
|
809
|
+
.currency(request.getCurrency())
|
|
810
|
+
.provider(request.getProvider())
|
|
811
|
+
.status(PaymentStatus.PENDING)
|
|
812
|
+
.build();
|
|
813
|
+
|
|
814
|
+
Payment savedPayment = paymentRepository.save(payment);
|
|
815
|
+
|
|
816
|
+
try {
|
|
817
|
+
// Get appropriate processor
|
|
818
|
+
PaymentProcessor processor = processors.get(request.getProvider());
|
|
819
|
+
if (processor == null) {
|
|
820
|
+
throw new UnsupportedPaymentProviderException("Unsupported provider: " + request.getProvider());
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
// Process payment with external provider
|
|
824
|
+
ExternalPaymentResponse response = processor.processPayment(request);
|
|
825
|
+
|
|
826
|
+
// Update payment record
|
|
827
|
+
savedPayment.setExternalTransactionId(response.getTransactionId());
|
|
828
|
+
savedPayment.setStatus(response.isSuccess() ? PaymentStatus.COMPLETED : PaymentStatus.FAILED);
|
|
829
|
+
savedPayment.setProviderResponse(encryptionService.encrypt(response.getRawResponse()));
|
|
830
|
+
|
|
831
|
+
paymentRepository.save(savedPayment);
|
|
832
|
+
|
|
833
|
+
return PaymentResult.builder()
|
|
834
|
+
.paymentId(savedPayment.getId())
|
|
835
|
+
.status(savedPayment.getStatus())
|
|
836
|
+
.transactionId(response.getTransactionId())
|
|
837
|
+
.success(response.isSuccess())
|
|
838
|
+
.build();
|
|
839
|
+
|
|
840
|
+
} catch (Exception e) {
|
|
841
|
+
savedPayment.setStatus(PaymentStatus.FAILED);
|
|
842
|
+
savedPayment.setErrorMessage(e.getMessage());
|
|
843
|
+
paymentRepository.save(savedPayment);
|
|
844
|
+
|
|
845
|
+
throw new PaymentProcessingException("Payment processing failed", e);
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// Stripe payment processor
|
|
850
|
+
@Component
|
|
851
|
+
public static class StripePaymentProcessor implements PaymentProcessor {
|
|
852
|
+
|
|
853
|
+
private final StripeClient stripeClient;
|
|
854
|
+
|
|
855
|
+
public StripePaymentProcessor(StripeClient stripeClient) {
|
|
856
|
+
this.stripeClient = stripeClient;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
@Override
|
|
860
|
+
public PaymentProvider getProvider() {
|
|
861
|
+
return PaymentProvider.STRIPE;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
@Override
|
|
865
|
+
public ExternalPaymentResponse processPayment(PaymentRequest request) {
|
|
866
|
+
try {
|
|
867
|
+
PaymentIntent intent = PaymentIntent.create(
|
|
868
|
+
PaymentIntentCreateParams.builder()
|
|
869
|
+
.setAmount(request.getAmount().multiply(BigDecimal.valueOf(100)).longValue()) // Convert to cents
|
|
870
|
+
.setCurrency(request.getCurrency().toLowerCase())
|
|
871
|
+
.setPaymentMethod(request.getPaymentMethodToken())
|
|
872
|
+
.setConfirm(true)
|
|
873
|
+
.build()
|
|
874
|
+
);
|
|
875
|
+
|
|
876
|
+
return ExternalPaymentResponse.builder()
|
|
877
|
+
.success("succeeded".equals(intent.getStatus()))
|
|
878
|
+
.transactionId(intent.getId())
|
|
879
|
+
.rawResponse(intent.toJson())
|
|
880
|
+
.build();
|
|
881
|
+
|
|
882
|
+
} catch (StripeException e) {
|
|
883
|
+
throw new PaymentProcessingException("Stripe payment failed", e);
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
// PayPal payment processor
|
|
889
|
+
@Component
|
|
890
|
+
public static class PayPalPaymentProcessor implements PaymentProcessor {
|
|
891
|
+
|
|
892
|
+
private final PayPalClient payPalClient;
|
|
893
|
+
|
|
894
|
+
public PayPalPaymentProcessor(PayPalClient payPalClient) {
|
|
895
|
+
this.payPalClient = payPalClient;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
@Override
|
|
899
|
+
public PaymentProvider getProvider() {
|
|
900
|
+
return PaymentProvider.PAYPAL;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
@Override
|
|
904
|
+
public ExternalPaymentResponse processPayment(PaymentRequest request) {
|
|
905
|
+
// PayPal integration implementation
|
|
906
|
+
// Similar to Stripe but using PayPal SDK
|
|
907
|
+
return ExternalPaymentResponse.builder()
|
|
908
|
+
.success(true)
|
|
909
|
+
.transactionId("paypal-transaction-id")
|
|
910
|
+
.rawResponse("{}")
|
|
911
|
+
.build();
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
private void validatePaymentRequest(PaymentRequest request) {
|
|
916
|
+
if (request.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
|
|
917
|
+
throw new InvalidPaymentException("Payment amount must be positive");
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
if (request.getOrderId() == null) {
|
|
921
|
+
throw new InvalidPaymentException("Order ID is required");
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
// Generated with:
|
|
927
|
+
// npx claude-flow sparc run coder "Create payment service with multiple providers and secure processing"
|
|
928
|
+
```
|
|
929
|
+
|
|
930
|
+
### 2. Email Service Integration
|
|
931
|
+
|
|
932
|
+
```java
|
|
933
|
+
// Email Service with template support
|
|
934
|
+
@Service
|
|
935
|
+
public class EmailService {
|
|
936
|
+
|
|
937
|
+
private final JavaMailSender mailSender;
|
|
938
|
+
private final TemplateEngine templateEngine;
|
|
939
|
+
private final EmailConfigurationProperties emailConfig;
|
|
940
|
+
|
|
941
|
+
public EmailService(JavaMailSender mailSender,
|
|
942
|
+
TemplateEngine templateEngine,
|
|
943
|
+
EmailConfigurationProperties emailConfig) {
|
|
944
|
+
this.mailSender = mailSender;
|
|
945
|
+
this.templateEngine = templateEngine;
|
|
946
|
+
this.emailConfig = emailConfig;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
@Async
|
|
950
|
+
public void sendWelcomeEmail(String toEmail, String firstName) {
|
|
951
|
+
Context context = new Context();
|
|
952
|
+
context.setVariable("firstName", firstName);
|
|
953
|
+
context.setVariable("companyName", emailConfig.getCompanyName());
|
|
954
|
+
context.setVariable("websiteUrl", emailConfig.getWebsiteUrl());
|
|
955
|
+
|
|
956
|
+
String htmlContent = templateEngine.process("welcome-email", context);
|
|
957
|
+
|
|
958
|
+
MimeMessage message = mailSender.createMimeMessage();
|
|
959
|
+
try {
|
|
960
|
+
MimeMessageHelper helper = new MimeMessageHelper(message, true, "UTF-8");
|
|
961
|
+
helper.setFrom(emailConfig.getFromEmail(), emailConfig.getFromName());
|
|
962
|
+
helper.setTo(toEmail);
|
|
963
|
+
helper.setSubject("Welcome to " + emailConfig.getCompanyName());
|
|
964
|
+
helper.setText(htmlContent, true);
|
|
965
|
+
|
|
966
|
+
mailSender.send(message);
|
|
967
|
+
|
|
968
|
+
} catch (MessagingException | UnsupportedEncodingException e) {
|
|
969
|
+
log.error("Failed to send welcome email to: {}", toEmail, e);
|
|
970
|
+
throw new EmailSendingException("Failed to send welcome email", e);
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
@Async
|
|
975
|
+
public void sendOrderConfirmationEmail(String toEmail, OrderDto order) {
|
|
976
|
+
Context context = new Context();
|
|
977
|
+
context.setVariable("order", order);
|
|
978
|
+
context.setVariable("companyName", emailConfig.getCompanyName());
|
|
979
|
+
|
|
980
|
+
String htmlContent = templateEngine.process("order-confirmation", context);
|
|
981
|
+
|
|
982
|
+
sendEmail(toEmail, "Order Confirmation - " + order.getOrderNumber(), htmlContent);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
@Async
|
|
986
|
+
public void sendPasswordResetEmail(String toEmail, String resetToken) {
|
|
987
|
+
Context context = new Context();
|
|
988
|
+
context.setVariable("resetToken", resetToken);
|
|
989
|
+
context.setVariable("resetUrl", emailConfig.getWebsiteUrl() + "/reset-password?token=" + resetToken);
|
|
990
|
+
context.setVariable("companyName", emailConfig.getCompanyName());
|
|
991
|
+
|
|
992
|
+
String htmlContent = templateEngine.process("password-reset", context);
|
|
993
|
+
|
|
994
|
+
sendEmail(toEmail, "Password Reset Request", htmlContent);
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
private void sendEmail(String toEmail, String subject, String htmlContent) {
|
|
998
|
+
MimeMessage message = mailSender.createMimeMessage();
|
|
999
|
+
try {
|
|
1000
|
+
MimeMessageHelper helper = new MimeMessageHelper(message, true, "UTF-8");
|
|
1001
|
+
helper.setFrom(emailConfig.getFromEmail(), emailConfig.getFromName());
|
|
1002
|
+
helper.setTo(toEmail);
|
|
1003
|
+
helper.setSubject(subject);
|
|
1004
|
+
helper.setText(htmlContent, true);
|
|
1005
|
+
|
|
1006
|
+
mailSender.send(message);
|
|
1007
|
+
|
|
1008
|
+
} catch (MessagingException | UnsupportedEncodingException e) {
|
|
1009
|
+
log.error("Failed to send email to: {} with subject: {}", toEmail, subject, e);
|
|
1010
|
+
throw new EmailSendingException("Failed to send email", e);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
// Email configuration
|
|
1016
|
+
@ConfigurationProperties(prefix = "app.email")
|
|
1017
|
+
@Data
|
|
1018
|
+
public class EmailConfigurationProperties {
|
|
1019
|
+
private String fromEmail;
|
|
1020
|
+
private String fromName;
|
|
1021
|
+
private String companyName;
|
|
1022
|
+
private String websiteUrl;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
// Generated with:
|
|
1026
|
+
// npx claude-flow sparc run coder "Create email service with template support and async processing"
|
|
1027
|
+
```
|
|
1028
|
+
|
|
1029
|
+
### 3. File Storage Integration
|
|
1030
|
+
|
|
1031
|
+
```java
|
|
1032
|
+
// File Storage Service with multiple providers
|
|
1033
|
+
@Service
|
|
1034
|
+
public class FileStorageService {
|
|
1035
|
+
|
|
1036
|
+
private final Map<StorageProvider, StorageAdapter> adapters;
|
|
1037
|
+
private final FileStorageProperties storageProperties;
|
|
1038
|
+
|
|
1039
|
+
public FileStorageService(List<StorageAdapter> adapterList,
|
|
1040
|
+
FileStorageProperties storageProperties) {
|
|
1041
|
+
this.adapters = adapterList.stream()
|
|
1042
|
+
.collect(Collectors.toMap(
|
|
1043
|
+
StorageAdapter::getProvider,
|
|
1044
|
+
adapter -> adapter
|
|
1045
|
+
));
|
|
1046
|
+
this.storageProperties = storageProperties;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
public FileUploadResult uploadFile(MultipartFile file, String directory) {
|
|
1050
|
+
validateFile(file);
|
|
1051
|
+
|
|
1052
|
+
String fileName = generateFileName(file.getOriginalFilename());
|
|
1053
|
+
String fullPath = directory + "/" + fileName;
|
|
1054
|
+
|
|
1055
|
+
StorageAdapter adapter = adapters.get(storageProperties.getDefaultProvider());
|
|
1056
|
+
|
|
1057
|
+
try {
|
|
1058
|
+
String fileUrl = adapter.uploadFile(file.getInputStream(), fullPath, file.getContentType());
|
|
1059
|
+
|
|
1060
|
+
return FileUploadResult.builder()
|
|
1061
|
+
.fileName(fileName)
|
|
1062
|
+
.originalFileName(file.getOriginalFilename())
|
|
1063
|
+
.contentType(file.getContentType())
|
|
1064
|
+
.size(file.getSize())
|
|
1065
|
+
.url(fileUrl)
|
|
1066
|
+
.provider(storageProperties.getDefaultProvider())
|
|
1067
|
+
.build();
|
|
1068
|
+
|
|
1069
|
+
} catch (IOException e) {
|
|
1070
|
+
throw new FileStorageException("Failed to upload file", e);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
// AWS S3 Storage Adapter
|
|
1075
|
+
@Component
|
|
1076
|
+
public static class S3StorageAdapter implements StorageAdapter {
|
|
1077
|
+
|
|
1078
|
+
private final AmazonS3 s3Client;
|
|
1079
|
+
private final S3Properties s3Properties;
|
|
1080
|
+
|
|
1081
|
+
public S3StorageAdapter(AmazonS3 s3Client, S3Properties s3Properties) {
|
|
1082
|
+
this.s3Client = s3Client;
|
|
1083
|
+
this.s3Properties = s3Properties;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
@Override
|
|
1087
|
+
public StorageProvider getProvider() {
|
|
1088
|
+
return StorageProvider.AWS_S3;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
@Override
|
|
1092
|
+
public String uploadFile(InputStream inputStream, String path, String contentType) {
|
|
1093
|
+
ObjectMetadata metadata = new ObjectMetadata();
|
|
1094
|
+
metadata.setContentType(contentType);
|
|
1095
|
+
|
|
1096
|
+
try {
|
|
1097
|
+
PutObjectRequest request = new PutObjectRequest(
|
|
1098
|
+
s3Properties.getBucketName(),
|
|
1099
|
+
path,
|
|
1100
|
+
inputStream,
|
|
1101
|
+
metadata
|
|
1102
|
+
);
|
|
1103
|
+
|
|
1104
|
+
s3Client.putObject(request);
|
|
1105
|
+
|
|
1106
|
+
return String.format("https://%s.s3.%s.amazonaws.com/%s",
|
|
1107
|
+
s3Properties.getBucketName(),
|
|
1108
|
+
s3Properties.getRegion(),
|
|
1109
|
+
path);
|
|
1110
|
+
|
|
1111
|
+
} catch (AmazonS3Exception e) {
|
|
1112
|
+
throw new FileStorageException("Failed to upload to S3", e);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
@Override
|
|
1117
|
+
public void deleteFile(String path) {
|
|
1118
|
+
try {
|
|
1119
|
+
s3Client.deleteObject(s3Properties.getBucketName(), path);
|
|
1120
|
+
} catch (AmazonS3Exception e) {
|
|
1121
|
+
throw new FileStorageException("Failed to delete from S3", e);
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// Local File System Storage Adapter
|
|
1127
|
+
@Component
|
|
1128
|
+
public static class LocalStorageAdapter implements StorageAdapter {
|
|
1129
|
+
|
|
1130
|
+
private final LocalStorageProperties localProperties;
|
|
1131
|
+
|
|
1132
|
+
public LocalStorageAdapter(LocalStorageProperties localProperties) {
|
|
1133
|
+
this.localProperties = localProperties;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
@Override
|
|
1137
|
+
public StorageProvider getProvider() {
|
|
1138
|
+
return StorageProvider.LOCAL;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
@Override
|
|
1142
|
+
public String uploadFile(InputStream inputStream, String path, String contentType) {
|
|
1143
|
+
Path fullPath = Paths.get(localProperties.getUploadDir(), path);
|
|
1144
|
+
|
|
1145
|
+
try {
|
|
1146
|
+
Files.createDirectories(fullPath.getParent());
|
|
1147
|
+
Files.copy(inputStream, fullPath, StandardCopyOption.REPLACE_EXISTING);
|
|
1148
|
+
|
|
1149
|
+
return localProperties.getBaseUrl() + "/" + path;
|
|
1150
|
+
|
|
1151
|
+
} catch (IOException e) {
|
|
1152
|
+
throw new FileStorageException("Failed to save file locally", e);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
@Override
|
|
1157
|
+
public void deleteFile(String path) {
|
|
1158
|
+
Path fullPath = Paths.get(localProperties.getUploadDir(), path);
|
|
1159
|
+
|
|
1160
|
+
try {
|
|
1161
|
+
Files.deleteIfExists(fullPath);
|
|
1162
|
+
} catch (IOException e) {
|
|
1163
|
+
throw new FileStorageException("Failed to delete local file", e);
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
private void validateFile(MultipartFile file) {
|
|
1169
|
+
if (file.isEmpty()) {
|
|
1170
|
+
throw new InvalidFileException("File is empty");
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
if (file.getSize() > storageProperties.getMaxFileSize()) {
|
|
1174
|
+
throw new InvalidFileException("File size exceeds limit");
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
String contentType = file.getContentType();
|
|
1178
|
+
if (!storageProperties.getAllowedContentTypes().contains(contentType)) {
|
|
1179
|
+
throw new InvalidFileException("File type not allowed: " + contentType);
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
private String generateFileName(String originalFileName) {
|
|
1184
|
+
String extension = StringUtils.getFilenameExtension(originalFileName);
|
|
1185
|
+
return UUID.randomUUID().toString() + (extension != null ? "." + extension : "");
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
// Generated with:
|
|
1190
|
+
// npx claude-flow sparc run coder "Create file storage service with AWS S3 and local storage support"
|
|
1191
|
+
```
|
|
1192
|
+
|
|
1193
|
+
## Monitoring and Observability Integration
|
|
1194
|
+
|
|
1195
|
+
### 1. Comprehensive Metrics
|
|
1196
|
+
|
|
1197
|
+
```java
|
|
1198
|
+
// Custom metrics for business operations
|
|
1199
|
+
@Component
|
|
1200
|
+
public class EcommerceMetrics {
|
|
1201
|
+
|
|
1202
|
+
private final Counter userRegistrationCounter;
|
|
1203
|
+
private final Counter orderCreationCounter;
|
|
1204
|
+
private final Timer orderProcessingTimer;
|
|
1205
|
+
private final Gauge activeUsersGauge;
|
|
1206
|
+
private final DistributionSummary orderValueSummary;
|
|
1207
|
+
|
|
1208
|
+
public EcommerceMetrics(MeterRegistry meterRegistry, UserRepository userRepository) {
|
|
1209
|
+
this.userRegistrationCounter = Counter.builder("ecommerce.users.registrations.total")
|
|
1210
|
+
.description("Total user registrations")
|
|
1211
|
+
.register(meterRegistry);
|
|
1212
|
+
|
|
1213
|
+
this.orderCreationCounter = Counter.builder("ecommerce.orders.created.total")
|
|
1214
|
+
.description("Total orders created")
|
|
1215
|
+
.register(meterRegistry);
|
|
1216
|
+
|
|
1217
|
+
this.orderProcessingTimer = Timer.builder("ecommerce.order.processing.duration")
|
|
1218
|
+
.description("Order processing duration")
|
|
1219
|
+
.register(meterRegistry);
|
|
1220
|
+
|
|
1221
|
+
this.activeUsersGauge = Gauge.builder("ecommerce.users.active.total")
|
|
1222
|
+
.description("Total active users")
|
|
1223
|
+
.register(meterRegistry, userRepository, repo -> repo.countByStatusAndActiveTrue(UserStatus.ACTIVE));
|
|
1224
|
+
|
|
1225
|
+
this.orderValueSummary = DistributionSummary.builder("ecommerce.order.value")
|
|
1226
|
+
.description("Order value distribution")
|
|
1227
|
+
.baseUnit("USD")
|
|
1228
|
+
.register(meterRegistry);
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
@EventListener
|
|
1232
|
+
public void handleUserRegistered(UserRegisteredEvent event) {
|
|
1233
|
+
userRegistrationCounter.increment();
|
|
1234
|
+
}
|
|
1235
|
+
|
|
1236
|
+
@EventListener
|
|
1237
|
+
public void handleOrderCreated(OrderCreatedEvent event) {
|
|
1238
|
+
orderCreationCounter.increment(
|
|
1239
|
+
Tags.of(
|
|
1240
|
+
Tag.of("payment_method", event.getPaymentMethod()),
|
|
1241
|
+
Tag.of("order_source", event.getSource())
|
|
1242
|
+
)
|
|
1243
|
+
);
|
|
1244
|
+
|
|
1245
|
+
orderValueSummary.record(event.getOrderValue().doubleValue());
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
public Timer.Sample startOrderProcessingTimer() {
|
|
1249
|
+
return Timer.start();
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
public void recordOrderProcessingTime(Timer.Sample sample, String status) {
|
|
1253
|
+
sample.stop(orderProcessingTimer.tag("status", status));
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
// Health checks for external dependencies
|
|
1258
|
+
@Component
|
|
1259
|
+
public class EcommerceHealthIndicator implements HealthIndicator {
|
|
1260
|
+
|
|
1261
|
+
private final DataSource dataSource;
|
|
1262
|
+
private final RedisTemplate<String, Object> redisTemplate;
|
|
1263
|
+
private final PaymentServiceClient paymentServiceClient;
|
|
1264
|
+
|
|
1265
|
+
public EcommerceHealthIndicator(DataSource dataSource,
|
|
1266
|
+
RedisTemplate<String, Object> redisTemplate,
|
|
1267
|
+
PaymentServiceClient paymentServiceClient) {
|
|
1268
|
+
this.dataSource = dataSource;
|
|
1269
|
+
this.redisTemplate = redisTemplate;
|
|
1270
|
+
this.paymentServiceClient = paymentServiceClient;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
@Override
|
|
1274
|
+
public Health health() {
|
|
1275
|
+
Health.Builder builder = Health.up();
|
|
1276
|
+
|
|
1277
|
+
// Check database
|
|
1278
|
+
try (Connection connection = dataSource.getConnection()) {
|
|
1279
|
+
if (connection.isValid(5)) {
|
|
1280
|
+
builder.withDetail("database", "Available");
|
|
1281
|
+
} else {
|
|
1282
|
+
builder.down().withDetail("database", "Connection invalid");
|
|
1283
|
+
}
|
|
1284
|
+
} catch (SQLException e) {
|
|
1285
|
+
builder.down().withDetail("database", "Connection failed: " + e.getMessage());
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
// Check Redis
|
|
1289
|
+
try {
|
|
1290
|
+
redisTemplate.opsForValue().get("health-check");
|
|
1291
|
+
builder.withDetail("redis", "Available");
|
|
1292
|
+
} catch (Exception e) {
|
|
1293
|
+
builder.down().withDetail("redis", "Connection failed: " + e.getMessage());
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
// Check payment service
|
|
1297
|
+
try {
|
|
1298
|
+
if (paymentServiceClient.healthCheck()) {
|
|
1299
|
+
builder.withDetail("payment-service", "Available");
|
|
1300
|
+
} else {
|
|
1301
|
+
builder.down().withDetail("payment-service", "Service unhealthy");
|
|
1302
|
+
}
|
|
1303
|
+
} catch (Exception e) {
|
|
1304
|
+
builder.down().withDetail("payment-service", "Connection failed: " + e.getMessage());
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
return builder.build();
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
// Generated with:
|
|
1312
|
+
// npx claude-flow sparc run monitor "Create comprehensive metrics and health checks for e-commerce platform"
|
|
1313
|
+
```
|
|
1314
|
+
|
|
1315
|
+
## Docker and Kubernetes Integration
|
|
1316
|
+
|
|
1317
|
+
### 1. Docker Compose for Development
|
|
1318
|
+
|
|
1319
|
+
```yaml
|
|
1320
|
+
# docker-compose.yml - Complete development environment
|
|
1321
|
+
version: '3.8'
|
|
1322
|
+
|
|
1323
|
+
services:
|
|
1324
|
+
# Databases
|
|
1325
|
+
postgres:
|
|
1326
|
+
image: postgres:15
|
|
1327
|
+
environment:
|
|
1328
|
+
POSTGRES_DB: ecommerce
|
|
1329
|
+
POSTGRES_USER: ecommerce
|
|
1330
|
+
POSTGRES_PASSWORD: password
|
|
1331
|
+
ports:
|
|
1332
|
+
- "5432:5432"
|
|
1333
|
+
volumes:
|
|
1334
|
+
- postgres_data:/var/lib/postgresql/data
|
|
1335
|
+
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
1336
|
+
|
|
1337
|
+
redis:
|
|
1338
|
+
image: redis:7-alpine
|
|
1339
|
+
ports:
|
|
1340
|
+
- "6379:6379"
|
|
1341
|
+
command: redis-server --appendonly yes
|
|
1342
|
+
volumes:
|
|
1343
|
+
- redis_data:/data
|
|
1344
|
+
|
|
1345
|
+
# Search and Analytics
|
|
1346
|
+
elasticsearch:
|
|
1347
|
+
image: docker.elastic.co/elasticsearch/elasticsearch:8.8.0
|
|
1348
|
+
environment:
|
|
1349
|
+
- discovery.type=single-node
|
|
1350
|
+
- xpack.security.enabled=false
|
|
1351
|
+
ports:
|
|
1352
|
+
- "9200:9200"
|
|
1353
|
+
volumes:
|
|
1354
|
+
- elasticsearch_data:/usr/share/elasticsearch/data
|
|
1355
|
+
|
|
1356
|
+
# Message Queue
|
|
1357
|
+
kafka:
|
|
1358
|
+
image: confluentinc/cp-kafka:latest
|
|
1359
|
+
environment:
|
|
1360
|
+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
|
1361
|
+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
|
|
1362
|
+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
|
|
1363
|
+
ports:
|
|
1364
|
+
- "9092:9092"
|
|
1365
|
+
depends_on:
|
|
1366
|
+
- zookeeper
|
|
1367
|
+
|
|
1368
|
+
zookeeper:
|
|
1369
|
+
image: confluentinc/cp-zookeeper:latest
|
|
1370
|
+
environment:
|
|
1371
|
+
ZOOKEEPER_CLIENT_PORT: 2181
|
|
1372
|
+
|
|
1373
|
+
# Service Discovery
|
|
1374
|
+
eureka-server:
|
|
1375
|
+
build: ./eureka-server
|
|
1376
|
+
ports:
|
|
1377
|
+
- "8761:8761"
|
|
1378
|
+
environment:
|
|
1379
|
+
- SPRING_PROFILES_ACTIVE=docker
|
|
1380
|
+
|
|
1381
|
+
# Configuration Server
|
|
1382
|
+
config-server:
|
|
1383
|
+
build: ./config-server
|
|
1384
|
+
ports:
|
|
1385
|
+
- "8888:8888"
|
|
1386
|
+
environment:
|
|
1387
|
+
- SPRING_PROFILES_ACTIVE=docker
|
|
1388
|
+
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://eureka-server:8761/eureka
|
|
1389
|
+
depends_on:
|
|
1390
|
+
- eureka-server
|
|
1391
|
+
|
|
1392
|
+
# API Gateway
|
|
1393
|
+
api-gateway:
|
|
1394
|
+
build: ./api-gateway
|
|
1395
|
+
ports:
|
|
1396
|
+
- "8080:8080"
|
|
1397
|
+
environment:
|
|
1398
|
+
- SPRING_PROFILES_ACTIVE=docker
|
|
1399
|
+
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://eureka-server:8761/eureka
|
|
1400
|
+
depends_on:
|
|
1401
|
+
- eureka-server
|
|
1402
|
+
- config-server
|
|
1403
|
+
|
|
1404
|
+
# Microservices
|
|
1405
|
+
user-service:
|
|
1406
|
+
build: ./user-service
|
|
1407
|
+
environment:
|
|
1408
|
+
- SPRING_PROFILES_ACTIVE=docker
|
|
1409
|
+
- DATABASE_URL=jdbc:postgresql://postgres:5432/ecommerce
|
|
1410
|
+
- REDIS_HOST=redis
|
|
1411
|
+
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://eureka-server:8761/eureka
|
|
1412
|
+
depends_on:
|
|
1413
|
+
- postgres
|
|
1414
|
+
- redis
|
|
1415
|
+
- eureka-server
|
|
1416
|
+
- config-server
|
|
1417
|
+
|
|
1418
|
+
product-service:
|
|
1419
|
+
build: ./product-service
|
|
1420
|
+
environment:
|
|
1421
|
+
- SPRING_PROFILES_ACTIVE=docker
|
|
1422
|
+
- DATABASE_URL=jdbc:postgresql://postgres:5432/ecommerce
|
|
1423
|
+
- REDIS_HOST=redis
|
|
1424
|
+
- ELASTICSEARCH_HOST=elasticsearch
|
|
1425
|
+
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://eureka-server:8761/eureka
|
|
1426
|
+
depends_on:
|
|
1427
|
+
- postgres
|
|
1428
|
+
- redis
|
|
1429
|
+
- elasticsearch
|
|
1430
|
+
- eureka-server
|
|
1431
|
+
- config-server
|
|
1432
|
+
|
|
1433
|
+
order-service:
|
|
1434
|
+
build: ./order-service
|
|
1435
|
+
environment:
|
|
1436
|
+
- SPRING_PROFILES_ACTIVE=docker
|
|
1437
|
+
- DATABASE_URL=jdbc:postgresql://postgres:5432/ecommerce
|
|
1438
|
+
- KAFKA_BROKERS=kafka:9092
|
|
1439
|
+
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://eureka-server:8761/eureka
|
|
1440
|
+
depends_on:
|
|
1441
|
+
- postgres
|
|
1442
|
+
- kafka
|
|
1443
|
+
- eureka-server
|
|
1444
|
+
- config-server
|
|
1445
|
+
|
|
1446
|
+
# Monitoring
|
|
1447
|
+
prometheus:
|
|
1448
|
+
image: prom/prometheus:latest
|
|
1449
|
+
ports:
|
|
1450
|
+
- "9090:9090"
|
|
1451
|
+
volumes:
|
|
1452
|
+
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
1453
|
+
command:
|
|
1454
|
+
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
1455
|
+
- '--storage.tsdb.path=/prometheus'
|
|
1456
|
+
|
|
1457
|
+
grafana:
|
|
1458
|
+
image: grafana/grafana:latest
|
|
1459
|
+
ports:
|
|
1460
|
+
- "3000:3000"
|
|
1461
|
+
environment:
|
|
1462
|
+
- GF_SECURITY_ADMIN_PASSWORD=admin
|
|
1463
|
+
volumes:
|
|
1464
|
+
- grafana_data:/var/lib/grafana
|
|
1465
|
+
- ./docker/grafana/provisioning:/etc/grafana/provisioning
|
|
1466
|
+
|
|
1467
|
+
volumes:
|
|
1468
|
+
postgres_data:
|
|
1469
|
+
redis_data:
|
|
1470
|
+
elasticsearch_data:
|
|
1471
|
+
grafana_data:
|
|
1472
|
+
|
|
1473
|
+
# Generated with:
|
|
1474
|
+
# npx claude-flow sparc run architect "Create comprehensive Docker Compose setup for e-commerce development"
|
|
1475
|
+
```
|
|
1476
|
+
|
|
1477
|
+
### 2. Kubernetes Production Deployment
|
|
1478
|
+
|
|
1479
|
+
```yaml
|
|
1480
|
+
# kubernetes/namespace.yaml
|
|
1481
|
+
apiVersion: v1
|
|
1482
|
+
kind: Namespace
|
|
1483
|
+
metadata:
|
|
1484
|
+
name: ecommerce
|
|
1485
|
+
|
|
1486
|
+
---
|
|
1487
|
+
# kubernetes/configmap.yaml
|
|
1488
|
+
apiVersion: v1
|
|
1489
|
+
kind: ConfigMap
|
|
1490
|
+
metadata:
|
|
1491
|
+
name: ecommerce-config
|
|
1492
|
+
namespace: ecommerce
|
|
1493
|
+
data:
|
|
1494
|
+
application.yml: |
|
|
1495
|
+
spring:
|
|
1496
|
+
profiles:
|
|
1497
|
+
active: kubernetes
|
|
1498
|
+
management:
|
|
1499
|
+
endpoints:
|
|
1500
|
+
web:
|
|
1501
|
+
exposure:
|
|
1502
|
+
include: health,info,metrics,prometheus
|
|
1503
|
+
endpoint:
|
|
1504
|
+
health:
|
|
1505
|
+
show-details: when-authorized
|
|
1506
|
+
|
|
1507
|
+
---
|
|
1508
|
+
# kubernetes/user-service.yaml
|
|
1509
|
+
apiVersion: apps/v1
|
|
1510
|
+
kind: Deployment
|
|
1511
|
+
metadata:
|
|
1512
|
+
name: user-service
|
|
1513
|
+
namespace: ecommerce
|
|
1514
|
+
labels:
|
|
1515
|
+
app: user-service
|
|
1516
|
+
version: v1
|
|
1517
|
+
spec:
|
|
1518
|
+
replicas: 3
|
|
1519
|
+
selector:
|
|
1520
|
+
matchLabels:
|
|
1521
|
+
app: user-service
|
|
1522
|
+
template:
|
|
1523
|
+
metadata:
|
|
1524
|
+
labels:
|
|
1525
|
+
app: user-service
|
|
1526
|
+
version: v1
|
|
1527
|
+
spec:
|
|
1528
|
+
containers:
|
|
1529
|
+
- name: user-service
|
|
1530
|
+
image: ecommerce/user-service:latest
|
|
1531
|
+
ports:
|
|
1532
|
+
- containerPort: 8080
|
|
1533
|
+
env:
|
|
1534
|
+
- name: SPRING_PROFILES_ACTIVE
|
|
1535
|
+
value: "kubernetes"
|
|
1536
|
+
- name: DATABASE_URL
|
|
1537
|
+
valueFrom:
|
|
1538
|
+
secretKeyRef:
|
|
1539
|
+
name: database-secret
|
|
1540
|
+
key: url
|
|
1541
|
+
- name: DATABASE_USERNAME
|
|
1542
|
+
valueFrom:
|
|
1543
|
+
secretKeyRef:
|
|
1544
|
+
name: database-secret
|
|
1545
|
+
key: username
|
|
1546
|
+
- name: DATABASE_PASSWORD
|
|
1547
|
+
valueFrom:
|
|
1548
|
+
secretKeyRef:
|
|
1549
|
+
name: database-secret
|
|
1550
|
+
key: password
|
|
1551
|
+
- name: REDIS_HOST
|
|
1552
|
+
value: "redis-service"
|
|
1553
|
+
- name: JAVA_OPTS
|
|
1554
|
+
value: "-Xms512m -Xmx1g -XX:+UseG1GC"
|
|
1555
|
+
resources:
|
|
1556
|
+
requests:
|
|
1557
|
+
memory: "512Mi"
|
|
1558
|
+
cpu: "250m"
|
|
1559
|
+
limits:
|
|
1560
|
+
memory: "1Gi"
|
|
1561
|
+
cpu: "500m"
|
|
1562
|
+
livenessProbe:
|
|
1563
|
+
httpGet:
|
|
1564
|
+
path: /actuator/health/liveness
|
|
1565
|
+
port: 8080
|
|
1566
|
+
initialDelaySeconds: 60
|
|
1567
|
+
periodSeconds: 30
|
|
1568
|
+
readinessProbe:
|
|
1569
|
+
httpGet:
|
|
1570
|
+
path: /actuator/health/readiness
|
|
1571
|
+
port: 8080
|
|
1572
|
+
initialDelaySeconds: 30
|
|
1573
|
+
periodSeconds: 10
|
|
1574
|
+
volumeMounts:
|
|
1575
|
+
- name: config-volume
|
|
1576
|
+
mountPath: /app/config
|
|
1577
|
+
volumes:
|
|
1578
|
+
- name: config-volume
|
|
1579
|
+
configMap:
|
|
1580
|
+
name: ecommerce-config
|
|
1581
|
+
|
|
1582
|
+
---
|
|
1583
|
+
apiVersion: v1
|
|
1584
|
+
kind: Service
|
|
1585
|
+
metadata:
|
|
1586
|
+
name: user-service
|
|
1587
|
+
namespace: ecommerce
|
|
1588
|
+
labels:
|
|
1589
|
+
app: user-service
|
|
1590
|
+
spec:
|
|
1591
|
+
selector:
|
|
1592
|
+
app: user-service
|
|
1593
|
+
ports:
|
|
1594
|
+
- port: 80
|
|
1595
|
+
targetPort: 8080
|
|
1596
|
+
type: ClusterIP
|
|
1597
|
+
|
|
1598
|
+
---
|
|
1599
|
+
# kubernetes/hpa.yaml
|
|
1600
|
+
apiVersion: autoscaling/v2
|
|
1601
|
+
kind: HorizontalPodAutoscaler
|
|
1602
|
+
metadata:
|
|
1603
|
+
name: user-service-hpa
|
|
1604
|
+
namespace: ecommerce
|
|
1605
|
+
spec:
|
|
1606
|
+
scaleTargetRef:
|
|
1607
|
+
apiVersion: apps/v1
|
|
1608
|
+
kind: Deployment
|
|
1609
|
+
name: user-service
|
|
1610
|
+
minReplicas: 3
|
|
1611
|
+
maxReplicas: 10
|
|
1612
|
+
metrics:
|
|
1613
|
+
- type: Resource
|
|
1614
|
+
resource:
|
|
1615
|
+
name: cpu
|
|
1616
|
+
target:
|
|
1617
|
+
type: Utilization
|
|
1618
|
+
averageUtilization: 70
|
|
1619
|
+
- type: Resource
|
|
1620
|
+
resource:
|
|
1621
|
+
name: memory
|
|
1622
|
+
target:
|
|
1623
|
+
type: Utilization
|
|
1624
|
+
averageUtilization: 80
|
|
1625
|
+
|
|
1626
|
+
# Generated with:
|
|
1627
|
+
# npx claude-flow sparc run architect "Create production Kubernetes manifests with auto-scaling"
|
|
1628
|
+
```
|
|
1629
|
+
|
|
1630
|
+
## Claude Flow Integration Examples
|
|
1631
|
+
|
|
1632
|
+
### 1. Complete Development Workflow
|
|
1633
|
+
|
|
1634
|
+
```bash
|
|
1635
|
+
#!/bin/bash
|
|
1636
|
+
# complete-ecommerce-development.sh
|
|
1637
|
+
# Auto-generated development workflow by Claude Flow
|
|
1638
|
+
|
|
1639
|
+
echo "Starting e-commerce platform development with Claude Flow..."
|
|
1640
|
+
|
|
1641
|
+
# Initialize project structure
|
|
1642
|
+
npx claude-flow sparc run architect "Design complete e-commerce microservices architecture"
|
|
1643
|
+
|
|
1644
|
+
# Generate core services in parallel
|
|
1645
|
+
npx claude-flow sparc batch coder,tester "Create user service with authentication and profile management" &
|
|
1646
|
+
npx claude-flow sparc batch coder,tester "Create product service with search and inventory management" &
|
|
1647
|
+
npx claude-flow sparc batch coder,tester "Create order service with payment processing and fulfillment" &
|
|
1648
|
+
npx claude-flow sparc batch coder,tester "Create notification service with email and SMS capabilities" &
|
|
1649
|
+
|
|
1650
|
+
# Wait for core services
|
|
1651
|
+
wait
|
|
1652
|
+
|
|
1653
|
+
# Generate infrastructure components
|
|
1654
|
+
npx claude-flow sparc run coder "Create API Gateway with rate limiting and authentication"
|
|
1655
|
+
npx claude-flow sparc run coder "Setup service discovery with Eureka"
|
|
1656
|
+
npx claude-flow sparc run coder "Configure centralized logging with ELK stack"
|
|
1657
|
+
|
|
1658
|
+
# Generate deployment configurations
|
|
1659
|
+
npx claude-flow sparc run architect "Create Docker Compose for development environment"
|
|
1660
|
+
npx claude-flow sparc run architect "Create Kubernetes manifests for production deployment"
|
|
1661
|
+
|
|
1662
|
+
# Generate monitoring and observability
|
|
1663
|
+
npx claude-flow sparc run monitor "Setup comprehensive monitoring with Prometheus and Grafana"
|
|
1664
|
+
npx claude-flow sparc run monitor "Configure distributed tracing with Jaeger"
|
|
1665
|
+
|
|
1666
|
+
# Generate CI/CD pipeline
|
|
1667
|
+
npx claude-flow sparc run cicd-engineer "Create GitHub Actions workflow for automated testing and deployment"
|
|
1668
|
+
|
|
1669
|
+
echo "E-commerce platform development completed!"
|
|
1670
|
+
|
|
1671
|
+
# Generated with:
|
|
1672
|
+
# npx claude-flow sparc run architect "Create complete development workflow script for e-commerce platform"
|
|
1673
|
+
```
|
|
1674
|
+
|
|
1675
|
+
### 2. Performance Optimization Workflow
|
|
1676
|
+
|
|
1677
|
+
```bash
|
|
1678
|
+
#!/bin/bash
|
|
1679
|
+
# performance-optimization.sh
|
|
1680
|
+
|
|
1681
|
+
echo "Starting performance optimization workflow..."
|
|
1682
|
+
|
|
1683
|
+
# Analyze current performance
|
|
1684
|
+
npx claude-flow sparc run perf-analyzer "Analyze application performance bottlenecks and generate optimization plan"
|
|
1685
|
+
|
|
1686
|
+
# Database optimization
|
|
1687
|
+
npx claude-flow sparc run perf-analyzer "Optimize database queries and connection pool settings"
|
|
1688
|
+
|
|
1689
|
+
# JVM tuning
|
|
1690
|
+
npx claude-flow sparc run perf-analyzer "Generate optimized JVM settings for production workload"
|
|
1691
|
+
|
|
1692
|
+
# Caching optimization
|
|
1693
|
+
npx claude-flow sparc run coder "Implement Redis caching strategy for frequently accessed data"
|
|
1694
|
+
|
|
1695
|
+
# Load testing
|
|
1696
|
+
npx claude-flow sparc run tester "Create comprehensive load tests with Gatling"
|
|
1697
|
+
|
|
1698
|
+
# Performance monitoring
|
|
1699
|
+
npx claude-flow sparc run monitor "Setup performance monitoring dashboards and alerts"
|
|
1700
|
+
|
|
1701
|
+
echo "Performance optimization completed!"
|
|
1702
|
+
```
|
|
1703
|
+
|
|
1704
|
+
## Next Steps
|
|
1705
|
+
|
|
1706
|
+
- [Project Setup](project-setup.md)
|
|
1707
|
+
- [Spring Boot Development](spring-boot.md)
|
|
1708
|
+
- [Enterprise Java Development](enterprise-java.md)
|
|
1709
|
+
- [Testing Strategies](testing.md)
|
|
1710
|
+
- [Performance Optimization](performance.md)
|
|
1711
|
+
- [Microservices Development](microservices.md)
|
|
1712
|
+
- [Claude Flow Integration](claude-flow-integration.md)
|