Execution Recovery

VerifiedCaution

Diagnoses and fixes common execution errors such as syntax issues, import failures, path problems, permission denials, and connection timeouts. Provides automated recovery strategies tailored to each error type, including dependency installation, permission adjustments, and connectivity tests. Useful when scripts or commands fail during execution.

Sby Skills Guide Bot
DevelopmentIntermediate
6/2/2026
Claude Code
#error-recovery#debugging#syntax-errors#dependency-management#permission-fixes

Recommended for

Automated summary

Provides systematic recovery strategies for common execution failures in Claude Code, such as syntax errors, import issues, path problems, permission denials, and network timeouts.

Strengths

  • Covers a wide range of error types with clear recovery steps, includes immediate triage and specific commands for diagnosis, and offers advanced techniques like heredoc repair.

Limitations

  • Assumes standard tooling (pip, npm, chmod) and may not cover all edge cases
  • relies on user having necessary permissions
  • some network tests may be blocked by security policies.
When to use it

Use when encountering execution errors during development or when automating error handling in Claude Code workflows.

When not to use it

Avoid for errors requiring deep domain-specific knowledge or when the error is caused by fundamental design flaws rather than execution issues.

Security analysis

Caution
Quality score90/100

The skill uses powerful tools (bash, package managers, network utilities) for legitimate recovery purposes. However, it automates actions like installing dependencies without validation of the source, and could be triggered by unverified error output, introducing risk in adversarial scenarios.

Findings
  • •Automatically installs packages based on error messages, which could lead to dependency confusion or malicious package installation if the error is spoofed.
  • •Allows arbitrary execution of shell commands, including network checks, permission changes, and file operations, which could be misused if triggers are manipulated.
How this analysis is made

Examples

Fix SyntaxError in Python
I'm getting a SyntaxError in my Python script. Can you fix it?
Resolve missing Node.js module
My Node.js app can't find a module. Help me resolve the dependency.
Permission denied on script
Permission denied when trying to run my script. What should I do?

name: execution-recovery description: Handle common execution failures with specialized recovery strategies. Fix syntax errors, import/dependency issues, path/file problems, permission denial, and connection timeouts. Use proactively when encountering errors or as automatic recovery mechanism. allowed-tools: Read, Edit, Execute, Grep

Execution Recovery

Apex2's execution optimization suite implemented as a Claude Code skill. Provides robust recovery from common execution failures.

Instructions

When invoked (automatically on errors or explicitly when help is needed), diagnose and fix execution problems:

1. Immediate Error Triage

Quickly categorize the error type to apply the right recovery strategy:

Syntax Errors:

  • Python: SyntaxError, IndentationError, NameError
  • JavaScript: SyntaxError, ReferenceError
  • Shell: syntax error near token, unexpected operator

Import/Module Errors:

  • ModuleNotFoundError, ImportError (Python)
  • Cannot find module (Node.js)
  • dependency resolution failures

Path/File Issues:

  • No such file or directory
  • Permission denied
  • File already exists
  • Directory not empty

Network/Connection Problems:

  • Connection refused, timeout
  • DNS resolution failures
  • Authentication failures
  • Rate limiting

2. Recovery Strategies by Error Type

Syntax Error Recovery

  1. Diagnose the specific line:

    # Python syntax checking
    python -m py_compile filename.py
    # or specific line diagnosis
    python -c "import ast; ast.parse(open('filename.py').read())"
    
    # JavaScript syntax checking  
    node -c filename.js
    npm install eslint --save-dev && npx eslint filename.js
    
  2. Common fixes to apply:

    • Fix missing parenthesis, brackets, quotes
    • Correct indentation (Python-specific)
    • Add missing semicolons (JS-specific)
    • Escape special characters in strings
    • Fix function call syntax
  3. Heredoc Management (for shell scripts):

    # Validate heredoc syntax
    cat << 'EOF' > script.sh
    # script content here
    EOF
    

Import/Dependency Recovery

  1. Diagnose missing dependencies:

    # Python imports
    python -c "import missing_module" 2>&1 | grep ModuleNotFoundError
    
    # Node.js
    npm ls missing-package
    
  2. Install solutions:

    # Python
    pip install missing-package
    # Add to requirements.txt
    
    # Node.js
    npm install missing-package
    # Add to package.json dependencies
    
  3. Version conflicts:

    # Check versions
    pip show package-name
    npm list package-name
    
    # Install specific version
    pip install package==version
    npm install package@version
    

