error-handling
Skill2 starsChanged 15 days agoMITView on GitHub
Design, implement, or review error contracts and recovery behavior across software boundaries.
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 60 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Keep the requested boundary: a review or design request produces findings or a proposal.
- Distinctive: line 15
Read the affected operation, callers, existing error types, adapters and tests.
- Distinctive: line 35
Place validation and translation at the boundary that owns them.
- Distinctive: line 47
Use runtime-supported cleanup and ownership mechanisms on success, failure and cancellation.
- Distinctive: line 56
Before adding retries, fallback, restart, rollback, compensation or a circuit breaker, read references/recovery.md.
- Distinctive: line 60
Prefer existing retry and recovery mechanisms over another nested loop.
- Distinctive: line 62
If the intended result cannot be established, return the supported failure or uncertainty rather than manufacture success.
- Distinctive: line 83
Use controllable dependencies and time where needed to exercise partial progress, exhaustion, cancellation and cleanup.
- Very specific: line 90
Run the project's applicable checks after implementation.
“Common” is measured: kept by at least 6 in 10 of the 60 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Error handling
Make failures explicit to their callers and recover only when the operation's contract supports it. Apply the language, runtime and framework already in use. Keep the requested boundary: a review or design request produces findings or a proposal; implementation requires the active task's authority.
Establish the contract
Read the affected operation, callers, existing error types, adapters and tests. Find the requirement or established contract for each material failure: what the caller can observe, which effects may already have happened, and who can decide the next action. Current behavior alone does not settle an unclear product policy.
Distinguish expected domain outcomes, invalid input or denied access, dependency failures, broken internal invariants, and cancellation or deadline expiry when they require different handling. Classify by the actual operation and runtime semantics, not message matching or a blanket rule for an entire status range. Separate known failure from an unknown outcome after a lost response.
Preserve public codes, response shapes, exit status, queue acknowledgement, exception identity and other caller-visible behavior unless the requested change revises that contract. Reuse the project's representation; do not introduce a universal error superclass, result type, transport envelope or dependency merely to follow this skill. Resolve an undecided fallback, data-loss or retry policy before implementing the affected behavior; continue independent work.
Propagate to an owner that can act
Place validation and translation at the boundary that owns them. Keep domain behavior independent of transport details where the existing structure permits. Rely on an established invariant only while its evidence holds: persisted data, concurrent changes and lifecycle transitions can invalidate a prior check.
Handle a failure where code can recover, add useful context, translate its representation, or perform required cleanup. Otherwise preserve propagation. Retain the cause and useful classification when wrapping; keep diagnostic detail separate from the public response. A catch that only logs does not establish recovery. An empty value, default result or successful exit must not conceal an unfulfilled operation.
Use runtime-supported cleanup and ownership mechanisms on success, failure and cancellation. Keep the primary failure identifiable if cleanup also fails; expose the secondary failure through the project's supported reporting mechanism. Treat cancellation as control flow when the runtime does; do not turn it into success or an automatic retry. Ensure asynchronous work has an owner that observes its completion and failures, including work outside a request or UI render boundary.
Choose recovery from the operation's semantics
Before adding retries, fallback, restart, rollback, compensation or a circuit breaker, read references/recovery.md. That reference owns replay safety, partial effects, limits and recovery transitions.
Prefer existing retry and recovery mechanisms over another nested loop. A fallback must satisfy an approved reduced contract and make partial or stale results clear. If the intended result cannot be established, return the supported failure or uncertainty rather than manufacture success. Do not add resilience infrastructure without a concrete failure mode that needs it.
Make failures understandable and testable
Give the user or caller an accurate outcome and a next action that is actually available. Preserve localization and accessibility conventions. Do not advise resubmitting a mutation whose outcome is unknown unless replay is safe. Keep technical causes out of public messages while retaining appropriate internal evidence for investigation.
Choose the reporting owner so one failure remains traceable without duplicate alerts at every layer. Record useful operation, correlation, classification and attempt context using the project's logging or telemetry conventions. Filter secrets, payloads and personal data before recording them; raw exception text and cause chains can contain sensitive values too. A public generic message does not justify logging unrestricted internal data.
Exercise the real error boundary through observable behavior. Cover the relevant failure, successful or permitted recovery path, and effects that must not repeat. Use controllable dependencies and time where needed to exercise partial progress, exhaustion, cancellation and cleanup. Verify result/state as well as reporting; absence of a side effect is meaningful when tied to the observed failure contract. Assert the classification, code or type that callers branch on; assert message text only where a user or caller consumes it. Do not replace the behavior under test with a mock or use elapsed waiting as proof.
Run the project's applicable checks after implementation. Use available verify
for application-level evidence when the change needs it; existing direct checks
remain useful if that skill is unavailable. debug owns a wider investigation
of an observed symptom; error-handling supplies the failure-contract decisions.
Return the result
Report the boundary and contract, changes or findings, observed outcomes and remaining uncertainty. For recovery work, include what was retried or reconciled, its stopping condition and the evidence that effects were not duplicated. Keep proposed behavior and tested behavior distinct. The active caller owns further delivery; this skill does not start publication or PR monitoring.
Other versions74 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 74
- microsoft/data-formulator★ 17ksame name
- epicenter-md/epicenter★ 4.8ksame name
- EpicenterHQ/epicenter★ 4.8ksame name
- NVIDIA-NeMo/RL★ 2.1ksame name
- software-mansion/react-native-executorch★ 1.8ksame name
- CloudAI-X/claude-workflow★ 1.4ksame name
- CloudAI-X/claude-workflow-v2★ 1.4ksame name
- alchemyplatform/aa-sdk★ 321same name
- Resgrid/Core★ 235same name
- DevelopersGlobal/ai-agent-skills★ 216same name
64 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use caching, logging and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
zebbernSkillcaching
Caching strategies — invalidation, TTL guidelines, cache keys, cache layers, and when not to cache. Use when implementing or reviewing caching logic.
Also in 5 projects that use this
diego-tobalinaSkilllogging
Logging best practices for Java (SLF4J/Logback) and Node.js (Winston/Pino). Use for structured logging, log levels, and avoiding sensitive data exposure.
Also in 10 projects that use this
WelluxSkilltype-safety
Add or fix type annotations and enforce strict type safety. Invoke for: "add types", "type annotation", "TypeScript types", "Python type hints", "mypy", "tsc strict", "type errors", "any type", "unsafe cast", "missing types", "type this".
Also in 3 projects that use this
dbtlrSkilldependencies
Use when adding, evaluating, or updating Rust crate dependencies. Also use when considering whether to implement something yourself vs pulling in a library.
Also in 3 projects that use this
MicrosoftSkillresilience
Apply resilience patterns (retry, backoff, circuit breaking) when writing or reviewing code that makes outbound HTTP/REST calls, database operations, or any I/O that can experience transient failures. Use this skill when: (1) writing new code that calls external services or APIs, (2) reviewing code that uses fetch, HTTP clients, or service-to-service calls, (3) adding queue consumers or workers that interact with remote systems, (4) debugging intermittent failures in production.
Also in 3 projects that use this
OpenAISkillauth
Authentication integration guidance — Clerk (native Vercel Marketplace), Descope, and Auth0 setup for Next.js applications. Covers middleware auth patterns, sign-in/sign-up flows, and Marketplace provisioning. Use when implementing user authentication.
Also in 5 projects that use this
In this repository48 other files it gives its agents.
- accessibilitySkill
- agent-instructionsSkill
- analyze-change-effectsSkill
- article-processingSkill
- ci-cd-automationSkill
- comment-styleSkill
- commitSkill
- communicate-clearlySkill
- compare-solutionsSkill
- create-project-instructionsSkill
- daily-meeting-updateSkill
- debugSkill
- deprecate-and-removeSkill
- design-code-structureSkill
- domain-searchSkill
- explain-codeSkill
- explain-decisionsSkill
- github-actionsSkill
- handoffSkill
- humanizeSkill
- issue-workflowSkill
- observabilitySkill
- people-memorySkill
- performance-optimizationSkill
- planningSkill
- pr-followupSkill
- prototypeSkill
- pr-review-followupSkill
- pr-reviewSkill
- prSkill
- report-work-activitySkill
- retroSkill
- review-code-changesSkill
- simplify-codeSkill
- skill-maintenanceSkill
- stacked-prSkill
- task-breakdownSkill
- tddSkill
- teachSkill
- typescript-best-practicesSkill
- verification-authoringSkill
- verifySkill
- wayfinderSkill
- workflow-to-skillSkill
- work-modeSkill
- worktrunkSkill
- write-documentationSkill
- youtube-processingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

