vercel-reliability-patterns

Featured

Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation. Use when building fault-tolerant serverless functions, implementing retry strategies, or adding resilience to production Vercel services. Trigger with phrases like "vercel reliability", "vercel circuit breaker", "vercel resilience", "vercel fallback", "vercel graceful degradation".

AI & Automation 2,926 stars 433 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Vercel Reliability Patterns ## Overview Build fault-tolerant Vercel deployments with circuit breakers, retry logic, graceful degradation, and instant rollback integration. Addresses reliability at two levels: function-level resilience (protecting against dependency failures) and deployment-level resilience (protecting against bad deploys). ## Prerequisites - Vercel project deployed to production - Understanding of failure modes in serverless - External dependencies (databases, APIs) identified ## Instructions ### Step 1: Circuit Breaker for External Dependencies ```typescript // lib/circuit-breaker.ts type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN'; class CircuitBreaker { private state: CircuitState = 'CLOSED'; private failures = 0; private lastFailure = 0; private readonly threshold: number; private readonly resetTimeMs: number; constructor(threshold = 5, resetTimeMs = 30000) { this.threshold = threshold; this.resetTimeMs = resetTimeMs; } async call<T>(fn: () => Promise<T>, fallback: () => T): Promise<T> { if (this.state === 'OPEN') { if (Date.now() - this.lastFailure > this.resetTimeMs) { this.state = 'HALF_OPEN'; } else { console.warn('Circuit OPEN — returning fallback'); return fallback(); } } try { const result = await fn(); this.onSuccess(); return result; } catch (error) { this.onFailure(); console.error('Circuit breaker caught error:', error); ...

Details

Author
jeremylongshore
Repository
jeremylongshore/claude-code-plugins-plus-skills
Created
1 years ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category