claude-flow-novice 2.15.2 → 2.15.3

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.
Files changed (98) hide show
  1. package/.claude/hooks/cfn-BACKUP_USAGE.md +243 -243
  2. package/.claude/hooks/cfn-invoke-security-validation.sh +69 -69
  3. package/.claude/hooks/cfn-post-edit-cfn-retrospective.sh +78 -78
  4. package/.claude/hooks/cfn-post-edit.config.json +44 -44
  5. package/.claude/skills/agent-lifecycle/SKILL.md +60 -0
  6. package/.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh +573 -0
  7. package/.claude/skills/agent-lifecycle/simple-audit.sh +31 -0
  8. package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
  9. package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
  10. package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
  11. package/.claude/skills/cfn-redis-coordination/get-context.sh +112 -112
  12. package/.claude/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
  13. package/.claude/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
  14. package/.claude/skills/cfn-transparency-middleware/test-integration.sh +161 -161
  15. package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
  16. package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +92 -92
  17. package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
  18. package/claude-assets/hooks/cfn-BACKUP_USAGE.md +243 -243
  19. package/claude-assets/hooks/cfn-invoke-security-validation.sh +69 -69
  20. package/claude-assets/hooks/cfn-post-edit-cfn-retrospective.sh +78 -78
  21. package/claude-assets/hooks/cfn-post-edit.config.json +44 -44
  22. package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +19 -19
  23. package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +19 -19
  24. package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +572 -572
  25. package/claude-assets/skills/agent-lifecycle/simple-audit.sh +30 -30
  26. package/claude-assets/skills/cfn-automatic-memory-persistence/persist-agent-output.sh +48 -48
  27. package/claude-assets/skills/cfn-automatic-memory-persistence/query-agent-history.sh +34 -34
  28. package/claude-assets/skills/cfn-deliverable-validation/confidence-calculator.sh +261 -261
  29. package/claude-assets/skills/cfn-expert-update/update-expert.sh +345 -345
  30. package/claude-assets/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
  31. package/claude-assets/skills/cfn-intervention-detector/detect-intervention.sh +110 -110
  32. package/claude-assets/skills/cfn-intervention-orchestrator/execute-intervention.sh +58 -58
  33. package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
  34. package/claude-assets/skills/cfn-loop2-output-processing/process-validator-output.sh +275 -275
  35. package/claude-assets/skills/cfn-memory-management/check-memory.sh +159 -159
  36. package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +196 -196
  37. package/claude-assets/skills/cfn-node-heap-sizer/task-mode-heap-limiter.sh +325 -325
  38. package/claude-assets/skills/cfn-playbook-auto-update/auto-update-playbook.sh +85 -85
  39. package/claude-assets/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
  40. package/claude-assets/skills/cfn-redis-coordination/get-context.sh +112 -112
  41. package/claude-assets/skills/cfn-scope-simplifier/simplify-scope.sh +67 -67
  42. package/claude-assets/skills/cfn-specialist-injection/recommend-specialist.sh +56 -56
  43. package/claude-assets/skills/cfn-standardized-error-handling/capture-agent-error.sh +86 -86
  44. package/claude-assets/skills/cfn-standardized-error-handling/test-error-handling.sh +165 -165
  45. package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +264 -264
  46. package/claude-assets/skills/cfn-task-decomposition/task-decomposer.sh +278 -278
  47. package/claude-assets/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
  48. package/claude-assets/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
  49. package/claude-assets/skills/cfn-transparency-middleware/test-integration.sh +161 -161
  50. package/claude-assets/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
  51. package/claude-assets/skills/cfn-transparency-middleware/tests/input-validation.sh +92 -92
  52. package/claude-assets/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
  53. package/claude-assets/skills/docker-build/SKILL.md +96 -203
  54. package/claude-assets/skills/docker-build/build.sh +73 -73
  55. package/claude-assets/skills/integration/agent-handoff.sh +494 -0
  56. package/claude-assets/skills/integration/file-operations.sh +414 -0
  57. package/claude-assets/skills/workflow-codification/APPROVAL_WORKFLOW.md +806 -0
  58. package/claude-assets/skills/workflow-codification/COST_TRACKING.md +637 -0
  59. package/claude-assets/skills/workflow-codification/EDGE_CASE_TRACKING.md +404 -0
  60. package/claude-assets/skills/workflow-codification/README_PHASE4.md +457 -0
  61. package/claude-assets/skills/workflow-codification/SKILL.md +110 -0
  62. package/claude-assets/skills/workflow-codification/analyze-patterns.sh +899 -0
  63. package/claude-assets/skills/workflow-codification/approval-workflow.sh +514 -0
  64. package/claude-assets/skills/workflow-codification/generate-skill-update.sh +525 -0
  65. package/claude-assets/skills/workflow-codification/review-skill.sh +643 -0
  66. package/claude-assets/skills/workflow-codification/templates/email-notification.txt +114 -0
  67. package/claude-assets/skills/workflow-codification/templates/slack-notification.md +85 -0
  68. package/claude-assets/skills/workflow-codification/test-integration.sh +281 -0
  69. package/claude-assets/skills/workflow-codification/track-cost-savings.sh +445 -0
  70. package/claude-assets/skills/workflow-codification/track-edge-case.sh +323 -0
  71. package/dist/cli/config-manager.js +91 -109
  72. package/dist/cli/config-manager.js.map +1 -1
  73. package/dist/integration/DatabaseHandoff.js +507 -0
  74. package/dist/integration/DatabaseHandoff.js.map +1 -0
  75. package/dist/integration/StandardAdapter.js +291 -0
  76. package/dist/integration/StandardAdapter.js.map +1 -0
  77. package/dist/lib/agent-output-parser.js +518 -0
  78. package/dist/lib/agent-output-parser.js.map +1 -0
  79. package/dist/lib/agent-output-validator.js +950 -0
  80. package/dist/lib/agent-output-validator.js.map +1 -0
  81. package/dist/lib/artifact-registry.js +443 -0
  82. package/dist/lib/artifact-registry.js.map +1 -0
  83. package/dist/lib/config-validator.js +687 -0
  84. package/dist/lib/config-validator.js.map +1 -0
  85. package/dist/types/agent-output.js +44 -0
  86. package/dist/types/agent-output.js.map +1 -0
  87. package/dist/types/config.js +28 -0
  88. package/dist/types/config.js.map +1 -0
  89. package/package.json +2 -1
  90. package/scripts/artifact-cleanup.sh +392 -0
  91. package/scripts/deploy-production.sh +355 -355
  92. package/scripts/docker-playwright-fix.sh +311 -311
  93. package/scripts/docker-rebuild-all-agents.sh +127 -127
  94. package/scripts/memory-leak-prevention.sh +305 -305
  95. package/scripts/migrate-artifacts.sh +563 -0
  96. package/scripts/migrate-yaml-to-json.sh +465 -0
  97. package/scripts/run-marketing-tests.sh +42 -42
  98. package/scripts/update_paths.sh +46 -46
