Tooluck logoTooluck
SKILL.md

error-handling

Agent skill fromCloudAI-X/claude-workflow-v2

Implements error handling patterns, structured logging, retry strategies, circuit breakers, and graceful degradation. Use when designing error handling, setting up logging, implementing retries, adding error tracking, or when asked about error boundaries, log aggregation, alerting, or resilience patterns.

How to install error-handling

install error-handling
# install the claude-workflow-v2 pack with the skills CLI
npx skills add CloudAI-X/claude-workflow-v2

# or add only this skill to Claude Code: copy the folder

skills/error-handling/

# into

~/.claude/skills/error-handling/ (all projects)

.claude/skills/error-handling/ (one project)

skills/error-handling/SKILL.md

MITFull file
1# Error Handling & Observability
2
3### When to Load
4
5- **Trigger**: Try/catch patterns, retry logic, error responses, circuit breakers, structured logging
6- **Skip**: No error handling or observability involved in the current task
7
8## Error Handling Workflow
9
10Copy this checklist and track progress:
11
12```
13Error Handling Progress:
14- [ ] Step 1: Define error taxonomy (categories and severity)
15- [ ] Step 2: Implement error handling by layer
16- [ ] Step 3: Set up structured logging
17- [ ] Step 4: Add retry and circuit breaker patterns
18- [ ] Step 5: Configure error tracking service
19- [ ] Step 6: Define user-facing error messages
20- [ ] Step 7: Validate against anti-patterns checklist
21```
22
23## Error Handling Patterns by Language
24
25### JavaScript / TypeScript
26
27```typescript
28// Custom error hierarchy
29class AppError extends Error {
30 constructor(
31 message: string,
32 public statusCode: number = 500,
33 public code: string = "INTERNAL_ERROR",
34 public isOperational: boolean = true,
35 ) {
36 super(message);
37 this.name = this.constructor.name;
38 }
39}
40class NotFoundError extends AppError {
41 constructor(resource: string, id: string) {
42 super(`${resource} with id ${id} not found`, 404, "NOT_FOUND");
43 }
44}
45class ValidationError extends AppError {
46 constructor(public errors: Record<string, string[]>) {
47 super("Validation failed", 400, "VALIDATION_ERROR");
48 }
49}
50
51// WRONG: Swallowing errors silently
52try {
53 await saveUser(data);
54} catch (e) {
55 // nothing here -- bug hides forever
56}
57…

Excerpt shown under the repository's MIT license.

More skills in claude-workflow-v2

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates