Skip to content
Development
Skill

/error-patterns

Provides error classification, recovery, and graceful-degradation patterns. Use when implementing error handling or debugging resilience failures in any skill.

From plugin
claude-night-market
343200 skills60 agents162 commands1 MCP

Claude Code

$ npx -y skills add athola/claude-night-market --skill error-patterns --agent claude-code

SKILL.md

error-patterns.SKILL.md
name: error-patterns
description: Provides error classification, recovery, and graceful-degradation patterns. Use when implementing error handling or debugging resilience failures in any skill.
alwaysApply: false
category: infrastructure
tags:
- errors
- error-handling
- recovery
- resilience
- debugging
dependencies:
- usage-logging
provides:
  infrastructure:
  - error-handling
  - error-classification
  - recovery
  patterns:
  - graceful-degradation
  - error-logging
  - debugging
usage_patterns:
- error-handling
- resilience-patterns
- debugging-workflows
complexity: beginner
estimated_tokens: 450
progressive_loading: true
modules:
- modules/classification.md
- modules/recovery-strategies.md
- modules/agent-damage-control.md

Error Patterns

Overview

Standardized error handling patterns for consistent, production-grade behavior across plugins. Provides error classification, recovery strategies, and debugging workflows.

When To Use

  • Building resilient integrations
  • Need consistent error handling
  • Want graceful degradation
  • Debugging production issues

When NOT To Use

  • Project doesn't use the leyline infrastructure patterns
  • Simple scripts without service architecture needs

Error Classification

By Severity

| Level | Action | Example | |-------|--------|---------| | **Critical** | Halt, alert | Auth failure, service down | | **Error** | Retry or secondary strategy | Rate limit, timeout | | **Warning** | Log, continue | Partial results, deprecation | | **Info** | Log only | Non-blocking issues |

By Recoverability

class ErrorCategory(Enum):
    TRANSIENT = "transient"  # Retry likely to succeed
    PERMANENT = "permanent"  # Retry won't help
    CONFIGURATION = "config"  # User action needed
    RESOURCE = "resource"  # Quota/limit issue

**Verification:** Run the command with `--help` flag to verify availability.

Quick Start

Standard Error Handler

# Sketch: implement handle_error and ErrorCategory in your plugin.
# leyline ships no error_patterns module.

try:
    result = service.execute(prompt)
except RateLimitError as e:
    return handle_error(
        e, ErrorCategory.RESOURCE, {"retry_after": e.retry_after, "service": "gemini"}
    )
except AuthError as e:
    return handle_error(
        e, ErrorCategory.CONFIGURATION, {"action": "Run 'gemini auth login'"}
    )

**Verification:** Run the command with `--help` flag to verify availability.

Error Result

@dataclass
class ErrorResult:
    category: ErrorCategory
    message: str
    recoverable: bool
    suggested_action: str
    metadata: dict

**Verification:** Run the command with `--help` flag to verify availability.

Common Patterns

Authentication Errors (401/403)

  • Verify credentials exist
  • Check token expiration
  • Validate permissions/scopes
  • Suggest re-authentication

Rate Limit Errors (429)

  • Extract retry-after header
  • Log for quota tracking
  • Implement backoff
  • Consider alternative service

Timeout Errors

  • Increase timeout for retries
  • Break into smaller requests
  • Use async patterns
  • Consider different model

Context Too Large (400)

  • Estimate tokens before request
  • Split into multiple requests
  • Reduce input content
  • Use larger context model

Integration Pattern

# In your skill's frontmatter
dependencies: [leyline:error-patterns]

**Verification:** Run the command with `--help` flag to verify availability.

Detailed Resources

  • **Classification**: See `modules/classification.md` for error taxonomy
  • **Recovery**: See `modules/recovery-strategies.md` for handling patterns
  • **Agent Damage Control**: See `modules/agent-damage-control.md` for multi-agent error recovery and escalation

Exit Criteria

  • [ ] Error classified correctly
  • [ ] Appropriate recovery attempted
  • [ ] User-actionable message provided
  • [ ] Error logged for debugging
Read more
@athola
Ships withclaude-night-market

A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.

343200 skills60 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
343
Star history of athola/claude-night-market on GitHub, a chart by star-history.com

Other skills on claude-night-market.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills11d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc13d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react2d252k
@facebook@facebookInstall Skill

Questions about error-patterns.

Which coding agents can use error-patterns?
error-patterns installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.