claude-flow-novice 2.15.1 → 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.
- package/.claude/cfn-extras/agents/google-sheets-specialist.md +614 -0
- package/.claude/commands/cfn/create-handoff.md +224 -0
- package/.claude/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/.claude/hooks/cfn-invoke-security-validation.sh +69 -69
- package/.claude/hooks/cfn-post-edit-cfn-retrospective.sh +78 -78
- package/.claude/hooks/cfn-post-edit.config.json +44 -44
- package/.claude/skills/agent-lifecycle/SKILL.md +60 -0
- package/.claude/skills/agent-lifecycle/execute-lifecycle-hook.sh +573 -0
- package/.claude/skills/agent-lifecycle/simple-audit.sh +31 -0
- package/.claude/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/.claude/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/.claude/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/.claude/skills/cfn-redis-coordination/get-context.sh +112 -112
- package/.claude/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
- package/.claude/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
- package/.claude/skills/cfn-transparency-middleware/test-integration.sh +161 -161
- package/.claude/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
- package/.claude/skills/cfn-transparency-middleware/tests/input-validation.sh +92 -92
- package/.claude/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/claude-assets/agents/cfn-dev-team/coordinators/handoff-coordinator.md +662 -0
- package/claude-assets/agents/cfn-dev-team/dev-ops/docker-specialist.md +29 -0
- package/claude-assets/cfn-extras/agents/google-sheets-specialist.md +614 -0
- package/claude-assets/commands/cfn/create-handoff.md +224 -0
- package/claude-assets/hooks/cfn-BACKUP_USAGE.md +243 -243
- package/claude-assets/hooks/cfn-invoke-security-validation.sh +69 -69
- package/claude-assets/hooks/cfn-post-edit-cfn-retrospective.sh +78 -78
- package/claude-assets/hooks/cfn-post-edit.config.json +44 -44
- package/claude-assets/hooks/cfn-post-execution/memory-cleanup.sh +19 -19
- package/claude-assets/hooks/cfn-pre-execution/memory-check.sh +19 -19
- package/claude-assets/skills/agent-lifecycle/execute-lifecycle-hook.sh +572 -572
- package/claude-assets/skills/agent-lifecycle/simple-audit.sh +30 -30
- package/claude-assets/skills/cfn-automatic-memory-persistence/persist-agent-output.sh +48 -48
- package/claude-assets/skills/cfn-automatic-memory-persistence/query-agent-history.sh +34 -34
- package/claude-assets/skills/cfn-deliverable-validation/confidence-calculator.sh +261 -261
- package/claude-assets/skills/cfn-expert-update/update-expert.sh +345 -345
- package/claude-assets/skills/cfn-hybrid-routing/check-dependencies.sh +51 -51
- package/claude-assets/skills/cfn-intervention-detector/detect-intervention.sh +110 -110
- package/claude-assets/skills/cfn-intervention-orchestrator/execute-intervention.sh +58 -58
- package/claude-assets/skills/cfn-loop-validation/orchestrate-cfn-loop.sh +252 -252
- package/claude-assets/skills/cfn-loop2-output-processing/process-validator-output.sh +275 -275
- package/claude-assets/skills/cfn-memory-management/check-memory.sh +159 -159
- package/claude-assets/skills/cfn-memory-management/cleanup-memory.sh +196 -196
- package/claude-assets/skills/cfn-node-heap-sizer/task-mode-heap-limiter.sh +325 -325
- package/claude-assets/skills/cfn-playbook-auto-update/auto-update-playbook.sh +85 -85
- package/claude-assets/skills/cfn-redis-coordination/agent-recovery.sh +74 -74
- package/claude-assets/skills/cfn-redis-coordination/get-context.sh +112 -112
- package/claude-assets/skills/cfn-scope-simplifier/simplify-scope.sh +67 -67
- package/claude-assets/skills/cfn-specialist-injection/recommend-specialist.sh +56 -56
- package/claude-assets/skills/cfn-standardized-error-handling/capture-agent-error.sh +86 -86
- package/claude-assets/skills/cfn-standardized-error-handling/test-error-handling.sh +165 -165
- package/claude-assets/skills/cfn-task-config-init/initialize-config.sh +264 -264
- package/claude-assets/skills/cfn-task-decomposition/task-decomposer.sh +278 -278
- package/claude-assets/skills/cfn-transparency-middleware/middleware-config.sh +28 -28
- package/claude-assets/skills/cfn-transparency-middleware/performance-benchmark.sh +78 -78
- package/claude-assets/skills/cfn-transparency-middleware/test-integration.sh +161 -161
- package/claude-assets/skills/cfn-transparency-middleware/test-transparency-skill.sh +367 -367
- package/claude-assets/skills/cfn-transparency-middleware/tests/input-validation.sh +92 -92
- package/claude-assets/skills/cfn-transparency-middleware/wrap-agent.sh +131 -131
- package/claude-assets/skills/docker-build/SKILL.md +96 -203
- package/claude-assets/skills/docker-build/build.sh +73 -73
- package/claude-assets/skills/integration/agent-handoff.sh +494 -0
- package/claude-assets/skills/integration/file-operations.sh +414 -0
- package/claude-assets/skills/workflow-codification/APPROVAL_WORKFLOW.md +806 -0
- package/claude-assets/skills/workflow-codification/COST_TRACKING.md +637 -0
- package/claude-assets/skills/workflow-codification/EDGE_CASE_TRACKING.md +404 -0
- package/claude-assets/skills/workflow-codification/README_PHASE4.md +457 -0
- package/claude-assets/skills/workflow-codification/SKILL.md +110 -0
- package/claude-assets/skills/workflow-codification/analyze-patterns.sh +899 -0
- package/claude-assets/skills/workflow-codification/approval-workflow.sh +514 -0
- package/claude-assets/skills/workflow-codification/generate-skill-update.sh +525 -0
- package/claude-assets/skills/workflow-codification/review-skill.sh +643 -0
- package/claude-assets/skills/workflow-codification/templates/email-notification.txt +114 -0
- package/claude-assets/skills/workflow-codification/templates/slack-notification.md +85 -0
- package/claude-assets/skills/workflow-codification/test-integration.sh +281 -0
- package/claude-assets/skills/workflow-codification/track-cost-savings.sh +445 -0
- package/claude-assets/skills/workflow-codification/track-edge-case.sh +323 -0
- package/dist/agents/agent-loader.js +165 -146
- package/dist/agents/agent-loader.js.map +1 -1
- package/dist/cli/config-manager.js +91 -109
- package/dist/cli/config-manager.js.map +1 -1
- package/dist/integration/DatabaseHandoff.js +507 -0
- package/dist/integration/DatabaseHandoff.js.map +1 -0
- package/dist/integration/StandardAdapter.js +291 -0
- package/dist/integration/StandardAdapter.js.map +1 -0
- package/dist/lib/agent-output-parser.js +518 -0
- package/dist/lib/agent-output-parser.js.map +1 -0
- package/dist/lib/agent-output-validator.js +950 -0
- package/dist/lib/agent-output-validator.js.map +1 -0
- package/dist/lib/artifact-registry.js +443 -0
- package/dist/lib/artifact-registry.js.map +1 -0
- package/dist/lib/config-validator.js +687 -0
- package/dist/lib/config-validator.js.map +1 -0
- package/dist/types/agent-output.js +44 -0
- package/dist/types/agent-output.js.map +1 -0
- package/dist/types/config.js +28 -0
- package/dist/types/config.js.map +1 -0
- package/package.json +2 -1
- package/scripts/artifact-cleanup.sh +392 -0
- package/scripts/build-linux.sh +78 -0
- package/scripts/deploy-production.sh +355 -355
- package/scripts/docker-playwright-fix.sh +311 -311
- package/scripts/docker-rebuild-all-agents.sh +127 -127
- package/scripts/memory-leak-prevention.sh +305 -305
- package/scripts/migrate-artifacts.sh +563 -0
- package/scripts/migrate-yaml-to-json.sh +465 -0
- package/scripts/run-marketing-tests.sh +42 -42
- package/scripts/update_paths.sh +46 -46
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# generate-skill-update.sh - Generate skill update proposals from edge cases
|
|
5
|
+
# Creates test cases, proposes logic modifications, updates documentation
|
|
6
|
+
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
DB_PATH="${DB_PATH:-${SCRIPT_DIR}/workflow-codification.db}"
|
|
9
|
+
PROPOSALS_DIR="${PROPOSALS_DIR:-${SCRIPT_DIR}/proposals}"
|
|
10
|
+
|
|
11
|
+
# Initialize proposals directory
|
|
12
|
+
init_proposals_dir() {
|
|
13
|
+
mkdir -p "$PROPOSALS_DIR"
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
# Parse semantic version
|
|
17
|
+
parse_version() {
|
|
18
|
+
local version="$1"
|
|
19
|
+
local part="$2" # major, minor, patch
|
|
20
|
+
|
|
21
|
+
local major minor patch
|
|
22
|
+
IFS='.' read -r major minor patch <<< "$version"
|
|
23
|
+
|
|
24
|
+
case "$part" in
|
|
25
|
+
major) echo "$major" ;;
|
|
26
|
+
minor) echo "$minor" ;;
|
|
27
|
+
patch) echo "$patch" ;;
|
|
28
|
+
*) echo "0" ;;
|
|
29
|
+
esac
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# Increment semantic version
|
|
33
|
+
increment_version() {
|
|
34
|
+
local version="$1"
|
|
35
|
+
local increment_type="${2:-patch}" # major, minor, patch
|
|
36
|
+
|
|
37
|
+
local major minor patch
|
|
38
|
+
major=$(parse_version "$version" "major")
|
|
39
|
+
minor=$(parse_version "$version" "minor")
|
|
40
|
+
patch=$(parse_version "$version" "patch")
|
|
41
|
+
|
|
42
|
+
case "$increment_type" in
|
|
43
|
+
major)
|
|
44
|
+
echo "$((major + 1)).0.0"
|
|
45
|
+
;;
|
|
46
|
+
minor)
|
|
47
|
+
echo "${major}.$((minor + 1)).0"
|
|
48
|
+
;;
|
|
49
|
+
patch)
|
|
50
|
+
echo "${major}.${minor}.$((patch + 1))"
|
|
51
|
+
;;
|
|
52
|
+
*)
|
|
53
|
+
echo "$version"
|
|
54
|
+
;;
|
|
55
|
+
esac
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
# Get edge case details
|
|
59
|
+
get_edge_case() {
|
|
60
|
+
local edge_case_hash="$1"
|
|
61
|
+
|
|
62
|
+
sqlite3 -json "$DB_PATH" <<EOF
|
|
63
|
+
SELECT * FROM edge_cases WHERE edge_case_hash = '$edge_case_hash';
|
|
64
|
+
EOF
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
# Generate test case
|
|
68
|
+
generate_test_case() {
|
|
69
|
+
local skill_name="$1"
|
|
70
|
+
local edge_case_hash="$2"
|
|
71
|
+
local input_params="$3"
|
|
72
|
+
local expected_output="$4"
|
|
73
|
+
local actual_output="$5"
|
|
74
|
+
local error_message="$6"
|
|
75
|
+
|
|
76
|
+
cat <<TESTCASE
|
|
77
|
+
# Test Case: Edge Case $edge_case_hash
|
|
78
|
+
|
|
79
|
+
## Description
|
|
80
|
+
Regression test for edge case identified in production execution.
|
|
81
|
+
|
|
82
|
+
## Input Parameters
|
|
83
|
+
\`\`\`
|
|
84
|
+
$input_params
|
|
85
|
+
\`\`\`
|
|
86
|
+
|
|
87
|
+
## Expected Output
|
|
88
|
+
\`\`\`
|
|
89
|
+
$expected_output
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
## Actual Output (Failure)
|
|
93
|
+
\`\`\`
|
|
94
|
+
$actual_output
|
|
95
|
+
\`\`\`
|
|
96
|
+
|
|
97
|
+
## Error Message
|
|
98
|
+
\`\`\`
|
|
99
|
+
$error_message
|
|
100
|
+
\`\`\`
|
|
101
|
+
|
|
102
|
+
## Test Implementation
|
|
103
|
+
|
|
104
|
+
\`\`\`bash
|
|
105
|
+
#!/usr/bin/env bash
|
|
106
|
+
set -euo pipefail
|
|
107
|
+
|
|
108
|
+
# Test: $skill_name - Edge Case $edge_case_hash
|
|
109
|
+
|
|
110
|
+
SCRIPT_DIR="\$(cd "\$(dirname "\${BASH_SOURCE[0]}")" && pwd)"
|
|
111
|
+
SKILL_PATH="\${SCRIPT_DIR}/../${skill_name}.sh"
|
|
112
|
+
|
|
113
|
+
# Execute skill with edge case parameters
|
|
114
|
+
output=\$("\$SKILL_PATH" $input_params 2>&1) || exit_code=\$?
|
|
115
|
+
|
|
116
|
+
# Verify expected behavior
|
|
117
|
+
if [[ \$exit_code -eq 0 ]]; then
|
|
118
|
+
if [[ "\$output" == "$expected_output" ]]; then
|
|
119
|
+
echo "PASS: Edge case handled correctly"
|
|
120
|
+
exit 0
|
|
121
|
+
else
|
|
122
|
+
echo "FAIL: Output mismatch"
|
|
123
|
+
echo "Expected: $expected_output"
|
|
124
|
+
echo "Actual: \$output"
|
|
125
|
+
exit 1
|
|
126
|
+
fi
|
|
127
|
+
else
|
|
128
|
+
echo "FAIL: Unexpected exit code \$exit_code"
|
|
129
|
+
exit 1
|
|
130
|
+
fi
|
|
131
|
+
\`\`\`
|
|
132
|
+
|
|
133
|
+
## Validation Criteria
|
|
134
|
+
- Exit code: 0 (success)
|
|
135
|
+
- Output matches expected value
|
|
136
|
+
- No error messages
|
|
137
|
+
- Execution time < 1000ms
|
|
138
|
+
TESTCASE
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
# Analyze edge case pattern
|
|
142
|
+
analyze_edge_case_pattern() {
|
|
143
|
+
local skill_name="$1"
|
|
144
|
+
local exit_code="$2"
|
|
145
|
+
local input_params="$3"
|
|
146
|
+
local error_message="$4"
|
|
147
|
+
|
|
148
|
+
local pattern_analysis=""
|
|
149
|
+
|
|
150
|
+
# Pattern detection logic
|
|
151
|
+
if [[ "$error_message" =~ "timeout" ]]; then
|
|
152
|
+
pattern_analysis="Timeout issue detected. Consider increasing timeout threshold or implementing retry logic."
|
|
153
|
+
elif [[ "$error_message" =~ "connection" ]]; then
|
|
154
|
+
pattern_analysis="Connection failure detected. Implement connection retry with exponential backoff."
|
|
155
|
+
elif [[ "$error_message" =~ "not found" ]]; then
|
|
156
|
+
pattern_analysis="Resource not found. Add existence check before operation."
|
|
157
|
+
elif [[ "$error_message" =~ "permission" ]]; then
|
|
158
|
+
pattern_analysis="Permission error. Validate permissions before execution or provide clear error message."
|
|
159
|
+
elif [[ "$exit_code" -eq 127 ]]; then
|
|
160
|
+
pattern_analysis="Command not found. Add dependency validation at script initialization."
|
|
161
|
+
elif [[ "$exit_code" -eq 1 ]]; then
|
|
162
|
+
pattern_analysis="General failure. Review error handling and add specific error messages."
|
|
163
|
+
else
|
|
164
|
+
pattern_analysis="Unknown pattern. Manual review required."
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
echo "$pattern_analysis"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
# Generate logic modification proposal
|
|
171
|
+
generate_logic_proposal() {
|
|
172
|
+
local skill_name="$1"
|
|
173
|
+
local pattern_analysis="$2"
|
|
174
|
+
local input_params="$3"
|
|
175
|
+
local error_message="$4"
|
|
176
|
+
|
|
177
|
+
cat <<PROPOSAL
|
|
178
|
+
# Logic Modification Proposal
|
|
179
|
+
|
|
180
|
+
## Analysis
|
|
181
|
+
$pattern_analysis
|
|
182
|
+
|
|
183
|
+
## Proposed Changes
|
|
184
|
+
|
|
185
|
+
### 1. Input Validation Enhancement
|
|
186
|
+
\`\`\`bash
|
|
187
|
+
# Add parameter validation
|
|
188
|
+
validate_input() {
|
|
189
|
+
local params=\$1
|
|
190
|
+
|
|
191
|
+
# Extract and validate parameters
|
|
192
|
+
# Example: Check for required fields, type validation, range checks
|
|
193
|
+
|
|
194
|
+
if [[ ! \$params =~ valid_pattern ]]; then
|
|
195
|
+
echo "Error: Invalid input parameters" >&2
|
|
196
|
+
return 1
|
|
197
|
+
fi
|
|
198
|
+
|
|
199
|
+
return 0
|
|
200
|
+
}
|
|
201
|
+
\`\`\`
|
|
202
|
+
|
|
203
|
+
### 2. Error Handling Improvement
|
|
204
|
+
\`\`\`bash
|
|
205
|
+
# Enhanced error handling
|
|
206
|
+
execute_with_retry() {
|
|
207
|
+
local max_retries=3
|
|
208
|
+
local retry_delay=2
|
|
209
|
+
local attempt=1
|
|
210
|
+
|
|
211
|
+
while [[ \$attempt -le \$max_retries ]]; do
|
|
212
|
+
if command_that_might_fail; then
|
|
213
|
+
return 0
|
|
214
|
+
else
|
|
215
|
+
echo "Attempt \$attempt failed, retrying in \${retry_delay}s..." >&2
|
|
216
|
+
sleep \$retry_delay
|
|
217
|
+
((attempt++))
|
|
218
|
+
fi
|
|
219
|
+
done
|
|
220
|
+
|
|
221
|
+
echo "Error: Maximum retries exceeded" >&2
|
|
222
|
+
return 1
|
|
223
|
+
}
|
|
224
|
+
\`\`\`
|
|
225
|
+
|
|
226
|
+
### 3. Edge Case Handling
|
|
227
|
+
\`\`\`bash
|
|
228
|
+
# Specific handling for edge case
|
|
229
|
+
handle_edge_case() {
|
|
230
|
+
local input=\$1
|
|
231
|
+
|
|
232
|
+
# Check for edge case condition
|
|
233
|
+
if [[ condition_that_triggered_edge_case ]]; then
|
|
234
|
+
# Apply specific handling logic
|
|
235
|
+
echo "Edge case detected, applying special handling" >&2
|
|
236
|
+
|
|
237
|
+
# Execute alternative logic path
|
|
238
|
+
alternative_execution_path
|
|
239
|
+
|
|
240
|
+
return \$?
|
|
241
|
+
fi
|
|
242
|
+
|
|
243
|
+
# Normal execution path
|
|
244
|
+
return 0
|
|
245
|
+
}
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
248
|
+
## Implementation Priority
|
|
249
|
+
1. High: Input validation (prevents invalid state)
|
|
250
|
+
2. Medium: Error handling (improves resilience)
|
|
251
|
+
3. Low: Edge case handling (addresses specific scenario)
|
|
252
|
+
|
|
253
|
+
## Backward Compatibility
|
|
254
|
+
- All changes maintain existing API contract
|
|
255
|
+
- New parameters are optional with sensible defaults
|
|
256
|
+
- Error messages provide clear migration guidance
|
|
257
|
+
PROPOSAL
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
# Generate documentation update
|
|
261
|
+
generate_documentation_update() {
|
|
262
|
+
local skill_name="$1"
|
|
263
|
+
local old_version="$2"
|
|
264
|
+
local new_version="$3"
|
|
265
|
+
local edge_case_hash="$4"
|
|
266
|
+
|
|
267
|
+
cat <<DOCS
|
|
268
|
+
# Documentation Update: $skill_name v$new_version
|
|
269
|
+
|
|
270
|
+
## Changelog
|
|
271
|
+
|
|
272
|
+
### Version $new_version ($(date +%Y-%m-%d))
|
|
273
|
+
|
|
274
|
+
**Fixed:**
|
|
275
|
+
- Resolved edge case $edge_case_hash
|
|
276
|
+
- Enhanced input validation
|
|
277
|
+
- Improved error handling and messaging
|
|
278
|
+
|
|
279
|
+
**Changed:**
|
|
280
|
+
- Updated parameter validation logic
|
|
281
|
+
- Added retry mechanism for transient failures
|
|
282
|
+
|
|
283
|
+
**Added:**
|
|
284
|
+
- New edge case handling for specific input patterns
|
|
285
|
+
- Comprehensive test coverage for edge cases
|
|
286
|
+
|
|
287
|
+
## Migration Guide
|
|
288
|
+
|
|
289
|
+
### Upgrading from v$old_version to v$new_version
|
|
290
|
+
|
|
291
|
+
No breaking changes. This is a backward-compatible patch release.
|
|
292
|
+
|
|
293
|
+
**Recommended Actions:**
|
|
294
|
+
1. Update skill reference to v$new_version
|
|
295
|
+
2. Review new error messages in integration code
|
|
296
|
+
3. Validate that existing parameters still work as expected
|
|
297
|
+
|
|
298
|
+
**New Features:**
|
|
299
|
+
- Enhanced error messages provide more context
|
|
300
|
+
- Automatic retry for transient failures (configurable)
|
|
301
|
+
- Stricter input validation (prevents invalid states)
|
|
302
|
+
|
|
303
|
+
## Updated Examples
|
|
304
|
+
|
|
305
|
+
\`\`\`bash
|
|
306
|
+
# Example: Basic usage (unchanged)
|
|
307
|
+
$skill_name.sh --param1 value1 --param2 value2
|
|
308
|
+
|
|
309
|
+
# Example: New retry behavior (automatic)
|
|
310
|
+
# Transient failures now retry up to 3 times with exponential backoff
|
|
311
|
+
|
|
312
|
+
# Example: Enhanced error messages
|
|
313
|
+
# Old: "Error: Operation failed"
|
|
314
|
+
# New: "Error: Connection timeout after 30s (attempt 3/3)"
|
|
315
|
+
\`\`\`
|
|
316
|
+
|
|
317
|
+
## Testing Recommendations
|
|
318
|
+
|
|
319
|
+
1. Regression testing: Verify existing workflows still function
|
|
320
|
+
2. Edge case testing: Test with previously failing inputs
|
|
321
|
+
3. Performance testing: Validate retry logic doesn't impact latency
|
|
322
|
+
DOCS
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
# Generate complete proposal
|
|
326
|
+
generate_proposal() {
|
|
327
|
+
local skill_name="$1"
|
|
328
|
+
local edge_case_hash="$2"
|
|
329
|
+
local occurrence_count="$3"
|
|
330
|
+
|
|
331
|
+
# Get edge case details
|
|
332
|
+
local edge_case_json
|
|
333
|
+
edge_case_json=$(get_edge_case "$edge_case_hash")
|
|
334
|
+
|
|
335
|
+
# Parse JSON (simplified - in production use jq)
|
|
336
|
+
local skill_version exit_code input_params expected_output actual_output error_message
|
|
337
|
+
skill_version=$(echo "$edge_case_json" | grep -o '"skill_version":"[^"]*"' | cut -d'"' -f4)
|
|
338
|
+
exit_code=$(echo "$edge_case_json" | grep -o '"exit_code":[0-9]*' | cut -d':' -f2)
|
|
339
|
+
input_params=$(echo "$edge_case_json" | grep -o '"input_params":"[^"]*"' | cut -d'"' -f4)
|
|
340
|
+
expected_output=$(echo "$edge_case_json" | grep -o '"expected_output":"[^"]*"' | cut -d'"' -f4)
|
|
341
|
+
actual_output=$(echo "$edge_case_json" | grep -o '"actual_output":"[^"]*"' | cut -d'"' -f4)
|
|
342
|
+
error_message=$(echo "$edge_case_json" | grep -o '"error_message":"[^"]*"' | cut -d'"' -f4)
|
|
343
|
+
|
|
344
|
+
# Increment version
|
|
345
|
+
local new_version
|
|
346
|
+
new_version=$(increment_version "$skill_version" "patch")
|
|
347
|
+
|
|
348
|
+
# Analyze pattern
|
|
349
|
+
local pattern_analysis
|
|
350
|
+
pattern_analysis=$(analyze_edge_case_pattern "$skill_name" "$exit_code" "$input_params" "$error_message")
|
|
351
|
+
|
|
352
|
+
# Create proposal directory
|
|
353
|
+
local proposal_dir="${PROPOSALS_DIR}/${skill_name}_${edge_case_hash:0:8}_v${new_version}"
|
|
354
|
+
mkdir -p "$proposal_dir"
|
|
355
|
+
|
|
356
|
+
# Generate proposal components
|
|
357
|
+
generate_test_case "$skill_name" "$edge_case_hash" "$input_params" "$expected_output" \
|
|
358
|
+
"$actual_output" "$error_message" > "${proposal_dir}/test_case.md"
|
|
359
|
+
|
|
360
|
+
generate_logic_proposal "$skill_name" "$pattern_analysis" "$input_params" \
|
|
361
|
+
"$error_message" > "${proposal_dir}/logic_proposal.md"
|
|
362
|
+
|
|
363
|
+
generate_documentation_update "$skill_name" "$skill_version" "$new_version" \
|
|
364
|
+
"$edge_case_hash" > "${proposal_dir}/documentation_update.md"
|
|
365
|
+
|
|
366
|
+
# Create summary
|
|
367
|
+
cat > "${proposal_dir}/PROPOSAL_SUMMARY.md" <<SUMMARY
|
|
368
|
+
# Skill Update Proposal: $skill_name v$new_version
|
|
369
|
+
|
|
370
|
+
## Overview
|
|
371
|
+
Edge case $edge_case_hash occurred $occurrence_count times, triggering automatic proposal generation.
|
|
372
|
+
|
|
373
|
+
**Current Version:** $skill_version
|
|
374
|
+
**Proposed Version:** $new_version
|
|
375
|
+
**Generated:** $(date +"%Y-%m-%d %H:%M:%S")
|
|
376
|
+
|
|
377
|
+
## Edge Case Details
|
|
378
|
+
- **Exit Code:** $exit_code
|
|
379
|
+
- **Input Parameters:** $input_params
|
|
380
|
+
- **Error Message:** $error_message
|
|
381
|
+
- **Occurrence Count:** $occurrence_count
|
|
382
|
+
|
|
383
|
+
## Pattern Analysis
|
|
384
|
+
$pattern_analysis
|
|
385
|
+
|
|
386
|
+
## Proposal Components
|
|
387
|
+
|
|
388
|
+
1. **Test Case** (\`test_case.md\`)
|
|
389
|
+
- Regression test for edge case
|
|
390
|
+
- Executable test script
|
|
391
|
+
- Validation criteria
|
|
392
|
+
|
|
393
|
+
2. **Logic Proposal** (\`logic_proposal.md\`)
|
|
394
|
+
- Input validation enhancements
|
|
395
|
+
- Error handling improvements
|
|
396
|
+
- Edge case handling logic
|
|
397
|
+
|
|
398
|
+
3. **Documentation Update** (\`documentation_update.md\`)
|
|
399
|
+
- Changelog entry
|
|
400
|
+
- Migration guide
|
|
401
|
+
- Updated examples
|
|
402
|
+
|
|
403
|
+
## Next Steps
|
|
404
|
+
|
|
405
|
+
1. **Review** proposal components
|
|
406
|
+
2. **Implement** proposed changes in skill script
|
|
407
|
+
3. **Test** using provided test case
|
|
408
|
+
4. **Update** skill documentation
|
|
409
|
+
5. **Deploy** new version
|
|
410
|
+
6. **Mark** edge case as resolved
|
|
411
|
+
|
|
412
|
+
## Approval Checklist
|
|
413
|
+
|
|
414
|
+
- [ ] Test case passes with proposed changes
|
|
415
|
+
- [ ] Backward compatibility maintained
|
|
416
|
+
- [ ] Documentation updated
|
|
417
|
+
- [ ] Version incremented correctly
|
|
418
|
+
- [ ] Edge case marked as resolved in database
|
|
419
|
+
|
|
420
|
+
## Commands
|
|
421
|
+
|
|
422
|
+
\`\`\`bash
|
|
423
|
+
# Mark edge case as resolved
|
|
424
|
+
track-edge-case.sh --action update-status \\
|
|
425
|
+
--edge-case-hash "$edge_case_hash" \\
|
|
426
|
+
--status "proposal_generated"
|
|
427
|
+
|
|
428
|
+
# After implementation
|
|
429
|
+
track-edge-case.sh --action update-status \\
|
|
430
|
+
--edge-case-hash "$edge_case_hash" \\
|
|
431
|
+
--status "resolved"
|
|
432
|
+
\`\`\`
|
|
433
|
+
SUMMARY
|
|
434
|
+
|
|
435
|
+
echo "Generated skill update proposal: $proposal_dir"
|
|
436
|
+
echo "Review PROPOSAL_SUMMARY.md for details"
|
|
437
|
+
|
|
438
|
+
# Update edge case status
|
|
439
|
+
sqlite3 "$DB_PATH" <<EOF
|
|
440
|
+
UPDATE edge_cases
|
|
441
|
+
SET status = 'proposal_generated'
|
|
442
|
+
WHERE edge_case_hash = '$edge_case_hash';
|
|
443
|
+
EOF
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
# Main execution
|
|
447
|
+
main() {
|
|
448
|
+
# Initialize
|
|
449
|
+
init_proposals_dir
|
|
450
|
+
|
|
451
|
+
# Parse arguments
|
|
452
|
+
local skill_name=""
|
|
453
|
+
local edge_case_hash=""
|
|
454
|
+
local occurrence_count=""
|
|
455
|
+
|
|
456
|
+
while [[ $# -gt 0 ]]; do
|
|
457
|
+
case $1 in
|
|
458
|
+
--skill-name)
|
|
459
|
+
skill_name="$2"
|
|
460
|
+
shift 2
|
|
461
|
+
;;
|
|
462
|
+
--edge-case-hash)
|
|
463
|
+
edge_case_hash="$2"
|
|
464
|
+
shift 2
|
|
465
|
+
;;
|
|
466
|
+
--occurrence-count)
|
|
467
|
+
occurrence_count="$2"
|
|
468
|
+
shift 2
|
|
469
|
+
;;
|
|
470
|
+
--help)
|
|
471
|
+
cat <<HELP
|
|
472
|
+
Usage: generate-skill-update.sh [OPTIONS]
|
|
473
|
+
|
|
474
|
+
Options:
|
|
475
|
+
--skill-name STRING Skill name (required)
|
|
476
|
+
--edge-case-hash STRING Edge case hash (required)
|
|
477
|
+
--occurrence-count INTEGER Edge case occurrence count (required)
|
|
478
|
+
|
|
479
|
+
Environment Variables:
|
|
480
|
+
DB_PATH Path to SQLite database (default: ./workflow-codification.db)
|
|
481
|
+
PROPOSALS_DIR Path to proposals directory (default: ./proposals)
|
|
482
|
+
|
|
483
|
+
Description:
|
|
484
|
+
Generates comprehensive skill update proposal based on recurring edge case:
|
|
485
|
+
- Test case (regression test)
|
|
486
|
+
- Logic modification proposal
|
|
487
|
+
- Documentation updates
|
|
488
|
+
- Version increment (semantic versioning)
|
|
489
|
+
|
|
490
|
+
Output:
|
|
491
|
+
Creates proposal directory: proposals/{skill_name}_{hash}_v{version}/
|
|
492
|
+
- PROPOSAL_SUMMARY.md
|
|
493
|
+
- test_case.md
|
|
494
|
+
- logic_proposal.md
|
|
495
|
+
- documentation_update.md
|
|
496
|
+
|
|
497
|
+
Example:
|
|
498
|
+
generate-skill-update.sh \\
|
|
499
|
+
--skill-name "cfn-coordination" \\
|
|
500
|
+
--edge-case-hash "abc123..." \\
|
|
501
|
+
--occurrence-count 5
|
|
502
|
+
HELP
|
|
503
|
+
exit 0
|
|
504
|
+
;;
|
|
505
|
+
*)
|
|
506
|
+
echo "Unknown argument: $1" >&2
|
|
507
|
+
exit 1
|
|
508
|
+
;;
|
|
509
|
+
esac
|
|
510
|
+
done
|
|
511
|
+
|
|
512
|
+
# Validate arguments
|
|
513
|
+
if [[ -z "$skill_name" || -z "$edge_case_hash" || -z "$occurrence_count" ]]; then
|
|
514
|
+
echo "Error: --skill-name, --edge-case-hash, and --occurrence-count are required" >&2
|
|
515
|
+
exit 1
|
|
516
|
+
fi
|
|
517
|
+
|
|
518
|
+
# Generate proposal
|
|
519
|
+
generate_proposal "$skill_name" "$edge_case_hash" "$occurrence_count"
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
# Execute main if not sourced
|
|
523
|
+
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
524
|
+
main "$@"
|
|
525
|
+
fi
|