resilience-patterns

Solid

Circuit breaker, bulkhead, retry with jitter, graceful shutdown, health check patterns for production resilience.

AI & Automation 552 stars 45 forks Updated 6 days ago MIT

Install

View on GitHub

Quality Score: 91/100

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

Skill Content

# Resilience Patterns Production-grade patterns for surviving failures without cascading. ## Circuit Breaker ```typescript // States: CLOSED (normal) → OPEN (blocking) → HALF_OPEN (testing) type CircuitState = 'CLOSED' | 'OPEN' | 'HALF_OPEN' class CircuitBreaker { private state: CircuitState = 'CLOSED' private failureCount = 0 private lastFailureTime = 0 private successCount = 0 constructor( private readonly failureThreshold = 5, private readonly recoveryTimeout = 30_000, // ms private readonly halfOpenMaxCalls = 3 ) {} async call<T>(fn: () => Promise<T>): Promise<T> { if (this.state === 'OPEN') { if (Date.now() - this.lastFailureTime > this.recoveryTimeout) { this.state = 'HALF_OPEN' this.successCount = 0 } else { throw new Error('Circuit breaker is OPEN — request rejected') } } try { const result = await fn() this.onSuccess() return result } catch (err) { this.onFailure() throw err } } private onSuccess(): void { if (this.state === 'HALF_OPEN') { this.successCount++ if (this.successCount >= this.halfOpenMaxCalls) { this.state = 'CLOSED' this.failureCount = 0 } } else { this.failureCount = 0 } } private onFailure(): void { this.failureCount++ this.lastFailureTime = Date.now() if (this.failureCount >= this.failureThreshold) { this.state = 'OPEN' } } getState(): Cir...

Details

Author
vibeeval
Repository
vibeeval/vibecosystem
Created
8 months ago
Last Updated
6 days ago
Language
C#
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Featured

customerio-reliability-patterns

Implement Customer.io reliability and fault-tolerance patterns. Use when building circuit breakers, fallback queues, idempotency, or graceful degradation for Customer.io integrations. Trigger: "customer.io reliability", "customer.io resilience", "customer.io circuit breaker", "customer.io fault tolerance".

2,926 Updated yesterday
jeremylongshore
AI & Automation Listed

chaos-and-resilience

Chaos engineering, resilience patterns, failure recovery, and fault tolerance for the {{PROJECT_NAME}}. Covers circuit breaker patterns (HTTP, WS, per-venue), reconnect gate design, graceful shutdown protocol, backpressure strategies (PubSub 1MB/4MB, persistence queues), worker lifecycle management, IPC channel health detection, failure scenario matrix, bounded queue design, and event loop stall recovery. Use when reviewing or writing any code that touches error handling, retry logic, reconnection, circuit breakers, worker management, IPC channels, queue management, backpressure, graceful shutdown, health checks, or any failure-adjacent code path.

3 Updated yesterday
Canhada-Labs
AI & Automation Featured

figma-reliability-patterns

Build resilient Figma integrations with circuit breakers, fallbacks, and graceful degradation. Use when implementing fault tolerance, handling Figma outages gracefully, or building production-grade reliability into Figma API consumers. Trigger with phrases like "figma reliability", "figma circuit breaker", "figma fallback", "figma resilience", "figma graceful degradation".

2,926 Updated yesterday
jeremylongshore