agentleFS
codebygarvcodebygarv/Ai-skills/skills/development/error-handling-architect/SKILL.md

error-handling-architect

Skill26 starsChanged 4 months agoMITView on GitHub

Designs structured error hierarchies, domain error mapping, and resilient fallback/retry mechanisms across applications.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    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
  1. Very specific:

    When error handling is fragmented with ad-hoc try/catch blocks, string checks, or unhandled promise rejections.

    line 12

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

Purpose

Standardize application error handling into a coherent architecture: custom error hierarchies, typed domain errors, HTTP/RPC status mappings, sanitized client responses, and structured observability logs.

When to Use

  • When error handling is fragmented with ad-hoc try/catch blocks, string checks, or unhandled promise rejections.
  • Designing error responses for public REST/gRPC APIs.
  • Setting up retry policies, circuit breakers, and graceful fallback behaviors.

What to Analyze

  1. Error Hierarchy: Base domain error, validation errors, not found errors, authorization errors, external service errors.
  2. Transport Mapping: Clean translation from internal domain error classes to HTTP status codes / RFC 7807 Problem Details.
  3. Data Sanitization: Stripping database credentials, stack traces, and internal URLs from client-facing responses.
  4. Telemetry & Log Context: Including correlation IDs, user IDs, and cause chains (error.cause) in server logs.
  5. Resilience Strategy: Idempotent retries with exponential backoff and jitter vs instant failure.

Output Format

  • Error Class Hierarchy: TypeScript / language-specific error class definitions.
  • Global Error Middleware: Centralized error interceptor / filter implementation.
  • RFC 7807 Response Schema: Standard JSON structure returned to API consumers.
  • Handling Matrix: Table mapping each Domain Error to HTTP Status, Log Level, and Retry Policy.

Avoid

  • Catching errors and silently swallowing them (catch (e) {}).
  • Leaking raw SQL error strings or file paths to API clients.

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.