
Vercel Deployment
Configure Vercel env vars, previews, and Next.js API runtimes so a solo builder can ship without misconfigured secrets or wrong edge vs serverless choices.
Overview
Vercel Deployment is an agent skill most often used in Ship (also Build integrations) that guides Next.js projects through Vercel environment variables, preview pipelines, and edge vs serverless API runtimes.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill vercel-deploymentWhat is this skill?
- Maps Development, Preview, and Production env vars with NEXT_PUBLIC_ vs server-only secrets
- Documents VERCEL_ENV checks for production vs preview behavior in code
- Guides edge vs serverless runtime selection for API routes and middleware
- Assumes Next.js App Router context via required nextjs-app-router skill
- Covers edge functions and serverless deployment patterns on Vercel
- Three Vercel environments: Development, Preview, Production
Adoption & trust: 1.4k installs on skills.sh; 40.1k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are ready to deploy Next.js but unsure which env vars belong in preview vs production or whether API routes should run on the edge or as serverless functions.
Who is it for?
Solo builders shipping a Next.js SaaS or marketing site on Vercel who need explicit env and runtime rules before go-live.
Skip if: Teams on non-Vercel hosts, non-Next.js stacks, or repos that only need local dev without any deploy target.
When should I use this skill?
Deploying or configuring a Next.js project on Vercel, setting environment variables, or choosing edge vs serverless for API routes.
What do I get? / Deliverables
After running the skill you get a Vercel-ready env and runtime layout aligned with App Router—then validate previews and promote main to production with correct secret boundaries.
- Environment variable matrix for dev, preview, and production
- Runtime choice notes for API routes and middleware
- Code snippets using VERCEL_ENV guards
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Ship because the skill centers on production deployment mechanics on Vercel rather than day-two incident response. Launch subphase matches first-time go-live and preview-to-production promotion workflows described in the environment and deployment patterns.
Where it fits
Wire Supabase URLs and anon keys with correct public vs server-only split before linking the Git repo to Vercel.
Configure preview vs production values and promote main after a green preview deployment.
Rotate database or service-role keys across Vercel environments without exposing them to the browser bundle.
How it compares
Use as a Vercel-specific deploy playbook instead of generic DevOps READMEs that omit preview branches and NEXT_PUBLIC_ pitfalls.
Common Questions / FAQ
Who is vercel-deployment for?
Solo and indie builders using Next.js App Router who deploy on Vercel and want agent-guided setup for env vars, previews, and API runtimes.
When should I use vercel-deployment?
Use it in Ship when promoting to production or tuning preview deploys; use it in Build when wiring integrations and secrets before the first Vercel link; revisit in Operate when rotating keys across environments.
Is vercel-deployment safe to install?
The skill describes handling secrets and server-only keys—review the Security Audits panel on this page and never paste production credentials into agent logs.
Workflow Chain
Requires first: nextjs app router
SKILL.md
READMESKILL.md - Vercel Deployment
# Vercel Deployment Expert knowledge for deploying to Vercel with Next.js ## Capabilities - vercel - deployment - edge-functions - serverless - environment-variables ## Prerequisites - Required skills: nextjs-app-router ## Patterns ### Environment Variables Setup Properly configure environment variables for all environments **When to use**: Setting up a new project on Vercel // Three environments in Vercel: // - Development (local) // - Preview (PR deployments) // - Production (main branch) // In Vercel Dashboard: // Settings → Environment Variables // PUBLIC variables (exposed to browser) NEXT_PUBLIC_SUPABASE_URL=https://xxx.supabase.co NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJ... // PRIVATE variables (server only) SUPABASE_SERVICE_ROLE_KEY=eyJ... // Never NEXT_PUBLIC_! DATABASE_URL=postgresql://... // Per-environment values: // Production: Real database, production API keys // Preview: Staging database, test API keys // Development: Local/dev values (also in .env.local) // In code, check environment: const isProduction = process.env.VERCEL_ENV === 'production' const isPreview = process.env.VERCEL_ENV === 'preview' ### Edge vs Serverless Functions Choose the right runtime for your API routes **When to use**: Creating API routes or middleware // EDGE RUNTIME - Fast cold starts, limited APIs // Good for: Auth checks, redirects, simple transforms // app/api/hello/route.ts export const runtime = 'edge' export async function GET() { return Response.json({ message: 'Hello from Edge!' }) } // middleware.ts (always edge) export function middleware(request: NextRequest) { // Fast auth checks here } // SERVERLESS (Node.js) - Full Node APIs, slower cold start // Good for: Database queries, file operations, heavy computation // app/api/users/route.ts export const runtime = 'nodejs' // Default, can omit export async function GET() { const users = await db.query('SELECT * FROM users') return Response.json(users) } ### Build Optimization Optimize build for faster deployments and smaller bundles **When to use**: Preparing for production deployment // next.config.js /** @type {import('next').NextConfig} */ const nextConfig = { // Minimize output output: 'standalone', // For Docker/self-hosting // Image optimization images: { remotePatterns: [ { hostname: 'your-cdn.com' }, ], }, // Bundle analyzer (dev only) // npm install @next/bundle-analyzer ...(process.env.ANALYZE === 'true' && { webpack: (config) => { const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') config.plugins.push(new BundleAnalyzerPlugin()) return config }, }), } // Reduce serverless function size: // - Use dynamic imports for heavy libs // - Check bundle with: npx @next/bundle-analyzer ### Preview Deployment Workflow Use preview deployments for PR reviews **When to use**: Setting up team development workflow // Every PR gets a unique preview URL automatically // Protect preview deployments with password: // Vercel Dashboard → Settings → Deployment Protection // Use different env vars for preview: // - PREVIEW: Use staging database // - PRODUCTION: Use production database // In code, detect preview: if (process.env.VERCEL_ENV === 'preview') { // Show "Preview" banner // Use test payment processor // Disable analytics } // Comment preview URL on PR (automatic with Vercel GitHub integration) ### Custom Domain Setup Configure custom domains with proper SSL **When to use**: Going to production // In Vercel Dashboard → Domains // Add domains: // - example.com (apex/root) // - www.example.com (subdomain) // DNS Configuration (at your registrar): // Type: A, Name: @, Value: 76.76.21.21 // Type: CNAME, Name: www, Value: cname.vercel-dns.com // Redirect www to apex (or vice versa): //