@@ -1,166 +1,166 @@
1
- #!/bin/bash
2
-
3
- # Enhanced Test Script for Standardized Error Handling
4
- # Version 2.0 - Comprehensive Error Scenario Testing
5
-
6
- # Directories and Script Paths
7
- SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8
- ERROR_CAPTURE_SCRIPT="${SCRIPT_DIR}/capture-agent-error.sh"
9
- RETRY_SCRIPT="${SCRIPT_DIR}/should-retry.sh"
10
-
11
- # Colored Output
12
- GREEN='\033[0;32m'
13
- RED='\033[0;31m'
14
- NC='\033[0m' # No Color
15
-
16
- # Test Utility Functions
17
- assert_equals() {
18
- local expected="$1"
19
- local actual="$2"
20
- local test_name="$3"
21
-
22
- if [ "$actual" = "$expected" ]; then
23
- echo -e "${GREEN}✅ $test_name passed${NC}"
24
- return 0
25
- else
26
- echo -e "${RED}❌ $test_name failed${NC}"
27
- echo " Expected: $expected"
28
- echo " Actual: $actual"
29
- return 1
30
- }
31
- }
32
-
33
- # Error Categorization Tests
34
- test_timeout_error_categorization() {
35
- local task_id="task-timeout-001"
36
- local agent_id="agent-timeout"
37
- local error_output="Operation timed out after 120 seconds"
38
-
39
- local result=$(bash "$ERROR_CAPTURE_SCRIPT" "backend-dev" "$task_id" "$agent_id" 124 "$error_output")
40
- assert_equals "TIMEOUT" "$result" "Timeout Error Categorization"
41
-
42
- # Check retry recommendation
43
- local retry_result=$(bash "$RETRY_SCRIPT" "TIMEOUT" "$task_id")
44
- assert_equals "RETRY_WITH_EXTENDED_TIMEOUT" "$retry_result" "Timeout Retry Recommendation"
45
- }
46
-
47
- test_crash_error_categorization() {
48
- local task_id="task-crash-002"
49
- local agent_id="agent-crash"
50
- local error_output="Segmentation fault in module X"
51
-
52
- local result=$(bash "$ERROR_CAPTURE_SCRIPT" "devops" "$task_id" "$agent_id" 139 "$error_output")
53
- assert_equals "CRASH" "$result" "Crash Error Categorization"
54
-
55
- # Check retry recommendation
56
- local retry_result=$(bash "$RETRY_SCRIPT" "CRASH" "$task_id")
57
- assert_equals "RETRY_WITH_ISOLATION" "$retry_result" "Crash Retry Recommendation"
58
- }
59
-
60
- test_dependency_failure_categorization() {
61
- local task_id="task-dep-003"
62
- local agent_id="agent-dep"
63
- local error_output="MODULE_NOT_FOUND: react-dom/server"
64
-
65
- local result=$(bash "$ERROR_CAPTURE_SCRIPT" "frontend-dev" "$task_id" "$agent_id" 1 "$error_output")
66
- assert_equals "DEPENDENCY_FAILURE" "$result" "Dependency Failure Categorization"
67
-
68
- # Check retry recommendation
69
- local retry_result=$(bash "$RETRY_SCRIPT" "DEPENDENCY_FAILURE" "$task_id")
70
- assert_equals "RETRY_WITH_DEPENDENCY_RESET" "$retry_result" "Dependency Failure Retry Recommendation"
71
- }
72
-
73
- test_no_deliverables_categorization() {
74
- local task_id="task-nodeliver-004"
75
- local agent_id="agent-nodeliver"
76
- local error_output=""
77
-
78
- local result=$(bash "$ERROR_CAPTURE_SCRIPT" "researcher" "$task_id" "$agent_id" 0 "$error_output")
79
- assert_equals "NO_DELIVERABLES" "$result" "No Deliverables Categorization"
80
-
81
- # Check retry recommendation
82
- local retry_result=$(bash "$RETRY_SCRIPT" "NO_DELIVERABLES" "$task_id")
83
- assert_equals "RETRY_WITH_CLARIFICATION" "$retry_result" "No Deliverables Retry Recommendation"
84
- }
85
-
86
- test_invalid_output_categorization() {
87
- local task_id="task-invalid-005"
88
- local agent_id="agent-invalid"
89
- local error_output="Unparseable or malformed output"
90
-
91
- local result=$(bash "$ERROR_CAPTURE_SCRIPT" "backend-dev" "$task_id" "$agent_id" 1 "$error_output")
92
- assert_equals "INVALID_OUTPUT" "$result" "Invalid Output Categorization"
93
-
94
- # Check retry recommendation
95
- local retry_result=$(bash "$RETRY_SCRIPT" "INVALID_OUTPUT" "$task_id")
96
- assert_equals "RETRY_WITH_VALIDATION" "$retry_result" "Invalid Output Retry Recommendation"
97
- }
98
-
99
- # JSON Error Report Validation Test
100
- test_json_error_report() {
101
- local task_id="task-json-006"
102
- local agent_id="agent-json"
103
- local error_output="Complex error scenario with multiple components"
104
-
105
- local result=$(bash "$ERROR_CAPTURE_SCRIPT" "devops" "$task_id" "$agent_id" 2 "$error_output")
106
- local json_report=$(bash "$ERROR_CAPTURE_SCRIPT" "devops" "$task_id" "$agent_id" 2 "$error_output" --json)
107
-
108
- # Validate JSON structure (requires jq)
109
- local json_valid=$(echo "$json_report" | jq empty 2>/dev/null && echo "valid" || echo "invalid")
110
- assert_equals "valid" "$json_valid" "JSON Error Report Validation"
111
-
112
- # Additional JSON structure checks could be added here
113
- }
114
-
115
- # Performance and Edge Case Test
116
- test_error_handling_performance() {
117
- local start_time=$(date +%s.%N)
118
-
119
- # Run multiple error scenarios quickly
120
- for _ in {1..10}; do
121
- bash "$ERROR_CAPTURE_SCRIPT" "backend-dev" "perf-task-$RANDOM" "agent-perf" 1 "Test performance"
122
- done
123
-
124
- local end_time=$(date +%s.%N)
125
- local duration=$(echo "$end_time - $start_time" | bc)
126
-
127
- # Check if total execution time is reasonable (under 2 seconds for 10 runs)
128
- local max_duration=2.0
129
- local passed=$(echo "$duration < $max_duration" | bc)
130
-
131
- assert_equals "1" "$passed" "Error Handling Performance Test"
132
- }
133
-
134
- # Main Test Runner
135
- run_error_handling_test_suite() {
136
- echo "Starting Comprehensive Error Handling Test Suite..."
137
-
138
- # Track test results
139
- local total_tests=6
140
- local passed_tests=0
141
-
142
- # Run each test and count successes
143
- test_timeout_error_categorization && ((passed_tests++))
144
- test_crash_error_categorization && ((passed_tests++))
145
- test_dependency_failure_categorization && ((passed_tests++))
146
- test_no_deliverables_categorization && ((passed_tests++))
147
- test_invalid_output_categorization && ((passed_tests++))
148
- test_json_error_report && ((passed_tests++))
149
- test_error_handling_performance && ((passed_tests++))
150
-
151
- local confidence=$(echo "scale=2; ($passed_tests / $total_tests)" | bc)
152
-
153
- echo -e "\n${GREEN}Test Suite Summary:${NC}"
154
- echo "Total Tests: $total_tests"
155
- echo "Passed Tests: $passed_tests"
156
- echo "Confidence: $confidence"
157
-
158
- # Return non-zero if not all tests pass
159
- [ "$passed_tests" -eq "$total_tests" ]
160
- }
161
-
162
- # Execute the test suite
163
- run_error_handling_test_suite
164
- exit_code=$?
165
-
1
+ #!/bin/bash
2
+
3
+ # Enhanced Test Script for Standardized Error Handling
4
+ # Version 2.0 - Comprehensive Error Scenario Testing
5
+
6
+ # Directories and Script Paths
7
+ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
8
+ ERROR_CAPTURE_SCRIPT="${SCRIPT_DIR}/capture-agent-error.sh"
9
+ RETRY_SCRIPT="${SCRIPT_DIR}/should-retry.sh"
10
+
11
+ # Colored Output
12
+ GREEN='\033[0;32m'
13
+ RED='\033[0;31m'
14
+ NC='\033[0m' # No Color
15
+
16
+ # Test Utility Functions
17
+ assert_equals() {
18
+ local expected="$1"
19
+ local actual="$2"
20
+ local test_name="$3"
21
+
22
+ if [ "$actual" = "$expected" ]; then
23
+ echo -e "${GREEN}✅ $test_name passed${NC}"
24
+ return 0
25
+ else
26
+ echo -e "${RED}❌ $test_name failed${NC}"
27
+ echo " Expected: $expected"
28
+ echo " Actual: $actual"
29
+ return 1
30
+ }
31
+ }
32
+
33
+ # Error Categorization Tests
34
+ test_timeout_error_categorization() {
35
+ local task_id="task-timeout-001"
36
+ local agent_id="agent-timeout"
37
+ local error_output="Operation timed out after 120 seconds"
38
+
39
+ local result=$(bash "$ERROR_CAPTURE_SCRIPT" "backend-dev" "$task_id" "$agent_id" 124 "$error_output")
40
+ assert_equals "TIMEOUT" "$result" "Timeout Error Categorization"
41
+
42
+ # Check retry recommendation
43
+ local retry_result=$(bash "$RETRY_SCRIPT" "TIMEOUT" "$task_id")
44
+ assert_equals "RETRY_WITH_EXTENDED_TIMEOUT" "$retry_result" "Timeout Retry Recommendation"
45
+ }
46
+
47
+ test_crash_error_categorization() {
48
+ local task_id="task-crash-002"
49
+ local agent_id="agent-crash"
50
+ local error_output="Segmentation fault in module X"
51
+
52
+ local result=$(bash "$ERROR_CAPTURE_SCRIPT" "devops" "$task_id" "$agent_id" 139 "$error_output")
53
+ assert_equals "CRASH" "$result" "Crash Error Categorization"
54
+
55
+ # Check retry recommendation
56
+ local retry_result=$(bash "$RETRY_SCRIPT" "CRASH" "$task_id")
57
+ assert_equals "RETRY_WITH_ISOLATION" "$retry_result" "Crash Retry Recommendation"
58
+ }
59
+
60
+ test_dependency_failure_categorization() {
61
+ local task_id="task-dep-003"
62
+ local agent_id="agent-dep"
63
+ local error_output="MODULE_NOT_FOUND: react-dom/server"
64
+
65
+ local result=$(bash "$ERROR_CAPTURE_SCRIPT" "frontend-dev" "$task_id" "$agent_id" 1 "$error_output")
66
+ assert_equals "DEPENDENCY_FAILURE" "$result" "Dependency Failure Categorization"
67
+
68
+ # Check retry recommendation
69
+ local retry_result=$(bash "$RETRY_SCRIPT" "DEPENDENCY_FAILURE" "$task_id")
70
+ assert_equals "RETRY_WITH_DEPENDENCY_RESET" "$retry_result" "Dependency Failure Retry Recommendation"
71
+ }
72
+
73
+ test_no_deliverables_categorization() {
74
+ local task_id="task-nodeliver-004"
75
+ local agent_id="agent-nodeliver"
76
+ local error_output=""
77
+
78
+ local result=$(bash "$ERROR_CAPTURE_SCRIPT" "researcher" "$task_id" "$agent_id" 0 "$error_output")
79
+ assert_equals "NO_DELIVERABLES" "$result" "No Deliverables Categorization"
80
+
81
+ # Check retry recommendation
82
+ local retry_result=$(bash "$RETRY_SCRIPT" "NO_DELIVERABLES" "$task_id")
83
+ assert_equals "RETRY_WITH_CLARIFICATION" "$retry_result" "No Deliverables Retry Recommendation"
84
+ }
85
+
86
+ test_invalid_output_categorization() {
87
+ local task_id="task-invalid-005"
88
+ local agent_id="agent-invalid"
89
+ local error_output="Unparseable or malformed output"
90
+
91
+ local result=$(bash "$ERROR_CAPTURE_SCRIPT" "backend-dev" "$task_id" "$agent_id" 1 "$error_output")
92
+ assert_equals "INVALID_OUTPUT" "$result" "Invalid Output Categorization"
93
+
94
+ # Check retry recommendation
95
+ local retry_result=$(bash "$RETRY_SCRIPT" "INVALID_OUTPUT" "$task_id")
96
+ assert_equals "RETRY_WITH_VALIDATION" "$retry_result" "Invalid Output Retry Recommendation"
97
+ }
98
+
99
+ # JSON Error Report Validation Test
100
+ test_json_error_report() {
101
+ local task_id="task-json-006"
102
+ local agent_id="agent-json"
103
+ local error_output="Complex error scenario with multiple components"
104
+
105
+ local result=$(bash "$ERROR_CAPTURE_SCRIPT" "devops" "$task_id" "$agent_id" 2 "$error_output")
106
+ local json_report=$(bash "$ERROR_CAPTURE_SCRIPT" "devops" "$task_id" "$agent_id" 2 "$error_output" --json)
107
+
108
+ # Validate JSON structure (requires jq)
109
+ local json_valid=$(echo "$json_report" | jq empty 2>/dev/null && echo "valid" || echo "invalid")
110
+ assert_equals "valid" "$json_valid" "JSON Error Report Validation"
111
+
112
+ # Additional JSON structure checks could be added here
113
+ }
114
+
115
+ # Performance and Edge Case Test
116
+ test_error_handling_performance() {
117
+ local start_time=$(date +%s.%N)
118
+
119
+ # Run multiple error scenarios quickly
120
+ for _ in {1..10}; do
121
+ bash "$ERROR_CAPTURE_SCRIPT" "backend-dev" "perf-task-$RANDOM" "agent-perf" 1 "Test performance"
122
+ done
123
+
124
+ local end_time=$(date +%s.%N)
125
+ local duration=$(echo "$end_time - $start_time" | bc)
126
+
127
+ # Check if total execution time is reasonable (under 2 seconds for 10 runs)
128
+ local max_duration=2.0
129
+ local passed=$(echo "$duration < $max_duration" | bc)
130
+
131
+ assert_equals "1" "$passed" "Error Handling Performance Test"
132
+ }
133
+
134
+ # Main Test Runner
135
+ run_error_handling_test_suite() {
136
+ echo "Starting Comprehensive Error Handling Test Suite..."
137
+
138
+ # Track test results
139
+ local total_tests=6
140
+ local passed_tests=0
141
+
142
+ # Run each test and count successes
143
+ test_timeout_error_categorization && ((passed_tests++))
144
+ test_crash_error_categorization && ((passed_tests++))
145
+ test_dependency_failure_categorization && ((passed_tests++))
146
+ test_no_deliverables_categorization && ((passed_tests++))
147
+ test_invalid_output_categorization && ((passed_tests++))
148
+ test_json_error_report && ((passed_tests++))
149
+ test_error_handling_performance && ((passed_tests++))
150
+
151
+ local confidence=$(echo "scale=2; ($passed_tests / $total_tests)" | bc)
152
+
153
+ echo -e "\n${GREEN}Test Suite Summary:${NC}"
154
+ echo "Total Tests: $total_tests"
155
+ echo "Passed Tests: $passed_tests"
156
+ echo "Confidence: $confidence"
157
+
158
+ # Return non-zero if not all tests pass
159
+ [ "$passed_tests" -eq "$total_tests" ]
160
+ }
161
+
162
+ # Execute the test suite
163
+ run_error_handling_test_suite
164
+ exit_code=$?
165
+
166
166
  exit $exit_code