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,369 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
#
|
|
3
|
+
# File Operations Skill - Test Suite
|
|
4
|
+
#
|
|
5
|
+
# Tests file locking and atomic write operations.
|
|
6
|
+
# Part of Task 4.2: Centralized File Locking & Atomic Operations
|
|
7
|
+
#
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
+
SKILL="$SCRIPT_DIR/execute.sh"
|
|
13
|
+
TEST_DIR="/tmp/cfn-file-ops-test-$$"
|
|
14
|
+
LOCK_DIR="/tmp/cfn-locks-test-$$"
|
|
15
|
+
|
|
16
|
+
export CFN_LOCK_DIR="$LOCK_DIR"
|
|
17
|
+
|
|
18
|
+
# Colors for output
|
|
19
|
+
RED='\033[0;31m'
|
|
20
|
+
GREEN='\033[0;32m'
|
|
21
|
+
YELLOW='\033[1;33m'
|
|
22
|
+
NC='\033[0m' # No Color
|
|
23
|
+
|
|
24
|
+
# Test counters
|
|
25
|
+
TESTS_RUN=0
|
|
26
|
+
TESTS_PASSED=0
|
|
27
|
+
TESTS_FAILED=0
|
|
28
|
+
|
|
29
|
+
#
|
|
30
|
+
# Setup test environment
|
|
31
|
+
#
|
|
32
|
+
setup() {
|
|
33
|
+
echo "Setting up test environment..."
|
|
34
|
+
mkdir -p "$TEST_DIR"
|
|
35
|
+
mkdir -p "$LOCK_DIR"
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
#
|
|
39
|
+
# Cleanup test environment
|
|
40
|
+
#
|
|
41
|
+
cleanup() {
|
|
42
|
+
echo "Cleaning up test environment..."
|
|
43
|
+
rm -rf "$TEST_DIR"
|
|
44
|
+
rm -rf "$LOCK_DIR"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#
|
|
48
|
+
# Assert helper
|
|
49
|
+
#
|
|
50
|
+
assert() {
|
|
51
|
+
local description="$1"
|
|
52
|
+
local command="$2"
|
|
53
|
+
|
|
54
|
+
TESTS_RUN=$((TESTS_RUN + 1))
|
|
55
|
+
echo -n " Test $TESTS_RUN: $description... "
|
|
56
|
+
|
|
57
|
+
if eval "$command" > /dev/null 2>&1; then
|
|
58
|
+
echo -e "${GREEN}PASS${NC}"
|
|
59
|
+
TESTS_PASSED=$((TESTS_PASSED + 1))
|
|
60
|
+
return 0
|
|
61
|
+
else
|
|
62
|
+
echo -e "${RED}FAIL${NC}"
|
|
63
|
+
TESTS_FAILED=$((TESTS_FAILED + 1))
|
|
64
|
+
return 1
|
|
65
|
+
fi
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
#
|
|
69
|
+
# Test: Lock acquisition and release
|
|
70
|
+
#
|
|
71
|
+
test_lock_acquisition() {
|
|
72
|
+
echo -e "\n${YELLOW}Test Suite: Lock Acquisition${NC}"
|
|
73
|
+
|
|
74
|
+
local test_file="$TEST_DIR/lock-test.txt"
|
|
75
|
+
touch "$test_file"
|
|
76
|
+
|
|
77
|
+
# Test 1: Acquire lock
|
|
78
|
+
assert "Can acquire lock" "
|
|
79
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id test-agent)
|
|
80
|
+
[ -n \"\$LOCK_INFO\" ]
|
|
81
|
+
"
|
|
82
|
+
|
|
83
|
+
# Test 2: Lock file exists
|
|
84
|
+
assert "Lock file created" "
|
|
85
|
+
$SKILL acquire-lock '$test_file' --agent-id test-agent > /tmp/lock-info-$$.txt
|
|
86
|
+
LOCK_INFO=\$(cat /tmp/lock-info-$$.txt)
|
|
87
|
+
LOCK_PATH=\"\${LOCK_INFO#*:}\"
|
|
88
|
+
[ -f \"\$LOCK_PATH\" ]
|
|
89
|
+
"
|
|
90
|
+
|
|
91
|
+
# Test 3: Release lock
|
|
92
|
+
assert "Can release lock" "
|
|
93
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id test-agent)
|
|
94
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
95
|
+
"
|
|
96
|
+
|
|
97
|
+
# Test 4: Lock file removed after release
|
|
98
|
+
assert "Lock file removed after release" "
|
|
99
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id test-agent)
|
|
100
|
+
LOCK_PATH=\"\${LOCK_INFO#*:}\"
|
|
101
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
102
|
+
[ ! -f \"\$LOCK_PATH\" ]
|
|
103
|
+
"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
#
|
|
107
|
+
# Test: Lock renewal
|
|
108
|
+
#
|
|
109
|
+
test_lock_renewal() {
|
|
110
|
+
echo -e "\n${YELLOW}Test Suite: Lock Renewal${NC}"
|
|
111
|
+
|
|
112
|
+
local test_file="$TEST_DIR/renewal-test.txt"
|
|
113
|
+
touch "$test_file"
|
|
114
|
+
|
|
115
|
+
# Test 5: Renew lock
|
|
116
|
+
assert "Can renew lock" "
|
|
117
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id test-agent)
|
|
118
|
+
$SKILL renew-lock \"\$LOCK_INFO\" --extension 60000
|
|
119
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
120
|
+
"
|
|
121
|
+
|
|
122
|
+
# Test 6: Renewal count increases
|
|
123
|
+
assert "Renewal count increases" "
|
|
124
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id test-agent)
|
|
125
|
+
LOCK_PATH=\"\${LOCK_INFO#*:}\"
|
|
126
|
+
BEFORE=\$(jq -r '.renewalCount' \"\$LOCK_PATH\")
|
|
127
|
+
$SKILL renew-lock \"\$LOCK_INFO\" --extension 60000
|
|
128
|
+
AFTER=\$(jq -r '.renewalCount' \"\$LOCK_PATH\")
|
|
129
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
130
|
+
[ \"\$AFTER\" -gt \"\$BEFORE\" ]
|
|
131
|
+
"
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
#
|
|
135
|
+
# Test: Atomic writes
|
|
136
|
+
#
|
|
137
|
+
test_atomic_writes() {
|
|
138
|
+
echo -e "\n${YELLOW}Test Suite: Atomic Writes${NC}"
|
|
139
|
+
|
|
140
|
+
local test_file="$TEST_DIR/write-test.txt"
|
|
141
|
+
|
|
142
|
+
# Test 7: Basic write
|
|
143
|
+
assert "Can write file atomically" "
|
|
144
|
+
$SKILL atomic-write '$test_file' 'Hello World'
|
|
145
|
+
[ -f '$test_file' ]
|
|
146
|
+
[ \"\$(cat '$test_file')\" = 'Hello World' ]
|
|
147
|
+
"
|
|
148
|
+
|
|
149
|
+
# Test 8: Write with checksum
|
|
150
|
+
assert "Write with checksum verification" "
|
|
151
|
+
$SKILL atomic-write '$test_file' 'Test content' --checksum
|
|
152
|
+
[ -f '$test_file' ]
|
|
153
|
+
"
|
|
154
|
+
|
|
155
|
+
# Test 9: Write with backup
|
|
156
|
+
assert "Write creates backup" "
|
|
157
|
+
echo 'Original' > '$test_file'
|
|
158
|
+
RESULT=\$($SKILL atomic-write '$test_file' 'Updated' --backup)
|
|
159
|
+
BACKUP_PATH=\$(echo \"\$RESULT\" | jq -r '.backupPath')
|
|
160
|
+
[ -f \"\$BACKUP_PATH\" ]
|
|
161
|
+
[ \"\$(cat \"\$BACKUP_PATH\")\" = 'Original' ]
|
|
162
|
+
"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
#
|
|
166
|
+
# Test: Atomic reads
|
|
167
|
+
#
|
|
168
|
+
test_atomic_reads() {
|
|
169
|
+
echo -e "\n${YELLOW}Test Suite: Atomic Reads${NC}"
|
|
170
|
+
|
|
171
|
+
local test_file="$TEST_DIR/read-test.txt"
|
|
172
|
+
|
|
173
|
+
# Test 10: Read file
|
|
174
|
+
assert "Can read file atomically" "
|
|
175
|
+
echo 'Test content' > '$test_file'
|
|
176
|
+
RESULT=\$($SKILL atomic-read '$test_file')
|
|
177
|
+
CONTENT=\$(echo \"\$RESULT\" | jq -r '.content')
|
|
178
|
+
[ \"\$CONTENT\" = 'Test content' ]
|
|
179
|
+
"
|
|
180
|
+
|
|
181
|
+
# Test 11: Read returns checksum
|
|
182
|
+
assert "Read returns checksum" "
|
|
183
|
+
echo 'Test' > '$test_file'
|
|
184
|
+
RESULT=\$($SKILL atomic-read '$test_file')
|
|
185
|
+
CHECKSUM=\$(echo \"\$RESULT\" | jq -r '.checksum')
|
|
186
|
+
[ -n \"\$CHECKSUM\" ]
|
|
187
|
+
[ \"\${#CHECKSUM}\" -eq 64 ]
|
|
188
|
+
"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
#
|
|
192
|
+
# Test: Checksum verification
|
|
193
|
+
#
|
|
194
|
+
test_checksum() {
|
|
195
|
+
echo -e "\n${YELLOW}Test Suite: Checksum Verification${NC}"
|
|
196
|
+
|
|
197
|
+
local test_file="$TEST_DIR/checksum-test.txt"
|
|
198
|
+
|
|
199
|
+
# Test 12: Verify checksum
|
|
200
|
+
assert "Can verify file checksum" "
|
|
201
|
+
echo -n 'Test' > '$test_file'
|
|
202
|
+
EXPECTED=\$(echo -n 'Test' | sha256sum | awk '{print \$1}')
|
|
203
|
+
RESULT=\$($SKILL verify-checksum '$test_file' \"\$EXPECTED\")
|
|
204
|
+
MATCHES=\$(echo \"\$RESULT\" | jq -r '.matches')
|
|
205
|
+
[ \"\$MATCHES\" = \"1\" ]
|
|
206
|
+
"
|
|
207
|
+
|
|
208
|
+
# Test 13: Detect checksum mismatch
|
|
209
|
+
assert "Detects checksum mismatch" "
|
|
210
|
+
echo -n 'Test' > '$test_file'
|
|
211
|
+
WRONG='0000000000000000000000000000000000000000000000000000000000000000'
|
|
212
|
+
RESULT=\$($SKILL verify-checksum '$test_file' \"\$WRONG\")
|
|
213
|
+
MATCHES=\$(echo \"\$RESULT\" | jq -r '.matches')
|
|
214
|
+
[ \"\$MATCHES\" = \"0\" ]
|
|
215
|
+
"
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
#
|
|
219
|
+
# Test: Concurrent access
|
|
220
|
+
#
|
|
221
|
+
test_concurrent_access() {
|
|
222
|
+
echo -e "\n${YELLOW}Test Suite: Concurrent Access${NC}"
|
|
223
|
+
|
|
224
|
+
local test_file="$TEST_DIR/concurrent-test.txt"
|
|
225
|
+
touch "$test_file"
|
|
226
|
+
|
|
227
|
+
# Test 14: Second acquire waits for first release
|
|
228
|
+
assert "Second lock waits for first" "
|
|
229
|
+
# Acquire lock in background, hold for 2 seconds
|
|
230
|
+
(
|
|
231
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id agent-1)
|
|
232
|
+
sleep 2
|
|
233
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
234
|
+
) &
|
|
235
|
+
|
|
236
|
+
# Wait a bit for first lock to acquire
|
|
237
|
+
sleep 0.5
|
|
238
|
+
|
|
239
|
+
# Try to acquire second lock (should wait)
|
|
240
|
+
START=\$(date +%s)
|
|
241
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id agent-2 --timeout 5000)
|
|
242
|
+
END=\$(date +%s)
|
|
243
|
+
WAIT_TIME=\$((END - START))
|
|
244
|
+
|
|
245
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
246
|
+
|
|
247
|
+
# Should have waited at least 1 second
|
|
248
|
+
[ \"\$WAIT_TIME\" -ge 1 ]
|
|
249
|
+
"
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
#
|
|
253
|
+
# Test: Force release
|
|
254
|
+
#
|
|
255
|
+
test_force_release() {
|
|
256
|
+
echo -e "\n${YELLOW}Test Suite: Force Release${NC}"
|
|
257
|
+
|
|
258
|
+
local test_file="$TEST_DIR/force-test.txt"
|
|
259
|
+
touch "$test_file"
|
|
260
|
+
|
|
261
|
+
# Test 15: Force release removes lock
|
|
262
|
+
assert "Force release removes lock" "
|
|
263
|
+
LOCK_INFO=\$($SKILL acquire-lock '$test_file' --agent-id test-agent)
|
|
264
|
+
LOCK_PATH=\"\${LOCK_INFO#*:}\"
|
|
265
|
+
$SKILL force-release \"\$LOCK_PATH\"
|
|
266
|
+
[ ! -f \"\$LOCK_PATH\" ]
|
|
267
|
+
"
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
#
|
|
271
|
+
# Test: Metrics
|
|
272
|
+
#
|
|
273
|
+
test_metrics() {
|
|
274
|
+
echo -e "\n${YELLOW}Test Suite: Metrics${NC}"
|
|
275
|
+
|
|
276
|
+
local test_file="$TEST_DIR/metrics-test.txt"
|
|
277
|
+
touch "$test_file"
|
|
278
|
+
|
|
279
|
+
# Test 16: Get metrics
|
|
280
|
+
assert "Can retrieve metrics" "
|
|
281
|
+
METRICS=\$($SKILL get-metrics)
|
|
282
|
+
ACTIVE=\$(echo \"\$METRICS\" | jq -r '.activeLocks')
|
|
283
|
+
[ -n \"\$ACTIVE\" ]
|
|
284
|
+
"
|
|
285
|
+
|
|
286
|
+
# Test 17: Metrics reflect active locks
|
|
287
|
+
assert "Metrics reflect active locks" "
|
|
288
|
+
# Clean start
|
|
289
|
+
rm -rf '$LOCK_DIR'/*.lock 2>/dev/null || true
|
|
290
|
+
|
|
291
|
+
LOCK_INFO_1=\$($SKILL acquire-lock '$test_file.1' --agent-id agent-1)
|
|
292
|
+
LOCK_INFO_2=\$($SKILL acquire-lock '$test_file.2' --agent-id agent-2)
|
|
293
|
+
|
|
294
|
+
METRICS=\$($SKILL get-metrics)
|
|
295
|
+
ACTIVE=\$(echo \"\$METRICS\" | jq -r '.activeLocks')
|
|
296
|
+
|
|
297
|
+
$SKILL release-lock \"\$LOCK_INFO_1\"
|
|
298
|
+
$SKILL release-lock \"\$LOCK_INFO_2\"
|
|
299
|
+
|
|
300
|
+
[ \"\$ACTIVE\" -ge 2 ]
|
|
301
|
+
"
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
#
|
|
305
|
+
# Test: Error handling
|
|
306
|
+
#
|
|
307
|
+
test_error_handling() {
|
|
308
|
+
echo -e "\n${YELLOW}Test Suite: Error Handling${NC}"
|
|
309
|
+
|
|
310
|
+
# Test 18: Missing file path
|
|
311
|
+
assert "Rejects missing file path" "
|
|
312
|
+
! $SKILL acquire-lock '' --agent-id test-agent
|
|
313
|
+
"
|
|
314
|
+
|
|
315
|
+
# Test 19: Invalid lock ID
|
|
316
|
+
assert "Rejects invalid lock ID" "
|
|
317
|
+
! $SKILL release-lock 'invalid-lock-id'
|
|
318
|
+
"
|
|
319
|
+
|
|
320
|
+
# Test 20: Timeout handling
|
|
321
|
+
assert "Handles lock timeout" "
|
|
322
|
+
LOCK_INFO=\$($SKILL acquire-lock '$TEST_DIR/timeout-test.txt' --agent-id agent-1)
|
|
323
|
+
! $SKILL acquire-lock '$TEST_DIR/timeout-test.txt' --agent-id agent-2 --timeout 500
|
|
324
|
+
$SKILL release-lock \"\$LOCK_INFO\"
|
|
325
|
+
"
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
#
|
|
329
|
+
# Main test runner
|
|
330
|
+
#
|
|
331
|
+
main() {
|
|
332
|
+
echo "========================================"
|
|
333
|
+
echo "File Operations Skill - Test Suite"
|
|
334
|
+
echo "========================================"
|
|
335
|
+
|
|
336
|
+
setup
|
|
337
|
+
|
|
338
|
+
test_lock_acquisition
|
|
339
|
+
test_lock_renewal
|
|
340
|
+
test_atomic_writes
|
|
341
|
+
test_atomic_reads
|
|
342
|
+
test_checksum
|
|
343
|
+
test_concurrent_access
|
|
344
|
+
test_force_release
|
|
345
|
+
test_metrics
|
|
346
|
+
test_error_handling
|
|
347
|
+
|
|
348
|
+
cleanup
|
|
349
|
+
|
|
350
|
+
echo ""
|
|
351
|
+
echo "========================================"
|
|
352
|
+
echo "Test Results"
|
|
353
|
+
echo "========================================"
|
|
354
|
+
echo "Total tests: $TESTS_RUN"
|
|
355
|
+
echo -e "Passed: ${GREEN}$TESTS_PASSED${NC}"
|
|
356
|
+
echo -e "Failed: ${RED}$TESTS_FAILED${NC}"
|
|
357
|
+
echo ""
|
|
358
|
+
|
|
359
|
+
if [ "$TESTS_FAILED" -eq 0 ]; then
|
|
360
|
+
echo -e "${GREEN}All tests passed!${NC}"
|
|
361
|
+
exit 0
|
|
362
|
+
else
|
|
363
|
+
echo -e "${RED}Some tests failed.${NC}"
|
|
364
|
+
exit 1
|
|
365
|
+
fi
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
# Run tests
|
|
369
|
+
main
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# CFN Log Operations Skill
|
|
2
|
+
|
|
3
|
+
**Specialization**: Distributed logging, log aggregation, and monitoring
|
|
4
|
+
|
|
5
|
+
**Part of**: Task 4.4 Distributed Logging Standardization
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
The CFN Log Operations skill provides comprehensive logging capabilities for the CFN system, including:
|
|
10
|
+
|
|
11
|
+
- **Log Search and Filtering**: Query logs by correlation ID, agent ID, task ID, or timestamp
|
|
12
|
+
- **Log Aggregation**: Combine logs from multiple sources into unified searchable formats
|
|
13
|
+
- **Log Rotation and Cleanup**: Manage log lifecycle with retention policies
|
|
14
|
+
- **Performance Monitoring**: Track logging overhead and system impact
|
|
15
|
+
- **Error Tracking**: Monitor and alert on ERROR/FATAL level logs
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
./.claude/skills/cfn-log-operations/execute.sh [COMMAND] [OPTIONS]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Commands
|
|
24
|
+
|
|
25
|
+
#### search
|
|
26
|
+
Search for logs matching specific criteria.
|
|
27
|
+
|
|
28
|
+
**Syntax**:
|
|
29
|
+
```bash
|
|
30
|
+
./execute.sh search [OPTIONS]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Options**:
|
|
34
|
+
- `--correlation-id ID` - Search by correlation ID
|
|
35
|
+
- `--agent-id ID` - Search by agent ID
|
|
36
|
+
- `--task-id ID` - Search by task ID
|
|
37
|
+
- `--level LEVEL` - Filter by log level (debug, info, warn, error)
|
|
38
|
+
- `--since DURATION` - Logs from last N hours/minutes (e.g., 24h, 2h)
|
|
39
|
+
- `--pattern PATTERN` - Grep pattern for message
|
|
40
|
+
- `--source SOURCE` - Filter by source container/service
|
|
41
|
+
- `--format FORMAT` - Output format (json, text, csv)
|
|
42
|
+
- `--limit COUNT` - Limit results (default: 100)
|
|
43
|
+
|
|
44
|
+
**Examples**:
|
|
45
|
+
```bash
|
|
46
|
+
# Search by correlation ID
|
|
47
|
+
./execute.sh search --correlation-id "task:task-001:agent"
|
|
48
|
+
|
|
49
|
+
# Find all errors in last 24 hours
|
|
50
|
+
./execute.sh search --level error --since 24h
|
|
51
|
+
|
|
52
|
+
# Find logs from specific agent
|
|
53
|
+
./execute.sh search --agent-id "backend-dev-001" --format json
|
|
54
|
+
|
|
55
|
+
# Search with message pattern
|
|
56
|
+
./execute.sh search --pattern "connection" --since 2h
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
#### aggregate
|
|
60
|
+
Aggregate logs from multiple sources into unified log files.
|
|
61
|
+
|
|
62
|
+
**Syntax**:
|
|
63
|
+
```bash
|
|
64
|
+
./execute.sh aggregate [OPTIONS]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Options**:
|
|
68
|
+
- `--source SOURCE` - Log source (docker, filesystem, all)
|
|
69
|
+
- `--output OUTPUT_DIR` - Output directory
|
|
70
|
+
- `--since DURATION` - Only aggregate recent logs
|
|
71
|
+
- `--deduplicate` - Remove duplicate entries
|
|
72
|
+
- `--validate` - Validate JSON structure
|
|
73
|
+
- `--compress` - Compress aggregated logs
|
|
74
|
+
- `--correlate-by FIELD` - Group by field (correlationId, agentId, taskId)
|
|
75
|
+
|
|
76
|
+
**Examples**:
|
|
77
|
+
```bash
|
|
78
|
+
# Aggregate all logs from last 24 hours
|
|
79
|
+
./execute.sh aggregate --source all --since 24h
|
|
80
|
+
|
|
81
|
+
# Aggregate and deduplicate
|
|
82
|
+
./execute.sh aggregate --source filesystem --deduplicate --validate
|
|
83
|
+
|
|
84
|
+
# Aggregate with compression
|
|
85
|
+
./execute.sh aggregate --source docker --compress
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
#### rotate
|
|
89
|
+
Manage log rotation and retention.
|
|
90
|
+
|
|
91
|
+
**Syntax**:
|
|
92
|
+
```bash
|
|
93
|
+
./execute.sh rotate [OPTIONS]
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Options**:
|
|
97
|
+
- `--log-dir DIR` - Directory to rotate (default: /var/log/cfn)
|
|
98
|
+
- `--max-size SIZE` - Maximum file size (e.g., 100M)
|
|
99
|
+
- `--max-files COUNT` - Maximum rotated files to keep
|
|
100
|
+
- `--compress` - Compress rotated logs
|
|
101
|
+
- `--retention-days DAYS` - Retention period
|
|
102
|
+
- `--force` - Force rotation even if not due
|
|
103
|
+
|
|
104
|
+
**Examples**:
|
|
105
|
+
```bash
|
|
106
|
+
# Rotate all logs
|
|
107
|
+
./execute.sh rotate
|
|
108
|
+
|
|
109
|
+
# Rotate with custom size and retention
|
|
110
|
+
./execute.sh rotate --max-size 50M --retention-days 30
|
|
111
|
+
|
|
112
|
+
# Force rotation with compression
|
|
113
|
+
./execute.sh rotate --force --compress
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### monitor
|
|
117
|
+
Monitor logs for errors and performance issues.
|
|
118
|
+
|
|
119
|
+
**Syntax**:
|
|
120
|
+
```bash
|
|
121
|
+
./execute.sh monitor [OPTIONS]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Options**:
|
|
125
|
+
- `--interval SECONDS` - Check interval (default: 60)
|
|
126
|
+
- `--alert-on LEVEL` - Alert levels (default: error,fatal)
|
|
127
|
+
- `--error-threshold COUNT` - Error count threshold
|
|
128
|
+
- `--action ACTION` - Alert action (log, email, webhook)
|
|
129
|
+
- `--performance-check` - Enable performance monitoring
|
|
130
|
+
- `--retention-check` - Enable retention compliance check
|
|
131
|
+
- `--daemon` - Run as daemon
|
|
132
|
+
|
|
133
|
+
**Examples**:
|
|
134
|
+
```bash
|
|
135
|
+
# Monitor with default settings
|
|
136
|
+
./execute.sh monitor
|
|
137
|
+
|
|
138
|
+
# Monitor with custom error threshold
|
|
139
|
+
./execute.sh monitor --error-threshold 20
|
|
140
|
+
|
|
141
|
+
# Monitor as daemon with performance checks
|
|
142
|
+
./execute.sh monitor --daemon --performance-check --retention-check
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### stats
|
|
146
|
+
Generate log statistics and metrics.
|
|
147
|
+
|
|
148
|
+
**Syntax**:
|
|
149
|
+
```bash
|
|
150
|
+
./execute.sh stats [OPTIONS]
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Options**:
|
|
154
|
+
- `--log-dir DIR` - Directory to analyze
|
|
155
|
+
- `--since DURATION` - Time window for analysis
|
|
156
|
+
- `--format FORMAT` - Output format (json, text)
|
|
157
|
+
|
|
158
|
+
**Examples**:
|
|
159
|
+
```bash
|
|
160
|
+
# Get log statistics
|
|
161
|
+
./execute.sh stats
|
|
162
|
+
|
|
163
|
+
# Statistics for last 24 hours
|
|
164
|
+
./execute.sh stats --since 24h --format json
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
#### export
|
|
168
|
+
Export logs in various formats.
|
|
169
|
+
|
|
170
|
+
**Syntax**:
|
|
171
|
+
```bash
|
|
172
|
+
./execute.sh export [OPTIONS]
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
**Options**:
|
|
176
|
+
- `--source SOURCE` - Log source directory
|
|
177
|
+
- `--format FORMAT` - Output format (json, csv, tsv)
|
|
178
|
+
- `--output FILE` - Output file
|
|
179
|
+
- `--filter PATTERN` - Filter logs before export
|
|
180
|
+
|
|
181
|
+
**Examples**:
|
|
182
|
+
```bash
|
|
183
|
+
# Export to CSV
|
|
184
|
+
./execute.sh export --format csv --output logs.csv
|
|
185
|
+
|
|
186
|
+
# Export errors to JSON
|
|
187
|
+
./execute.sh export --filter "level==error" --format json
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Log Format Specification
|
|
191
|
+
|
|
192
|
+
All logs follow the standardized JSON format:
|
|
193
|
+
|
|
194
|
+
```json
|
|
195
|
+
{
|
|
196
|
+
"timestamp": "2025-11-16T03:00:00Z",
|
|
197
|
+
"level": "info",
|
|
198
|
+
"message": "Task completed successfully",
|
|
199
|
+
"correlationId": "task:task-001:agent",
|
|
200
|
+
"source": "cfn-agent-container",
|
|
201
|
+
"context": {
|
|
202
|
+
"agentId": "backend-dev-001",
|
|
203
|
+
"taskId": "task-001",
|
|
204
|
+
"iteration": 1,
|
|
205
|
+
"sprintId": "sprint-4"
|
|
206
|
+
},
|
|
207
|
+
"metadata": {
|
|
208
|
+
"duration": 5000,
|
|
209
|
+
"confidence": 0.92,
|
|
210
|
+
"tags": ["task-execution", "success"]
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Required Fields
|
|
216
|
+
- `timestamp`: ISO 8601 UTC timestamp
|
|
217
|
+
- `level`: debug, info, warn, error, fatal
|
|
218
|
+
- `message`: Human-readable message
|
|
219
|
+
- `source`: Container/service name
|
|
220
|
+
|
|
221
|
+
### Optional Fields
|
|
222
|
+
- `correlationId`: Format: `type:id:agent` (e.g., `task:task-001:agent`)
|
|
223
|
+
- `context`: Additional context (agentId, taskId, iteration, sprintId)
|
|
224
|
+
- `metadata`: Operation-specific metadata (duration, confidence, tags)
|
|
225
|
+
- `error`: Error details (name, message, stack)
|
|
226
|
+
|
|
227
|
+
## Search Patterns
|
|
228
|
+
|
|
229
|
+
### Using jq
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Find all error logs
|
|
233
|
+
jq 'select(.level=="error")' logs/*.json
|
|
234
|
+
|
|
235
|
+
# Filter by correlation ID
|
|
236
|
+
jq 'select(.correlationId=="task-001:task:agent")' logs/*.json
|
|
237
|
+
|
|
238
|
+
# Find logs by agent
|
|
239
|
+
jq 'select(.context.agentId=="backend-dev-001")' logs/*.json
|
|
240
|
+
|
|
241
|
+
# Count errors by source
|
|
242
|
+
jq 'select(.level=="error") | .source' logs/*.json | sort | uniq -c
|
|
243
|
+
|
|
244
|
+
# Complex query: errors in last hour
|
|
245
|
+
jq 'select(.level=="error" and .timestamp > "'$(date -u -d '1 hour ago' +'%Y-%m-%dT%H:%M:%SZ')'")' logs/*.json
|
|
246
|
+
|
|
247
|
+
# Export to CSV
|
|
248
|
+
jq -r '[.timestamp, .level, .message, .source] | @csv' logs/*.json
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Using grep and awk
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Find error logs
|
|
255
|
+
grep '"level":"error"' logs/*.json
|
|
256
|
+
|
|
257
|
+
# Find logs by task ID
|
|
258
|
+
grep 'task-001' logs/*.json | jq '.'
|
|
259
|
+
|
|
260
|
+
# Count log levels
|
|
261
|
+
grep -o '"level":"[^"]*"' logs/*.json | sort | uniq -c
|
|
262
|
+
|
|
263
|
+
# Find slow operations (duration > 5000ms)
|
|
264
|
+
jq 'select(.metadata.duration > 5000)' logs/*.json
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Troubleshooting
|
|
268
|
+
|
|
269
|
+
### No logs found
|
|
270
|
+
- Check log directory path: `/var/log/cfn/`
|
|
271
|
+
- Verify log files exist: `ls -la /var/log/cfn/`
|
|
272
|
+
- Check permissions: `stat /var/log/cfn/`
|
|
273
|
+
|
|
274
|
+
### JSON parsing errors
|
|
275
|
+
- Validate log format: `./.claude/skills/cfn-log-operations/execute.sh search --validate`
|
|
276
|
+
- Check file encoding: `file logs/*.log`
|
|
277
|
+
- Review recent logs: `tail -50 logs/*.log`
|
|
278
|
+
|
|
279
|
+
### Performance issues
|
|
280
|
+
- Reduce search scope: use `--since` flag
|
|
281
|
+
- Limit results: use `--limit` flag
|
|
282
|
+
- Check disk space: `df /var/log/cfn`
|
|
283
|
+
|
|
284
|
+
### Retention not working
|
|
285
|
+
- Verify logrotate config: `/etc/logrotate.d/cfn-logs`
|
|
286
|
+
- Test logrotate: `logrotate -d /etc/logrotate.d/cfn-logs`
|
|
287
|
+
- Check permissions: files should be readable by logrotate
|
|
288
|
+
|
|
289
|
+
## Integration
|
|
290
|
+
|
|
291
|
+
This skill integrates with:
|
|
292
|
+
- Docker logging driver (json-file)
|
|
293
|
+
- Logrotate for log rotation and retention
|
|
294
|
+
- Application logging utilities (`src/lib/logging.ts`)
|
|
295
|
+
- Monitoring systems (custom alerting)
|
|
296
|
+
|
|
297
|
+
## Performance Targets
|
|
298
|
+
|
|
299
|
+
- Search operation: <500ms for 1GB of logs
|
|
300
|
+
- Aggregation: <5% CPU overhead
|
|
301
|
+
- Monitoring: <1% memory overhead when running as daemon
|
|
302
|
+
- 90%+ structured JSON logs (10% unstructured OK)
|
|
303
|
+
|
|
304
|
+
## Related Tasks
|
|
305
|
+
|
|
306
|
+
- **Task 0.5**: Logging utilities (`src/lib/logging.ts`)
|
|
307
|
+
- **Task 4.1**: Integration infrastructure
|
|
308
|
+
- **Task 4.4**: Distributed logging standardization
|