Path/File Recovery

  1. Path validation:

    # Check if file exists
    ls -la file-path
    dirname file-path && ls -la $(dirname file-path)
    
    # Current working directory
    pwd
    
    # Relative vs absolute path testing
    echo $(pwd)/relative-path
    
  2. Permission fixes:

    # Make executable
    chmod +x script.sh
    
    # Read/write permissions
    chmod 644 file.txt
    chmod 755 directory/
    
  3. Directory creation:

    # Create parents as needed
    mkdir -p path/to/directory
    
    # Safe file creation
    touch new-file.txt
    

Network/Connection Recovery

  1. Connectivity testing:

    # Test basic connectivity
    ping -c 3 example.com
    curl -I https://example.com
    
    # Check specific ports
    telnet host port
    nc -zv host port
    
  2. DNS resolution:

    # Check DNS
    nslookup hostname
    dig hostname
    
    # Test different DNS servers
    nslookup hostname 8.8.8.8
    
  3. Authentication and retries:

    # Retry with exponential backoff
    # Use auth tokens appropriately
    # Check rate limits and wait periods
    

3. Advanced Recovery Techniques

Heredoc Repair (for shell scripts)

# Fix indentation in heredoc
cat << 'EOF' > fixed-script.sh
#!/bin/bash
echo "Fix indentation issues"
# Other commands
EOF

Session Recovery

# Detect stuck tmux/session issues
tmux list-sessions
tmux kill-session -t session-name

# Start fresh session
tmux new-session -d -s work-session

Long-Running Task Management

# Resume interrupted tasks
# Check progress of long operations
# Implement timeouts for very long commands
timeout 300s command-that-might-hang

4. Systematic Debugging Process

  1. Capture the exact error message
  2. Reproduce the error to isolate cause
  3. Check recent changes that might have broken things
  4. Apply the appropriate recovery strategy
  5. Verify the fix works before proceeding

5. Prevention Strategies

Add safeguards to prevent recurrence:

  • Input validation in scripts
  • Error handling that catches common failures
  • Automated testing before deployment
  • Configuration validation on startup

Error Categories and Fixes

Docker/Microservice Issues

# Container not found
docker ps -a
docker logs container-name

# Port conflicts
netstat -tulpn | grep port-number
docker run -p different-port:port

Database Connection Problems

# Connection testing
psql -h host -U user -d database -c "SELECT 1;"
mysql -h host -u user -e "SELECT 1;"

# Service status
systemctl status postgresql
systemctl status mysql

Git Repository Issues

# Permission denied
git config --global core.sharedRepository group

# Corrupted repository
git fsck
git gc --prune=now

Output Format

Provide structured recovery report:

Error Analysis:
  Type: [syntax/import/path/network/other]
  Severity: [low/medium/high]
  Criticality: [blocking/warning/info]

Root Cause:
  Immediate cause: [what happened]
  Underlying issue: [why it happened]
  Contributing factors: [other factors]

Recovery Applied:
  Step 1: [action taken]
  Result: [success/failure]
  Step 2: [next action if needed]
  Result: [success/failure]

Solution Details:
  Code fixed: [show corrected code]
  Command executed: [show command]
  Changes made: [describe modifications]

Verification:
  Test performed: [how fix was verified]
  Result: [successful/unsuccessful]
  Additional steps: [if needed]

Prevention:
  Future safeguards: [how to prevent recurrence]
  Monitoring: [what to watch]
  Documentation: [what to update]

When to Use

This recovery skill is designed for:

  • Automatic recovery when execution commands fail
  • Manual intervention when complex errors occur
  • Debugging mysterious failures
  • Learning from mistakes to prevent recurrence
  • Building robust execution pipelines

The goal is to turn execution failures into learning opportunities, with the system becoming more reliable through each recovery.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/execution-recovery-mmk3ni85/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/execution-recovery-mmk3ni85' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/execution-recovery-mmk3ni85/download' --output '.skill-downloads/execution-recovery-mmk3ni85/SKILL.md.part' && mv '.skill-downloads/execution-recovery-mmk3ni85/SKILL.md.part' '.skill-downloads/execution-recovery-mmk3ni85/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Read, Edit, Execute, Grep

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/execution-recovery-mmk3ni85/SKILL.md' && test -s '.skill-downloads/execution-recovery-mmk3ni85/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/execution-recovery' && cp -R '.skill-downloads/execution-recovery-mmk3ni85' '.claude/skills/execution-recovery'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/execution-recovery-mmk3ni85'

openskills read 'execution-recovery-mmk3ni85'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/execution-recovery-mmk3ni85/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills