
- 01_analyze_syntax.sh: Find syntax errors (~1500 tokens) - 02_fix_syntax.sh: Fix syntax in specific files (~1000 tokens) - 03_analyze_env.sh: Find ENV references (~1200 tokens) - 04_migrate_env.sh: Migrate ENV to config (~1500 tokens) - 05_test_module.sh: Test modules after migration (~800 tokens) - migration_coordinator.sh: Orchestrate complete migration - README.md: Usage instructions and safety features Total migration cost: ~15-20k tokens vs 50k+ monolithic approach
54 lines
1.4 KiB
Bash
Executable File
54 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Agent 1: Syntax Analyzer
|
|
# Finds all syntax errors in the provisioning codebase
|
|
# Token-efficient: ~1500 tokens total
|
|
|
|
echo "🔍 Launching Syntax Analyzer Agent..."
|
|
|
|
# Create knowledge bundle for agent
|
|
KNOWLEDGE=$(cat << 'EOF'
|
|
# Syntax Analysis Task
|
|
|
|
## Find These Patterns:
|
|
1. $"(get-provisioning-X)? | default "") " → Missing outer parentheses
|
|
2. ^$"(get-provisioning-name))" → Extra parentheses
|
|
3. Broken function calls in expressions
|
|
4. Missing parentheses in command substitution
|
|
|
|
## Focus Areas:
|
|
- core/nulib/servers/*.nu
|
|
- core/nulib/main_provisioning/*.nu
|
|
- core/nulib/lib_provisioning/utils/*.nu
|
|
- core/nulib/taskservs/*.nu
|
|
|
|
## Output Format:
|
|
```json
|
|
{
|
|
"syntax_errors": [
|
|
{"file": "path/to/file.nu", "line": 55, "error": "missing parentheses", "pattern": "$\"(get-function)?"},
|
|
...
|
|
],
|
|
"files_checked": 45,
|
|
"total_errors": 12
|
|
}
|
|
```
|
|
|
|
## Test Command:
|
|
Use: nu --ide-check FILE_PATH
|
|
EOF
|
|
)
|
|
|
|
# Launch Claude Code agent
|
|
claude-code task \
|
|
--description "Find syntax errors in provisioning codebase" \
|
|
--prompt "$KNOWLEDGE
|
|
|
|
TASK: Analyze .nu files for syntax errors
|
|
SCOPE: Core provisioning modules (servers, main_provisioning, utils, taskservs)
|
|
OUTPUT: JSON report with file paths, line numbers, and error types" \
|
|
--type "general-purpose" \
|
|
> .migration/state/syntax_analysis.json
|
|
|
|
echo "✅ Syntax analysis complete. Results in .migration/state/syntax_analysis.json"
|
|
echo "📊 Run: cat .migration/state/syntax_analysis.json | jq" |