Error-State Recovery

Wrap command executions in a self-healing retry loop with heuristic fixes.

27|8|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/Sounder25/Google-Antigravity-Skills-Library --skill error-state-recovery
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Error-State Recovery
Source: https://github.com/Sounder25/Google-Antigravity-Skills-Library/tree/main/06_error_recovery
Command: npx skills add https://github.com/Sounder25/Google-Antigravity-Skills-Library --skill error-state-recovery

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Agents often fail due to transient or trivial errors. This skill provides a Invoke-Recoverable wrapper that catches these errors, attempts to apply known fixes, and retries the operation.

Core Features & Use Cases

  • Self-healing wrapper around command execution to automatically fix common issues (missing deps, locked files) and retry.
  • Heuristics-based fixes for common errors like ModuleNotFoundError, DirectoryNotFound, and File Locked.
  • Logs and outputs failures into ERROR_STATE.json for debugging and escalation to the Agent with structured context.

Quick Start

Use the skill to wrap a failing command and auto-recover. Example: .\skills\06_error_recovery\invoke_recovery.ps1 -Command "python hunt.py" -Retries 3

Frequently Asked Questions about Error-State Recovery

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically retry failed PowerShell commands when transient errors occur?

To automatically retry failed PowerShell commands, you can wrap them in a self-healing execution loop that catches errors, applies heuristic fixes like module installation or directory creation, and retries the operation up to a specified limit.

Why does my automation script fail when files are locked or dependencies are missing, and how do I fix it?

Automation scripts fail when files are locked or dependencies are missing because execution environments lack self-healing capabilities to dynamically resolve these issues. You can fix this by applying a wrapper that detects these errors, unlocks files, installs modules, and retries.

How do I capture error context from failed CLI workflows into a structured format for debugging?

To capture error context from failed CLI workflows, you can use a recovery wrapper that logs structured error details into an ERROR_STATE.json file, providing deterministic state tracking for debugging and escalation to the Agent.

Can I use a self-healing wrapper to auto-fix ModuleNotFound and DirectoryNotFound errors in CLI workflows?

Yes, you can use a self-healing wrapper to auto-fix ModuleNotFound and DirectoryNotFound errors in CLI workflows. It applies heuristics to install missing modules and create missing directories automatically before retrying the command.

What are the limitations of using heuristics-based error recovery for command execution?

The limitation of heuristics-based error recovery is that it only applies known fixes for common errors like missing dependencies or locked files. If a command fails due to an unrecognized error, the wrapper will escalate the structured error details to the Agent after exhausting retries.

Does PowerShell error-state recovery work across different environments for deterministic retry behavior?

Yes, PowerShell error-state recovery works across different environments by providing deterministic retry behavior for automation scripts. It handles transient failures and environmental issues like missing dependencies or locked files consistently regardless of the underlying environment.