error-handling

error-handling is a skill for Claude Code from komluk/scaffolding. It costs 61 tokens per session (1,176 once invoked), scanned A, original, MIT.

Rules for handling failures consistently in frontend and backend software. Frontend code runs in the user's browser, while backend code runs on a server; both need to turn failures into useful responses without exposing internal details.

In plain words
What is it for?
Use it when writing exception handlers, try/catch blocks, error boundaries, custom exceptions, API-error handling, retries, or user-facing error messages. It covers validation, authentication, permissions, missing resources, conflicts, rate limits, and server failures.
Why use it?
It prevents each part of an application from handling errors differently or showing confusing and unsafe messages. It also gives failures consistent categories, status codes, and user actions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the scaffolding plugin — 39 skills, 9 commands, 13 agents shipped together

Good fit Use it when writing exception handlers, try/catch blocks, error boundaries, custom exceptions, API-error handling, retries, or user-facing error messages. It covers validation, authentication, permissions, missing resources, conflicts, rate limits, and server failures.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/komluk/scaffolding/error-handling
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 komluk/scaffolding --skill error-handling
Clone the repo
git clone --depth 1 https://github.com/komluk/scaffolding

Made for: Claude Code.

Or install scaffolding, the plugin that ships this one along with the rest of its 39 skills, 9 commands, 13 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/komluk/scaffolding/error-handling/github.svg)](https://agentmods.dev/skills/komluk/scaffolding/error-handling)
Your own site
<a href="https://agentmods.dev/skills/komluk/scaffolding/error-handling"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/error-handling/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

Your own site · 80×15
<a href="https://agentmods.dev/skills/komluk/scaffolding/error-handling"><img src="https://agentmods.dev/badge/skills/komluk/scaffolding/error-handling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,176 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.00061 $0.01176
Opus 5.5 $0.00024 $0.00470
Sonnet 5.5 $0.00012 $0.00235
Haiku 4.5 $0.00006 $0.00118

Measured 1mo ago against content hash d687bb5dbf52, 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 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/error-handling/SKILL.md · 192 lines

How it starts

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

Error Handling Skill

Purpose

Standards for consistent error handling across frontend and backend layers (examples in React + Python).

Auto-Invoke Triggers

  • Implementing exception handling
  • Creating custom exceptions
  • Handling API errors
  • Implementing retry logic
  • Designing user-facing error messages

Error Categories

Category HTTP Code User Action Log Level
Validation 400 Show field errors WARN
Authentication 401 Redirect to login WARN
Authorization 403 Show permission denied WARN
NotFound 404 Show not found message INFO
Conflict 409 Show conflict details WARN
RateLimit 429 Show retry-after WARN
ExternalService 502 Show fallback/retry option ERROR
Internal 500 Show generic error ERROR
Critical 500 Show maintenance page CRITICAL

Exception Hierarchy Design

Principles

  • Create base AppException class for all application errors
  • Extend with specific exception types per category
  • Include: code, message, status code, details (optional)
  • Never expose internal details to clients

Required Exception Types

  1. ValidationException - Invalid input data
  2. AuthenticationException - Auth token invalid/expired
  3. AuthorizationException - User lacks permission
  4. NotFoundException - Resource doesn't exist
  5. ConflictException - Resource state conflict
  6. RateLimitException - Too many requests
  7. ExternalServiceException - Third-party failure

Error Response Format

Standard Structure

{
  "code": "ERROR_CODE",
  "message": "Human-readable description",
  "details": { "field": ["error1", "error2"] },
  "correlationId": "abc-123"
}

Error Codes Convention

  • Use SCREAMING_SNAKE_CASE
  • Be specific: USER_NOT_FOUND not NOT_FOUND
  • Group by domain: AUTH_TOKEN_EXPIRED, AUTH_INVALID_CREDENTIALS

Frontend Error Handling

Principles

  • Catch errors at API client level
  • Transform to typed error objects
  • Display user-friendly messages
  • Log for debugging (not in production)

Read the full file on GitHub · 192 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 · 192 lines · 61 tokens per session scan A d687bb5dbf52

Subscribe to this mod's changes

error-handling is a skill published in the GitHub repository komluk/scaffolding (15 stars, last pushed yesterday), licensed MIT. It adds 61 tokens to every session and 1,176 once invoked, about $0.0002 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-30.

Related

Other skills, from other repositories

operating-cadence

Designs the rhythm an organization runs on — which reviews happen weekly, monthly and quarterly, what each one decides, who owns the numbers presented, and how a signal at the front line reaches the people who can act on it. Use this to set up a management operating system, fix a meeting calendar that produces no…

cbrock84/headcount · 95 tokens

broken-links

Find and fix broken links — three modes with different scale ceilings. local audits any local repo (HTML/MD/MDX, no size limit) via Glob/Grep + per-link verification. page checks one live URL deeply (30-100 outbound links per run). site requires the Ahrefs site-audit MCP for true multi-page crawl — without it, refuses…

akii-technologies-ltd/akii-seo-ai-search-optimizer · 162 tokens

analyze

Deep-dive codebase analysis that explains how things actually work — business rules, architecture patterns, auth flows, data models, integrations, and performance hotspots. Use whenever the user asks "how does X work", "map the Y flow", "what are the business rules for Z", "trace the auth path", "explore the codebase…

rsmdt/the-startup · 118 tokens

debug

Systematically diagnose and resolve bugs through conversational investigation and root cause analysis.

rsmdt/the-startup · 15 tokens

testing

Writing effective tests and running them successfully. Covers layer-specific mocking rules, test design principles, debugging failures, and flaky test management. Use when writing tests, reviewing test quality, or debugging test failures.

rsmdt/the-startup · 42 tokens

performance-analysis

Measurement approaches, profiling patterns, bottleneck identification, and optimization guidance. Use when diagnosing performance issues, establishing baselines, identifying bottlenecks, or planning for scale. Always measure before optimizing.

rsmdt/the-startup · 42 tokens