agentleFS
XData-siXData-si/xdata-agenthub/skills/error-handling-review/SKILL.md

error-handling-review

Skill1 starsChanged 34 days agoMITView on GitHub

Review how code detects, propagates, reports and recovers from errors — exceptions, retries, timeouts, partial failure and user-facing messages. Use when reviewing service code, integrations, background jobs or after incidents caused by swallowed or misleading errors.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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
  1. Distinctive:

    Timeouts everywhere: Every network or IPC call has a timeout shorter than the caller's.

    line 20
  2. Distinctive:

    Retries are safe: Only idempotent operations or those with idempotency keys.

    line 21
  3. Distinctive:

    Every finding names the failure scenario and its consequence (data loss, duplicate charge, silent outage).

    line 39
  4. Distinctive:

    Do not test failure handling by breaking shared or production dependencies.

    line 47

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Error Handling Review

Goal

Failures are visible, attributable and handled at the right layer; the system degrades predictably instead of corrupting data or hiding problems.

Inputs

  • Code under review and its callers, logging and metrics conventions, retry and timeout configuration.
  • Known failure modes of dependencies (network, database, third-party APIs, file system).

Review checklist

  1. No silent swallowing. Flag broad catch/except blocks that log nothing, return defaults or continue. Each catch either handles a specific error meaningfully or re-raises with context.
  2. Context preserved. Wrapped errors keep the cause (raise … from err, %w, cause); messages include identifiers (order ID), not secrets or personal data.
  3. Right layer. Low-level code reports; the boundary (HTTP handler, job runner) decides the user response, the retry and the alert.
  4. Timeouts everywhere. Every network or IPC call has a timeout shorter than the caller's; there are no unbounded waits.
  5. Retries are safe. Only idempotent operations or those with idempotency keys; exponential backoff with jitter; a maximum number of attempts; no retry on validation or authorization errors.
  6. Partial failure. Multi-step operations use transactions, compensation or an outbox; consider what state remains if the process dies between steps.
  7. Resource cleanup. Files, locks, connections and temporary data are released on error paths (finally, with, defer).
  8. User-facing errors. Clear, actionable, without stack traces or internal hostnames; a stable error code for support.
  9. Observability. Errors are logged once (not at every layer), with severity, a correlation ID and a metric suitable for alerting.

Example fixture

def charge(order):
    try:
        gateway.charge(order.total)
    except Exception:
        pass                     # swallowed: order shipped without payment
    order.mark_paid()

Expected findings: broad exception swallowed, state updated after failure, no timeout or idempotency key, no log or metric.

Acceptance checks

  • Every finding names the failure scenario and its consequence (data loss, duplicate charge, silent outage).
  • Recommendations specify which errors to catch, where, and what the caller observes.
  • At least one negative test is proposed per critical path (dependency timeout, partial failure).

Output

Findings ordered by impact, a patch suggestion, and proposed failure-injection tests.

Safety

Do not test failure handling by breaking shared or production dependencies; use fakes, fault injection in disposable environments, or recorded responses.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.