claude-flow-novice 2.9.1 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/cfn-dev-team/CLAUDE.md +1086 -0
- package/.claude/agents/cfn-dev-team/README.md +116 -0
- package/.claude/agents/cfn-dev-team/architecture/api-designer-persona.md +149 -0
- package/.claude/agents/cfn-dev-team/architecture/base-template-generator.md +196 -0
- package/.claude/agents/cfn-dev-team/architecture/goal-planner.md +183 -0
- package/.claude/agents/cfn-dev-team/architecture/planner.md +182 -0
- package/.claude/agents/cfn-dev-team/architecture/system-architect.md +162 -0
- package/.claude/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +540 -0
- package/.claude/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +20 -14
- package/.claude/agents/cfn-dev-team/coordinators/consensus-builder.md +167 -0
- package/.claude/agents/cfn-dev-team/dev-ops/devops-engineer.md +148 -0
- package/.claude/agents/cfn-dev-team/dev-ops/github-commit-agent.md +118 -0
- package/.claude/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +540 -0
- package/.claude/agents/cfn-dev-team/developers/backend-dev.md +20 -0
- package/.claude/agents/cfn-dev-team/developers/data/data-engineer.md +585 -0
- package/.claude/agents/cfn-dev-team/developers/database/database-architect.md +276 -0
- package/.claude/agents/cfn-dev-team/developers/dev-backend-api.md +147 -0
- package/.claude/agents/cfn-dev-team/developers/frontend/mobile-dev.md +218 -0
- package/.claude/agents/cfn-dev-team/developers/{react-frontend-engineer.md → frontend/react-frontend-engineer.md} +53 -5
- package/.claude/agents/cfn-dev-team/developers/frontend/spec-mobile-react-native.md +199 -0
- package/.claude/agents/cfn-dev-team/developers/graphql-specialist.md +615 -0
- package/.claude/agents/cfn-dev-team/developers/rust-developer.md +174 -0
- package/.claude/agents/cfn-dev-team/documentation/README-VALIDATION.md +243 -0
- package/.claude/agents/cfn-dev-team/documentation/agent-type-guidelines.md +465 -0
- package/.claude/agents/cfn-dev-team/documentation/api-docs.md +103 -0
- package/.claude/agents/cfn-dev-team/documentation/docs-api-openapi.md +98 -0
- package/.claude/agents/cfn-dev-team/documentation/pseudocode.md +159 -0
- package/.claude/agents/cfn-dev-team/documentation/specification.md +157 -0
- package/.claude/agents/cfn-dev-team/product-owners/accessibility-advocate-persona.md +109 -0
- package/.claude/agents/cfn-dev-team/{coordinators → product-owners}/cto-agent.md +8 -6
- package/.claude/agents/cfn-dev-team/product-owners/power-user-persona.md +190 -0
- package/.claude/agents/cfn-dev-team/{coordinators → product-owners}/product-owner.md +85 -59
- package/.claude/agents/cfn-dev-team/reviewers/quality/analyze-code-quality.md +141 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/code-analyzer.md +200 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/cyclomatic-complexity-reducer.md +321 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +238 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +101 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/quality-metrics.md +375 -0
- package/.claude/agents/cfn-dev-team/reviewers/quality/security-specialist.md +193 -0
- package/.claude/agents/cfn-dev-team/reviewers/reviewer.md +39 -0
- package/.claude/agents/cfn-dev-team/testers/interaction-tester.md +31 -0
- package/.claude/agents/cfn-dev-team/testers/load-testing-specialist.md +469 -0
- package/.claude/agents/cfn-dev-team/testers/playwright-tester.md +24 -0
- package/.claude/agents/cfn-dev-team/testers/tester.md +20 -0
- package/.claude/agents/cfn-dev-team/utility/agent-builder.md +151 -0
- package/.claude/agents/cfn-dev-team/utility/analyst.md +178 -0
- package/.claude/agents/cfn-dev-team/utility/claude-code-expert.md +1043 -0
- package/.claude/agents/cfn-dev-team/utility/code-booster.md +139 -0
- package/.claude/agents/cfn-dev-team/utility/context-curator.md +99 -0
- package/.claude/agents/cfn-dev-team/{developers → utility}/researcher.md +6 -4
- package/.claude/commands/cfn/CFN_LOOP_FRONTEND.md +741 -0
- package/.claude/commands/cfn/CFN_LOOP_TASK_MODE.md +353 -0
- package/.claude/commands/cfn/cfn-loop-frontend.md +555 -0
- package/.claude/commands/cfn/cfn-loop.md +168 -7
- package/{CFN-CLAUDE.md → .claude/root-claude-distribute/CFN-CLAUDE.md} +23 -3
- package/.claude/skills/cfn-ace-system/SKILL.md +364 -0
- package/.claude/skills/cfn-ace-system/add-bullet.sh +145 -0
- package/.claude/skills/cfn-ace-system/analyze-anti-pattern-effectiveness.sh +56 -0
- package/.claude/skills/cfn-ace-system/classify-task.sh +18 -0
- package/.claude/skills/cfn-ace-system/export-ace-metrics.sh +48 -0
- package/.claude/skills/cfn-ace-system/extract-tags.sh +385 -0
- package/.claude/skills/cfn-ace-system/format-negative-context.sh +180 -0
- package/.claude/skills/cfn-ace-system/init-indexes.sql +160 -0
- package/.claude/skills/cfn-ace-system/invoke-context-curate.sh +192 -0
- package/.claude/skills/cfn-ace-system/invoke-context-inject.sh +361 -0
- package/.claude/skills/cfn-ace-system/invoke-context-query.sh +139 -0
- package/.claude/skills/cfn-ace-system/invoke-context-reflect.sh +343 -0
- package/.claude/skills/cfn-ace-system/invoke-context-stats.sh +227 -0
- package/.claude/skills/cfn-ace-system/log-merge.sh +67 -0
- package/.claude/skills/cfn-ace-system/monitor-injection-performance.sh +138 -0
- package/.claude/skills/cfn-ace-system/optimize-injection-pipeline.sh +169 -0
- package/.claude/skills/cfn-ace-system/query-anti-patterns.sh +276 -0
- package/.claude/skills/cfn-ace-system/query-contexts.sh +150 -0
- package/.claude/skills/cfn-ace-system/query-reflections.sh +35 -0
- package/.claude/skills/cfn-ace-system/schema/001-create-context-reflections.sql +237 -0
- package/.claude/skills/cfn-ace-system/schema/README.md +723 -0
- package/.claude/skills/cfn-ace-system/schema/SCHEMA_DESIGN_SUMMARY.md +564 -0
- package/.claude/skills/cfn-ace-system/schema/populate-test-data-simple.sh +62 -0
- package/.claude/skills/cfn-ace-system/schema/populate-test-data.sh +247 -0
- package/.claude/skills/cfn-ace-system/schema/run-migration.sh +231 -0
- package/.claude/skills/cfn-ace-system/schema/validate-schema.sql +280 -0
- package/.claude/skills/cfn-ace-system/score-relevance-adapter.sh +138 -0
- package/.claude/skills/cfn-ace-system/score-relevance.sh +253 -0
- package/.claude/skills/cfn-ace-system/sprint-7-lessons.json +46 -0
- package/.claude/skills/cfn-ace-system/store-reflection.sh +46 -0
- package/.claude/skills/cfn-ace-system/test-ace-skill.sh +312 -0
- package/.claude/skills/cfn-ace-system/track-ab-test.sh +42 -0
- package/.claude/skills/cfn-ace-system/update-reflection.sh +41 -0
- package/.claude/skills/cfn-agent-discovery/SKILL.md +40 -0
- package/.claude/skills/cfn-agent-discovery/agents-registry-clean.json +0 -0
- package/.claude/skills/cfn-agent-discovery/agents-registry-fixed.json +19 -0
- package/.claude/skills/cfn-agent-discovery/agents-registry.json +718 -0
- package/.claude/skills/cfn-agent-discovery/discover-agents.py +184 -0
- package/.claude/skills/cfn-agent-discovery/discover-agents.sh +87 -0
- package/.claude/skills/cfn-agent-discovery/invoke-registry.sh +11 -0
- package/.claude/skills/cfn-agent-discovery/temp_script.py +0 -0
- package/.claude/skills/cfn-agent-execution/execute-agent.sh +126 -0
- package/.claude/skills/cfn-agent-output-processing/SKILL.md +359 -0
- package/.claude/skills/cfn-agent-selector/SKILL.md +90 -0
- package/.claude/skills/cfn-agent-selector/select-agents.sh +112 -0
- package/.claude/skills/cfn-agent-spawning/SKILL.md +135 -0
- package/.claude/skills/cfn-agent-spawning/agent-selection-guide.md +814 -0
- package/.claude/skills/cfn-agent-spawning/check-dependencies.sh +30 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +263 -0
- package/.claude/skills/cfn-agent-spawning/spawn-templates.sh +613 -0
- package/.claude/skills/cfn-analytics/description-refinement-guide.md +164 -0
- package/.claude/skills/cfn-analytics/log-skill-invocation.js +122 -0
- package/.claude/skills/cfn-analytics/run-production-criteria-tests.sh +126 -0
- package/.claude/skills/cfn-analytics/skill-analytics-dashboard.js +113 -0
- package/.claude/skills/cfn-analytics/skill-invocation-hook.sh +28 -0
- package/.claude/skills/cfn-analytics/skill-invocations.sql +58 -0
- package/.claude/skills/cfn-analytics/test-corpus.json +32 -0
- package/.claude/skills/cfn-analytics/test-data-generator.js +115 -0
- package/.claude/skills/cfn-analytics/test-manual-override-rate.js +285 -0
- package/.claude/skills/cfn-analytics/validate-skill-selection.js +188 -0
- package/.claude/skills/cfn-config-management/SKILL.md +34 -0
- package/.claude/skills/cfn-config-management/check-dependencies.sh +56 -0
- package/.claude/skills/cfn-config-management/config.json +32 -0
- package/.claude/skills/cfn-config-management/manage-config.sh +113 -0
- package/.claude/skills/cfn-event-bus/SKILL.md +412 -0
- package/.claude/skills/cfn-event-bus/config.json +111 -0
- package/.claude/skills/cfn-event-bus/eventbus-wrapper.cjs +69 -0
- package/.claude/skills/cfn-event-bus/invoke-event-publish.sh +147 -0
- package/.claude/skills/cfn-event-bus/invoke-event-subscribe.sh +171 -0
- package/.claude/skills/cfn-event-bus/invoke-lifecycle-track.sh +201 -0
- package/.claude/skills/cfn-event-bus/test-event-bus.sh +280 -0
- package/.claude/skills/cfn-fleet-manager/SKILL.md +412 -0
- package/.claude/skills/cfn-fleet-manager/config.json +60 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-allocate.sh +182 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-balance.sh +239 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-metrics.sh +193 -0
- package/.claude/skills/cfn-fleet-manager/invoke-fleet-register.sh +124 -0
- package/.claude/skills/cfn-fleet-manager/test-fleet-manager.sh +345 -0
- package/.claude/skills/cfn-hook-pipeline/SKILL.md +148 -0
- package/.claude/skills/cfn-hook-pipeline/auto-resolve.sh +66 -0
- package/.claude/skills/cfn-hook-pipeline/check-dependencies.sh +40 -0
- package/.claude/skills/cfn-hook-pipeline/feedback-resolver.sh +452 -0
- package/.claude/skills/cfn-hook-pipeline/post-edit-handler.sh +154 -0
- package/.claude/skills/cfn-hook-pipeline/security-scan.json +60 -0
- package/.claude/skills/cfn-hook-pipeline/security-scanner.sh +121 -0
- package/.claude/skills/cfn-hook-pipeline/test-root-warning-resolution.sh +148 -0
- package/.claude/skills/cfn-hybrid-routing/SKILL.md +46 -0
- package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +52 -0
- package/.claude/skills/cfn-hybrid-routing/config.json +26 -0
- package/.claude/skills/cfn-hybrid-routing/spawn-worker.sh +44 -0
- package/.claude/skills/cfn-loop-orchestration/SKILL.md +299 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/auto-tune-timeouts.sh +228 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/consensus.sh +84 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/context-injection.sh +142 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/context-lookup.sh +359 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/deliverable-verifier.sh +71 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +90 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/iteration-manager.sh +87 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/spawn-agents.sh +271 -0
- package/.claude/skills/cfn-loop-orchestration/helpers/timeout-calculator.sh +51 -0
- package/.claude/skills/cfn-loop-orchestration/inject-loop-context.sh +41 -0
- package/.claude/skills/cfn-loop-orchestration/monitor-execution.sh +156 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +884 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +840 -0
- package/.claude/skills/cfn-loop-orchestration/security_utils.sh +99 -0
- package/.claude/skills/cfn-loop-orchestration/test-cfn-orchestration.sh +281 -0
- package/.claude/skills/cfn-loop-orchestration/test-edge-cases.sh +188 -0
- package/.claude/skills/cfn-loop-validation/SKILL.md +353 -0
- package/.claude/skills/cfn-loop-validation/check-dependencies.sh +31 -0
- package/.claude/skills/cfn-loop-validation/config.json +161 -0
- package/.claude/skills/cfn-loop-validation/consensus-calculator.js +477 -0
- package/.claude/skills/cfn-loop-validation/evidence-chain.sql +163 -0
- package/.claude/skills/cfn-loop-validation/examples/README.md +453 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-full-cfn-loop.sh +234 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-loop2-consensus.sh +132 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-loop3-gate.sh +115 -0
- package/.claude/skills/cfn-loop-validation/examples/coordinator-redis-integration.sh +186 -0
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -0
- package/.claude/skills/cfn-loop-validation/validate-iteration.sh +134 -0
- package/.claude/skills/cfn-process-lifecycle/SKILL.md +39 -0
- package/.claude/skills/cfn-process-lifecycle/check-dependencies.sh +58 -0
- package/.claude/skills/cfn-process-lifecycle/config.json +39 -0
- package/.claude/skills/cfn-process-lifecycle/process-manager.sh +144 -0
- package/.claude/skills/cfn-product-owner-decision/SKILL.md +332 -0
- package/.claude/skills/cfn-product-owner-decision/execute-decision.sh +176 -0
- package/.claude/skills/cfn-product-owner-decision/parse-decision.sh +66 -0
- package/.claude/skills/cfn-product-owner-decision/validate-deliverables.sh +82 -0
- package/.claude/skills/cfn-redis-coordination/AGENT_LOGGING.md +280 -0
- package/.claude/skills/cfn-redis-coordination/BZPOPMIN_FIX_SUMMARY.md +209 -0
- package/.claude/skills/cfn-redis-coordination/HEARTBEAT.md +57 -0
- package/.claude/skills/cfn-redis-coordination/HEARTBEAT_MONITORING.md +267 -0
- package/.claude/skills/cfn-redis-coordination/LOGGING.md +260 -0
- package/.claude/skills/cfn-redis-coordination/SECURITY_REVIEW.md +25 -0
- package/.claude/skills/cfn-redis-coordination/SHUTDOWN_HANDLING.md +164 -0
- package/.claude/skills/cfn-redis-coordination/SKILL.md +720 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh +124 -0
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +75 -0
- package/.claude/skills/cfn-redis-coordination/analyze-task-complexity.sh +277 -0
- package/.claude/skills/cfn-redis-coordination/cancel-swarm.sh +221 -0
- package/.claude/skills/cfn-redis-coordination/cfn-loop-exec.sh +468 -0
- package/.claude/skills/cfn-redis-coordination/cfn-loop-relaunch.sh +29 -0
- package/.claude/skills/cfn-redis-coordination/check-dependencies.sh +32 -0
- package/.claude/skills/cfn-redis-coordination/collect-confidence-scores.sh +179 -0
- package/.claude/skills/cfn-redis-coordination/collect-results.sh +75 -0
- package/.claude/skills/cfn-redis-coordination/complete-swarm.sh +75 -0
- package/.claude/skills/cfn-redis-coordination/config.json +61 -0
- package/.claude/skills/cfn-redis-coordination/data/cfn-loop.db +0 -0
- package/.claude/skills/cfn-redis-coordination/demos/phase4-wake-queue-test-report.md +82 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-bzpopmin-fix.sh +274 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-cancel-swarm.sh +276 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-dlq.sh +129 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-iteration-feedback.sh +320 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-orchestrator.sh +249 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4-unix.sh +148 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake-phase4.sh +163 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-priority-wake.sh +138 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quick-fix.sh +81 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-absolute.sh +45 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-fallback.sh +68 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-percentage.sh +56 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum-with-retry.sh +81 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-quorum.sh +57 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-shutdown-handling.sh +187 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-shutdown.sh +160 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-utils-unix.sh +97 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-utils.sh +97 -0
- package/.claude/skills/cfn-redis-coordination/demos/test-waiting-mode.sh +59 -0
- package/.claude/skills/cfn-redis-coordination/examples/README.md +73 -0
- package/.claude/skills/cfn-redis-coordination/examples/grafana-dashboard.json +352 -0
- package/.claude/skills/cfn-redis-coordination/examples/hierarchical-pattern.sh +127 -0
- package/.claude/skills/cfn-redis-coordination/examples/mesh-pattern.sh +171 -0
- package/.claude/skills/cfn-redis-coordination/examples/timeout-handling.sh +227 -0
- package/.claude/skills/cfn-redis-coordination/examples/waiting-mode-pattern.sh +239 -0
- package/.claude/skills/cfn-redis-coordination/execute-product-owner-decision.sh +258 -0
- package/.claude/skills/cfn-redis-coordination/get-agent-timeout.sh +177 -0
- package/.claude/skills/cfn-redis-coordination/heartbeat-functions.sh +137 -0
- package/.claude/skills/cfn-redis-coordination/heartbeat-protocol.md +106 -0
- package/.claude/skills/cfn-redis-coordination/heartbeat.sh +126 -0
- package/.claude/skills/cfn-redis-coordination/init-swarm.sh +148 -0
- package/.claude/skills/cfn-redis-coordination/invoke-redis-pattern.sh +220 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +283 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh.backup-p7 +423 -0
- package/.claude/skills/cfn-redis-coordination/list-active-swarms.sh +147 -0
- package/.claude/skills/cfn-redis-coordination/log-event.sh +109 -0
- package/.claude/skills/cfn-redis-coordination/metrics-export.sh +674 -0
- package/.claude/skills/cfn-redis-coordination/metrics-schema.json +66 -0
- package/.claude/skills/cfn-redis-coordination/metrics-storage.md +31 -0
- package/.claude/skills/cfn-redis-coordination/monitor-cfn-violations.sh +391 -0
- package/.claude/skills/cfn-redis-coordination/monitor-heartbeats.sh +101 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop-v3.sh +141 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh +31 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup +38 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-1761167675 +1672 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-p5 +1604 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase1 +1550 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase2 +1621 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.backup-phase3 +1621 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.bak +0 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.broken +1627 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.corrupted +80 -0
- package/.claude/skills/cfn-redis-coordination/orchestrate-cfn-loop.sh.deprecated +1864 -0
- package/.claude/skills/cfn-redis-coordination/priority-wake-mechanism.md +75 -0
- package/.claude/skills/cfn-redis-coordination/priority_wake.py +134 -0
- package/.claude/skills/cfn-redis-coordination/query-dlq.sh +162 -0
- package/.claude/skills/cfn-redis-coordination/query-logs.sh +103 -0
- package/.claude/skills/cfn-redis-coordination/redis-pattern.sh +619 -0
- package/.claude/skills/cfn-redis-coordination/retrieve-context.sh +58 -0
- package/.claude/skills/cfn-redis-coordination/select-specialist-agent.sh +371 -0
- package/.claude/skills/cfn-redis-coordination/semantic-match-tfidf.py +252 -0
- package/.claude/skills/cfn-redis-coordination/send-heartbeat.sh +165 -0
- package/.claude/skills/cfn-redis-coordination/signal.sh +38 -0
- package/.claude/skills/cfn-redis-coordination/store-context.sh +86 -0
- package/.claude/skills/cfn-redis-coordination/store-epic-context.sh +123 -0
- package/.claude/skills/cfn-redis-coordination/test-context-injection.sh +354 -0
- package/.claude/skills/cfn-redis-coordination/test-timeout-enforcement.sh +513 -0
- package/.claude/skills/cfn-redis-coordination/tests/convert-line-endings.sh +15 -0
- package/.claude/skills/cfn-redis-coordination/tests/dlq-functionality-test.sh +102 -0
- package/.claude/skills/cfn-redis-coordination/tests/edge-cases-test.sh +99 -0
- package/.claude/skills/cfn-redis-coordination/tests/integration-test.sh +170 -0
- package/.claude/skills/cfn-redis-coordination/tests/retry-mechanism-test.sh +82 -0
- package/.claude/skills/cfn-redis-coordination/tests/run-test-suite.sh +92 -0
- package/.claude/skills/cfn-redis-coordination/tests/run-tests.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-monitoring.sh +418 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-heartbeat-simple.sh +124 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-primitives.sh +166 -0
- package/.claude/skills/cfn-redis-coordination/tests/test-utils.sh +54 -0
- package/.claude/skills/cfn-redis-coordination/tests/test_coordination_primitives.sh.deprecated +20 -0
- package/.claude/skills/cfn-redis-coordination/tests/test_utils.sh +49 -0
- package/.claude/skills/cfn-redis-coordination/v2_modularization/core_orchestration.sh +76 -0
- package/.claude/skills/cfn-redis-coordination/validate-parameters.sh +492 -0
- package/.claude/skills/cfn-sqlite-memory/IMPLEMENTATION_REPORT.md +393 -0
- package/.claude/skills/cfn-sqlite-memory/QUICK_REFERENCE.md +204 -0
- package/.claude/skills/cfn-sqlite-memory/SKILL.md +415 -0
- package/.claude/skills/cfn-sqlite-memory/acl-queries.sql +452 -0
- package/.claude/skills/cfn-sqlite-memory/check-dependencies.sh +36 -0
- package/.claude/skills/cfn-sqlite-memory/config.json +45 -0
- package/.claude/skills/cfn-sqlite-memory/memory-cli.sh +88 -0
- package/.claude/skills/cfn-sqlite-memory/test-state-persistence.js +187 -0
- package/.claude/skills/cfn-sqlite-memory/ttl-cleanup.sh +274 -0
- package/.claude/skills/cfn-test-execution/SKILL.md +128 -0
- package/.claude/skills/cfn-test-execution/check-dependencies.sh +36 -0
- package/.claude/skills/cfn-test-execution/test-cache-reader.sh +134 -0
- package/.claude/skills/cfn-test-execution/test-concurrent-conflicts.sh +115 -0
- package/.claude/skills/cfn-test-execution/test-coordinator-pattern.sh +109 -0
- package/.claude/skills/cfn-transparency-middleware/Cargo.toml +18 -0
- package/.claude/skills/cfn-transparency-middleware/SECURITY.md +41 -0
- package/.claude/skills/cfn-transparency-middleware/SKILL.md +91 -0
- package/.claude/skills/cfn-transparency-middleware/TEST_RESULTS.md +174 -0
- package/.claude/skills/cfn-transparency-middleware/config.json +31 -0
- package/.claude/skills/cfn-transparency-middleware/examples/basic-usage.ts +39 -0
- package/.claude/skills/cfn-transparency-middleware/examples/batch-processing.ts +52 -0
- package/.claude/skills/cfn-transparency-middleware/examples/custom-filtering.ts +61 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-filter.sh +98 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-init.sh +224 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-level.sh +333 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-metrics.sh +345 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-observe.sh +140 -0
- package/.claude/skills/cfn-transparency-middleware/invoke-transparency-stop.sh +235 -0
- package/.claude/skills/cfn-transparency-middleware/memory_query.rs +85 -0
- package/.claude/skills/cfn-transparency-middleware/memory_repository.rs +140 -0
- package/.claude/skills/cfn-transparency-middleware/memory_schema.rs +64 -0
- package/.claude/skills/cfn-transparency-middleware/middleware-config.sh +29 -0
- package/.claude/skills/cfn-transparency-middleware/performance-benchmark.sh +79 -0
- package/.claude/skills/cfn-transparency-middleware/test-e2e.sh +406 -0
- package/.claude/skills/cfn-transparency-middleware/test-integration.sh +162 -0
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh +368 -0
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh.unix +126 -0
- package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +93 -0
- package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +132 -0
- package/.claude/skills/cfn-webapp-testing/SCREENSHOT_NAMING_CONVENTION.md +547 -0
- package/.claude/skills/cfn-webapp-testing/SKILL.md +877 -0
- package/.claude/skills/cfn-webapp-testing/capture-screenshot.sh +238 -0
- package/.claude/skills/cfn-webapp-testing/cfn-loop-integration.sh +265 -0
- package/.claude/skills/cfn-webapp-testing/compare-screenshots.sh +199 -0
- package/.claude/skills/cfn-webapp-testing/init-storage.sh +150 -0
- package/.claude/skills/cfn-webapp-testing/set-baseline.sh +196 -0
- package/.claude/skills/cfn-webapp-testing/test-webapp-testing.sh +233 -0
- package/README.md +51 -2
- package/dist/ace/ace-reflector.js +109 -10
- package/dist/ace/ace-reflector.js.map +1 -1
- package/dist/cli/agent-executor.js +1 -1
- package/dist/cli/agent-executor.js.map +1 -1
- package/package.json +43 -7
- package/readme/README.md +15 -4
- package/scripts/init-project.js +76 -6
- package/scripts/run-marketing-tests.sh +43 -0
- package/scripts/update_paths.sh +47 -0
- package/tools/install-lizard.sh +37 -0
- package/tools/simple-complexity.sh +44 -0
- package/.claude/agents/cfn-dev-team/developers/coder.md +0 -270
- package/.claude/agents/cfn-dev-team/developers/state-architect.md +0 -127
- package/.claude/agents/cfn-dev-team/reviewers/code-quality-validator.md +0 -128
- /package/.claude/agents/cfn-dev-team/developers/{ui-designer.md → frontend/ui-designer.md} +0 -0
- /package/.claude/agents/cfn-dev-team/{coordinators → product-owners}/product-owner-agent.md +0 -0
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
##############################################################################
|
|
3
|
+
# Product Owner Decision Execution Script
|
|
4
|
+
#
|
|
5
|
+
# Handles the complete Product Owner decision protocol:
|
|
6
|
+
# 1. Query Loop 2 consensus from Redis
|
|
7
|
+
# 2. Apply GOAP decision framework
|
|
8
|
+
# 3. Push decision to Redis
|
|
9
|
+
# 4. Signal completion
|
|
10
|
+
# 5. Report confidence
|
|
11
|
+
#
|
|
12
|
+
# Usage:
|
|
13
|
+
# ./execute-product-owner-decision.sh --task-id <task> --agent-id <agent>
|
|
14
|
+
##############################################################################
|
|
15
|
+
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
|
|
18
|
+
# Parse arguments
|
|
19
|
+
TASK_ID=""
|
|
20
|
+
AGENT_ID=""
|
|
21
|
+
|
|
22
|
+
while [[ $# -gt 0 ]]; do
|
|
23
|
+
case $1 in
|
|
24
|
+
--task-id)
|
|
25
|
+
TASK_ID="$2"
|
|
26
|
+
shift 2
|
|
27
|
+
;;
|
|
28
|
+
--agent-id)
|
|
29
|
+
AGENT_ID="$2"
|
|
30
|
+
shift 2
|
|
31
|
+
;;
|
|
32
|
+
*)
|
|
33
|
+
echo "Unknown option: $1"
|
|
34
|
+
echo "Usage: $0 --task-id <task> --agent-id <agent>"
|
|
35
|
+
exit 1
|
|
36
|
+
;;
|
|
37
|
+
esac
|
|
38
|
+
done
|
|
39
|
+
|
|
40
|
+
if [ -z "$TASK_ID" ] || [ -z "$AGENT_ID" ]; then
|
|
41
|
+
echo "Error: --task-id and --agent-id are required"
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo "[Product Owner] Starting decision execution for task: $TASK_ID"
|
|
46
|
+
echo ""
|
|
47
|
+
|
|
48
|
+
# Step 1: Query Loop 2 consensus and context
|
|
49
|
+
echo "[Step 1] Querying Loop 2 consensus and context from Redis..."
|
|
50
|
+
CONSENSUS=$(redis-cli lindex "swarm:${TASK_ID}:metrics:loop2_consensus" 0 | jq -r '.consensus')
|
|
51
|
+
ITERATION=$(redis-cli lindex "swarm:${TASK_ID}:metrics:loop2_consensus" 0 | jq -r '.iteration')
|
|
52
|
+
|
|
53
|
+
# Get feedback from validators
|
|
54
|
+
FEEDBACK_JSON=$(redis-cli lrange "swarm:${TASK_ID}:loop2:feedback" 0 -1 | jq -s '.')
|
|
55
|
+
|
|
56
|
+
# Get acceptance criteria and scope
|
|
57
|
+
ACCEPTANCE_CRITERIA=$(redis-cli get "swarm:${TASK_ID}:success-criteria" | jq -r '.acceptanceCriteria // []')
|
|
58
|
+
EPIC_CONTEXT=$(redis-cli get "swarm:${TASK_ID}:epic-context")
|
|
59
|
+
IN_SCOPE=$(echo "$EPIC_CONTEXT" | jq -r '.inScope // []')
|
|
60
|
+
OUT_OF_SCOPE=$(echo "$EPIC_CONTEXT" | jq -r '.outOfScope // []')
|
|
61
|
+
EPIC_GOAL=$(echo "$EPIC_CONTEXT" | jq -r '.epicGoal // ""')
|
|
62
|
+
|
|
63
|
+
echo " Loop 2 Consensus: $CONSENSUS"
|
|
64
|
+
echo " Iteration: $ITERATION"
|
|
65
|
+
echo " Validator Feedback Items: $(echo "$FEEDBACK_JSON" | jq 'length')"
|
|
66
|
+
echo ""
|
|
67
|
+
|
|
68
|
+
# Step 2: Apply scope categorization
|
|
69
|
+
echo "[Step 2] Categorizing validator feedback by scope..."
|
|
70
|
+
|
|
71
|
+
# Initialize arrays
|
|
72
|
+
IN_SCOPE_ITEMS="[]"
|
|
73
|
+
OUT_OF_SCOPE_ITEMS="[]"
|
|
74
|
+
IN_SCOPE_CONSENSUS=0
|
|
75
|
+
OUT_OF_SCOPE_CONSENSUS=0
|
|
76
|
+
|
|
77
|
+
# Process feedback if available
|
|
78
|
+
if [ "$FEEDBACK_JSON" != "null" ] && [ "$FEEDBACK_JSON" != "[]" ]; then
|
|
79
|
+
# Categorize each feedback item
|
|
80
|
+
for feedback_item in $(echo "$FEEDBACK_JSON" | jq -r '.[] | @base64'); do
|
|
81
|
+
_jq() {
|
|
82
|
+
echo "$feedback_item" | base64 --decode | jq -r "$1"
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
FEEDBACK_TEXT=$(_jq '.')
|
|
86
|
+
IS_IN_SCOPE="false"
|
|
87
|
+
|
|
88
|
+
# Check if feedback relates to acceptance criteria or inScope items
|
|
89
|
+
for criterion in $(echo "$ACCEPTANCE_CRITERIA" | jq -r '.[] | @base64'); do
|
|
90
|
+
CRITERION_TEXT=$(echo "$criterion" | base64 --decode)
|
|
91
|
+
if echo "$FEEDBACK_TEXT" | grep -iq "$(echo "$CRITERION_TEXT" | head -c 20)"; then
|
|
92
|
+
IS_IN_SCOPE="true"
|
|
93
|
+
break
|
|
94
|
+
fi
|
|
95
|
+
done
|
|
96
|
+
|
|
97
|
+
# Add to appropriate category
|
|
98
|
+
if [ "$IS_IN_SCOPE" = "true" ]; then
|
|
99
|
+
IN_SCOPE_ITEMS=$(echo "$IN_SCOPE_ITEMS" | jq --arg item "$FEEDBACK_TEXT" '. + [$item]')
|
|
100
|
+
else
|
|
101
|
+
OUT_OF_SCOPE_ITEMS=$(echo "$OUT_OF_SCOPE_ITEMS" | jq --arg item "$FEEDBACK_TEXT" '. + [$item]')
|
|
102
|
+
fi
|
|
103
|
+
done
|
|
104
|
+
|
|
105
|
+
# Calculate in-scope consensus (consensus weighted by in-scope ratio)
|
|
106
|
+
TOTAL_ITEMS=$(echo "$FEEDBACK_JSON" | jq 'length')
|
|
107
|
+
IN_SCOPE_COUNT=$(echo "$IN_SCOPE_ITEMS" | jq 'length')
|
|
108
|
+
|
|
109
|
+
if [ "$TOTAL_ITEMS" -gt 0 ]; then
|
|
110
|
+
# If there's feedback, weight consensus by in-scope ratio
|
|
111
|
+
IN_SCOPE_CONSENSUS=$(echo "scale=2; $CONSENSUS * $IN_SCOPE_COUNT / $TOTAL_ITEMS" | bc -l)
|
|
112
|
+
else
|
|
113
|
+
# No feedback means validators had no concerns - use full consensus
|
|
114
|
+
IN_SCOPE_CONSENSUS=$CONSENSUS
|
|
115
|
+
fi
|
|
116
|
+
else
|
|
117
|
+
# No feedback at all - use full consensus as in-scope
|
|
118
|
+
IN_SCOPE_CONSENSUS=$CONSENSUS
|
|
119
|
+
fi
|
|
120
|
+
|
|
121
|
+
echo " In-Scope Items: $(echo "$IN_SCOPE_ITEMS" | jq 'length')"
|
|
122
|
+
echo " Out-of-Scope Items: $(echo "$OUT_OF_SCOPE_ITEMS" | jq 'length')"
|
|
123
|
+
echo " In-Scope Consensus: $IN_SCOPE_CONSENSUS"
|
|
124
|
+
echo ""
|
|
125
|
+
|
|
126
|
+
# Step 3: Apply GOAP decision framework with scope enforcement
|
|
127
|
+
echo "[Step 3] Applying GOAP decision framework with scope enforcement..."
|
|
128
|
+
|
|
129
|
+
# Default threshold (standard mode)
|
|
130
|
+
CONSENSUS_THRESHOLD=0.90
|
|
131
|
+
MAX_ITERATIONS=10
|
|
132
|
+
|
|
133
|
+
# Determine decision based on scope-aware consensus
|
|
134
|
+
DECISION_TYPE=""
|
|
135
|
+
DECISION_REASONING=""
|
|
136
|
+
DECISION_CONFIDENCE=0
|
|
137
|
+
BACKLOG_ITEMS="[]"
|
|
138
|
+
|
|
139
|
+
if (( $(echo "$CONSENSUS >= $CONSENSUS_THRESHOLD" | bc -l) )); then
|
|
140
|
+
# High consensus - check if there are out-of-scope items
|
|
141
|
+
OUT_OF_SCOPE_COUNT=$(echo "$OUT_OF_SCOPE_ITEMS" | jq 'length')
|
|
142
|
+
|
|
143
|
+
if [ "$OUT_OF_SCOPE_COUNT" -gt 0 ]; then
|
|
144
|
+
DECISION_TYPE="DEFER_AND_PROCEED"
|
|
145
|
+
DECISION_REASONING="In-scope work complete (consensus $CONSENSUS >= $CONSENSUS_THRESHOLD). Deferring $OUT_OF_SCOPE_COUNT out-of-scope items to backlog."
|
|
146
|
+
DECISION_CONFIDENCE=0.92
|
|
147
|
+
BACKLOG_ITEMS="$OUT_OF_SCOPE_ITEMS"
|
|
148
|
+
echo " Decision: DEFER_AND_PROCEED (moving out-of-scope items to backlog)"
|
|
149
|
+
else
|
|
150
|
+
DECISION_TYPE="PROCEED"
|
|
151
|
+
DECISION_REASONING="All work complete, consensus threshold met ($CONSENSUS >= $CONSENSUS_THRESHOLD)"
|
|
152
|
+
DECISION_CONFIDENCE=0.95
|
|
153
|
+
echo " Decision: PROCEED (consensus exceeds threshold, no out-of-scope items)"
|
|
154
|
+
fi
|
|
155
|
+
elif [ "$ITERATION" -lt "$MAX_ITERATIONS" ]; then
|
|
156
|
+
# Below consensus - check if in-scope consensus would meet threshold
|
|
157
|
+
if (( $(echo "$IN_SCOPE_CONSENSUS >= $CONSENSUS_THRESHOLD" | bc -l) )); then
|
|
158
|
+
# In-scope work is good, out-of-scope items preventing consensus
|
|
159
|
+
DECISION_TYPE="DEFER_AND_PROCEED"
|
|
160
|
+
DECISION_REASONING="In-scope consensus met ($IN_SCOPE_CONSENSUS >= $CONSENSUS_THRESHOLD). Out-of-scope items preventing overall consensus - deferring to backlog."
|
|
161
|
+
DECISION_CONFIDENCE=0.88
|
|
162
|
+
BACKLOG_ITEMS="$OUT_OF_SCOPE_ITEMS"
|
|
163
|
+
echo " Decision: DEFER_AND_PROCEED (in-scope work complete, deferring out-of-scope blockers)"
|
|
164
|
+
else
|
|
165
|
+
# In-scope work needs improvement
|
|
166
|
+
DECISION_TYPE="ITERATE"
|
|
167
|
+
DECISION_REASONING="In-scope consensus below threshold ($IN_SCOPE_CONSENSUS < $CONSENSUS_THRESHOLD), targeted improvements needed"
|
|
168
|
+
DECISION_CONFIDENCE=0.90
|
|
169
|
+
BACKLOG_ITEMS="$OUT_OF_SCOPE_ITEMS"
|
|
170
|
+
echo " Decision: ITERATE (in-scope work needs improvement, iteration $ITERATION/$MAX_ITERATIONS)"
|
|
171
|
+
fi
|
|
172
|
+
else
|
|
173
|
+
DECISION_TYPE="ABORT"
|
|
174
|
+
DECISION_REASONING="Max iterations reached ($ITERATION >= $MAX_ITERATIONS) without meeting in-scope consensus threshold"
|
|
175
|
+
DECISION_CONFIDENCE=0.85
|
|
176
|
+
echo " Decision: ABORT (max iterations reached)"
|
|
177
|
+
fi
|
|
178
|
+
|
|
179
|
+
echo ""
|
|
180
|
+
|
|
181
|
+
# Build structured decision JSON with scope analysis
|
|
182
|
+
DECISION=$(jq -n \
|
|
183
|
+
--arg decision "$DECISION_TYPE" \
|
|
184
|
+
--arg reasoning "$DECISION_REASONING" \
|
|
185
|
+
--arg confidence "$DECISION_CONFIDENCE" \
|
|
186
|
+
--argjson in_scope_items "$IN_SCOPE_ITEMS" \
|
|
187
|
+
--argjson out_of_scope_items "$OUT_OF_SCOPE_ITEMS" \
|
|
188
|
+
--arg in_scope_consensus "$IN_SCOPE_CONSENSUS" \
|
|
189
|
+
--argjson backlog_items "$BACKLOG_ITEMS" \
|
|
190
|
+
'{
|
|
191
|
+
decision: $decision,
|
|
192
|
+
reasoning: $reasoning,
|
|
193
|
+
confidence: ($confidence | tonumber),
|
|
194
|
+
scope_analysis: {
|
|
195
|
+
in_scope_consensus: ($in_scope_consensus | tonumber),
|
|
196
|
+
in_scope_items: $in_scope_items,
|
|
197
|
+
out_of_scope_items: $out_of_scope_items
|
|
198
|
+
},
|
|
199
|
+
backlog_items: $backlog_items
|
|
200
|
+
}')
|
|
201
|
+
|
|
202
|
+
echo "[Step 4] Managing backlog items..."
|
|
203
|
+
if [ "$(echo "$BACKLOG_ITEMS" | jq 'length')" -gt 0 ]; then
|
|
204
|
+
# Store backlog items in Redis
|
|
205
|
+
BACKLOG_KEY="swarm:${TASK_ID}:backlog"
|
|
206
|
+
echo "$BACKLOG_ITEMS" | redis-cli -x LPUSH "$BACKLOG_KEY" >/dev/null
|
|
207
|
+
echo " ✓ Stored $(echo "$BACKLOG_ITEMS" | jq 'length') backlog items in Redis: $BACKLOG_KEY"
|
|
208
|
+
|
|
209
|
+
# Persist backlog to file for human review
|
|
210
|
+
BACKLOG_FILE=".claude/cfn-data/backlog/${TASK_ID}.json"
|
|
211
|
+
mkdir -p "$(dirname "$BACKLOG_FILE")"
|
|
212
|
+
|
|
213
|
+
BACKLOG_RECORD=$(jq -n \
|
|
214
|
+
--arg task_id "$TASK_ID" \
|
|
215
|
+
--arg timestamp "$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
|
|
216
|
+
--arg epic_goal "$EPIC_GOAL" \
|
|
217
|
+
--argjson items "$BACKLOG_ITEMS" \
|
|
218
|
+
'{
|
|
219
|
+
task_id: $task_id,
|
|
220
|
+
timestamp: $timestamp,
|
|
221
|
+
epic_goal: $epic_goal,
|
|
222
|
+
deferred_items: $items,
|
|
223
|
+
status: "pending_review"
|
|
224
|
+
}')
|
|
225
|
+
|
|
226
|
+
echo "$BACKLOG_RECORD" > "$BACKLOG_FILE"
|
|
227
|
+
echo " ✓ Backlog persisted to: $BACKLOG_FILE"
|
|
228
|
+
else
|
|
229
|
+
echo " No backlog items to store"
|
|
230
|
+
fi
|
|
231
|
+
echo ""
|
|
232
|
+
|
|
233
|
+
echo "[Step 5] Pushing decision to Redis..."
|
|
234
|
+
DECISION_KEY="swarm:${TASK_ID}:${AGENT_ID}:decision"
|
|
235
|
+
echo "$DECISION" | redis-cli -x LPUSH "$DECISION_KEY" >/dev/null
|
|
236
|
+
echo " ✓ Decision pushed to: $DECISION_KEY"
|
|
237
|
+
echo " Content: $DECISION"
|
|
238
|
+
echo ""
|
|
239
|
+
|
|
240
|
+
# Step 6: Signal completion
|
|
241
|
+
echo "[Step 6] Signaling completion..."
|
|
242
|
+
DONE_KEY="swarm:${TASK_ID}:${AGENT_ID}:done"
|
|
243
|
+
redis-cli LPUSH "$DONE_KEY" "complete" >/dev/null
|
|
244
|
+
echo " ✓ Completion signaled"
|
|
245
|
+
echo ""
|
|
246
|
+
|
|
247
|
+
# Step 7: Report confidence
|
|
248
|
+
echo "[Step 7] Reporting confidence..."
|
|
249
|
+
./.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh report \
|
|
250
|
+
--task-id "$TASK_ID" \
|
|
251
|
+
--agent-id "$AGENT_ID" \
|
|
252
|
+
--confidence "$DECISION_CONFIDENCE"
|
|
253
|
+
|
|
254
|
+
echo ""
|
|
255
|
+
echo "🎉 Product Owner decision execution complete!"
|
|
256
|
+
echo " Decision: $DECISION_TYPE"
|
|
257
|
+
echo " Consensus: $CONSENSUS"
|
|
258
|
+
echo " Iteration: $ITERATION"
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# get-agent-timeout.sh - Get agent timeout from swarm metadata with intelligent fallback
|
|
3
|
+
# Part of Redis Coordination Skill
|
|
4
|
+
# Usage: ./get-agent-timeout.sh --task-id <id> --agent-id <id>
|
|
5
|
+
#
|
|
6
|
+
# Returns agent-specific timeout from swarm metadata with fallback order:
|
|
7
|
+
# 1. agentTimeouts[agent-id] (exact match from swarm metadata)
|
|
8
|
+
# 2. roleTimeouts[agent-role] (role-based from swarm metadata)
|
|
9
|
+
# 3. agentTimeouts.default (fallback from swarm metadata)
|
|
10
|
+
# 4. Role-based hardcoded defaults (researcher=7200, backend-dev=3600, etc.)
|
|
11
|
+
# 5. 3600 (hardcoded default: 1 hour)
|
|
12
|
+
#
|
|
13
|
+
# Version: 1.1.0
|
|
14
|
+
# Last Updated: 2025-10-19
|
|
15
|
+
|
|
16
|
+
set -euo pipefail
|
|
17
|
+
|
|
18
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
+
REDIS_HOST="${REDIS_HOST:-localhost}"
|
|
20
|
+
REDIS_PORT="${REDIS_PORT:-6379}"
|
|
21
|
+
DEFAULT_TIMEOUT=3600 # 60 minutes default
|
|
22
|
+
|
|
23
|
+
# Parse arguments
|
|
24
|
+
TASK_ID=""
|
|
25
|
+
AGENT_ID=""
|
|
26
|
+
|
|
27
|
+
while [[ $# -gt 0 ]]; do
|
|
28
|
+
case $1 in
|
|
29
|
+
--task-id)
|
|
30
|
+
TASK_ID="$2"
|
|
31
|
+
shift 2
|
|
32
|
+
;;
|
|
33
|
+
--agent-id)
|
|
34
|
+
AGENT_ID="$2"
|
|
35
|
+
shift 2
|
|
36
|
+
;;
|
|
37
|
+
*)
|
|
38
|
+
echo "❌ Unknown argument: $1" >&2
|
|
39
|
+
echo "Usage: $0 --task-id <id> --agent-id <id>" >&2
|
|
40
|
+
exit 1
|
|
41
|
+
;;
|
|
42
|
+
esac
|
|
43
|
+
done
|
|
44
|
+
|
|
45
|
+
# Validate required arguments
|
|
46
|
+
if [[ -z "$TASK_ID" || -z "$AGENT_ID" ]]; then
|
|
47
|
+
echo "❌ Missing required arguments" >&2
|
|
48
|
+
echo "Usage: $0 --task-id <id> --agent-id <id>" >&2
|
|
49
|
+
exit 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
# Function to extract role from agent-id
|
|
53
|
+
extract_role_from_agent_id() {
|
|
54
|
+
local agent_id="$1"
|
|
55
|
+
|
|
56
|
+
# Extract role prefix (everything before last hyphen and number)
|
|
57
|
+
# Examples:
|
|
58
|
+
# "researcher-1" -> "researcher"
|
|
59
|
+
# "backend-dev-6" -> "backend-dev"
|
|
60
|
+
# "reviewer" -> "reviewer"
|
|
61
|
+
if [[ "$agent_id" =~ ^(.+)-[0-9]+$ ]]; then
|
|
62
|
+
echo "${BASH_REMATCH[1]}"
|
|
63
|
+
else
|
|
64
|
+
echo "$agent_id"
|
|
65
|
+
fi
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
# Function to get role-based hardcoded timeout defaults (fallback layer 4)
|
|
69
|
+
get_hardcoded_role_timeout() {
|
|
70
|
+
local role="$1"
|
|
71
|
+
|
|
72
|
+
case "$role" in
|
|
73
|
+
researcher)
|
|
74
|
+
echo "7200" # 2 hours - research takes longer
|
|
75
|
+
;;
|
|
76
|
+
backend-dev|coder|frontend-dev)
|
|
77
|
+
echo "3600" # 1 hour - development work
|
|
78
|
+
;;
|
|
79
|
+
reviewer|tester|security)
|
|
80
|
+
echo "1800" # 30 minutes - validation/review
|
|
81
|
+
;;
|
|
82
|
+
coordinator|orchestrator|product-owner)
|
|
83
|
+
echo "900" # 15 minutes - coordination tasks
|
|
84
|
+
;;
|
|
85
|
+
devops|architect)
|
|
86
|
+
echo "5400" # 90 minutes - infrastructure/architecture
|
|
87
|
+
;;
|
|
88
|
+
*)
|
|
89
|
+
echo "3600" # 1 hour - default fallback
|
|
90
|
+
;;
|
|
91
|
+
esac
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
# Function to extract timeout from JSON using jq or fallback parsing
|
|
95
|
+
extract_timeout_from_json() {
|
|
96
|
+
local json="$1"
|
|
97
|
+
local key="$2"
|
|
98
|
+
|
|
99
|
+
if [[ -z "$json" || "$json" == "(nil)" ]]; then
|
|
100
|
+
echo ""
|
|
101
|
+
return
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
# Use jq if available
|
|
105
|
+
if command -v jq &>/dev/null; then
|
|
106
|
+
local result
|
|
107
|
+
result=$(echo "$json" | jq -r --arg k "$key" '.[$k] // empty' 2>/dev/null || echo "")
|
|
108
|
+
echo "$result"
|
|
109
|
+
else
|
|
110
|
+
# Fallback: simple pattern matching for "key": value
|
|
111
|
+
echo "$json" | grep -oP "\"$key\"\s*:\s*\K\d+" 2>/dev/null || echo ""
|
|
112
|
+
fi
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
# Get swarm ID from task mapping
|
|
116
|
+
SWARM_ID=$(redis-cli -h "$REDIS_HOST" -p "$REDIS_PORT" \
|
|
117
|
+
GET "task:${TASK_ID}:swarm" 2>/dev/null || echo "")
|
|
118
|
+
|
|
119
|
+
if [[ -z "$SWARM_ID" || "$SWARM_ID" == "(nil)" ]]; then
|
|
120
|
+
# Fallback: assume task-id is swarm-id for backwards compatibility
|
|
121
|
+
SWARM_ID="$TASK_ID"
|
|
122
|
+
fi
|
|
123
|
+
|
|
124
|
+
# Read swarm metadata from Redis
|
|
125
|
+
METADATA=$(redis-cli -h "$REDIS_HOST" -p "$REDIS_PORT" \
|
|
126
|
+
HGETALL "swarm:${SWARM_ID}:metadata" 2>/dev/null || echo "")
|
|
127
|
+
|
|
128
|
+
# Extract role from agent ID
|
|
129
|
+
ROLE=$(extract_role_from_agent_id "$AGENT_ID")
|
|
130
|
+
|
|
131
|
+
# Parse metadata and extract timeout configurations
|
|
132
|
+
TIMEOUT=""
|
|
133
|
+
|
|
134
|
+
if [[ -n "$METADATA" && "$METADATA" != "(nil)" ]]; then
|
|
135
|
+
# Parse metadata into associative array
|
|
136
|
+
declare -A META
|
|
137
|
+
while IFS= read -r key && IFS= read -r value; do
|
|
138
|
+
META["$key"]="$value"
|
|
139
|
+
done <<< "$METADATA"
|
|
140
|
+
|
|
141
|
+
AGENT_TIMEOUTS_JSON="${META[agentTimeouts]:-}"
|
|
142
|
+
ROLE_TIMEOUTS_JSON="${META[roleTimeouts]:-}"
|
|
143
|
+
|
|
144
|
+
# Fallback order 1: agentTimeouts[agent-id] (exact match)
|
|
145
|
+
if [[ -n "$AGENT_TIMEOUTS_JSON" ]]; then
|
|
146
|
+
TIMEOUT=$(extract_timeout_from_json "$AGENT_TIMEOUTS_JSON" "$AGENT_ID")
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
# Fallback order 2: roleTimeouts[agent-role] (role-based)
|
|
150
|
+
if [[ -z "$TIMEOUT" && -n "$ROLE_TIMEOUTS_JSON" ]]; then
|
|
151
|
+
TIMEOUT=$(extract_timeout_from_json "$ROLE_TIMEOUTS_JSON" "$ROLE")
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
# Fallback order 3: agentTimeouts.default
|
|
155
|
+
if [[ -z "$TIMEOUT" && -n "$AGENT_TIMEOUTS_JSON" ]]; then
|
|
156
|
+
TIMEOUT=$(extract_timeout_from_json "$AGENT_TIMEOUTS_JSON" "default")
|
|
157
|
+
fi
|
|
158
|
+
fi
|
|
159
|
+
|
|
160
|
+
# Fallback order 4: Role-based hardcoded defaults
|
|
161
|
+
if [[ -z "$TIMEOUT" ]]; then
|
|
162
|
+
TIMEOUT=$(get_hardcoded_role_timeout "$ROLE")
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
# Fallback order 5: Hardcoded default (3600s)
|
|
166
|
+
if [[ -z "$TIMEOUT" ]]; then
|
|
167
|
+
TIMEOUT="$DEFAULT_TIMEOUT"
|
|
168
|
+
fi
|
|
169
|
+
|
|
170
|
+
# Validate timeout is numeric
|
|
171
|
+
if ! [[ "$TIMEOUT" =~ ^[0-9]+$ ]]; then
|
|
172
|
+
echo "⚠️ Invalid timeout value: $TIMEOUT, using default: ${DEFAULT_TIMEOUT}s" >&2
|
|
173
|
+
TIMEOUT="$DEFAULT_TIMEOUT"
|
|
174
|
+
fi
|
|
175
|
+
|
|
176
|
+
# Return timeout value
|
|
177
|
+
echo "$TIMEOUT"
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
##############################################################################
|
|
4
|
+
# Heartbeat Monitoring Functions Library
|
|
5
|
+
# Extracted from orchestrate-cfn-loop.sh for standalone testing
|
|
6
|
+
##############################################################################
|
|
7
|
+
|
|
8
|
+
##############################################################################
|
|
9
|
+
# Heartbeat Monitoring Functions
|
|
10
|
+
##############################################################################
|
|
11
|
+
declare -A MISSED_HEARTBEATS # Track missed heartbeats per agent
|
|
12
|
+
|
|
13
|
+
function check_agent_heartbeat() {
|
|
14
|
+
local agent="$1"
|
|
15
|
+
local task_id="$2"
|
|
16
|
+
|
|
17
|
+
HB_KEY="swarm:${task_id}:${agent}:heartbeat"
|
|
18
|
+
HB_DATA=$(redis-cli GET "$HB_KEY" 2>/dev/null || echo "")
|
|
19
|
+
|
|
20
|
+
if [ -z "$HB_DATA" ] || [ "$HB_DATA" = "(nil)" ]; then
|
|
21
|
+
return 1 # Dead
|
|
22
|
+
else
|
|
23
|
+
return 0 # Alive
|
|
24
|
+
fi
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function calculate_quorum() {
|
|
28
|
+
local quorum_spec="$1"
|
|
29
|
+
local total_agents="$2"
|
|
30
|
+
|
|
31
|
+
# If no quorum specified, require all agents
|
|
32
|
+
if [ -z "$quorum_spec" ]; then
|
|
33
|
+
echo "$total_agents"
|
|
34
|
+
return 0
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Check if percentage format (e.g., "85%")
|
|
38
|
+
if [[ "$quorum_spec" =~ %$ ]]; then
|
|
39
|
+
# Extract percentage value (remove % suffix)
|
|
40
|
+
local pct="${quorum_spec%\%}"
|
|
41
|
+
# Calculate: ceil(total_agents * pct / 100)
|
|
42
|
+
echo "scale=0; ($total_agents * $pct + 50) / 100" | bc
|
|
43
|
+
# Check if decimal (0.0-1.0), treat as fraction
|
|
44
|
+
elif [[ "$quorum_spec" =~ ^0?\.[0-9]+$ ]]; then
|
|
45
|
+
# Calculate: ceil(total_agents * fraction)
|
|
46
|
+
echo "scale=0; ($quorum_spec * $total_agents + 0.5) / 1" | bc
|
|
47
|
+
else
|
|
48
|
+
# Absolute number - validate it doesn't exceed total
|
|
49
|
+
if [ "$quorum_spec" -gt "$total_agents" ]; then
|
|
50
|
+
echo "Error: Quorum ($quorum_spec) exceeds total agents ($total_agents)" >&2
|
|
51
|
+
return 1
|
|
52
|
+
fi
|
|
53
|
+
echo "$quorum_spec"
|
|
54
|
+
fi
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function check_heartbeats_loop() {
|
|
58
|
+
local task_id="$1"
|
|
59
|
+
local loop_name="$2"
|
|
60
|
+
shift 2
|
|
61
|
+
local agents=("$@")
|
|
62
|
+
|
|
63
|
+
for AGENT in "${agents[@]}"; do
|
|
64
|
+
# Skip agents already marked as failed
|
|
65
|
+
if [[ " ${LOOP3_FAILED_AGENTS[@]} ${LOOP2_FAILED_AGENTS[@]} " =~ " ${AGENT} " ]]; then
|
|
66
|
+
continue
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
if ! check_agent_heartbeat "$AGENT" "$task_id"; then
|
|
70
|
+
MISSED_HEARTBEATS["$AGENT"]=$((${MISSED_HEARTBEATS["$AGENT"]:-0} + 1))
|
|
71
|
+
|
|
72
|
+
if [ ${MISSED_HEARTBEATS["$AGENT"]} -ge 2 ]; then
|
|
73
|
+
local timestamp=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
|
74
|
+
echo " [$timestamp] [$loop_name] ⚠️ $AGENT appears hung (no heartbeat for 60s)" >&2
|
|
75
|
+
|
|
76
|
+
# Determine which loop this agent belongs to and check quorum
|
|
77
|
+
if [[ " ${LOOP3_AGENTS} " =~ " ${AGENT} " ]]; then
|
|
78
|
+
REMAINING=$((${#LOOP3_COMPLETED_AGENTS[@]}))
|
|
79
|
+
REQUIRED=$(calculate_quorum "$MIN_QUORUM_LOOP3" "$LOOP3_TOTAL")
|
|
80
|
+
elif [[ " ${LOOP2_AGENTS} " =~ " ${LOOP2_AGENTS} " ]]; then
|
|
81
|
+
REMAINING=$((${#LOOP2_COMPLETED_AGENTS[@]}))
|
|
82
|
+
REQUIRED=$(calculate_quorum "$MIN_QUORUM_LOOP2" "$LOOP2_TOTAL")
|
|
83
|
+
else
|
|
84
|
+
continue
|
|
85
|
+
fi
|
|
86
|
+
|
|
87
|
+
if [ $REMAINING -ge $REQUIRED ]; then
|
|
88
|
+
echo " [$timestamp] [$loop_name] ℹ️ Continuing with quorum (${REMAINING}/${REQUIRED} agents)" >&2
|
|
89
|
+
else
|
|
90
|
+
echo " [$timestamp] [$loop_name] ⚠️ Cannot meet quorum without $AGENT (${REMAINING}/${REQUIRED})" >&2
|
|
91
|
+
fi
|
|
92
|
+
fi
|
|
93
|
+
else
|
|
94
|
+
MISSED_HEARTBEATS["$AGENT"]=0 # Reset counter
|
|
95
|
+
fi
|
|
96
|
+
done
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function start_heartbeat_monitor() {
|
|
100
|
+
local task_id="$1"
|
|
101
|
+
local loop_name="$2"
|
|
102
|
+
shift 2
|
|
103
|
+
local agents=("$@")
|
|
104
|
+
|
|
105
|
+
# Create marker file for this monitor
|
|
106
|
+
local monitor_marker="/tmp/heartbeat-monitor-${task_id}-${loop_name}.active"
|
|
107
|
+
touch "$monitor_marker"
|
|
108
|
+
|
|
109
|
+
(
|
|
110
|
+
while [ -f "$monitor_marker" ]; do
|
|
111
|
+
# Check for shutdown
|
|
112
|
+
if [ "${SHUTDOWN_REQUESTED:-0}" -eq 1 ]; then
|
|
113
|
+
break
|
|
114
|
+
fi
|
|
115
|
+
|
|
116
|
+
check_heartbeats_loop "$task_id" "$loop_name" "${agents[@]}"
|
|
117
|
+
sleep 30
|
|
118
|
+
done
|
|
119
|
+
) &
|
|
120
|
+
|
|
121
|
+
echo "$!" # Return PID
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function stop_heartbeat_monitor() {
|
|
125
|
+
local task_id="$1"
|
|
126
|
+
local loop_name="$2"
|
|
127
|
+
local monitor_pid="$3"
|
|
128
|
+
|
|
129
|
+
# Remove marker file to stop the monitor loop
|
|
130
|
+
rm -f "/tmp/heartbeat-monitor-${task_id}-${loop_name}.active"
|
|
131
|
+
|
|
132
|
+
# Kill monitor process if still running
|
|
133
|
+
if [ -n "$monitor_pid" ] && kill -0 "$monitor_pid" 2>/dev/null; then
|
|
134
|
+
kill "$monitor_pid" 2>/dev/null || true
|
|
135
|
+
wait "$monitor_pid" 2>/dev/null || true
|
|
136
|
+
fi
|
|
137
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Heartbeat Protocol Specification
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
The heartbeat protocol provides a mechanism for detecting hung or unresponsive agents in distributed agent swarms using Redis as a coordination mechanism.
|
|
5
|
+
|
|
6
|
+
## Key Design Components
|
|
7
|
+
|
|
8
|
+
### 1. Heartbeat Key Pattern
|
|
9
|
+
```
|
|
10
|
+
swarm:{task_id}:{agent_id}:heartbeat
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### 2. Heartbeat Message Structure
|
|
14
|
+
```json
|
|
15
|
+
{
|
|
16
|
+
"timestamp": 1760898665,
|
|
17
|
+
"status": "working|idle|error",
|
|
18
|
+
"iteration": 2,
|
|
19
|
+
"progress": 0.75,
|
|
20
|
+
"agent_details": {
|
|
21
|
+
"agent_id": "architect-5",
|
|
22
|
+
"task_id": "redis-phase5-1760898665",
|
|
23
|
+
"environment": {
|
|
24
|
+
"cpu_usage": 0.65,
|
|
25
|
+
"memory_usage": 0.42,
|
|
26
|
+
"system_load": 0.3
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 3. Heartbeat Configuration
|
|
33
|
+
- **Update Frequency**: Every 30 seconds
|
|
34
|
+
- **Default TTL**: 60 seconds
|
|
35
|
+
- **Miss Threshold**: 2 consecutive missed heartbeats
|
|
36
|
+
- **Quorum Threshold**: 70% of agents must be responsive
|
|
37
|
+
|
|
38
|
+
### 4. Heartbeat Workflow
|
|
39
|
+
1. Agent periodically sends heartbeat via Redis SET
|
|
40
|
+
2. Orchestrator monitors heartbeats in background process
|
|
41
|
+
3. On missed heartbeats, trigger progressive recovery mechanisms
|
|
42
|
+
|
|
43
|
+
### 5. Recovery Stages
|
|
44
|
+
- **Stage 1 (Miss 1)**: Log warning, continue monitoring
|
|
45
|
+
- **Stage 2 (Miss 2)**:
|
|
46
|
+
- Check if remaining agents meet quorum
|
|
47
|
+
- Log to Dead Letter Queue (DLQ)
|
|
48
|
+
- Attempt soft restart of agent
|
|
49
|
+
- **Stage 3 (Miss 3)**:
|
|
50
|
+
- Hard restart agent
|
|
51
|
+
- Potentially replace with standby agent
|
|
52
|
+
|
|
53
|
+
### 6. Implementation Pseudo-code
|
|
54
|
+
```bash
|
|
55
|
+
# Send Heartbeat
|
|
56
|
+
redis-cli set "swarm:${TASK_ID}:${AGENT_ID}:heartbeat" \
|
|
57
|
+
"$(generate_heartbeat_payload)" \
|
|
58
|
+
EX 60 # 60-second expiry
|
|
59
|
+
|
|
60
|
+
# Check Heartbeats
|
|
61
|
+
check_agent_heartbeats() {
|
|
62
|
+
for agent in ${AGENTS[@]}; do
|
|
63
|
+
heartbeat=$(redis-cli get "swarm:${TASK_ID}:${agent}:heartbeat")
|
|
64
|
+
if [[ -z "$heartbeat" ]]; then
|
|
65
|
+
handle_missed_heartbeat "$agent"
|
|
66
|
+
fi
|
|
67
|
+
done
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
handle_missed_heartbeat() {
|
|
71
|
+
local agent="$1"
|
|
72
|
+
local miss_count=$(get_miss_count "$agent")
|
|
73
|
+
|
|
74
|
+
case "$miss_count" in
|
|
75
|
+
1) log_warning "$agent missed first heartbeat" ;;
|
|
76
|
+
2)
|
|
77
|
+
log_dlq "$agent"
|
|
78
|
+
attempt_soft_restart "$agent"
|
|
79
|
+
check_quorum
|
|
80
|
+
;;
|
|
81
|
+
3)
|
|
82
|
+
hard_restart_agent "$agent"
|
|
83
|
+
;;
|
|
84
|
+
esac
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 7. Monitoring and Logging
|
|
89
|
+
- Comprehensive logging to `/var/log/claude-flow/heartbeat.log`
|
|
90
|
+
- Prometheus metrics for heartbeat health
|
|
91
|
+
- Grafana dashboard tracking agent responsiveness
|
|
92
|
+
|
|
93
|
+
### 8. Security Considerations
|
|
94
|
+
- Cryptographically sign heartbeat messages
|
|
95
|
+
- Rate limit heartbeat submissions
|
|
96
|
+
- Validate heartbeat payload schema
|
|
97
|
+
|
|
98
|
+
## Integration Points
|
|
99
|
+
- Redis Coordination Skill
|
|
100
|
+
- CFN Loop Validation
|
|
101
|
+
- Agent Spawning Mechanism
|
|
102
|
+
|
|
103
|
+
## Test Coverage
|
|
104
|
+
- Unit tests for heartbeat generation
|
|
105
|
+
- Integration tests for recovery mechanisms
|
|
106
|
+
- Chaos testing (intentional agent hanging)
|