VE

vercel-local-dev-loop

Streamlines local development with hot-reloading and environment variable management using Vercel CLI.

Install

mkdir -p .claude/skills/vercel-local-dev-loop && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/8909" && unzip -o skill.zip -d .claude/skills/vercel-local-dev-loop && rm skill.zip

Installs to .claude/skills/vercel-local-dev-loop

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Configure Vercel local development with vercel dev, environment variables,
74 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Emulate Vercel platform locally with vercel dev
  • Synchronize environment variables from Vercel
  • Test serverless functions with local API routes
  • Apply vercel.json configurations locally
  • Mock request and response objects for unit testing

How it works

The skill uses the Vercel CLI to start a local server that emulates production behavior, including environment variable loading and API route handling.

Inputs & outputs

You give it
Local project files and Vercel environment variables
You get back
Local development server running at localhost

When to use vercel-local-dev-loop

  • Sync environment variables from Vercel to local
  • Start a local dev server for API testing
  • Debug function logic before deployment
  • Configure hot-reload environments

About this skill

Vercel Local Dev Loop

Overview

Run Vercel serverless functions and API routes locally using vercel dev. Covers environment variable management, hot reload, local testing patterns, and framework-specific dev servers.

Prerequisites

  • Completed vercel-install-auth setup
  • Project linked via vercel link
  • Node.js 18+ with npm/pnpm

Instructions

Step 1: Pull Environment Variables

# Pull env vars from Vercel to local .env files
vercel env pull .env.development.local

# This creates .env.development.local with all Development-scoped vars:
# VERCEL="1"
# VERCEL_ENV="development"
# DATABASE_URL="postgres://..."
# API_SECRET="sk-..."

Step 2: Start Local Dev Server

# vercel dev starts a local server that emulates the Vercel platform
vercel dev

# Output:
# Vercel CLI 39.x.x — dev command
# > Ready on http://localhost:3000

# With a specific port
vercel dev --listen 8080

# With debug logging
vercel dev --debug

vercel dev provides:

  • Serverless function emulation at /api/* routes
  • Automatic TypeScript compilation
  • vercel.json rewrites, redirects, and headers applied locally
  • Environment variables loaded from .env*.local files
  • Framework detection (Next.js, Nuxt, SvelteKit, etc.)

Step 3: Test Serverless Functions Locally

# Test your API route
curl http://localhost:3000/api/hello
# {"message":"Hello from Vercel Serverless Function!"}

# Test with POST body
curl -X POST http://localhost:3000/api/users \
  -H "Content-Type: application/json" \
  -d '{"name":"test","email":"[email protected]"}'

# Test with query parameters
curl "http://localhost:3000/api/search?q=vercel&limit=10"

Step 4: Framework-Specific Dev Servers

For frameworks with their own dev server, use those instead of vercel dev:

# Next.js — built-in Vercel compatibility
npx next dev
# API routes at pages/api/* or app/api/* work identically

# Nuxt
npx nuxi dev

# SvelteKit
npm run dev

# Astro
npx astro dev

The framework dev servers handle API routes natively. Use vercel dev only for plain serverless function projects without a framework.

Step 5: Local Environment Variable Management

# Add a new env var for development only
vercel env add MY_VAR development
# Prompts for value, stores encrypted on Vercel

# List all env vars
vercel env ls

# Remove an env var
vercel env rm MY_VAR development

# Pull updated vars after changes
vercel env pull .env.development.local

Step 6: Testing with Vitest

// api/__tests__/hello.test.ts
import { describe, it, expect, vi } from 'vitest';

// Mock the Vercel request/response
function createMockReq(overrides = {}) {
  return { method: 'GET', query: {}, body: null, ...overrides };
}

function createMockRes() {
  const res: any = {};
  res.status = vi.fn().mockReturnValue(res);
  res.json = vi.fn().mockReturnValue(res);
  res.send = vi.fn().mockReturnValue(res);
  return res;
}

describe('GET /api/hello', () => {
  it('returns 200 with message', async () => {
    const handler = (await import('../hello')).default;
    const req = createMockReq();
    const res = createMockRes();

    handler(req, res);

    expect(res.status).toHaveBeenCalledWith(200);
    expect(res.json).toHaveBeenCalledWith(
      expect.objectContaining({ message: expect.any(String) })
    );
  });
});

.env File Hierarchy

Vercel loads environment files in this order (later files override earlier):

FileEnvironmentGit
.envAllCommit
.env.localAll (local only)Ignore
.env.developmentDevelopmentCommit
.env.development.localDevelopment (local only)Ignore

Output

  • Local dev server running with serverless function emulation
  • Environment variables synced from Vercel to local .env files
  • Hot reload on file changes
  • Test suite for serverless function handlers

Error Handling

ErrorCauseSolution
vercel dev hangs on startPort already in useKill the process on port 3000 or use --listen 8080
Error: No framework detectedMissing package.json or frameworkAdd a build framework or use plain functions in api/
Env var undefined locallyNot pulled from VercelRun vercel env pull .env.development.local
FUNCTION_INVOCATION_TIMEOUTFunction exceeds 10s locallyCheck for unresolved promises or infinite loops
TypeScript errors in api/Missing @vercel/node typesnpm install --save-dev @vercel/node

Resources

Next Steps

Proceed to vercel-sdk-patterns for production-ready REST API integration patterns.

Prerequisites

vercel-install-auth setupProject linked via vercel linkNode.js 18+ with npm/pnpm

Limitations

  • Function invocation timeout of 10s locally

How it compares

It provides a unified local environment that mirrors Vercel's production infrastructure instead of relying on disparate framework-specific dev servers.

Compared to similar skills

vercel-local-dev-loop side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
vercel-local-dev-loop (this skill)027dCautionIntermediate
browser-tools69moReviewIntermediate
browser-extension-builder66moNo flagsIntermediate
obsidian-data-handling427dNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry