claude-flow-novice 2.15.3 → 2.15.5
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 +29 -6
- 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 +238 -29
- 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 +6 -2
- package/.claude/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/.claude/skills/cfn-redis-coordination/redis-functions.sh +34 -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 +29 -6
- 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 +238 -29
- 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 +6 -2
- package/claude-assets/skills/cfn-redis-coordination/redis-cli-wrapper.sh +24 -3
- package/claude-assets/skills/cfn-redis-coordination/redis-functions.sh +34 -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/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/config-manager.js +109 -91
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/cli/conversation-fork-cleanup.js +201 -0
- package/dist/cli/conversation-fork-cleanup.js.map +1 -0
- package/dist/cli/conversation-fork.js +16 -3
- package/dist/cli/conversation-fork.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/docs/BUG_19_MEMORY_LEAK_TASK_MODE.md +405 -0
- package/docs/MEMORY_CLEANUP_GUIDE.md +358 -0
- package/docs/MEMORY_LEAK_FIX_SUMMARY.md +322 -0
- package/docs/REDIS_CLEANUP_EXECUTIVE_SUMMARY.md +319 -0
- package/docs/REDIS_CLEANUP_VERIFICATION_REPORT.md +574 -0
- package/package.json +35 -4
- package/readme/README.md +53 -5
- 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/scripts/verify-redis-cleanup.sh +173 -0
- package/tests/README.md +84 -0
- package/tests/test-memory-leak-task-mode.sh +435 -0
- 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,421 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# Test Suite for JSON Validation Skill
|
|
4
|
+
# Validates defensive parsing, security features, and helper functions
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# ./.claude/skills/json-validation/test-validate-success-criteria.sh
|
|
8
|
+
#
|
|
9
|
+
# Exit Codes:
|
|
10
|
+
# 0 - All tests passed
|
|
11
|
+
# 1 - One or more tests failed
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
|
|
15
|
+
# Test counters
|
|
16
|
+
TESTS_RUN=0
|
|
17
|
+
TESTS_PASSED=0
|
|
18
|
+
TESTS_FAILED=0
|
|
19
|
+
|
|
20
|
+
# Colors for output
|
|
21
|
+
RED='\033[0;31m'
|
|
22
|
+
GREEN='\033[0;32m'
|
|
23
|
+
YELLOW='\033[1;33m'
|
|
24
|
+
NC='\033[0m' # No Color
|
|
25
|
+
|
|
26
|
+
# Source the skill
|
|
27
|
+
SKILL_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/validate-success-criteria.sh"
|
|
28
|
+
source "$SKILL_PATH"
|
|
29
|
+
|
|
30
|
+
# Test helper functions
|
|
31
|
+
assert_equals() {
|
|
32
|
+
local expected="$1"
|
|
33
|
+
local actual="$2"
|
|
34
|
+
local test_name="$3"
|
|
35
|
+
|
|
36
|
+
TESTS_RUN=$((TESTS_RUN + 1))
|
|
37
|
+
|
|
38
|
+
if [[ "$expected" == "$actual" ]]; then
|
|
39
|
+
TESTS_PASSED=$((TESTS_PASSED + 1))
|
|
40
|
+
echo -e "${GREEN}✓${NC} $test_name"
|
|
41
|
+
return 0
|
|
42
|
+
else
|
|
43
|
+
TESTS_FAILED=$((TESTS_FAILED + 1))
|
|
44
|
+
echo -e "${RED}✗${NC} $test_name"
|
|
45
|
+
echo -e " Expected: ${YELLOW}$expected${NC}"
|
|
46
|
+
echo -e " Actual: ${YELLOW}$actual${NC}"
|
|
47
|
+
return 1
|
|
48
|
+
fi
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
assert_exit_code() {
|
|
52
|
+
local expected_code="$1"
|
|
53
|
+
local test_name="$2"
|
|
54
|
+
shift 2
|
|
55
|
+
local actual_code=0
|
|
56
|
+
|
|
57
|
+
TESTS_RUN=$((TESTS_RUN + 1))
|
|
58
|
+
|
|
59
|
+
# Run command and capture exit code
|
|
60
|
+
"$@" >/dev/null 2>&1 || actual_code=$?
|
|
61
|
+
|
|
62
|
+
if [[ "$expected_code" -eq "$actual_code" ]]; then
|
|
63
|
+
TESTS_PASSED=$((TESTS_PASSED + 1))
|
|
64
|
+
echo -e "${GREEN}✓${NC} $test_name"
|
|
65
|
+
return 0
|
|
66
|
+
else
|
|
67
|
+
TESTS_FAILED=$((TESTS_FAILED + 1))
|
|
68
|
+
echo -e "${RED}✗${NC} $test_name"
|
|
69
|
+
echo -e " Expected exit code: ${YELLOW}$expected_code${NC}"
|
|
70
|
+
echo -e " Actual exit code: ${YELLOW}$actual_code${NC}"
|
|
71
|
+
return 1
|
|
72
|
+
fi
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
assert_non_empty() {
|
|
76
|
+
local value="$1"
|
|
77
|
+
local test_name="$2"
|
|
78
|
+
|
|
79
|
+
TESTS_RUN=$((TESTS_RUN + 1))
|
|
80
|
+
|
|
81
|
+
if [[ -n "$value" ]]; then
|
|
82
|
+
TESTS_PASSED=$((TESTS_PASSED + 1))
|
|
83
|
+
echo -e "${GREEN}✓${NC} $test_name"
|
|
84
|
+
return 0
|
|
85
|
+
else
|
|
86
|
+
TESTS_FAILED=$((TESTS_FAILED + 1))
|
|
87
|
+
echo -e "${RED}✗${NC} $test_name"
|
|
88
|
+
echo -e " Expected non-empty value"
|
|
89
|
+
return 1
|
|
90
|
+
fi
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
# Test suite separator
|
|
94
|
+
test_suite() {
|
|
95
|
+
echo ""
|
|
96
|
+
echo "=== $1 ==="
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
# Cleanup function
|
|
100
|
+
cleanup() {
|
|
101
|
+
unset AGENT_SUCCESS_CRITERIA
|
|
102
|
+
unset CRITERIA
|
|
103
|
+
unset TEST_SUITES
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
# Run tests
|
|
107
|
+
echo "JSON Validation Skill Test Suite"
|
|
108
|
+
echo "=================================="
|
|
109
|
+
|
|
110
|
+
# Test 1: Valid JSON parsing
|
|
111
|
+
test_suite "Test 1: Valid JSON Parsing"
|
|
112
|
+
|
|
113
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
114
|
+
"test_suites": [
|
|
115
|
+
{
|
|
116
|
+
"name": "unit-tests",
|
|
117
|
+
"command": "npm test",
|
|
118
|
+
"pass_threshold": 0.95
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}'
|
|
122
|
+
|
|
123
|
+
assert_exit_code 0 "validate_success_criteria returns 0 for valid JSON" validate_success_criteria
|
|
124
|
+
assert_non_empty "$CRITERIA" "CRITERIA is exported and non-empty"
|
|
125
|
+
assert_non_empty "$TEST_SUITES" "TEST_SUITES is exported and non-empty"
|
|
126
|
+
|
|
127
|
+
cleanup
|
|
128
|
+
|
|
129
|
+
# Test 2: Invalid JSON rejection
|
|
130
|
+
test_suite "Test 2: Invalid JSON Rejection"
|
|
131
|
+
|
|
132
|
+
export AGENT_SUCCESS_CRITERIA='{"invalid": json}'
|
|
133
|
+
|
|
134
|
+
assert_exit_code 1 "validate_success_criteria returns 1 for invalid JSON" validate_success_criteria
|
|
135
|
+
|
|
136
|
+
cleanup
|
|
137
|
+
|
|
138
|
+
# Test 3: Empty criteria (valid case)
|
|
139
|
+
test_suite "Test 3: Empty Criteria"
|
|
140
|
+
|
|
141
|
+
export AGENT_SUCCESS_CRITERIA=""
|
|
142
|
+
|
|
143
|
+
assert_exit_code 0 "validate_success_criteria returns 0 for empty criteria" validate_success_criteria
|
|
144
|
+
|
|
145
|
+
cleanup
|
|
146
|
+
|
|
147
|
+
# Test 4: Missing AGENT_SUCCESS_CRITERIA (valid case)
|
|
148
|
+
test_suite "Test 4: Missing Environment Variable"
|
|
149
|
+
|
|
150
|
+
unset AGENT_SUCCESS_CRITERIA
|
|
151
|
+
|
|
152
|
+
assert_exit_code 0 "validate_success_criteria returns 0 when variable not set" validate_success_criteria
|
|
153
|
+
|
|
154
|
+
# Test 5: get_test_suite function
|
|
155
|
+
test_suite "Test 5: get_test_suite Function"
|
|
156
|
+
|
|
157
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
158
|
+
"test_suites": [
|
|
159
|
+
{
|
|
160
|
+
"name": "unit-tests",
|
|
161
|
+
"command": "npm test"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"name": "integration-tests",
|
|
165
|
+
"command": "npm run test:integration"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
}'
|
|
169
|
+
|
|
170
|
+
validate_success_criteria
|
|
171
|
+
|
|
172
|
+
suite=$(get_test_suite "unit-tests")
|
|
173
|
+
suite_name=$(echo "$suite" | jq -r '.name // empty')
|
|
174
|
+
assert_equals "unit-tests" "$suite_name" "get_test_suite retrieves correct suite"
|
|
175
|
+
|
|
176
|
+
suite2=$(get_test_suite "integration-tests")
|
|
177
|
+
suite2_name=$(echo "$suite2" | jq -r '.name // empty')
|
|
178
|
+
assert_equals "integration-tests" "$suite2_name" "get_test_suite retrieves second suite"
|
|
179
|
+
|
|
180
|
+
missing=$(get_test_suite "nonexistent")
|
|
181
|
+
assert_equals "" "$missing" "get_test_suite returns empty for missing suite"
|
|
182
|
+
|
|
183
|
+
cleanup
|
|
184
|
+
|
|
185
|
+
# Test 6: get_test_command function
|
|
186
|
+
test_suite "Test 6: get_test_command Function"
|
|
187
|
+
|
|
188
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
189
|
+
"test_suites": [
|
|
190
|
+
{
|
|
191
|
+
"name": "unit-tests",
|
|
192
|
+
"command": "npm test"
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
}'
|
|
196
|
+
|
|
197
|
+
validate_success_criteria
|
|
198
|
+
|
|
199
|
+
cmd=$(get_test_command "unit-tests")
|
|
200
|
+
assert_equals "npm test" "$cmd" "get_test_command retrieves correct command"
|
|
201
|
+
|
|
202
|
+
missing_cmd=$(get_test_command "nonexistent")
|
|
203
|
+
assert_equals "" "$missing_cmd" "get_test_command returns empty for missing suite"
|
|
204
|
+
|
|
205
|
+
cleanup
|
|
206
|
+
|
|
207
|
+
# Test 7: get_pass_threshold function
|
|
208
|
+
test_suite "Test 7: get_pass_threshold Function"
|
|
209
|
+
|
|
210
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
211
|
+
"test_suites": [
|
|
212
|
+
{
|
|
213
|
+
"name": "unit-tests",
|
|
214
|
+
"command": "npm test",
|
|
215
|
+
"pass_threshold": 0.95
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
}'
|
|
219
|
+
|
|
220
|
+
validate_success_criteria
|
|
221
|
+
|
|
222
|
+
threshold=$(get_pass_threshold "unit-tests")
|
|
223
|
+
assert_equals "0.95" "$threshold" "get_pass_threshold retrieves correct threshold"
|
|
224
|
+
|
|
225
|
+
missing_threshold=$(get_pass_threshold "nonexistent")
|
|
226
|
+
assert_equals "" "$missing_threshold" "get_pass_threshold returns empty for missing suite"
|
|
227
|
+
|
|
228
|
+
cleanup
|
|
229
|
+
|
|
230
|
+
# Test 8: list_test_suites function
|
|
231
|
+
test_suite "Test 8: list_test_suites Function"
|
|
232
|
+
|
|
233
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
234
|
+
"test_suites": [
|
|
235
|
+
{"name": "unit-tests", "command": "npm test"},
|
|
236
|
+
{"name": "integration-tests", "command": "npm run test:integration"},
|
|
237
|
+
{"name": "e2e-tests", "command": "npm run test:e2e"}
|
|
238
|
+
]
|
|
239
|
+
}'
|
|
240
|
+
|
|
241
|
+
validate_success_criteria
|
|
242
|
+
|
|
243
|
+
suites=$(list_test_suites)
|
|
244
|
+
suite_count=$(echo "$suites" | wc -l)
|
|
245
|
+
assert_equals "3" "$suite_count" "list_test_suites returns correct count"
|
|
246
|
+
|
|
247
|
+
first_suite=$(echo "$suites" | head -1)
|
|
248
|
+
assert_equals "unit-tests" "$first_suite" "list_test_suites includes first suite"
|
|
249
|
+
|
|
250
|
+
cleanup
|
|
251
|
+
|
|
252
|
+
# Test 9: validate_criteria_structure - valid structure
|
|
253
|
+
test_suite "Test 9: validate_criteria_structure - Valid"
|
|
254
|
+
|
|
255
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
256
|
+
"test_suites": [
|
|
257
|
+
{
|
|
258
|
+
"name": "unit-tests",
|
|
259
|
+
"command": "npm test"
|
|
260
|
+
}
|
|
261
|
+
]
|
|
262
|
+
}'
|
|
263
|
+
|
|
264
|
+
validate_success_criteria
|
|
265
|
+
|
|
266
|
+
assert_exit_code 0 "validate_criteria_structure returns 0 for valid structure" validate_criteria_structure
|
|
267
|
+
|
|
268
|
+
cleanup
|
|
269
|
+
|
|
270
|
+
# Test 10: validate_criteria_structure - missing test_suites
|
|
271
|
+
test_suite "Test 10: validate_criteria_structure - Missing test_suites"
|
|
272
|
+
|
|
273
|
+
export AGENT_SUCCESS_CRITERIA='{"other_field": "value"}'
|
|
274
|
+
|
|
275
|
+
validate_success_criteria
|
|
276
|
+
|
|
277
|
+
assert_exit_code 1 "validate_criteria_structure returns 1 for missing test_suites" validate_criteria_structure
|
|
278
|
+
|
|
279
|
+
cleanup
|
|
280
|
+
|
|
281
|
+
# Test 11: validate_criteria_structure - missing name field
|
|
282
|
+
test_suite "Test 11: validate_criteria_structure - Missing name"
|
|
283
|
+
|
|
284
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
285
|
+
"test_suites": [
|
|
286
|
+
{
|
|
287
|
+
"command": "npm test"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
290
|
+
}'
|
|
291
|
+
|
|
292
|
+
validate_success_criteria
|
|
293
|
+
|
|
294
|
+
assert_exit_code 1 "validate_criteria_structure returns 1 for missing name field" validate_criteria_structure
|
|
295
|
+
|
|
296
|
+
cleanup
|
|
297
|
+
|
|
298
|
+
# Test 12: validate_criteria_structure - missing command field
|
|
299
|
+
test_suite "Test 12: validate_criteria_structure - Missing command"
|
|
300
|
+
|
|
301
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
302
|
+
"test_suites": [
|
|
303
|
+
{
|
|
304
|
+
"name": "unit-tests"
|
|
305
|
+
}
|
|
306
|
+
]
|
|
307
|
+
}'
|
|
308
|
+
|
|
309
|
+
validate_success_criteria
|
|
310
|
+
|
|
311
|
+
assert_exit_code 1 "validate_criteria_structure returns 1 for missing command field" validate_criteria_structure
|
|
312
|
+
|
|
313
|
+
cleanup
|
|
314
|
+
|
|
315
|
+
# Test 13: Fallback operators - missing optional fields
|
|
316
|
+
test_suite "Test 13: Fallback Operators"
|
|
317
|
+
|
|
318
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
319
|
+
"test_suites": [
|
|
320
|
+
{
|
|
321
|
+
"name": "unit-tests",
|
|
322
|
+
"command": "npm test"
|
|
323
|
+
}
|
|
324
|
+
]
|
|
325
|
+
}'
|
|
326
|
+
|
|
327
|
+
validate_success_criteria
|
|
328
|
+
|
|
329
|
+
# Missing pass_threshold should return empty (not error)
|
|
330
|
+
threshold=$(get_pass_threshold "unit-tests")
|
|
331
|
+
assert_equals "" "$threshold" "Missing optional field returns empty (not error)"
|
|
332
|
+
|
|
333
|
+
cleanup
|
|
334
|
+
|
|
335
|
+
# Test 14: Security - JSON injection attempt
|
|
336
|
+
test_suite "Test 14: Security - JSON Injection"
|
|
337
|
+
|
|
338
|
+
export AGENT_SUCCESS_CRITERIA='{"test_suites": [{"name": "$(rm -rf /)", "command": "evil"}]}'
|
|
339
|
+
|
|
340
|
+
# Should validate successfully (structure is valid)
|
|
341
|
+
assert_exit_code 0 "Injection attempt in name field is parsed safely" validate_success_criteria
|
|
342
|
+
|
|
343
|
+
# But the name should be properly escaped when extracted
|
|
344
|
+
suite=$(get_test_suite '$(rm -rf /)')
|
|
345
|
+
suite_name=$(echo "$suite" | jq -r '.name // empty')
|
|
346
|
+
# The exact match proves it's treated as literal string, not executed
|
|
347
|
+
assert_equals '$(rm -rf /)' "$suite_name" "Injection payload treated as literal string"
|
|
348
|
+
|
|
349
|
+
cleanup
|
|
350
|
+
|
|
351
|
+
# Test 15: Multiple test suites with mixed valid/invalid
|
|
352
|
+
test_suite "Test 15: Multiple Test Suites"
|
|
353
|
+
|
|
354
|
+
export AGENT_SUCCESS_CRITERIA='{
|
|
355
|
+
"test_suites": [
|
|
356
|
+
{"name": "unit-tests", "command": "npm test", "pass_threshold": 0.95},
|
|
357
|
+
{"name": "integration-tests", "command": "npm run test:integration", "pass_threshold": 0.90},
|
|
358
|
+
{"name": "e2e-tests", "command": "npm run test:e2e"}
|
|
359
|
+
]
|
|
360
|
+
}'
|
|
361
|
+
|
|
362
|
+
validate_success_criteria
|
|
363
|
+
|
|
364
|
+
cmd1=$(get_test_command "unit-tests")
|
|
365
|
+
cmd2=$(get_test_command "integration-tests")
|
|
366
|
+
cmd3=$(get_test_command "e2e-tests")
|
|
367
|
+
|
|
368
|
+
assert_equals "npm test" "$cmd1" "First suite command correct"
|
|
369
|
+
assert_equals "npm run test:integration" "$cmd2" "Second suite command correct"
|
|
370
|
+
assert_equals "npm run test:e2e" "$cmd3" "Third suite command correct"
|
|
371
|
+
|
|
372
|
+
threshold1=$(get_pass_threshold "unit-tests")
|
|
373
|
+
threshold2=$(get_pass_threshold "integration-tests")
|
|
374
|
+
threshold3=$(get_pass_threshold "e2e-tests")
|
|
375
|
+
|
|
376
|
+
assert_equals "0.95" "$threshold1" "First suite threshold correct"
|
|
377
|
+
assert_equals "0.90" "$threshold2" "Second suite threshold correct"
|
|
378
|
+
assert_equals "" "$threshold3" "Missing threshold returns empty"
|
|
379
|
+
|
|
380
|
+
cleanup
|
|
381
|
+
|
|
382
|
+
# Test 16: Function exports
|
|
383
|
+
test_suite "Test 16: Function Exports"
|
|
384
|
+
|
|
385
|
+
# Verify all functions are exported
|
|
386
|
+
assert_exit_code 0 "validate_success_criteria is exported" declare -F validate_success_criteria
|
|
387
|
+
assert_exit_code 0 "get_test_suite is exported" declare -F get_test_suite
|
|
388
|
+
assert_exit_code 0 "get_test_command is exported" declare -F get_test_command
|
|
389
|
+
assert_exit_code 0 "get_pass_threshold is exported" declare -F get_pass_threshold
|
|
390
|
+
assert_exit_code 0 "list_test_suites is exported" declare -F list_test_suites
|
|
391
|
+
assert_exit_code 0 "validate_criteria_structure is exported" declare -F validate_criteria_structure
|
|
392
|
+
|
|
393
|
+
# Print summary
|
|
394
|
+
echo ""
|
|
395
|
+
echo "=================================="
|
|
396
|
+
echo "Test Summary"
|
|
397
|
+
echo "=================================="
|
|
398
|
+
echo -e "Total tests: $TESTS_RUN"
|
|
399
|
+
echo -e "${GREEN}Passed: $TESTS_PASSED${NC}"
|
|
400
|
+
if [[ $TESTS_FAILED -gt 0 ]]; then
|
|
401
|
+
echo -e "${RED}Failed: $TESTS_FAILED${NC}"
|
|
402
|
+
else
|
|
403
|
+
echo -e "Failed: $TESTS_FAILED"
|
|
404
|
+
fi
|
|
405
|
+
|
|
406
|
+
# Calculate pass rate
|
|
407
|
+
if [[ $TESTS_RUN -gt 0 ]]; then
|
|
408
|
+
pass_rate=$(awk "BEGIN {printf \"%.2f\", ($TESTS_PASSED / $TESTS_RUN) * 100}")
|
|
409
|
+
echo -e "Pass rate: ${pass_rate}%"
|
|
410
|
+
fi
|
|
411
|
+
|
|
412
|
+
echo ""
|
|
413
|
+
|
|
414
|
+
# Exit with appropriate code
|
|
415
|
+
if [[ $TESTS_FAILED -eq 0 ]]; then
|
|
416
|
+
echo -e "${GREEN}✓ All tests passed${NC}"
|
|
417
|
+
exit 0
|
|
418
|
+
else
|
|
419
|
+
echo -e "${RED}✗ Some tests failed${NC}"
|
|
420
|
+
exit 1
|
|
421
|
+
fi
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
#
|
|
3
|
+
# JSON Validation Skill - Success Criteria Validator
|
|
4
|
+
# Centralized validation for AGENT_SUCCESS_CRITERIA environment variable
|
|
5
|
+
#
|
|
6
|
+
# Usage:
|
|
7
|
+
# source .claude/skills/json-validation/validate-success-criteria.sh
|
|
8
|
+
# validate_success_criteria
|
|
9
|
+
#
|
|
10
|
+
# Exit Codes:
|
|
11
|
+
# 0 - Success (criteria valid or not provided)
|
|
12
|
+
# 1 - Invalid JSON in AGENT_SUCCESS_CRITERIA
|
|
13
|
+
#
|
|
14
|
+
# Environment Variables:
|
|
15
|
+
# AGENT_SUCCESS_CRITERIA - JSON string with test requirements
|
|
16
|
+
#
|
|
17
|
+
# Exports:
|
|
18
|
+
# CRITERIA - Parsed JSON criteria object
|
|
19
|
+
# TEST_SUITES - Array of test suite names
|
|
20
|
+
|
|
21
|
+
set -euo pipefail
|
|
22
|
+
|
|
23
|
+
# Validate and parse AGENT_SUCCESS_CRITERIA
|
|
24
|
+
#
|
|
25
|
+
# This function implements defensive JSON parsing to prevent injection attacks
|
|
26
|
+
# (CVSS 8.2) and ensures consistent error handling across all agents.
|
|
27
|
+
#
|
|
28
|
+
# Returns:
|
|
29
|
+
# 0 if validation succeeds (or no criteria provided)
|
|
30
|
+
# 1 if validation fails (malformed JSON)
|
|
31
|
+
validate_success_criteria() {
|
|
32
|
+
# Check if AGENT_SUCCESS_CRITERIA is provided
|
|
33
|
+
if [[ -z "${AGENT_SUCCESS_CRITERIA:-}" ]]; then
|
|
34
|
+
# No criteria provided - this is valid (agent may not require test-driven execution)
|
|
35
|
+
return 0
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
# Validate JSON structure before parsing
|
|
39
|
+
if ! echo "$AGENT_SUCCESS_CRITERIA" | jq -e '.' >/dev/null 2>&1; then
|
|
40
|
+
echo "❌ Invalid JSON in AGENT_SUCCESS_CRITERIA" >&2
|
|
41
|
+
echo " Expected valid JSON object with test_suites array" >&2
|
|
42
|
+
echo " Received: ${AGENT_SUCCESS_CRITERIA:0:100}..." >&2
|
|
43
|
+
return 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
# Parse validated JSON
|
|
47
|
+
CRITERIA=$(echo "$AGENT_SUCCESS_CRITERIA" | jq -r '.')
|
|
48
|
+
export CRITERIA
|
|
49
|
+
|
|
50
|
+
# Extract test suites with fallback operators (suppress iteration error if test_suites missing)
|
|
51
|
+
TEST_SUITES=$(echo "$CRITERIA" | jq -r '.test_suites[]? // empty' 2>/dev/null || echo "")
|
|
52
|
+
export TEST_SUITES
|
|
53
|
+
|
|
54
|
+
# Display loaded criteria (if any test suites present)
|
|
55
|
+
if [[ -n "$TEST_SUITES" ]]; then
|
|
56
|
+
echo "📋 Success Criteria Loaded:"
|
|
57
|
+
echo "$TEST_SUITES" | jq -r '.name // "unnamed"'
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
return 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# Extract specific test suite by name
|
|
64
|
+
#
|
|
65
|
+
# Usage:
|
|
66
|
+
# get_test_suite "unit-tests"
|
|
67
|
+
#
|
|
68
|
+
# Returns:
|
|
69
|
+
# JSON object for matching test suite, or empty string if not found
|
|
70
|
+
get_test_suite() {
|
|
71
|
+
local suite_name="$1"
|
|
72
|
+
|
|
73
|
+
if [[ -z "${CRITERIA:-}" ]]; then
|
|
74
|
+
echo ""
|
|
75
|
+
return 0
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
echo "$CRITERIA" | jq -r --arg name "$suite_name" '.test_suites[]? | select(.name == $name) // empty' 2>/dev/null || echo ""
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# Get test command for specific suite
|
|
82
|
+
#
|
|
83
|
+
# Usage:
|
|
84
|
+
# get_test_command "unit-tests"
|
|
85
|
+
#
|
|
86
|
+
# Returns:
|
|
87
|
+
# Test command string (e.g., "npm test"), or empty if not found
|
|
88
|
+
get_test_command() {
|
|
89
|
+
local suite_name="$1"
|
|
90
|
+
local suite
|
|
91
|
+
|
|
92
|
+
suite=$(get_test_suite "$suite_name")
|
|
93
|
+
|
|
94
|
+
if [[ -z "$suite" ]]; then
|
|
95
|
+
echo ""
|
|
96
|
+
return 0
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
echo "$suite" | jq -r '.command // empty'
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
# Get pass rate threshold for specific suite
|
|
103
|
+
#
|
|
104
|
+
# Usage:
|
|
105
|
+
# get_pass_threshold "unit-tests"
|
|
106
|
+
#
|
|
107
|
+
# Returns:
|
|
108
|
+
# Pass rate threshold (e.g., "0.95"), or empty if not found
|
|
109
|
+
get_pass_threshold() {
|
|
110
|
+
local suite_name="$1"
|
|
111
|
+
local suite
|
|
112
|
+
|
|
113
|
+
suite=$(get_test_suite "$suite_name")
|
|
114
|
+
|
|
115
|
+
if [[ -z "$suite" ]]; then
|
|
116
|
+
echo ""
|
|
117
|
+
return 0
|
|
118
|
+
fi
|
|
119
|
+
|
|
120
|
+
echo "$suite" | jq -r '.pass_threshold // empty'
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
# List all test suite names
|
|
124
|
+
#
|
|
125
|
+
# Usage:
|
|
126
|
+
# list_test_suites
|
|
127
|
+
#
|
|
128
|
+
# Returns:
|
|
129
|
+
# Newline-separated list of suite names
|
|
130
|
+
list_test_suites() {
|
|
131
|
+
if [[ -z "${CRITERIA:-}" ]]; then
|
|
132
|
+
echo ""
|
|
133
|
+
return 0
|
|
134
|
+
fi
|
|
135
|
+
|
|
136
|
+
echo "$CRITERIA" | jq -r '.test_suites[]?.name // "unnamed"' 2>/dev/null || echo ""
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
# Validate that required fields are present in criteria
|
|
140
|
+
#
|
|
141
|
+
# Usage:
|
|
142
|
+
# validate_criteria_structure
|
|
143
|
+
#
|
|
144
|
+
# Returns:
|
|
145
|
+
# 0 if structure is valid
|
|
146
|
+
# 1 if required fields are missing
|
|
147
|
+
validate_criteria_structure() {
|
|
148
|
+
if [[ -z "${CRITERIA:-}" ]]; then
|
|
149
|
+
# No criteria to validate
|
|
150
|
+
return 0
|
|
151
|
+
fi
|
|
152
|
+
|
|
153
|
+
# Check for required top-level structure
|
|
154
|
+
if ! echo "$CRITERIA" | jq -e '.test_suites' >/dev/null 2>&1; then
|
|
155
|
+
echo "❌ Missing required field: test_suites" >&2
|
|
156
|
+
return 1
|
|
157
|
+
fi
|
|
158
|
+
|
|
159
|
+
# Check if test_suites is null or not an array
|
|
160
|
+
local suite_type
|
|
161
|
+
suite_type=$(echo "$CRITERIA" | jq -r '.test_suites | type')
|
|
162
|
+
if [[ "$suite_type" != "array" ]]; then
|
|
163
|
+
echo "❌ test_suites must be an array, got: $suite_type" >&2
|
|
164
|
+
return 1
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
# Validate each test suite has required fields
|
|
168
|
+
local suite_count
|
|
169
|
+
suite_count=$(echo "$CRITERIA" | jq -r '.test_suites | length')
|
|
170
|
+
|
|
171
|
+
for ((i=0; i<suite_count; i++)); do
|
|
172
|
+
local suite
|
|
173
|
+
suite=$(echo "$CRITERIA" | jq -r ".test_suites[$i]")
|
|
174
|
+
|
|
175
|
+
# Check for name field
|
|
176
|
+
if ! echo "$suite" | jq -e '.name' >/dev/null 2>&1; then
|
|
177
|
+
echo "❌ Test suite $i missing required field: name" >&2
|
|
178
|
+
return 1
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
# Check for command field
|
|
182
|
+
if ! echo "$suite" | jq -e '.command' >/dev/null 2>&1; then
|
|
183
|
+
echo "❌ Test suite $i missing required field: command" >&2
|
|
184
|
+
return 1
|
|
185
|
+
fi
|
|
186
|
+
done
|
|
187
|
+
|
|
188
|
+
return 0
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
# Export functions for use in agent scripts
|
|
192
|
+
export -f validate_success_criteria
|
|
193
|
+
export -f get_test_suite
|
|
194
|
+
export -f get_test_command
|
|
195
|
+
export -f get_pass_threshold
|
|
196
|
+
export -f list_test_suites
|
|
197
|
+
export -f validate_criteria_structure
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Parameter Validation Script
|
|
3
|
+
# Validates CFN Loop parameters and configuration
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# Function to validate parameters
|
|
8
|
+
validate_parameters() {
|
|
9
|
+
local task_description="${1:-}"
|
|
10
|
+
local mode="${2:-standard}"
|
|
11
|
+
|
|
12
|
+
if [ -z "$task_description" ]; then
|
|
13
|
+
echo "ERROR: Task description is required" >&2
|
|
14
|
+
return 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
# Validate mode
|
|
18
|
+
case "$mode" in
|
|
19
|
+
mvp|standard|enterprise)
|
|
20
|
+
;;
|
|
21
|
+
*)
|
|
22
|
+
echo "ERROR: Invalid mode: $mode" >&2
|
|
23
|
+
return 1
|
|
24
|
+
;;
|
|
25
|
+
esac
|
|
26
|
+
|
|
27
|
+
echo "Parameters validated successfully"
|
|
28
|
+
return 0
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
# Main execution
|
|
32
|
+
if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
|
|
33
|
+
validate_parameters "$@"
|
|
34
|
+
fi
|