Help us improve
Share bugs, ideas, or general feedback.
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.
npx claudepluginhub thearchitectit/agent-guardrails-templateHow 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.
Use when repeated fix attempts fail, the agent appears stuck in a loop, or complexity is increasing without progress
Guides systematic root-cause debugging via triage checklist for test failures, build breaks, unexpected behavior, logs, and errors.
Forces architectural reassessment after 2+ failed fixes, whack-a-mole symptoms, or cascading errors. Inventories attempts, finds shared systems, researches via Perplexity. Proactive for infra config.
Share bugs, ideas, or general feedback.
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 isolation