Agent skill

Vercel Reliability Patterns

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation.

MITAuto-check passedBackend & APIs

Install Vercel Reliability Patterns

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill vercel-reliability-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace vercel-reliability-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/vercel-reliability-patterns .claude/skills/vercel-reliability-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
vercel-reliability-patterns
GitHub stars
2.8k
Token cost
~2.6k tokens
SKILL.md length
374 words
Files
6 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation.

  • Works in 6 steps: Circuit Breaker for External Dependencies → Retry with Exponential Backoff → Graceful Degradation with Stale Cache → …
  • Building fault-tolerant serverless functions
  • SKILL.md covers Overview, Prerequisites, Instructions and Reliability Patterns Summary, plus 5 more sections
  • Calls vercel and curl

What it does

Vercel Reliability Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. 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".

Its SKILL.md is about 2.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/circuit-breaker.md`, `references/dead-letter-queue.md` and `references/errors.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Error handling, Deployment and Serverless. It works with Vercel. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Building fault-tolerant serverless functions
  • Implementing retry strategies
  • Adding resilience to production Vercel services
  • With phrases like vercel reliability

Example prompts

  • “vercel reliability”
  • “vercel circuit breaker”
  • “vercel resilience”
  • “/vercel-reliability-patterns”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Circuit Breaker for External Dependencies
  2. Retry with Exponential Backoff
  3. Graceful Degradation with Stale Cache
  4. Idempotency Keys for Mutations
  5. Health Check with Dependency Status
  6. Deployment-Level Resilience

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • vercel
    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • vercel.com
    • martinfowler.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Vercel Reliability Patterns loads about 2.6k tokens when it runs, and up to ~3.5k if it reads all its reference files. Until then it costs about 108 tokens; SKILL.md has 374 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~108
When it runs · the whole SKILL.md, loaded when a task matches
~2.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit 80f86df, republished under its MIT licence (© jeremylongshore). 374 words, ~2,603 tokens.

Download SKILL.mdSave it as .claude/skills/vercel-reliability-patterns/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
vercel-reliability-patterns
description
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".
allowed-tools
Read, Write, Edit
compatibility
Designed for Claude Code
version
1.18.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, vercel, reliability, resilience, patterns

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);
      return fallback();
    }
  }

  private onSuccess(): void {
    this.failures = 0;
    this.state = 'CLOSED';
  }

  private onFailure(): void {
    this.failures++;
    this.lastFailure = Date.now();
    if (this.failures >= this.threshold) {
      this.state = 'OPEN';
      console.warn(`Circuit OPENED after ${this.failures} failures`);
    }
  }
}

// Usage in a serverless function:
const dbCircuit = new CircuitBreaker(3, 30000);

export default async function handler(req, res) {
  const users = await dbCircuit.call(
    () => db.user.findMany({ take: 10 }),
    () => [] // Fallback: empty array when DB is down
  );
  res.json({ users, degraded: users.length === 0 });
}

Important for serverless: Circuit breaker state lives in a single function instance. Different instances have independent circuits. For global circuit state, use Vercel KV or Edge Config.

Step 2: Retry with Exponential Backoff
typescript
// lib/retry.ts
interface RetryOptions {
  maxRetries?: number;
  baseDelayMs?: number;
  maxDelayMs?: number;
  retryOn?: (error: unknown) => boolean;
}

async function withRetry<T>(
  fn: () => Promise<T>,
  options: RetryOptions = {}
): Promise<T> {
  const { maxRetries = 3, baseDelayMs = 200, maxDelayMs = 5000, retryOn } = options;

  for (let attempt = 0; attempt <= maxRetries; attempt++) {
    try {
      return await fn();
    } catch (error) {
      if (attempt === maxRetries) throw error;
      if (retryOn && !retryOn(error)) throw error;

      const delay = Math.min(
        baseDelayMs * Math.pow(2, attempt) + Math.random() * 200,
        maxDelayMs
      );
      await new Promise(r => setTimeout(r, delay));
    }
  }
  throw new Error('Unreachable');
}

// Usage:
const data = await withRetry(
  () => fetch('https://api.example.com/data').then(r => {
    if (!r.ok) throw new Error(`HTTP ${r.status}`);
    return r.json();
  }),
  {
    maxRetries: 3,
    retryOn: (err) => {
      // Only retry on network errors and 5xx, not 4xx
      if (err instanceof TypeError) return true; // network error
      return err.message?.includes('5');
    },
  }
);
Step 3: Graceful Degradation with Stale Cache
typescript
// api/products.ts — serve stale data when primary source is down
import { get, set } from '@vercel/kv';

