
Vercel Functions
Configure, debug, and optimize Serverless, Edge, Fluid Compute, streaming, and Cron routes on Vercel without Pages Router mistakes.
Overview
vercel-functions is an agent skill most often used in Build (also Ship, Operate) that guides configuration, debugging, and optimization of Vercel Serverless, Edge, Fluid Compute, streaming, and Cron server-side code.
Install
npx skills add https://github.com/vercel-labs/vercel-plugin --skill vercel-functionsWhat is this skill?
- Covers Serverless, Edge, Fluid Compute, streaming responses, Cron Jobs, and runtime configuration on Vercel
- Path-aware triggers for App Router route.*, pages/api, monorepo api paths, and vercel.json
- Validation rules flag default exports, Pages Router types, and direct vendor AI SDKs in handlers
- Recommends upgrading route AI code to the Vercel AI SDK via linked ai-sdk guidance
- Pairs with vercel dev and vercel logs bash patterns for local repro and production debugging
- Built-in validate patterns include error-level checks for default exports and Pages Router types
- Metadata priority 8 with official functions and runtimes doc links
Adoption & trust: 281 installs on skills.sh; 187 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are editing Vercel route handlers or vercel.json but keep hitting wrong exports, Pages Router types, or non-streaming AI SDK patterns that break deploys or inflate cold starts.
Who is it for?
Solo builders shipping Next.js or monorepo APIs on Vercel who want agent-guided fixes tied to real file paths and severity-ranked validate rules.
Skip if: Teams not hosting on Vercel or apps with no server routes, edge functions, or vercel.json—use framework-native server docs instead.
When should I use this skill?
Configuring, debugging, or optimizing server-side code running on Vercel (Serverless, Edge, Fluid Compute, streaming, Cron, runtime config).
What do I get? / Deliverables
Your handlers follow Vercel’s named-export Web API model with correct runtime choices and validated AI integration paths, ready to ship and tune with vercel dev and vercel logs.
- Corrected route handlers with named HTTP exports
- Updated vercel.json or runtime configuration aligned with Vercel docs
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Server-side route handlers and vercel.json are authored during product build; this is the canonical shelf for API and route work. Function runtimes, named HTTP exports, and streaming live in backend/API layers rather than frontend or launch SEO work.
Where it fits
Scaffold a POST route with correct GET/POST exports and pick Edge versus Node runtime for a low-latency webhook.
Wire a streaming AI response in a route handler using AI SDK patterns instead of a raw provider client.
Run validate rules on api/** before production deploy to catch Pages Router types still in the tree.
Tune Cron schedule and memory settings in vercel.json after reviewing vercel logs for timeouts.
How it compares
Use instead of generic Next.js API tutorials that still teach Pages Router defaults and vendor-locked streaming snippets.
Common Questions / FAQ
Who is vercel-functions for?
Indie and solo developers deploying server logic on Vercel who want an agent that knows App Router route conventions, Fluid Compute, and official function docs.
When should I use vercel-functions?
During Build when authoring api or route files and vercel.json; during Ship when validating handlers before release; during Operate when debugging with vercel logs or tuning Cron and streaming behavior.
Is vercel-functions safe to install?
Treat it like any third-party skill: review the Security Audits panel on this Prism page and confirm changes in your own repo before merging automated edits.
Workflow Chain
Then invoke: ai sdk
SKILL.md
READMESKILL.md - Vercel Functions
--- name: vercel-functions description: Vercel Functions expert guidance — Serverless Functions, Edge Functions, Fluid Compute, streaming, Cron Jobs, and runtime configuration. Use when configuring, debugging, or optimizing server-side code running on Vercel. metadata: priority: 8 docs: - "https://vercel.com/docs/functions" - "https://vercel.com/docs/functions/runtimes" sitemap: "https://vercel.com/sitemap/docs.xml" pathPatterns: - 'api/**/*.*' - 'pages/api/**' - 'src/pages/api/**' - 'app/**/route.*' - 'src/app/**/route.*' - 'apps/*/api/**/*.*' - 'apps/*/app/**/route.*' - 'apps/*/src/app/**/route.*' - 'apps/*/pages/api/**' - 'vercel.json' - 'apps/*/vercel.json' bashPatterns: - '\bvercel\s+dev\b' - '\bvercel\s+logs\b' validate: - pattern: export\s+default\s+function message: 'Use named exports (GET, POST, PUT, DELETE) instead of default export for route handlers' severity: error - pattern: NextApiRequest|NextApiResponse message: 'NextApiRequest/NextApiResponse are Pages Router types — use Web API Request/Response' severity: error - pattern: 'from\s+[''"](openai|@anthropic-ai/sdk|anthropic)[''"]|new\s+(OpenAI|Anthropic)\(' message: 'Direct AI provider SDK detected in route handler. Use the Vercel AI SDK for streaming, tools, and provider abstraction.' severity: recommended upgradeToSkill: ai-sdk upgradeWhy: 'Replace vendor-locked provider SDKs with @ai-sdk/openai or @ai-sdk/anthropic for unified streaming and tool support.' skipIfFileContains: '@ai-sdk/|from\s+[''"](ai)[''"]|import.*from\s+[''"](ai)[''"]|streamText|generateText' - pattern: 'setTimeout\s*\(|setInterval\s*\(|await\s+new\s+Promise\s*\([^)]*setTimeout' message: 'Long-running or polling logic detected in a serverless handler. Functions have execution time limits.' severity: recommended upgradeToSkill: workflow upgradeWhy: 'Move delayed/polling logic to Vercel Workflow for durable execution with pause, resume, retries, and crash safety.' skipIfFileContains: 'use workflow|use step|@vercel/workflow' - pattern: 'writeFile(Sync)?\(|createWriteStream\(|from\s+[''"](multer|formidable)[''"]|fs\.writeFile' message: 'Local filesystem write detected. Serverless functions have ephemeral, read-only filesystems.' severity: error upgradeToSkill: vercel-storage upgradeWhy: 'Replace local filesystem writes with Vercel Blob, Neon, or Upstash for persistent, platform-native storage.' skipIfFileContains: '@vercel/blob|@upstash/|@neondatabase/' - pattern: 'export\s+(async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE)\b' message: 'Route handler has no observability instrumentation. Add logging and error tracking for production debugging.' severity: warn skipIfFileContains: 'console\.error|logger\.|captureException|Sentry|@vercel/otel|withTracing' - pattern: 'from\s+[''""](lru-cache|node-cache|memory-cache)[''""]|new\s+(LRUCache|NodeCache|Map)\(\s*\).*cache' message: 'In-process memory cache detected in serverless function. Process memory is not shared across invocations.' severity: recommended upgradeToSkill: runtime-cache upgradeWhy: 'Replace in-process caches with Vercel Runtime Cache (getCache from @vercel/functions) for region-aware caching that persists across invocations.' skipIfFileContains: 'getCache|from\s+[''""]\@vercel/functions[''""]' - pattern: 'maxRetries\s*[=:]|retryCount\s*[=:]|retry\s*\(\s*|for\s*\([^)]*retry|while\s*\([^)]*retry' message: 'Manual retry logic detected. Use Vercel Workflow DevKit for automatic retries with durable execution.' severity: recommended upgradeToSkill: workflow upgradeWhy: 'Replace manual retry loops with Workflow DevKit steps that provide automatic retries, crash safety, and observability.' skipIfFileContains: 'use workflow|use step|@vercel/workflow|from\s+[''""](workflow)[''""]' - pattern: 'from\s+[