error-handling-architecture

error-handling-architecture is a skill for Claude Code, Codex from KraitDev/skiLL.Md. It costs 18 tokens per session (1,669 once invoked), scanned A, original, MIT.

A set of instructions for designing one consistent way for a backend service to catch, classify, log, and report failures. A backend service is the server-side part of an application.

In plain words
What is it for?
Setting up error handling in backend services, replacing scattered try/catch blocks, separating user or network errors from programming bugs, and standardizing API error responses.
Why use it?
It prevents uncaught errors from crashing services and reduces the risk of exposing sensitive details. It also makes failures easier to diagnose across the application.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Codex.

Good fit Setting up error handling in backend services, replacing scattered try/catch blocks, separating user or network errors from programming bugs, and standardizing API error responses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kraitdev/skill.md/error-handling-architecture
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add KraitDev/skiLL.Md --skill error-handling-architecture
Clone the repo
git clone --depth 1 https://github.com/KraitDev/skiLL.Md

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for error-handling-architecture

README.md
[![agentmods](https://agentmods.dev/badge/skills/kraitdev/skill.md/error-handling-architecture/github.svg)](https://agentmods.dev/skills/kraitdev/skill.md/error-handling-architecture)
Your own site
<a href="https://agentmods.dev/skills/kraitdev/skill.md/error-handling-architecture"><img src="https://agentmods.dev/badge/skills/kraitdev/skill.md/error-handling-architecture/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for error-handling-architecture

Your own site · 80×15
<a href="https://agentmods.dev/skills/kraitdev/skill.md/error-handling-architecture"><img src="https://agentmods.dev/badge/skills/kraitdev/skill.md/error-handling-architecture.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,669 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00018 $0.01669
Opus 5.5 $0.00007 $0.00668
Sonnet 5.5 $0.00004 $0.00334
Haiku 4.5 $0.00002 $0.00167

Measured 1mo ago against content hash 8a61dc94ca27, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

error-handling-architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/backend/error-handling-architecture/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Error Handling Architecture

Purpose

Uncaught exceptions crash servers. Leaked errors expose vulnerabilities. This skill creates a central, robust pipeline for capturing, categorizing, logging, and responding to failures without leaking sensitive data, ensuring system resilience and debugging capability.

When to use

  • Setting up a new backend service
  • Refactoring code with excessive uncoordinated try/catch blocks
  • Standardizing API error responses across a team
  • Implementing a new microservice with shared error handling

When NOT to use

  • Client-side error handling (different context)
  • Monitoring/alerting setup (separate concern, use Logging & Observability instead)
  • Specific framework error documentation

Inputs required

  • Existing backend service codebase
  • Framework error handling capabilities (Express middleware, Django signals, etc.)
  • Logging infrastructure setup

Workflow

  1. Define Error Classes: Create base AppError class with statusCode, isOperational flag, and metadata
  2. Categorize Errors: Distinguish Operational (bad input, network) from Programmer (null ptr, logic bug)
  3. Centralize Middleware: Add framework-level error handler to catch ALL exceptions globally
  4. Log Appropriately: Full stack for 5xx errors; metadata only for 4xx errors
  5. Sanitize Output: Strip stack traces and internal details before sending to client
  6. Crash on Programmer Error: Unhandled programmer errors MUST crash and restart the process
  7. Test Error Paths: Verify error handling works for all failure scenarios

Rules

  • MUST NEVER silently swallow exceptions (catch(e) {})
  • MUST crash and restart process for unhandled Programmer Errors
  • MUST standardize all HTTP error responses to RFC 7807 format
  • MUST log full stack traces for 5xx errors
  • MUST log only message and context for 4xx errors
  • MUST sanitize all error responses (no DB details, SQL, stack traces)
  • MUST NEVER throw string literals (always throw Error objects)
  • MUST distinguish between Operational and Programmer errors

Read the full file on GitHub · 178 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 178 lines · 18 tokens per session scan A 8a61dc94ca27

Subscribe to this mod's changes

error-handling-architecture is a skill published in the GitHub repository KraitDev/skiLL.Md (6 stars, last pushed 4mo ago), licensed MIT. It adds 18 tokens to every session and 1,669 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

error-handling

Implement robust error handling with custom error types, proper propagation, user-friendly messages, and logging. Use when adding error handling to APIs, libraries, or applications.

asgarovf/locusai · 36 tokens

error-handling

Use when designing the reaction to a class of failures — typed error taxonomies, retry/backoff/timeout policy, circuit breakers, React/Next error boundaries, and the user-message vs operator-log split. NOT diagnosing one specific crash (that is debug), NOT logs/metrics/traces (that is observability), NOT the wire…

ericrisco/rsc-harness · 78 tokens

flutter-dio-cache-interceptor-engineering

Use when adding, reviewing, debugging, testing, or tuning diocacheinterceptor in a Flutter or Dart Dio client. Covers CacheOptions, CachePolicy, HTTP revalidation, cache stores, offline fallback, authenticated-user key isolation, invalidation, platform compatibility, and 4.x migration. Trigger for stale Dio responses…

ariaramin/flutter-skills · 126 tokens

flutter-dio-engineering

Design, implement, review, debug, secure, test, refactor, and optimize production Flutter/Dart networking built with Dio 5.x. Use this skill whenever a Flutter task involves Dio clients, REST/HTTP APIs, BaseOptions/Options, interceptors, bearer authentication, token refresh, retries, cancellation, uploads/downloads…

ariaramin/flutter-skills · 132 tokens

flutter-firebase-messaging

Use when adding, configuring, reviewing, debugging, migrating, or optimizing Firebase Cloud Messaging in a Flutter app with FlutterFire firebasemessaging. Covers permissions, registration tokens, foreground and background handling, notification taps and routing, Android channels and priority, APNs, macOS, Web Push…

ariaramin/flutter-skills · 150 tokens

Full-Stack Error Handling

Error propagation patterns — backend error shape to API response to frontend fetch wrapper to UI state.

niels-emmer/myace · 24 tokens