export default async function handler(req, res) {
  const cacheKey = 'products:latest';

  try {
    // Try primary data source
    const freshData = await fetchProductsFromDB();

    // Update cache with fresh data
    await set(cacheKey, JSON.stringify(freshData), { ex: 3600 });

    res.setHeader('x-data-source', 'live');
    res.json(freshData);
  } catch (error) {
    // Primary failed — serve stale cache
    const cachedData = await get(cacheKey);

    if (cachedData) {
      console.warn('Serving stale cache — primary source unavailable');
      res.setHeader('x-data-source', 'cache-stale');
      res.json(JSON.parse(cachedData as string));
    } else {
      // No cache available — return degraded response
      res.setHeader('x-data-source', 'degraded');
      res.status(503).json({
        error: 'Service temporarily unavailable',
        degraded: true,
      });
    }
  }
}
Step 4: Idempotency Keys for Mutations
typescript
// api/orders/route.ts — idempotent order creation
import { NextRequest, NextResponse } from 'next/server';
import { db } from '@/lib/db';

export async function POST(request: NextRequest) {
  const idempotencyKey = request.headers.get('idempotency-key');
  if (!idempotencyKey) {
    return NextResponse.json(
      { error: 'idempotency-key header required' },
      { status: 400 }
    );
  }

  // Check if this request was already processed
  const existing = await db.idempotencyRecord.findUnique({
    where: { key: idempotencyKey },
  });

  if (existing) {
    // Return the cached response — same status and body
    return NextResponse.json(JSON.parse(existing.responseBody), {
      status: existing.responseStatus,
      headers: { 'x-idempotent-replay': 'true' },
    });
  }

  // Process the order
  const body = await request.json();
  const order = await db.order.create({ data: body });

  // Cache the response for idempotency
  const responseBody = JSON.stringify({ order });
  await db.idempotencyRecord.create({
    data: { key: idempotencyKey, responseStatus: 201, responseBody },
  });

  return NextResponse.json({ order }, { status: 201 });
}
Step 5: Health Check with Dependency Status
typescript
// api/health/route.ts
export const dynamic = 'force-dynamic';

interface HealthCheck {
  name: string;
  check: () => Promise<boolean>;
}

const checks: HealthCheck[] = [
  {
    name: 'database',
    check: async () => {
      await db.$queryRaw`SELECT 1`;
      return true;
    },
  },
  {
    name: 'cache',
    check: async () => {
      await kv.ping();
      return true;
    },
  },
  {
    name: 'external-api',
    check: async () => {
      const r = await fetch('https://api.example.com/health', { signal: AbortSignal.timeout(3000) });
      return r.ok;
    },
  },
];

export async function GET() {
  const results: Record<string, 'ok' | 'error'> = {};

  await Promise.all(
    checks.map(async ({ name, check }) => {
      try {
        await check();
        results[name] = 'ok';
      } catch {
        results[name] = 'error';
      }
    })
  );

  const healthy = Object.values(results).every(v => v === 'ok');
  return Response.json(
    { status: healthy ? 'healthy' : 'degraded', checks: results },
    { status: healthy ? 200 : 503 }
  );
}
Step 6: Deployment-Level Resilience
bash
# Instant rollback on health check failure (CI integration)
DEPLOY_URL=$(vercel --prod)
HEALTH=$(curl -s -o /dev/null -w "%{http_code}" "$DEPLOY_URL/api/health")

if [ "$HEALTH" != "200" ]; then
  echo "Health check failed ($HEALTH) — rolling back"
  vercel rollback
  exit 1
fi
echo "Deployment healthy"

Reliability Patterns Summary

PatternProtects AgainstVercel Implementation
Circuit breakerDependency degradationIn-function state or Edge Config
Retry + backoffTransient failureswithRetry wrapper
Stale cachePrimary source outageVercel KV with TTL
IdempotencyDuplicate mutationsDatabase record per request
Health checksBad deployments/api/health + rollback automation
Instant rollbackDeployment regressionvercel rollback in CI

Output

  • Circuit breaker protecting all external dependency calls
  • Retry logic with exponential backoff for transient failures
  • Graceful degradation serving stale data when primary fails
  • Idempotency preventing duplicate mutations
  • Automated health check + rollback pipeline
Show full SKILL.md (168 more words)Show less

Error Handling

ErrorCauseSolution
Circuit opens too aggressivelyThreshold too lowIncrease failure threshold (e.g., 5 → 10)
Retry causes duplicate side effectsNo idempotencyAdd idempotency-key to mutation endpoints
Stale cache expiredTTL too short or never populatedIncrease TTL, seed cache on deploy
Health check false positiveTimeout too shortIncrease AbortSignal timeout to 5s
Rollback reverts good deploymentFlaky health checkAdd retry to health check before rollback

Examples

Protect a payment mutation from retries and rollback safely

Require a client-supplied idempotency key for the mutation, store the key and outcome in the authoritative data store, and retry only transient upstream failures with bounded backoff. Exercise a synthetic duplicate request in preview and confirm that it returns the original outcome without creating a second charge or record. Pair health-check rollback with multiple checks and an explicit deployment ID so a noisy probe cannot revert a healthy release.

Resources

