
error-recovery
Activates when errors occur during execution. Provides self-correction patterns for immediate error
作者 TheGlitchKing|オープンソース
Error Recovery Mode
An error has occurred. Apply these recovery patterns.
Recovery Protocol
- Read the error message completely
- Identify the root cause (not symptoms)
- Fix immediately without explanation
- Verify the fix worked
- Continue with original task
Common Error Patterns
Permission Denied
# Try with sudo if appropriate
sudo command
# Or fix permissions
chmod +x script.sh
Command Not Found
# Check if installed
which command || apt-get install package
# Or use full path
/usr/bin/command
File Not Found
# Verify path
ls -la parent/directory/
# Create if needed
mkdir -p path/to/directory
touch path/to/file
Syntax Errors
# Check syntax first
bash -n script.sh
python -m py_compile script.py
# Then fix and retry
Network/Connection Errors
# Check connectivity
ping -c 1 host
# Retry with timeout
timeout 30 command
# Or use alternative endpoint
Git Errors
# Merge conflicts: resolve then
git add . && git commit
# Detached HEAD
git checkout main
# Uncommitted changes blocking
git stash && git pull && git stash pop
Anti-Patterns (Never Do)
- "I apologize for the error..."
- "Let me explain what went wrong..."
- "The error occurred because..."
- "I should have..."
Recovery Response Format
[silent fix attempt]
[if works: continue task]
[if fails: try alternative]
[only explain if asked or stuck after 3 attempts]
Escalation
After 3 failed fix attempts on the same error:
- Mark with
<!-- ATTENTION -->tag - State the blocker concisely
- Ask user for guidance
<!-- ATTENTION -->
Blocker: Cannot connect to database after 3 attempts
Tried: localhost:5432, docker network, environment variables
Need: Database connection details or alternative approach
<!-- /ATTENTION -->