From agent-guardrails
Guides structured recovery from errors and failures by assessing, logging root cause, and applying safe fixes with rollback plans. Prevents cascading mistakes via forbidden patterns and escalation rules.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-guardrails:error-recoveryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
How to recover from failures, errors, and unexpected states without making things worse.
How to recover from failures, errors, and unexpected states without making things worse.
| Situation | Action |
|---|---|
| Clear cause, safe fix | Apply targeted fix |
| Unclear cause | HALT and ask user for guidance |
| Data corruption | Restore from backup or rollback |
| Environment issue | Rebuild/reset environment |
| Dependency issue | Update, downgrade, or pin dependency |
NEVER do these when recovering from errors:
Before any significant change, know your rollback plan:
Escalate to user when:
When running in pi, error recovery is supported by the @architectit/pi-guardrails extension:
guardrail_record_attempt tracks failures automatically — at 3 strikes, halting is recommendedguardrail_log_violation records failure context for post-mortem analysisguardrail_mcp with action sandbox_run provides isolated execution for testing recovery stepsrm -rf, sudo, etc.)See [[sandbox-isolation]] and [[guardrails-core]] for details.
Apply the Error Recovery Protocol to the current failure or error situation. Guide the user through stopping, assessing, understanding, and fixing the problem without making it worse. Follow the recovery steps above and escalate when the escalation criteria are met.
docs/workflows/ROLLBACK_PROCEDURES.md — Detailed rollback proceduresdocs/workflows/AGENT_ESCALATION.md — When and how to escalatedocs/standards/TEST_PRODUCTION_SEPARATION.md — Environment isolationnpx claudepluginhub thearchitectit/agent-guardrails-templateUse when repeated fix attempts fail, the agent appears stuck in a loop, or complexity is increasing without progress
Guides systematic root-cause debugging when tests fail, builds break, or unexpected errors occur. Provides a structured triage checklist to preserve evidence, localize, and fix issues instead of guessing.
Guides developers through systematic root cause investigation of bugs and failures. Use when encountering test failures, errors, or unexpected behavior.