Next Steps

For policy guardrails, see vercel-policy-guardrails.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/.curated/vercel-reliability-patterns of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/circuit-breaker.md
  • references/dead-letter-queue.md
  • references/errors.md
  • references/examples.md
  • references/idempotency-keys.md

Open the folder on GitHubat commit 80f86df

Compare with similar skills

Vercel Reliability Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Vercel Reliability Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vercel Reliability Patterns this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.6kAutomated safety check: PassMIT
Deploy Verceljohnku2011/boilerplates-with-ai-skills240—~660Automated safety check: NotesMIT
Vercel Deploymentdavila7/claude-code-templates32k5 repos~534Automated safety check: PassMIT
Frontmcp Deploymentagentfront/frontmcp146—~9.2kAutomated safety check: NotesApache-2.0
Deploy Fullstack Vercelvellum-ai/vellum-assistant1.4k—~2.8kAutomated safety check: PassMIT
Vercelhoodini/ai-agents-skills282—~1.1kAutomated safety check: NotesNone

Similar skills

  • Deploy Vercel

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when deploying or configuring this project on Vercel — env vars, build settings, serverless limits, and production checks for Next.js or Express.

    240 GitHub stars~660 tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Vercel Deployment

    davila7/claude-code-templates

    Expert knowledge for deploying to Vercel with Next.js Use when: vercel, deploy, deployment, hosting, production.

    32k GitHub starsUsed in 5 repos~534 tokens
    DevOps & CloudAuto-check passed
  • Frontmcp Deployment

    agentfront/frontmcp

    A skill your agent uses when deploying, building for production, packaging, or shipping a FrontMCP server.

    146 GitHub stars~9.2k tokensUpdated 2 days ago
    DevOps & CloudAuto-check: notes
  • Deploy Fullstack Vercel

    vellum-ai/vellum-assistant

    Build and deploy a full-stack app (React frontend + Python/FastAPI backend) or a Vellum app to Vercel as a serverless demo with seeded data

    1.4k GitHub stars~2.8k tokensUpdated today
    Backend & APIsAuto-check passed
  • Vercel

    hoodini/ai-agents-skills

    Deploy and configure applications on Vercel. An agent skill from hoodini/ai-agents-skills.

    282 GitHub stars~1.1k tokensUpdated 2 mo ago
    Backend & APIsAuto-check: notes
  • Deploying Applications

    ancoleman/ai-design-components

    Deployment patterns from Kubernetes to serverless and edge functions.

    526 GitHub stars~3.1k tokensUpdated 10 mo ago
    DevOps & CloudAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Questions about Vercel Reliability Patterns

What does Vercel Reliability Patterns do?

Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation. Vercel Reliability Patterns is an agent skill from jeremylongshore/tons-of-skills-marketplace. Implement reliability patterns for Vercel deployments including circuit breakers, retry logic, and graceful degradation.

When should I use Vercel Reliability Patterns?

Vercel Reliability Patterns fits situations like: building fault-tolerant serverless functions; implementing retry strategies; adding resilience to production Vercel services; with phrases like vercel reliability.

How do I install Vercel Reliability Patterns in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill vercel-reliability-patterns -a claude-code`. Or copy the skill folder (skills/.curated/vercel-reliability-patterns in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/vercel-reliability-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Vercel Reliability Patterns in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill vercel-reliability-patterns -a codex`. Or copy the skill folder (skills/.curated/vercel-reliability-patterns in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/vercel-reliability-patterns in your project. Codex loads it when a task matches its description.

Can I use Vercel Reliability Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill vercel-reliability-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/vercel-reliability-patterns, .gemini/skills/vercel-reliability-patterns, .github/skills/vercel-reliability-patterns and .opencode/skills/vercel-reliability-patterns in your project.

What does Vercel Reliability Patterns need to run?

Going by SKILL.md and its folder, Vercel Reliability Patterns needs the command-line tools its instructions call (vercel and curl). Its frontmatter pre-approves these tools: Read, Write, Edit. Compatibility (from SKILL.md): Designed for Claude Code.

Does Vercel Reliability Patterns access the network?

SKILL.md names 2 domains. As links in the text: vercel.com and martinfowler.com. This is read from the text; nothing was executed.

Is Vercel Reliability Patterns safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Vercel Reliability Patterns use?

Vercel Reliability Patterns is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Vercel Reliability Patterns use?

About 2.6k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 865 tokens, read only when the agent opens those files.

What are the alternatives to Vercel Reliability Patterns?

Skills that share tags, products or a category with Vercel Reliability Patterns: Deploy Vercel (johnku2011/boilerplates-with-ai-skills, 240 stars), Vercel Deployment (davila7/claude-code-templates, 32k stars), Frontmcp Deployment (agentfront/frontmcp, 146 stars) and Deploy Fullstack Vercel (vellum-ai/vellum-assistant, 1.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vercel Reliability Patterns?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.