Agent Failure Recovery Protocol

A structured recovery framework to stop agent loops, handle malformed output, and manage autonomous error escalation.

Install
cmdop skills install agensi-agent-failure-recovery-protocol

Self-Healing Agent Workflows

The Agent Failure Recovery Protocol is a specialized logic layer for multi-agent systems and long-running autonomous tasks. It solves the "zombie agent" problem—where agents loop, stall, or drift off-task—by providing a structured decision-making framework for error handling. Instead of simple try/catch blocks, it implements a sophisticated recovery logic that preserves your token budget and keeps projects moving forward.

What it does

  • Failure Classification: Instantly identifies if an agent is stalled, looping, or producing malformed output.
  • Graded Recovery Ladder: Implements a tiered response system that starts with cheap reframing before escalating to task decomposition or human intervention.
  • Circuit Breakers: Hard limits that prevent runaway loops and protect your API budget from infinite retries.
  • Audit Trails: Maintains a failure ledger to track recurring bottlenecks and improve workflow architecture over time.

Why use this skill?

Standard prompting leaves agents brittle; when they hit an error, they often repeat it until they hit a context limit. This skill adds a "supervisory" layer to your agent's reasoning, making it more resilient and professional. It's tool-agnostic, working with any agent that reads the SKILL.md standard, including Claude Code, Codex CLI, Cursor, VS Code Copilot, and Gemini CLI. The output is a clear, auditable log of why a failure happened and exactly how it was resolved.