claude-flow-novice 2.15.3 → 2.15.4
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/cfn-extras/skills/advanced-features/cfn-agent-swap/recommend-swap.sh +59 -59
- package/.claude/cfn-extras/skills/analytics/cfn-improvement-recommender/recommend-improvements.sh +91 -91
- package/.claude/cfn-extras/skills/analytics/cfn-pattern-extraction/extract-patterns.sh +79 -79
- package/.claude/cfn-extras/skills/analytics/cfn-retrospective-report/generate-report.sh +100 -100
- package/.claude/cfn-extras/skills/analytics/cfn-telemetry/start-telemetry.sh +110 -110
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/add-bullet.sh +145 -145
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/log-merge.sh +67 -67
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/monitor-injection-performance.sh +137 -137
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/optimize-injection-pipeline.sh +168 -168
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/query-reflections.sh +35 -35
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/store-reflection.sh +45 -45
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/track-ab-test.sh +41 -41
- package/.claude/cfn-extras/skills/deprecated/cfn-ace-system/update-reflection.sh +41 -41
- package/.claude/cfn-extras/skills/deprecated/cfn-cli-setup/validate-cli-environment.sh +191 -191
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/create-campaign.sh +231 -231
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/get-campaign-performance.sh +190 -190
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/pause-campaign.sh +142 -142
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/set-budget.sh +181 -181
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/update-bid-strategy.sh +133 -133
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/get-conversation-history.sh +121 -121
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/qualify-lead.sh +156 -156
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/schedule-demo.sh +181 -181
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/send-message.sh +137 -137
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/transfer-to-human.sh +179 -179
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/create-campaign.sh +183 -183
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/get-delivery-status.sh +139 -139
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/opt-out.sh +150 -150
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/schedule-campaign.sh +187 -187
- package/.claude/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/send-sms.sh +181 -181
- package/.claude/cfn-extras/skills/ui-portal/cfn-web-portal/test-web-portal-skill.sh +50 -50
- package/.claude/cfn-extras/skills/ui-portal/cfn-web-portal/validate-deployment.sh +84 -84
- package/.claude/cfn-extras/skills/utility/cfn-environment-sanitization/sanitize-environment.sh +243 -243
- package/.claude/commands/cfn-loop-cli.md +16 -2
- package/.claude/commands/switch-api.md +31 -10
- package/.claude/hooks/cfn-lint-sql-injection.sh +61 -0
- package/.claude/hooks/cfn-post-edit-cfn-retrospective.sh +33 -2
- package/.claude/hooks/cfn-pre-edit-security-warning.sh +40 -0
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh +22 -24
- package/.claude/skills/cfn-docker-agent-spawning/SKILL.md +28 -4
- package/.claude/skills/cfn-docker-agent-spawning/spawn-agent.sh +3 -1
- package/.claude/skills/cfn-docker-loop-orchestration/orchestrate.sh +224 -20
- package/.claude/skills/cfn-loop-orchestration/helpers/gate-check.sh +550 -46
- package/.claude/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +277 -0
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh +184 -23
- package/.claude/skills/cfn-loop-orchestration/security_utils.sh +24 -0
- package/.claude/skills/cfn-loop-orchestration/test-iteration-context-injection.sh +366 -0
- package/.claude/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +319 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/agent-log.sh.bak +124 -0
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +2 -2
- package/.claude/skills/cfn-redis-coordination/collect-confidence-scores.sh +30 -0
- package/.claude/skills/cfn-redis-coordination/get-context.sh +33 -0
- package/.claude/skills/cfn-redis-coordination/get-success-criteria.sh +54 -0
- package/.claude/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -0
- package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/.claude/skills/cfn-redis-coordination/redis-functions.sh +33 -0
- package/.claude/skills/cfn-redis-coordination/report-completion.sh +24 -31
- package/.claude/skills/cfn-redis-coordination/store-context.sh +4 -0
- package/.claude/skills/cfn-redis-coordination/store-success-criteria.sh +85 -0
- package/.claude/skills/cfn-redis-coordination/update-all-scripts.sh +67 -0
- package/.claude/skills/cfn-sqlite-memory/ttl-cleanup.sh +17 -25
- package/.claude/skills/cfn-transparency-middleware/test-e2e.sh +15 -0
- package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +15 -0
- package/README.md +116 -475
- package/claude-assets/agents/cfn-dev-team/README.md +103 -0
- package/claude-assets/agents/cfn-dev-team/architecture/goal-planner.md +1 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-frontend-coordinator.md +77 -15
- package/claude-assets/agents/cfn-dev-team/coordinators/cfn-v3-coordinator.md +355 -6
- package/claude-assets/agents/cfn-dev-team/coordinators/consensus-builder.md +82 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +82 -1
- package/claude-assets/agents/cfn-dev-team/coordinators/multi-sprint-coordinator.md +77 -15
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +99 -12
- package/claude-assets/agents/cfn-dev-team/dev-ops/github-commit-agent.md +1 -1
- package/claude-assets/agents/cfn-dev-team/dev-ops/kubernetes-specialist.md +97 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/monitoring-specialist.md +20 -1
- package/claude-assets/agents/cfn-dev-team/developers/api-gateway-specialist.md +97 -0
- package/claude-assets/agents/cfn-dev-team/developers/backend-developer.md +110 -13
- package/claude-assets/agents/cfn-dev-team/developers/data/data-engineer.md +106 -15
- package/claude-assets/agents/cfn-dev-team/developers/database/database-architect.md +115 -11
- package/claude-assets/agents/cfn-dev-team/developers/frontend/mobile-dev.md +94 -7
- package/claude-assets/agents/cfn-dev-team/developers/frontend/react-frontend-engineer.md +87 -9
- package/claude-assets/agents/cfn-dev-team/developers/frontend/typescript-specialist.md +85 -7
- package/claude-assets/agents/cfn-dev-team/developers/frontend/ui-designer.md +160 -28
- package/claude-assets/agents/cfn-dev-team/developers/graphql-specialist.md +101 -19
- package/claude-assets/agents/cfn-dev-team/developers/rust-developer.md +108 -14
- package/claude-assets/agents/cfn-dev-team/reviewers/{reviewer.md → code-reviewer.md} +95 -8
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/code-quality-validator.md +107 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/perf-analyzer.md +98 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/performance-benchmarker.md +95 -7
- package/claude-assets/agents/cfn-dev-team/reviewers/quality/security-specialist.md +136 -9
- package/claude-assets/agents/cfn-dev-team/testers/api-testing-specialist.md +108 -1
- package/claude-assets/agents/cfn-dev-team/testers/chaos-engineering-specialist.md +107 -13
- package/claude-assets/agents/cfn-dev-team/testers/contract-tester.md +737 -0
- package/claude-assets/agents/cfn-dev-team/testers/e2e/playwright-tester.md +1 -1
- package/claude-assets/agents/cfn-dev-team/testers/integration-tester.md +828 -0
- package/claude-assets/agents/cfn-dev-team/testers/interaction-tester.md +106 -7
- package/claude-assets/agents/cfn-dev-team/testers/load-testing-specialist.md +77 -0
- package/claude-assets/agents/cfn-dev-team/testers/mutation-testing-specialist.md +684 -0
- package/claude-assets/agents/cfn-dev-team/testers/playwright-tester.md +110 -1
- package/claude-assets/agents/cfn-dev-team/testers/tester.md +94 -7
- package/claude-assets/agents/cfn-dev-team/utility/code-booster.md +1 -3
- package/claude-assets/agents/cfn-dev-team/utility/epic-creator.md +87 -13
- package/claude-assets/agents/cfn-dev-team/utility/memory-leak-specialist.md +103 -7
- package/claude-assets/agents/cfn-dev-team/utility/researcher.md +1 -3
- package/claude-assets/agents/cfn-dev-team/utility/z-ai-specialist.md +94 -7
- package/claude-assets/agents/docker-coordinators/cfn-docker-v3-coordinator.md +46 -0
- package/claude-assets/agents/project-only-agents/npm-package-specialist.md +1 -1
- package/claude-assets/cfn-extras/skills/advanced-features/cfn-agent-swap/recommend-swap.sh +59 -59
- package/claude-assets/cfn-extras/skills/analytics/cfn-improvement-recommender/recommend-improvements.sh +91 -91
- package/claude-assets/cfn-extras/skills/analytics/cfn-pattern-extraction/extract-patterns.sh +79 -79
- package/claude-assets/cfn-extras/skills/analytics/cfn-retrospective-report/generate-report.sh +100 -100
- package/claude-assets/cfn-extras/skills/analytics/cfn-telemetry/start-telemetry.sh +110 -110
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/add-bullet.sh +145 -145
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/log-merge.sh +67 -67
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/monitor-injection-performance.sh +137 -137
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/optimize-injection-pipeline.sh +168 -168
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/query-reflections.sh +35 -35
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/store-reflection.sh +45 -45
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/track-ab-test.sh +41 -41
- package/claude-assets/cfn-extras/skills/deprecated/cfn-ace-system/update-reflection.sh +41 -41
- package/claude-assets/cfn-extras/skills/deprecated/cfn-cli-setup/validate-cli-environment.sh +191 -191
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/create-campaign.sh +231 -231
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/get-campaign-performance.sh +190 -190
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/pause-campaign.sh +142 -142
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/set-budget.sh +181 -181
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-ad-campaigns/operations/update-bid-strategy.sh +133 -133
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/get-conversation-history.sh +121 -121
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/qualify-lead.sh +156 -156
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/schedule-demo.sh +181 -181
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/send-message.sh +137 -137
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-chatbot-conversations/operations/transfer-to-human.sh +179 -179
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/create-campaign.sh +183 -183
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/get-delivery-status.sh +139 -139
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/opt-out.sh +150 -150
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/schedule-campaign.sh +187 -187
- package/claude-assets/cfn-extras/skills/marketing/cfn-marketing-sms-campaigns/operations/send-sms.sh +181 -181
- package/claude-assets/cfn-extras/skills/ui-portal/cfn-web-portal/test-web-portal-skill.sh +50 -50
- package/claude-assets/cfn-extras/skills/ui-portal/cfn-web-portal/validate-deployment.sh +84 -84
- package/claude-assets/cfn-extras/skills/utility/cfn-environment-sanitization/sanitize-environment.sh +243 -243
- package/claude-assets/commands/cfn-loop-cli.md +16 -2
- package/claude-assets/commands/switch-api.md +31 -10
- package/claude-assets/hooks/cfn-lint-sql-injection.sh +61 -0
- package/claude-assets/hooks/cfn-post-edit-cfn-retrospective.sh +33 -2
- package/claude-assets/hooks/cfn-pre-edit-security-warning.sh +40 -0
- package/claude-assets/hooks/detect-hardcoded-credentials.sh +212 -0
- package/claude-assets/skills/SKILL_TEMPLATE.md +774 -0
- package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +84 -113
- package/claude-assets/skills/agent-lifecycle/simple-audit.sh +33 -6
- package/claude-assets/skills/agent-template-generator/SKILL.md +440 -0
- package/claude-assets/skills/agent-template-generator/generate-agent.sh +405 -0
- package/claude-assets/skills/agent-validation-linter/SKILL.md +589 -0
- package/claude-assets/skills/agent-validation-linter/lint-agents.sh +271 -0
- package/claude-assets/skills/bootstrap/bash-fundamentals.md +786 -0
- package/claude-assets/skills/bootstrap/database-connection.md +464 -0
- package/claude-assets/skills/bootstrap/error-handling.md +580 -0
- package/claude-assets/skills/bootstrap/file-operations.md +699 -0
- package/claude-assets/skills/bootstrap/skill-loader.md +616 -0
- package/claude-assets/skills/bootstrap/sqlite-params.sh +287 -0
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh +22 -24
- package/claude-assets/skills/cfn-automatic-memory-persistence/test-memory-persistence.sh +17 -16
- package/claude-assets/skills/cfn-deployment/SKILL.md +293 -0
- package/claude-assets/skills/cfn-deployment/execute.sh +21 -0
- package/claude-assets/skills/cfn-docker-agent-spawning/SKILL.md +28 -4
- package/claude-assets/skills/cfn-docker-agent-spawning/spawn-agent.sh +3 -1
- package/claude-assets/skills/cfn-docker-loop-orchestration/orchestrate.sh +224 -20
- package/claude-assets/skills/cfn-environment-sanitization/sanitize-environment.sh +38 -0
- package/claude-assets/skills/cfn-error-batching-strategy/lib/core-functions.sh +47 -47
- package/claude-assets/skills/cfn-file-operations/SKILL.md +290 -0
- package/claude-assets/skills/cfn-file-operations/execute.sh +129 -0
- package/claude-assets/skills/cfn-file-operations/lib/atomic-write.sh +294 -0
- package/claude-assets/skills/cfn-file-operations/lib/lock.sh +361 -0
- package/claude-assets/skills/cfn-file-operations/test.sh +369 -0
- package/claude-assets/skills/cfn-log-operations/SKILL.md +308 -0
- package/claude-assets/skills/cfn-log-operations/execute.sh +420 -0
- package/claude-assets/skills/cfn-log-operations/lib/rotate.sh +406 -0
- package/claude-assets/skills/cfn-log-operations/lib/search.sh +448 -0
- package/claude-assets/skills/cfn-log-operations/test.sh +394 -0
- package/claude-assets/skills/cfn-loop-orchestration/helpers/gate-check.sh +550 -46
- package/claude-assets/skills/cfn-loop-orchestration/helpers/parse-test-results.sh +277 -0
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh +184 -23
- package/claude-assets/skills/cfn-loop-orchestration/security_utils.sh +24 -0
- package/claude-assets/skills/cfn-loop-orchestration/test-iteration-context-injection.sh +366 -0
- package/claude-assets/skills/cfn-parameterized-queries/SKILL.md +339 -0
- package/claude-assets/skills/cfn-playbook/query-playbook.sh +19 -15
- package/claude-assets/skills/cfn-playbook/update-playbook.sh +25 -14
- package/claude-assets/skills/cfn-process-instrumentation/instrument-process.sh +44 -0
- package/claude-assets/skills/cfn-promotion/SKILL.md +305 -0
- package/claude-assets/skills/cfn-redis-coordination/CENTRALIZED_REDIS_WRAPPER.md +319 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh +4 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-log.sh.bak +124 -0
- package/claude-assets/skills/cfn-redis-coordination/agent-recovery.sh +2 -2
- package/claude-assets/skills/cfn-redis-coordination/collect-confidence-scores.sh +30 -0
- package/claude-assets/skills/cfn-redis-coordination/get-context.sh +33 -0
- package/claude-assets/skills/cfn-redis-coordination/get-success-criteria.sh +54 -0
- package/claude-assets/skills/cfn-redis-coordination/invoke-waiting-mode.sh +3 -0
- package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/claude-assets/skills/cfn-redis-coordination/redis-functions.sh +33 -0
- package/claude-assets/skills/cfn-redis-coordination/report-completion.sh +24 -31
- package/claude-assets/skills/cfn-redis-coordination/store-context.sh +4 -0
- package/claude-assets/skills/cfn-redis-coordination/store-success-criteria.sh +85 -0
- package/claude-assets/skills/cfn-redis-coordination/update-all-scripts.sh +67 -0
- package/claude-assets/skills/cfn-skill-loader/SKILL.md +466 -0
- package/claude-assets/skills/cfn-skill-loader/execute.sh +344 -0
- package/claude-assets/skills/cfn-sqlite-memory/ttl-cleanup.sh +17 -25
- package/claude-assets/skills/cfn-task-audit/get-audit-data.sh +42 -21
- package/claude-assets/skills/cfn-task-audit/store-task-audit.sh +17 -10
- package/claude-assets/skills/cfn-test-runner/detect-regressions.sh +17 -14
- package/claude-assets/skills/cfn-test-runner/detect-regressions.sh.backup-1763392821 +55 -0
- package/claude-assets/skills/cfn-test-runner/store-benchmarks.sh +17 -19
- package/claude-assets/skills/cfn-transparency-middleware/test-e2e.sh +15 -0
- package/claude-assets/skills/cfn-transparency-middleware/tests/input-validation.sh +15 -0
- package/claude-assets/skills/cfn-utilities/SKILL.md +237 -0
- package/claude-assets/skills/cfn-utilities/execute.sh +32 -0
- package/claude-assets/skills/cfn-utilities/lib/errors.sh +56 -0
- package/claude-assets/skills/cfn-utilities/lib/file-ops.sh +164 -0
- package/claude-assets/skills/cfn-utilities/lib/logging.sh +77 -0
- package/claude-assets/skills/cfn-utilities/lib/retry.sh +127 -0
- package/claude-assets/skills/cfn-utilities/test.sh +317 -0
- package/claude-assets/skills/integration/agent-handoff.sh +62 -64
- package/claude-assets/skills/json-validation/SKILL.md +431 -0
- package/claude-assets/skills/json-validation/test-validate-success-criteria.sh +421 -0
- package/claude-assets/skills/json-validation/validate-success-criteria.sh +197 -0
- package/claude-assets/skills/redis-coordination/validate-parameters.sh +34 -0
- package/claude-assets/skills/workflow-codification/DEPLOY_QUICK_REFERENCE.md +106 -0
- package/claude-assets/skills/workflow-codification/PROPAGATE_UPDATE_QUICK_REFERENCE.md +366 -0
- package/claude-assets/skills/workflow-codification/deploy-approved-skill.sh +481 -0
- package/claude-assets/skills/workflow-codification/deploy-approved-skill.sh.backup-1763392820 +512 -0
- package/claude-assets/skills/workflow-codification/lib/security-utils.sh +204 -0
- package/claude-assets/skills/workflow-codification/propagate-skill-update.sh +648 -0
- package/claude-assets/skills/workflow-codification/propagate-skill-update.sh.backup-1763392820 +664 -0
- package/claude-assets/skills/workflow-codification/test-integration.sh +15 -0
- package/claude-assets/skills/workflow-codification/test-metadata-update.sh +350 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh +55 -14
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh.backup-1763392821 +445 -0
- package/claude-assets/skills/workflow-codification/track-edge-case.sh +27 -60
- package/claude-assets/skills/workflow-codification/workflow-codification.db +0 -0
- package/dist/ace/ace-curator.js +10 -2
- package/dist/ace/ace-curator.js.map +1 -1
- package/dist/ace/ace-generator.js +4 -0
- package/dist/ace/ace-generator.js.map +1 -1
- package/dist/ace/ace-reflector.js +1 -1
- package/dist/ace/ace-reflector.js.map +1 -1
- package/dist/ace/context-injection.js +24 -2
- package/dist/ace/context-injection.js.map +1 -1
- package/dist/agents/agent-loader.js +146 -165
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/agents/task-agent-integration.js +1 -1
- package/dist/agents/task-agent-integration.js.map +1 -1
- package/dist/api/health-endpoints.js +390 -0
- package/dist/api/health-endpoints.js.map +1 -0
- package/dist/cli/agent-executor.js +4 -1
- package/dist/cli/agent-executor.js.map +1 -1
- package/dist/cli/agent-prompt-builder.js +89 -1
- package/dist/cli/agent-prompt-builder.js.map +1 -1
- package/dist/cli/agent-spawn.js +130 -37
- package/dist/cli/agent-spawn.js.map +1 -1
- package/dist/cli/skill-cache-validator.js +412 -0
- package/dist/cli/skill-cache-validator.js.map +1 -0
- package/dist/cli/skill-cli.js +991 -0
- package/dist/cli/skill-cli.js.map +1 -0
- package/dist/cli/skill-execution-logger.js +284 -0
- package/dist/cli/skill-execution-logger.js.map +1 -0
- package/dist/cli/skill-loader.js +457 -0
- package/dist/cli/skill-loader.js.map +1 -0
- package/dist/coordination/event-bus.js +2 -2
- package/dist/coordination/event-bus.js.map +1 -1
- package/dist/coordination/fleet-manager.js +1 -1
- package/dist/coordination/fleet-manager.js.map +1 -1
- package/dist/coordination/index.js +23 -9
- package/dist/coordination/index.js.map +1 -1
- package/dist/coordination/types/fleet-manager.types.js.map +1 -1
- package/dist/db/migration-manager.js +483 -0
- package/dist/db/migration-manager.js.map +1 -0
- package/dist/db/skills-query.js +535 -0
- package/dist/db/skills-query.js.map +1 -0
- package/dist/integration/DatabaseHandoff.js +1 -1
- package/dist/integration/DatabaseHandoff.js.map +1 -1
- package/dist/jobs/edge-case-analyzer.js +367 -0
- package/dist/jobs/edge-case-analyzer.js.map +1 -0
- package/dist/jobs/promotion-sla-enforcer.js +288 -0
- package/dist/jobs/promotion-sla-enforcer.js.map +1 -0
- package/dist/lib/agent-output-parser.js.map +1 -1
- package/dist/lib/agent-output-validator.js.map +1 -1
- package/dist/lib/agent-workspace.js +281 -0
- package/dist/lib/agent-workspace.js.map +1 -0
- package/dist/lib/atomic-file-writer.js +377 -0
- package/dist/lib/atomic-file-writer.js.map +1 -0
- package/dist/lib/backup-manager.js +779 -0
- package/dist/lib/backup-manager.js.map +1 -0
- package/dist/lib/checkpoint-manager.js +837 -0
- package/dist/lib/checkpoint-manager.js.map +1 -0
- package/dist/lib/circuit-breaker.js +340 -0
- package/dist/lib/circuit-breaker.js.map +1 -0
- package/dist/lib/completion-signal-handler.js +243 -0
- package/dist/lib/completion-signal-handler.js.map +1 -0
- package/dist/lib/config-manager.js +312 -0
- package/dist/lib/config-manager.js.map +1 -0
- package/dist/lib/config-migrator.js +386 -0
- package/dist/lib/config-migrator.js.map +1 -0
- package/dist/lib/config-validator.js.map +1 -1
- package/dist/lib/correlation-cache.js +311 -0
- package/dist/lib/correlation-cache.js.map +1 -0
- package/dist/lib/correlation.js +263 -0
- package/dist/lib/correlation.js.map +1 -0
- package/dist/lib/database-service/connection-pool-manager.js +520 -0
- package/dist/lib/database-service/connection-pool-manager.js.map +1 -0
- package/dist/lib/database-service/correlation.js +329 -0
- package/dist/lib/database-service/correlation.js.map +1 -0
- package/dist/lib/database-service/errors.js +120 -0
- package/dist/lib/database-service/errors.js.map +1 -0
- package/dist/lib/database-service/index.js +168 -0
- package/dist/lib/database-service/index.js.map +1 -0
- package/dist/lib/database-service/postgres-adapter.js +526 -0
- package/dist/lib/database-service/postgres-adapter.js.map +1 -0
- package/dist/lib/database-service/redis-adapter.js +360 -0
- package/dist/lib/database-service/redis-adapter.js.map +1 -0
- package/dist/lib/database-service/sqlite-adapter.js +544 -0
- package/dist/lib/database-service/sqlite-adapter.js.map +1 -0
- package/dist/lib/database-service/transaction-manager.js +773 -0
- package/dist/lib/database-service/transaction-manager.js.map +1 -0
- package/dist/lib/database-service/types.js +23 -0
- package/dist/lib/database-service/types.js.map +1 -0
- package/dist/lib/deadlock-resolver.js +292 -0
- package/dist/lib/deadlock-resolver.js.map +1 -0
- package/dist/lib/distributed-lock.js +451 -0
- package/dist/lib/distributed-lock.js.map +1 -0
- package/dist/lib/edge-case-deduplicator.js +227 -0
- package/dist/lib/edge-case-deduplicator.js.map +1 -0
- package/dist/lib/encryption-manager.js +322 -0
- package/dist/lib/encryption-manager.js.map +1 -0
- package/dist/lib/error-aggregator.js +234 -0
- package/dist/lib/error-aggregator.js.map +1 -0
- package/dist/lib/errors.js +287 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/file-lock-manager.js +578 -0
- package/dist/lib/file-lock-manager.js.map +1 -0
- package/dist/lib/file-operations.js +367 -0
- package/dist/lib/file-operations.js.map +1 -0
- package/dist/lib/idempotent-write.js +237 -0
- package/dist/lib/idempotent-write.js.map +1 -0
- package/dist/lib/integration-schema-validator.js +522 -0
- package/dist/lib/integration-schema-validator.js.map +1 -0
- package/dist/lib/lock-health-monitor.js +298 -0
- package/dist/lib/lock-health-monitor.js.map +1 -0
- package/dist/lib/log-shipper.js +422 -0
- package/dist/lib/log-shipper.js.map +1 -0
- package/dist/lib/logging.js +146 -0
- package/dist/lib/logging.js.map +1 -0
- package/dist/lib/message-deduplicator.js +439 -0
- package/dist/lib/message-deduplicator.js.map +1 -0
- package/dist/lib/multi-system-query.js +604 -0
- package/dist/lib/multi-system-query.js.map +1 -0
- package/dist/lib/orphan-detector.js +332 -0
- package/dist/lib/orphan-detector.js.map +1 -0
- package/dist/lib/password-generator.js +166 -0
- package/dist/lib/password-generator.js.map +1 -0
- package/dist/lib/path-validator.js +429 -0
- package/dist/lib/path-validator.js.map +1 -0
- package/dist/lib/query-translator.js +905 -0
- package/dist/lib/query-translator.js.map +1 -0
- package/dist/lib/queue-recovery.js +469 -0
- package/dist/lib/queue-recovery.js.map +1 -0
- package/dist/lib/redis-queue-manager.js +512 -0
- package/dist/lib/redis-queue-manager.js.map +1 -0
- package/dist/lib/reflection-archiver.js +272 -0
- package/dist/lib/reflection-archiver.js.map +1 -0
- package/dist/lib/retry-manager.js +453 -0
- package/dist/lib/retry-manager.js.map +1 -0
- package/dist/lib/retry.js +262 -0
- package/dist/lib/retry.js.map +1 -0
- package/dist/lib/schema-transform.js +695 -0
- package/dist/lib/schema-transform.js.map +1 -0
- package/dist/lib/schema-validator.js +491 -0
- package/dist/lib/schema-validator.js.map +1 -0
- package/dist/lib/skill-cache.js +297 -0
- package/dist/lib/skill-cache.js.map +1 -0
- package/dist/lib/skill-content-manager.js +337 -0
- package/dist/lib/skill-content-manager.js.map +1 -0
- package/dist/lib/skill-frontmatter-parser.js +237 -0
- package/dist/lib/skill-frontmatter-parser.js.map +1 -0
- package/dist/lib/skill-git-integration.js +275 -0
- package/dist/lib/skill-git-integration.js.map +1 -0
- package/dist/lib/skill-markdown-validator.js +396 -0
- package/dist/lib/skill-markdown-validator.js.map +1 -0
- package/dist/lib/skill-output-parser.js +312 -0
- package/dist/lib/skill-output-parser.js.map +1 -0
- package/dist/lib/unified-query-api.js +467 -0
- package/dist/lib/unified-query-api.js.map +1 -0
- package/dist/middleware/auth-middleware.js +350 -0
- package/dist/middleware/auth-middleware.js.map +1 -0
- package/dist/middleware/schema-validation.js +347 -0
- package/dist/middleware/schema-validation.js.map +1 -0
- package/dist/providers/anthropic-provider.js +1 -1
- package/dist/providers/anthropic-provider.js.map +1 -1
- package/dist/providers/provider-factory.js +2 -2
- package/dist/providers/provider-factory.js.map +1 -1
- package/dist/services/edge-case-analyzer.js +321 -0
- package/dist/services/edge-case-analyzer.js.map +1 -0
- package/dist/services/edge-case-deduplicator.js +266 -0
- package/dist/services/edge-case-deduplicator.js.map +1 -0
- package/dist/services/edge-case-detector.js +337 -0
- package/dist/services/edge-case-detector.js.map +1 -0
- package/dist/services/edge-case-tracker.js +547 -0
- package/dist/services/edge-case-tracker.js.map +1 -0
- package/dist/services/health-check-system.js +586 -0
- package/dist/services/health-check-system.js.map +1 -0
- package/dist/services/metrics-logger.js +412 -0
- package/dist/services/metrics-logger.js.map +1 -0
- package/dist/services/patch-generator.js +378 -0
- package/dist/services/patch-generator.js.map +1 -0
- package/dist/services/patch-validator.js +337 -0
- package/dist/services/patch-validator.js.map +1 -0
- package/dist/services/performance-monitor.js +811 -0
- package/dist/services/performance-monitor.js.map +1 -0
- package/dist/services/promotion-pipeline.js +918 -0
- package/dist/services/promotion-pipeline.js.map +1 -0
- package/dist/services/promotion-validator.js +394 -0
- package/dist/services/promotion-validator.js.map +1 -0
- package/dist/services/reflection-logger.js +388 -0
- package/dist/services/reflection-logger.js.map +1 -0
- package/dist/services/skill-deployment.js +472 -0
- package/dist/services/skill-deployment.js.map +1 -0
- package/dist/services/skill-loader.js +427 -0
- package/dist/services/skill-loader.js.map +1 -0
- package/dist/services/skill-promotion.js +372 -0
- package/dist/services/skill-promotion.js.map +1 -0
- package/dist/services/skill-validator.js +454 -0
- package/dist/services/skill-validator.js.map +1 -0
- package/dist/services/skill-versioning.js +244 -0
- package/dist/services/skill-versioning.js.map +1 -0
- package/dist/services/workspace-supervisor.js +597 -0
- package/dist/services/workspace-supervisor.js.map +1 -0
- package/dist/types/edge-case.js +45 -0
- package/dist/types/edge-case.js.map +1 -0
- package/package.json +201 -177
- package/readme/README.md +19 -4
- package/scripts/backup-cleanup.sh +627 -0
- package/scripts/cleanup-workspaces.sh +412 -0
- package/scripts/cleanup-yaml-configs.sh +141 -0
- package/scripts/deploy-approved-skills.sh +263 -0
- package/scripts/health-check.sh +447 -0
- package/scripts/log-aggregator.sh +554 -0
- package/scripts/log-monitor.sh +629 -0
- package/scripts/manage-agent-workspaces.sh +434 -0
- package/scripts/migrate-schema.sh +533 -0
- package/scripts/promote-staged-skills.sh +423 -0
- package/scripts/verify-no-secrets.sh +88 -35
- package/.claude/cfn-extras/agents/deprecated-coordinators/adaptive-coordinator.md.backup +0 -161
- package/.claude/cfn-extras/agents/deprecated-coordinators/blocking-coordinator-example.md.backup +0 -728
- package/.claude/cfn-extras/agents/deprecated-coordinators/mesh-coordinator.md.backup +0 -131
- package/.claude/skills/agent-lifecycle/SKILL.md +0 -60
- package/.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh +0 -573
- package/.claude/skills/agent-lifecycle/simple-audit.sh +0 -31
- package/.claude/skills/cfn-agent-spawning/spawn-agent.sh.backup +0 -273
- package/.claude/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -949
- package/README.md.backup_before_replace +0 -781
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/adaptive-coordinator.md.backup +0 -161
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/blocking-coordinator-example.md.backup +0 -728
- package/claude-assets/cfn-extras/agents/deprecated-coordinators/mesh-coordinator.md.backup +0 -131
- package/claude-assets/skills/cfn-agent-spawning/spawn-agent.sh.backup +0 -273
- package/claude-assets/skills/cfn-loop-orchestration/orchestrate.sh.backup +0 -949
|
@@ -0,0 +1,648 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# propagate-skill-update.sh - Propagate Skill Update from Phase 4 Edge Case Tracker
|
|
4
|
+
#
|
|
5
|
+
# Purpose:
|
|
6
|
+
# When Phase 4 Edge Case Tracker detects and approves a skill improvement,
|
|
7
|
+
# this script propagates the changes back to the Skills Database with proper
|
|
8
|
+
# version management and approval tracking.
|
|
9
|
+
#
|
|
10
|
+
# Usage:
|
|
11
|
+
# propagate-skill-update.sh SKILL_NAME NEW_VERSION UPDATE_PATH [CHANGE_TYPE] [NOTIFY_AGENTS]
|
|
12
|
+
#
|
|
13
|
+
# Parameters:
|
|
14
|
+
# SKILL_NAME - Skill name (e.g., "jwt-authentication")
|
|
15
|
+
# NEW_VERSION - New version (e.g., "1.0.1", "1.1.0", "2.0.0")
|
|
16
|
+
# UPDATE_PATH - Path to updated skill markdown file
|
|
17
|
+
# CHANGE_TYPE - Version change type: patch|minor|major (default: patch)
|
|
18
|
+
# NOTIFY_AGENTS - Whether to notify agents: true|false (default: false)
|
|
19
|
+
#
|
|
20
|
+
# Phase 4 Integration:
|
|
21
|
+
# After Phase 4 edge case tracker detects and approves a skill improvement:
|
|
22
|
+
#
|
|
23
|
+
# ./.claude/skills/workflow-codification/propagate-skill-update.sh \
|
|
24
|
+
# "$SKILL_NAME" \
|
|
25
|
+
# "$NEW_VERSION" \
|
|
26
|
+
# "$UPDATE_PATH" \
|
|
27
|
+
# "$CHANGE_TYPE" \
|
|
28
|
+
# "$NOTIFY_AGENTS"
|
|
29
|
+
#
|
|
30
|
+
# Examples:
|
|
31
|
+
#
|
|
32
|
+
# Bug fix (patch):
|
|
33
|
+
# ./.claude/skills/workflow-codification/propagate-skill-update.sh \
|
|
34
|
+
# "jwt-authentication" \
|
|
35
|
+
# "1.0.1" \
|
|
36
|
+
# ".claude/skills/auth/jwt-auth-v1.0.1.md" \
|
|
37
|
+
# "patch" \
|
|
38
|
+
# "true"
|
|
39
|
+
#
|
|
40
|
+
# New feature (minor):
|
|
41
|
+
# ./.claude/skills/workflow-codification/propagate-skill-update.sh \
|
|
42
|
+
# "jwt-authentication" \
|
|
43
|
+
# "1.1.0" \
|
|
44
|
+
# ".claude/skills/auth/jwt-auth-v1.1.0.md" \
|
|
45
|
+
# "minor" \
|
|
46
|
+
# "false"
|
|
47
|
+
#
|
|
48
|
+
# Breaking change (major):
|
|
49
|
+
# ./.claude/skills/workflow-codification/propagate-skill-update.sh \
|
|
50
|
+
# "jwt-authentication" \
|
|
51
|
+
# "2.0.0" \
|
|
52
|
+
# ".claude/skills/auth/jwt-auth-v2.0.0.md" \
|
|
53
|
+
# "major" \
|
|
54
|
+
# "true"
|
|
55
|
+
#
|
|
56
|
+
# Exit Codes:
|
|
57
|
+
# 0 - Success
|
|
58
|
+
# 1 - Invalid parameters
|
|
59
|
+
# 2 - File not found
|
|
60
|
+
# 3 - Database error
|
|
61
|
+
# 4 - Skill not found in database
|
|
62
|
+
# 5 - Invalid version increment
|
|
63
|
+
# 6 - Content hash unchanged (no update needed)
|
|
64
|
+
#
|
|
65
|
+
# Environment Variables:
|
|
66
|
+
# CFN_SKILLS_DB_PATH - Path to Skills DB (default: ./.claude/skills-database/skills.db)
|
|
67
|
+
# PHASE4_POSTGRES_HOST - PostgreSQL host for Phase 4 (optional)
|
|
68
|
+
# PHASE4_POSTGRES_DB - PostgreSQL database name (default: workflow_codification)
|
|
69
|
+
# PHASE4_POSTGRES_USER - PostgreSQL username (optional)
|
|
70
|
+
# PHASE4_POSTGRES_PASS - PostgreSQL password (optional)
|
|
71
|
+
# ENABLE_AGENT_NOTIFICATIONS - Enable agent notifications (default: false)
|
|
72
|
+
|
|
73
|
+
set -euo pipefail
|
|
74
|
+
|
|
75
|
+
# Source SQLite parameter binding library (Pattern B - SQL injection prevention)
|
|
76
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
77
|
+
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
|
78
|
+
source "${SCRIPT_DIR}/../bootstrap/sqlite-params.sh"
|
|
79
|
+
|
|
80
|
+
# Configuration
|
|
81
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
82
|
+
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
|
83
|
+
|
|
84
|
+
# Source security utilities (SQL escaping, secure credentials)
|
|
85
|
+
source "${SCRIPT_DIR}/lib/security-utils.sh"
|
|
86
|
+
|
|
87
|
+
# Skills Database (SQLite - required)
|
|
88
|
+
CFN_SKILLS_DB_PATH="${CFN_SKILLS_DB_PATH:-./.claude/skills-database/skills.db}"
|
|
89
|
+
|
|
90
|
+
# Phase 4 PostgreSQL (optional)
|
|
91
|
+
PHASE4_POSTGRES_HOST="${PHASE4_POSTGRES_HOST:-}"
|
|
92
|
+
PHASE4_POSTGRES_DB="${PHASE4_POSTGRES_DB:-workflow_codification}"
|
|
93
|
+
PHASE4_POSTGRES_USER="${PHASE4_POSTGRES_USER:-}"
|
|
94
|
+
PHASE4_POSTGRES_PASS="${PHASE4_POSTGRES_PASS:-}"
|
|
95
|
+
|
|
96
|
+
# Agent notifications
|
|
97
|
+
ENABLE_AGENT_NOTIFICATIONS="${ENABLE_AGENT_NOTIFICATIONS:-false}"
|
|
98
|
+
|
|
99
|
+
# Color codes
|
|
100
|
+
RED='\033[0;31m'
|
|
101
|
+
GREEN='\033[0;32m'
|
|
102
|
+
YELLOW='\033[1;33m'
|
|
103
|
+
BLUE='\033[0;34m'
|
|
104
|
+
CYAN='\033[0;36m'
|
|
105
|
+
NC='\033[0m'
|
|
106
|
+
|
|
107
|
+
#######################################
|
|
108
|
+
# Utility functions
|
|
109
|
+
#######################################
|
|
110
|
+
log_info() {
|
|
111
|
+
echo -e "${BLUE}[INFO]${NC} $*" >&2
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
log_success() {
|
|
115
|
+
echo -e "${GREEN}[SUCCESS]${NC} $*" >&2
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
log_error() {
|
|
119
|
+
echo -e "${RED}[ERROR]${NC} $*" >&2
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
log_warning() {
|
|
123
|
+
echo -e "${YELLOW}[WARNING]${NC} $*" >&2
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
log_debug() {
|
|
127
|
+
if [[ "${DEBUG:-0}" == "1" ]]; then
|
|
128
|
+
echo -e "${CYAN}[DEBUG]${NC} $*" >&2
|
|
129
|
+
fi
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
error_exit() {
|
|
133
|
+
local exit_code="$1"
|
|
134
|
+
shift
|
|
135
|
+
log_error "$@"
|
|
136
|
+
exit "$exit_code"
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
#######################################
|
|
140
|
+
# Validation functions
|
|
141
|
+
#######################################
|
|
142
|
+
validate_parameters() {
|
|
143
|
+
local skill_name="$1"
|
|
144
|
+
local new_version="$2"
|
|
145
|
+
local update_path="$3"
|
|
146
|
+
|
|
147
|
+
# Validate required parameters
|
|
148
|
+
if [[ -z "$skill_name" ]] || [[ -z "$new_version" ]] || [[ -z "$update_path" ]]; then
|
|
149
|
+
echo "[ERROR] Missing required parameters" >&2
|
|
150
|
+
echo "Usage: propagate-skill-update.sh SKILL_NAME NEW_VERSION UPDATE_PATH [CHANGE_TYPE] [NOTIFY_AGENTS]" >&2
|
|
151
|
+
echo "" >&2
|
|
152
|
+
echo "Example:" >&2
|
|
153
|
+
echo " propagate-skill-update.sh jwt-authentication 1.0.1 ./skill-v1.0.1.md patch true" >&2
|
|
154
|
+
exit 1
|
|
155
|
+
fi
|
|
156
|
+
|
|
157
|
+
# SECURITY FIX: Validate skill name (prevent injection)
|
|
158
|
+
validate_skill_name "$skill_name" || exit 1
|
|
159
|
+
|
|
160
|
+
# Validate version format (semantic versioning)
|
|
161
|
+
if ! [[ "$new_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
162
|
+
echo "[ERROR] Invalid version format: $new_version" >&2
|
|
163
|
+
echo "Expected format: MAJOR.MINOR.PATCH (e.g., 1.0.1)" >&2
|
|
164
|
+
exit 1
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
# Validate update file exists
|
|
168
|
+
if [[ ! -f "$update_path" ]]; then
|
|
169
|
+
echo "[ERROR] Update file not found: $update_path" >&2
|
|
170
|
+
exit 2
|
|
171
|
+
fi
|
|
172
|
+
|
|
173
|
+
# Validate update file is readable
|
|
174
|
+
if [[ ! -r "$update_path" ]]; then
|
|
175
|
+
echo "[ERROR] Update file is not readable: $update_path" >&2
|
|
176
|
+
echo "Check file permissions." >&2
|
|
177
|
+
exit 2
|
|
178
|
+
fi
|
|
179
|
+
|
|
180
|
+
# SECURITY FIX: Validate file path (prevent traversal)
|
|
181
|
+
validate_file_path "$update_path" "$PROJECT_ROOT" || exit 1
|
|
182
|
+
|
|
183
|
+
# Validate database exists
|
|
184
|
+
if [[ ! -f "$CFN_SKILLS_DB_PATH" ]]; then
|
|
185
|
+
echo "[ERROR] Skills database not found: $CFN_SKILLS_DB_PATH" >&2
|
|
186
|
+
exit 3
|
|
187
|
+
fi
|
|
188
|
+
|
|
189
|
+
# SECURITY FIX: Escape SQL string before query
|
|
190
|
+
|
|
191
|
+
# Validate skill exists in database (before attempting update)
|
|
192
|
+
local skill_count
|
|
193
|
+
skill_count=$(sqlite_select "$CFN_SKILLS_DB_PATH" "SELECT COUNT(*) FROM skills WHERE name = ?1" "$skill_name" 2>/dev/null || echo "0")
|
|
194
|
+
|
|
195
|
+
if [[ "$skill_count" -eq 0 ]]; then
|
|
196
|
+
echo "[ERROR] Skill not found in database: $skill_name" >&2
|
|
197
|
+
echo "Available skills:" >&2
|
|
198
|
+
sqlite_select "$CFN_SKILLS_DB_PATH" "SELECT name FROM skills ORDER BY name" 2>/dev/null || echo " (could not retrieve skills list)" >&2
|
|
199
|
+
exit 4
|
|
200
|
+
fi
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
validate_change_type() {
|
|
204
|
+
local change_type="$1"
|
|
205
|
+
|
|
206
|
+
# Validate CHANGE_TYPE if provided
|
|
207
|
+
if [[ -n "$change_type" ]] && ! [[ "$change_type" =~ ^(patch|minor|major)$ ]]; then
|
|
208
|
+
echo "[ERROR] Invalid CHANGE_TYPE: $change_type" >&2
|
|
209
|
+
echo "Valid values: patch, minor, major" >&2
|
|
210
|
+
exit 1
|
|
211
|
+
fi
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
#######################################
|
|
215
|
+
# Frontmatter parsing functions
|
|
216
|
+
#######################################
|
|
217
|
+
parse_frontmatter() {
|
|
218
|
+
local file_path="$1"
|
|
219
|
+
local key="$2"
|
|
220
|
+
|
|
221
|
+
# Extract frontmatter between --- markers
|
|
222
|
+
local frontmatter=$(sed -n '/^---$/,/^---$/p' "$file_path" | sed '1d;$d')
|
|
223
|
+
|
|
224
|
+
# Parse specific key
|
|
225
|
+
local value=$(echo "$frontmatter" | grep "^${key}:" | cut -d: -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
226
|
+
|
|
227
|
+
# Handle array format [tag1, tag2] → convert to JSON array
|
|
228
|
+
if [[ "$value" =~ ^\[.*\]$ ]]; then
|
|
229
|
+
# Convert [tag1, tag2] to ["tag1", "tag2"]
|
|
230
|
+
value=$(echo "$value" | sed 's/\[//;s/\]//' | awk -F', *' '{printf "["; for(i=1;i<=NF;i++) {if(i>1) printf ","; printf "\"" $i "\""} printf "]"}')
|
|
231
|
+
fi
|
|
232
|
+
|
|
233
|
+
echo "$value"
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
#######################################
|
|
237
|
+
# Version management functions
|
|
238
|
+
#######################################
|
|
239
|
+
parse_version() {
|
|
240
|
+
local version="$1"
|
|
241
|
+
local -n major_ref="$2"
|
|
242
|
+
local -n minor_ref="$3"
|
|
243
|
+
local -n patch_ref="$4"
|
|
244
|
+
|
|
245
|
+
IFS='.' read -r major_ref minor_ref patch_ref <<< "$version"
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
compare_versions() {
|
|
249
|
+
local current_version="$1"
|
|
250
|
+
local new_version="$2"
|
|
251
|
+
|
|
252
|
+
local current_major current_minor current_patch
|
|
253
|
+
local new_major new_minor new_patch
|
|
254
|
+
|
|
255
|
+
parse_version "$current_version" current_major current_minor current_patch
|
|
256
|
+
parse_version "$new_version" new_major new_minor new_patch
|
|
257
|
+
|
|
258
|
+
# Compare major
|
|
259
|
+
if [[ $new_major -gt $current_major ]]; then
|
|
260
|
+
echo "major"
|
|
261
|
+
return 0
|
|
262
|
+
elif [[ $new_major -lt $current_major ]]; then
|
|
263
|
+
echo "downgrade"
|
|
264
|
+
return 0
|
|
265
|
+
fi
|
|
266
|
+
|
|
267
|
+
# Compare minor
|
|
268
|
+
if [[ $new_minor -gt $current_minor ]]; then
|
|
269
|
+
echo "minor"
|
|
270
|
+
return 0
|
|
271
|
+
elif [[ $new_minor -lt $current_minor ]]; then
|
|
272
|
+
echo "downgrade"
|
|
273
|
+
return 0
|
|
274
|
+
fi
|
|
275
|
+
|
|
276
|
+
# Compare patch
|
|
277
|
+
if [[ $new_patch -gt $current_patch ]]; then
|
|
278
|
+
echo "patch"
|
|
279
|
+
return 0
|
|
280
|
+
elif [[ $new_patch -lt $current_patch ]]; then
|
|
281
|
+
echo "downgrade"
|
|
282
|
+
return 0
|
|
283
|
+
fi
|
|
284
|
+
|
|
285
|
+
echo "same"
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
validate_version_increment() {
|
|
289
|
+
local current_version="$1"
|
|
290
|
+
local new_version="$2"
|
|
291
|
+
local expected_change_type="$3"
|
|
292
|
+
|
|
293
|
+
local actual_change_type
|
|
294
|
+
actual_change_type=$(compare_versions "$current_version" "$new_version")
|
|
295
|
+
|
|
296
|
+
log_debug "Version comparison: $current_version → $new_version (detected: $actual_change_type, expected: $expected_change_type)"
|
|
297
|
+
|
|
298
|
+
case "$actual_change_type" in
|
|
299
|
+
same)
|
|
300
|
+
error_exit 4 "Version unchanged: $current_version → $new_version"
|
|
301
|
+
;;
|
|
302
|
+
downgrade)
|
|
303
|
+
error_exit 4 "Version downgrade not allowed: $current_version → $new_version"
|
|
304
|
+
;;
|
|
305
|
+
patch|minor|major)
|
|
306
|
+
if [[ "$actual_change_type" != "$expected_change_type" ]]; then
|
|
307
|
+
error_exit 4 "Version change type mismatch: detected $actual_change_type, but change_type=$expected_change_type (version: $current_version → $new_version)"
|
|
308
|
+
fi
|
|
309
|
+
;;
|
|
310
|
+
*)
|
|
311
|
+
error_exit 4 "Invalid version comparison result: $actual_change_type"
|
|
312
|
+
;;
|
|
313
|
+
esac
|
|
314
|
+
|
|
315
|
+
log_debug "Version increment validated: $current_version → $new_version ($expected_change_type)"
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
#######################################
|
|
319
|
+
# Database functions
|
|
320
|
+
#######################################
|
|
321
|
+
get_skill_info() {
|
|
322
|
+
local skill_name="$1"
|
|
323
|
+
|
|
324
|
+
# Use parameterized query to prevent SQL injection (CVSS 8.6 fix)
|
|
325
|
+
local result
|
|
326
|
+
result=$(sqlite_select "$CFN_SKILLS_DB_PATH" \
|
|
327
|
+
"SELECT id, version, content_hash, content_path FROM skills WHERE name = ?1" \
|
|
328
|
+
"$skill_name")
|
|
329
|
+
|
|
330
|
+
if [[ -z "$result" ]]; then
|
|
331
|
+
error_exit 4 "Skill not found in database: $skill_name"
|
|
332
|
+
fi
|
|
333
|
+
|
|
334
|
+
echo "$result"
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
calculate_content_hash() {
|
|
338
|
+
local file_path="$1"
|
|
339
|
+
|
|
340
|
+
if [[ ! -f "$file_path" ]]; then
|
|
341
|
+
error_exit 2 "Cannot calculate hash - file not found: $file_path"
|
|
342
|
+
fi
|
|
343
|
+
|
|
344
|
+
sha256sum "$file_path" | awk '{print $1}'
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
update_skill_record() {
|
|
348
|
+
local skill_id="$1"
|
|
349
|
+
local new_version="$2"
|
|
350
|
+
local new_hash="$3"
|
|
351
|
+
local update_path="$4"
|
|
352
|
+
local new_tags="$5"
|
|
353
|
+
local new_category="$6"
|
|
354
|
+
local new_owner="$7"
|
|
355
|
+
local new_approval_level="$8"
|
|
356
|
+
|
|
357
|
+
log_info "Updating skill record (ID: $skill_id)"
|
|
358
|
+
|
|
359
|
+
# SECURITY FIX: Escape all SQL strings to prevent injection
|
|
360
|
+
|
|
361
|
+
sqlite3 "$CFN_SKILLS_DB_PATH" <<EOF
|
|
362
|
+
UPDATE skills
|
|
363
|
+
SET version = '${safe_new_version}',
|
|
364
|
+
content_hash = '${safe_new_hash}',
|
|
365
|
+
content_path = '${safe_update_path}',
|
|
366
|
+
tags = '${safe_new_tags}',
|
|
367
|
+
category = '${safe_new_category}',
|
|
368
|
+
owner = '${safe_new_owner}',
|
|
369
|
+
approval_level = '${safe_new_approval_level}',
|
|
370
|
+
updated_at = datetime('now')
|
|
371
|
+
WHERE id = ${skill_id};
|
|
372
|
+
EOF
|
|
373
|
+
|
|
374
|
+
if [[ $? -ne 0 ]]; then
|
|
375
|
+
error_exit 6 "Failed to update skill record"
|
|
376
|
+
fi
|
|
377
|
+
|
|
378
|
+
log_debug "Skill record updated successfully"
|
|
379
|
+
log_info "Metadata refreshed from frontmatter:"
|
|
380
|
+
log_info " Tags: $new_tags"
|
|
381
|
+
log_info " Category: $new_category"
|
|
382
|
+
log_info " Owner: $new_owner"
|
|
383
|
+
log_info " Approval Level: $new_approval_level"
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
record_approval_history() {
|
|
387
|
+
local skill_id="$1"
|
|
388
|
+
local new_version="$2"
|
|
389
|
+
local change_type="$3"
|
|
390
|
+
|
|
391
|
+
log_info "Recording approval history"
|
|
392
|
+
|
|
393
|
+
local metadata
|
|
394
|
+
metadata=$(cat <<EOF
|
|
395
|
+
{
|
|
396
|
+
"change_type": "$change_type",
|
|
397
|
+
"source": "phase4-edge-case-tracker",
|
|
398
|
+
"propagated_at": "$(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
|
399
|
+
}
|
|
400
|
+
EOF
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
# SECURITY FIX: Escape SQL strings
|
|
404
|
+
|
|
405
|
+
sqlite3 "$CFN_SKILLS_DB_PATH" <<EOF
|
|
406
|
+
INSERT INTO approval_history (
|
|
407
|
+
skill_id,
|
|
408
|
+
version,
|
|
409
|
+
approval_level,
|
|
410
|
+
approver,
|
|
411
|
+
decision,
|
|
412
|
+
reasoning,
|
|
413
|
+
approval_criteria_check,
|
|
414
|
+
timestamp
|
|
415
|
+
) VALUES (
|
|
416
|
+
${skill_id},
|
|
417
|
+
'${safe_new_version}',
|
|
418
|
+
'auto',
|
|
419
|
+
'phase4-edge-case-tracker',
|
|
420
|
+
'approved',
|
|
421
|
+
'Edge case update propagated from Phase 4 after expert review and validation',
|
|
422
|
+
'${safe_metadata}',
|
|
423
|
+
datetime('now')
|
|
424
|
+
);
|
|
425
|
+
EOF
|
|
426
|
+
|
|
427
|
+
if [[ $? -ne 0 ]]; then
|
|
428
|
+
error_exit 6 "Failed to record approval history"
|
|
429
|
+
fi
|
|
430
|
+
|
|
431
|
+
log_debug "Approval history recorded"
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
get_affected_agents() {
|
|
435
|
+
local skill_id="$1"
|
|
436
|
+
|
|
437
|
+
# SECURITY FIX: Skill ID should be numeric (validated earlier)
|
|
438
|
+
# But add explicit check for safety
|
|
439
|
+
if ! [[ "$skill_id" =~ ^[0-9]+$ ]]; then
|
|
440
|
+
log_error "Invalid skill ID (must be numeric): $skill_id"
|
|
441
|
+
return 1
|
|
442
|
+
fi
|
|
443
|
+
|
|
444
|
+
sqlite3 "$CFN_SKILLS_DB_PATH" <<EOF
|
|
445
|
+
SELECT DISTINCT agent_type
|
|
446
|
+
FROM agent_skill_mappings
|
|
447
|
+
WHERE skill_id = ${skill_id}
|
|
448
|
+
ORDER BY agent_type;
|
|
449
|
+
EOF
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
#######################################
|
|
453
|
+
# PostgreSQL integration (optional)
|
|
454
|
+
#######################################
|
|
455
|
+
update_phase4_edge_case_status() {
|
|
456
|
+
local skill_name="$1"
|
|
457
|
+
local new_version="$2"
|
|
458
|
+
|
|
459
|
+
if [[ -z "$PHASE4_POSTGRES_HOST" ]]; then
|
|
460
|
+
log_debug "PostgreSQL not configured - skipping Phase 4 status update"
|
|
461
|
+
return 0
|
|
462
|
+
fi
|
|
463
|
+
|
|
464
|
+
log_info "Updating Phase 4 edge case status (if applicable)"
|
|
465
|
+
|
|
466
|
+
# This would update the edge_cases table in PostgreSQL
|
|
467
|
+
# Implementation depends on Phase 4 schema
|
|
468
|
+
# For now, just log that we would do this
|
|
469
|
+
|
|
470
|
+
log_debug "Phase 4 status update would occur here for skill: $skill_name, version: $new_version"
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
#######################################
|
|
474
|
+
# Agent notification
|
|
475
|
+
#######################################
|
|
476
|
+
notify_affected_agents() {
|
|
477
|
+
local skill_id="$1"
|
|
478
|
+
local skill_name="$2"
|
|
479
|
+
local old_version="$3"
|
|
480
|
+
local new_version="$4"
|
|
481
|
+
local change_type="$5"
|
|
482
|
+
|
|
483
|
+
local agents
|
|
484
|
+
agents=$(get_affected_agents "$skill_id")
|
|
485
|
+
|
|
486
|
+
if [[ -z "$agents" ]]; then
|
|
487
|
+
log_info "No agents using this skill"
|
|
488
|
+
return 0
|
|
489
|
+
fi
|
|
490
|
+
|
|
491
|
+
local agent_count
|
|
492
|
+
agent_count=$(echo "$agents" | wc -l)
|
|
493
|
+
|
|
494
|
+
log_info "Agents using this skill ($agent_count):"
|
|
495
|
+
echo "$agents" | while read -r agent_type; do
|
|
496
|
+
echo " - $agent_type"
|
|
497
|
+
done
|
|
498
|
+
|
|
499
|
+
# Optional: Create notification records
|
|
500
|
+
# This would require a notifications table in the database
|
|
501
|
+
# For now, we just list the agents
|
|
502
|
+
|
|
503
|
+
echo ""
|
|
504
|
+
log_success "Notification: Skill '$skill_name' updated from $old_version to $new_version ($change_type)"
|
|
505
|
+
log_info "Affected agents should reload skill content on next invocation"
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
#######################################
|
|
509
|
+
# Main execution
|
|
510
|
+
#######################################
|
|
511
|
+
main() {
|
|
512
|
+
local skill_name="$1"
|
|
513
|
+
local new_version="$2"
|
|
514
|
+
local update_path="$3"
|
|
515
|
+
local change_type="${4:-patch}"
|
|
516
|
+
local notify_agents="${5:-false}"
|
|
517
|
+
|
|
518
|
+
log_info "=========================================="
|
|
519
|
+
log_info "Propagate Skill Update"
|
|
520
|
+
log_info "=========================================="
|
|
521
|
+
log_info "Skill: $skill_name"
|
|
522
|
+
log_info "New Version: $new_version"
|
|
523
|
+
log_info "Update Path: $update_path"
|
|
524
|
+
log_info "Change Type: $change_type"
|
|
525
|
+
log_info "Notify Agents: $notify_agents"
|
|
526
|
+
log_info "=========================================="
|
|
527
|
+
echo ""
|
|
528
|
+
|
|
529
|
+
# Step 1: Validate inputs
|
|
530
|
+
log_info "Step 1: Validating inputs"
|
|
531
|
+
validate_parameters "$skill_name" "$new_version" "$update_path"
|
|
532
|
+
validate_change_type "$change_type"
|
|
533
|
+
log_success "Input validation passed"
|
|
534
|
+
echo ""
|
|
535
|
+
|
|
536
|
+
# Step 2: Lookup existing skill
|
|
537
|
+
log_info "Step 2: Looking up existing skill"
|
|
538
|
+
local skill_info
|
|
539
|
+
skill_info=$(get_skill_info "$skill_name")
|
|
540
|
+
|
|
541
|
+
local skill_id current_version current_hash current_path
|
|
542
|
+
IFS='|' read -r skill_id current_version current_hash current_path <<< "$skill_info"
|
|
543
|
+
|
|
544
|
+
log_info "Found skill: ID=$skill_id, Current Version=$current_version"
|
|
545
|
+
log_debug "Current Hash: $current_hash"
|
|
546
|
+
log_debug "Current Path: $current_path"
|
|
547
|
+
echo ""
|
|
548
|
+
|
|
549
|
+
# Step 3: Validate version increment
|
|
550
|
+
log_info "Step 3: Validating version increment"
|
|
551
|
+
validate_version_increment "$current_version" "$new_version" "$change_type"
|
|
552
|
+
log_success "Version increment validated: $current_version → $new_version ($change_type)"
|
|
553
|
+
echo ""
|
|
554
|
+
|
|
555
|
+
# Step 4: Calculate new content hash
|
|
556
|
+
log_info "Step 4: Calculating new content hash"
|
|
557
|
+
local new_hash
|
|
558
|
+
new_hash=$(calculate_content_hash "$update_path")
|
|
559
|
+
log_debug "New Hash: $new_hash"
|
|
560
|
+
|
|
561
|
+
# Check if content actually changed
|
|
562
|
+
if [[ "$new_hash" == "$current_hash" ]]; then
|
|
563
|
+
log_warning "Content hash unchanged - no actual content changes detected"
|
|
564
|
+
log_warning "Old Hash: $current_hash"
|
|
565
|
+
log_warning "New Hash: $new_hash"
|
|
566
|
+
error_exit 5 "Content hash unchanged - update not needed (version would increment without content changes)"
|
|
567
|
+
fi
|
|
568
|
+
|
|
569
|
+
log_success "Content hash calculated and differs from current"
|
|
570
|
+
echo ""
|
|
571
|
+
|
|
572
|
+
# Step 5: Parse frontmatter metadata and update skill record
|
|
573
|
+
log_info "Step 5: Parsing frontmatter metadata from updated skill"
|
|
574
|
+
local new_tags new_category new_owner new_approval_level
|
|
575
|
+
|
|
576
|
+
new_tags=$(parse_frontmatter "$update_path" "tags")
|
|
577
|
+
new_category=$(parse_frontmatter "$update_path" "category")
|
|
578
|
+
new_owner=$(parse_frontmatter "$update_path" "owner")
|
|
579
|
+
new_approval_level=$(parse_frontmatter "$update_path" "approval_level")
|
|
580
|
+
|
|
581
|
+
# Use existing values if not found in frontmatter
|
|
582
|
+
if [[ -z "$new_tags" ]]; then
|
|
583
|
+
new_tags=$(sqlite_select "$CFN_SKILLS_DB_PATH" "SELECT tags FROM skills WHERE id = ?1" "$skill_id")
|
|
584
|
+
log_debug "Tags not found in frontmatter, using existing: $new_tags"
|
|
585
|
+
fi
|
|
586
|
+
|
|
587
|
+
if [[ -z "$new_category" ]]; then
|
|
588
|
+
new_category=$(sqlite_select "$CFN_SKILLS_DB_PATH" "SELECT category FROM skills WHERE id = ?1" "$skill_id")
|
|
589
|
+
log_debug "Category not found in frontmatter, using existing: $new_category"
|
|
590
|
+
fi
|
|
591
|
+
|
|
592
|
+
if [[ -z "$new_owner" ]]; then
|
|
593
|
+
new_owner=$(sqlite_select "$CFN_SKILLS_DB_PATH" "SELECT owner FROM skills WHERE id = ?1" "$skill_id")
|
|
594
|
+
log_debug "Owner not found in frontmatter, using existing: $new_owner"
|
|
595
|
+
fi
|
|
596
|
+
|
|
597
|
+
if [[ -z "$new_approval_level" ]]; then
|
|
598
|
+
new_approval_level=$(sqlite_select "$CFN_SKILLS_DB_PATH" "SELECT approval_level FROM skills WHERE id = ?1" "$skill_id")
|
|
599
|
+
log_debug "Approval level not found in frontmatter, using existing: $new_approval_level"
|
|
600
|
+
fi
|
|
601
|
+
|
|
602
|
+
log_info "Updating skill record in database"
|
|
603
|
+
update_skill_record "$skill_id" "$new_version" "$new_hash" "$update_path" "$new_tags" "$new_category" "$new_owner" "$new_approval_level"
|
|
604
|
+
log_success "Skill record updated with refreshed metadata"
|
|
605
|
+
echo ""
|
|
606
|
+
|
|
607
|
+
# Step 6: Record approval history
|
|
608
|
+
log_info "Step 6: Recording approval history"
|
|
609
|
+
record_approval_history "$skill_id" "$new_version" "$change_type"
|
|
610
|
+
log_success "Approval history recorded"
|
|
611
|
+
echo ""
|
|
612
|
+
|
|
613
|
+
# Step 7: Update Phase 4 edge case status (optional)
|
|
614
|
+
log_info "Step 7: Updating Phase 4 edge case status (if applicable)"
|
|
615
|
+
update_phase4_edge_case_status "$skill_name" "$new_version"
|
|
616
|
+
echo ""
|
|
617
|
+
|
|
618
|
+
# Step 8: Notify agents (optional)
|
|
619
|
+
if [[ "$notify_agents" == "true" ]] || [[ "$ENABLE_AGENT_NOTIFICATIONS" == "true" ]]; then
|
|
620
|
+
log_info "Step 8: Notifying affected agents"
|
|
621
|
+
notify_affected_agents "$skill_id" "$skill_name" "$current_version" "$new_version" "$change_type"
|
|
622
|
+
else
|
|
623
|
+
log_info "Step 8: Agent notification disabled (skipping)"
|
|
624
|
+
fi
|
|
625
|
+
echo ""
|
|
626
|
+
|
|
627
|
+
# Success summary
|
|
628
|
+
log_info "=========================================="
|
|
629
|
+
log_success "Skill Update Propagated Successfully"
|
|
630
|
+
log_info "=========================================="
|
|
631
|
+
log_info "Skill Name: $skill_name"
|
|
632
|
+
log_info "Version: $current_version → $new_version"
|
|
633
|
+
log_info "Change Type: $change_type"
|
|
634
|
+
log_info "Content Hash: ${new_hash:0:16}..."
|
|
635
|
+
log_info "Update Path: $update_path"
|
|
636
|
+
log_info "Metadata Refreshed: Yes"
|
|
637
|
+
log_info " Tags: $new_tags"
|
|
638
|
+
log_info " Category: $new_category"
|
|
639
|
+
log_info " Owner: $new_owner"
|
|
640
|
+
log_info " Approval Level: $new_approval_level"
|
|
641
|
+
log_info "=========================================="
|
|
642
|
+
|
|
643
|
+
exit 0
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
# Execute main function
|
|
647
|
+
main "$@"
|
|
648
|
+
|