vstorm-co/production-stack-skills/production-error-handling
Claude Code and agent skill by vstorm-co/production-stack-skills
- community
Checking that the SKILL.md file is still in the repository.
Production error handling patterns — error taxonomy, retry with exponential backoff, circuit breakers, graceful degradation, dead-letter queues, and structured error logging. Use this skill when the user writes error-prone code (external API calls, database operations, file I/O, network calls), implements retry logic, or asks about resilience patterns. Also trigger when user says /production errors.
Install
npx vskill@latest install vstorm-co/production-stack-skills/production-error-handlingSKILL.md
The same SKILL.md was published earlier as vstorm-co/production-stack-skills/production-error-handling.
Production Error Handling
This skill encodes battle-tested error handling patterns for systems that must stay up when everything around them is falling apart. Every pattern here comes from real production incidents: the retry storm that turned a blip into a 4-hour outage, the bare except: pass that silently ate data for three weeks, the missing timeout that let a dead service hold open 200 connections until the pool starved. Follow this guide and none of that happens on your watch.
1. Error Taxonomy
Classify every error BEFORE writing handling code. Different errors demand different responses. Treating them the same is how you turn a recoverable hiccup into a cascading outage.
The Four Categories
| Category | Response | Retry? | Alert? | Examples | |
|---|---|---|---|---|---|
| Transient | Retry with backoff | Yes | After N failures | Network timeout, 503, connection reset, rate limited (429) | |
| Permanent | Fail immediately | Never | On unexpected frequency | 400, 401, 404, validation error, malformed input | |
| Partial | Degrade gracefully | Optional | Low priority | Cache miss, analytics down, email service down | |
| Fatal | Crash fast | Never | Immediate (PagerDuty) | Missing config, corrupt state, OOM, disk full |
Exception Hierarchy for a Service
Define your exception hierarchy up front. This is not optional -- without it, every developer invents their own error handling and nothing is consistent.
Rules:
- Every exception carries a machine-readable
error_codefor structured logging and API responses TransientErroris the ONLY base class that retry logic should catch- Catching
ServiceErrorin a handler tells you "something from our domain went wrong" without mixing in random library exceptions - Fatal errors crash the process. Do not try to recover from corrupt state -- you will make it worse
2. Retry with Exponential Backoff and Jitter
Why Linear Retry Kills You
Linear retry (sleep 1s, try again, sleep 1s, try again) causes thundering herd: when a service recovers, all waiting clients slam it simultaneously at the exact same interval. The service goes down again. Repeat until someone pages the on-call.
The correct formula:
base: starting delay (0.5s-1s)attempt: 0-indexed retry countjitter: random component (0 to base) that desynchronizes clientsmax_delay: cap to prevent absurd waits (30s-60s)
Python: tenacity
tenacity is the standard Python retry library. It handles backoff, jitter, and conditional retry in a composable way.
Node.js: p-retry
Retry Rules -- Non-Negotiable
- NEVER retry non-idempotent requests without an idempotency key. Retrying a
POST /chargewithout one can double-charge a customer. - NEVER retry 4xx errors (except 429). A 400 Bad Request will still be 400 on the next attempt.
- Always set `max_retries` (3-5 is typical). Without a cap, a persistent failure retries forever.
- Always set `max_delay` (30s-60s). Without a cap, exponential backoff reaches absurd delays.
- Always set a timeout on the underlying call. Retry logic without a timeout just stacks up hanging connections.
3. Circuit Breaker Pattern
A circuit breaker stops calling a failing service. Without it, every request to your service blocks for the timeout duration waiting for a dead dependency.
State Machine
- Closed: Normal operation. Failures are counted.
- Open: Circuit is tripped. All calls fail immediately with a fallback. No requests reach the downstream service.
- Half-Open: After
recovery_timeout, one probe request is allowed through. If it succeeds, circuit closes. If it fails, circuit re-opens.
Python: pybreaker
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/production-error-handling/SKILL.md
Popularity
- Repository stars
- 26
- Repository forks
- 7
- 7-day trend score
- 16
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vstorm-co/production-stack-skills/production-error-handling)