exception-handling-and-recovery
Skill4 starsChanged 5 months agoApache-2.0View on GitHub
Use when building resilient agent workflows that must detect failures, retry safely, degrade gracefully, rollback state, or escalate to a human/operator.
In this repository114 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibility-wcagSkill
- agentic-ux-patternsSkill
- ai-model-governanceSkill
- api-design-and-lifecycleSkill
- apply-laws-of-aiSkill
- bdd-practiceSkill
- browser-testing-with-devtoolsSkill
- business-capability-modelingSkill
- business-information-concept-modelingSkill
- capability-maturity-assessmentSkill
- cdc-and-source-to-stream-ingestionSkill
- ci-cd-and-automationSkill
- cloud-platform-architectureSkill
- code-review-and-qualitySkill
- cognitive-bias-reviewSkill
- conceptual-data-modelingSkill
- context-engineeringSkill
- data-contract-designSkill
- data-governance-and-qualitySkill
- data-integration-and-interoperabilitySkill
- data-lifecycle-and-retention-managementSkill
- data-lineage-and-provenanceSkill
- data-product-dashboard-designSkill
- data-product-designSkill
- data-security-and-privacy-architectureSkill
- ddd-practiceSkill
- deprecation-and-migrationSkill
- design-system-practiceSkill
- documentation-and-adrsSkill
- dora-four-keysSkill
- dry-principleSkill
- eip-integration-validationSkill
- evaluation-and-monitoringSkill
- event-driven-architectureSkill
- event-governance-and-lineageSkill
- event-modelingSkill
- event-streaming-platform-designSkill
- finops-practiceSkill
- frontend-state-and-interaction-designSkill
- git-workflow-and-versioningSkill
- goal-setting-and-monitoringSkill
- guardrails-safety-patternsSkill
- human-in-the-loopSkill
- idea-refinementSkill
- incident-response-and-postmortemsSkill
- incremental-implementationSkill
- infrastructure-as-codeSkill
- integration-message-constructionSkill
- inter-agent-communication-a2aSkill
- kiss-principleSkill
- knowledge-graph-ragSkill
- knowledge-retrieval-ragSkill
- krag-evaluation-governanceSkill
- krag-ingestion-graph-constructionSkill
- krag-retrieval-answeringSkill
- krag-system-designSkill
- lakehouse-and-medallion-architectureSkill
- learning-and-adaptationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use this skill when an agent calls tools, edits files, executes code, uses network services, invokes models, or performs any multi-step …
- Distinctive: line 27
Use fallbacks for unavailable services, models or tools.
- Distinctive: line 46
Never hide failures. Convert raw exceptions into actionable diagnostics and include the next safe step.
- Distinctive: line 51
Never retry a destructive operation unless it is idempotent or explicitly safe.
- Distinctive: line 52
Never proceed after failed validation without documenting the risk.
- Distinctive: line 53
Prefer controlled failure over silent corruption.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Exception Handling and Recovery
When to use
Use this skill when an agent calls tools, edits files, executes code, uses network services, invokes models, or performs any multi-step workflow where failures are likely.
Objective
Make failures explicit, recover safely where possible, and preserve enough evidence to repair or escalate.
Procedure
- Detect errors early: tool exceptions, malformed outputs, timeout, unavailable service, failed tests, invalid schema, unexpected state.
- Classify the failure as transient, deterministic, recoverable, unsafe, or unknown.
- Select a recovery strategy: retry, fallback, rollback, repair, degrade, ask clarification, or escalate.
- Preserve evidence: error message, stack trace, command, inputs, outputs and affected files.
- Resume only from a known-good state.
Recovery strategies
- Retry transient failures with bounded attempts and back-off.
- Use fallbacks for unavailable services, models or tools.
- Roll back partial file or state changes before trying a different approach.
- Reduce scope when a full solution is blocked.
- Escalate when credentials, permissions, destructive actions or ambiguous requirements are involved.
Implementation guidance
Wrap risky operations with typed outcomes:
@dataclass
class OperationResult:
ok: bool
value: Any | None = None
error_type: str | None = None
error_message: str | None = None
recoverable: bool = FalseNever hide failures. Convert raw exceptions into actionable diagnostics and include the next safe step.
Guardrails
- Never retry indefinitely.
- Never retry a destructive operation unless it is idempotent or explicitly safe.
- Never proceed after failed validation without documenting the risk.
- Prefer controlled failure over silent corruption.
References
Verification
- Failure modes are identified.
- Retry and fallback limits are explicit.
- Rollback or cleanup path exists.
- Errors are logged with enough context.
- Escalation condition is defined.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

