Showing 28 verified skills. 284 preview entries are hidden until we confirm a real source. Show preview skills · Why?
Generate comprehensive error handling with recovery strategies
claude install community/error-handlerError handling patterns: generate custom error hierarchies, React error boundaries, retry logic, graceful degradation, and user-facing error pages.
This is the actual SKILL.md file that powers this skill. Copy it to install.
---
name: error-handler
description: |
Trigger when the user asks to improve error handling, add error boundaries,
structure exceptions, or design retry logic. Phrases: "error handling",
"error boundary", "exception strategy", "retry logic", "fail gracefully".
allowed-tools:
- Read
- Write
- Edit
- Grep
---
# Error Handler
Audit a codebase's error handling and apply consistent patterns. Distinguish
recoverable from unrecoverable errors; do not swallow failures.
## Prerequisites
- Codebase has at least basic logging or observability
- User has decided on a stance for unknown errors (fail fast vs log and continue)
## Steps
1. **Grep the codebase for error patterns:**
- `catch (e)` blocks with no body - silent swallow, fix these
- `console.error` without re-throw or escalation
- `throw new Error("...")` without context
- `any` catches in TypeScript
2. **Classify errors into four buckets:**
- **Programmer errors** (null deref, type mismatch) - should crash loudly
in dev, never be caught broadly
- **Operational errors** (network timeout, rate limit) - should retry with
backoff up to a cap, then escalate
- **User errors** (invalid input) - should return a structured error
response, not throw
- **Contract errors** (upstream API breaks its schema) - should fail loud
with full context; these are bugs in the integration
3. **Apply the right pattern per bucket:**
User input validation at the boundary:
```ts
const result = InputSchema.safeParse(req.body);
if (!result.success) {
return Response.json({ error: result.error.format() }, { status: 422 });
}
```
Operational retry with backoff:
```ts
async function withRetry<T>(fn: () => Promise<T>, attempts = 3): Promise<T> {
for (let i = 0; i < attempts; i++) {
try { return await fn(); } catch (e) {
if (i === attempts - 1) throw e;
await new Promise(r => setTimeout(r, 2 ** i * 250));
}
}
throw new Error("unreachable");
}
```
Context-preserving rethrow:
```ts
try { await fetchUser(id); }
catch (e) { throw new Error(`fetchUser failed for id=${id}: ${e}`); }
```
4. **Never use bare `try/catch/empty`.** If you catch, either log with context
and rethrow, or deliberately handle. Silent swallows are bugs waiting to
happen at 2am.
5. **Add an error boundary at the framework root** for React apps. In Next.js,
`app/error.tsx` catches render-time errors.
## Output
- Grep report showing error-handling hotspots
- PR that fixes the silent-swallow and empty-catch cases first
- README section documenting the project's error-handling stance
mkdir -p ~/.claude/skills/error-handler~/.claude/skills/error-handler/SKILL.mdResulting file structure:
~/.claude/
skills/
error-handler/
SKILL.md <-- skill definitionSkills are loaded automatically by Claude Code when you start a new session. The skill name and description in the frontmatter determine when Claude triggers it.
Recommended from shared domain, career, and tool overlap with Error Handler
Generate typed API clients and webhook handlers from specs
Both used by Software Engineer
You'll keep your agent's memory and skills when switching between coding harnesses.
Works in shared tools
You'll ship higher-quality agent outputs by engineering context instead of prompts.
Works in shared tools
Control a browser from your AI editor - navigate, screenshot, interact
Both used by Software Engineer
Build GraphQL schemas with resolvers and type-safe client generation
Both used by Software Engineer
Extract strings, manage translations, and validate i18n completeness
Both used by Software Engineer
Error Handler