agentleFS
manish1803manish1803/nextjs-fullstack-skills/skills/06-dev-workflow/deployment-vercel-production/SKILL.md

deployment-vercel-production

Skill2 starsChanged 4 months agoMITView on GitHub

Deploy Next.js/full-stack apps to production on Vercel — environment configuration, preview deployments, custom domains, edge/serverless function considerations, and production readiness checks. Use whenever the user asks to deploy, sets up CI/CD, configures environments/env vars, or asks "is this ready for production".

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Cold starts: keep serverless function bundle size lean (avoid bundling heavy unused dependencies) to minimize cold-start latency on …

    line 24
  2. Distinctive:

    Edge vs Node runtime: use the Edge runtime only for latency-sensitive, lightweight logic (auth checks, redirects, geolocation-based …

    line 25
  3. Very specific:

    Run next build locally (or in CI) before assuming a deploy will succeed — type errors and dynamic-rendering issues sometimes only surface …

    line 29
  4. Distinctive:

    No error tracking, meaning production bugs are only discovered via user reports

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Production & Vercel Deployment Skill

Environment strategy

  • Three environments minimum: Development (local), Preview (auto-deployed per PR/branch on Vercel), Production (main branch).
  • Environment variables scoped per environment in Vercel's dashboard — never share production secrets (payment keys, DB URLs) into Preview; use test/sandbox credentials for Preview so PR previews can't touch real customer data.
  • Validate required env vars at build/boot time with a schema (config/env.ts + zod) — fail loudly at build time, not with a runtime crash in production.

Pre-launch production readiness checklist

  • All secrets in environment variables, none hardcoded or committed
  • Error tracking configured (Sentry or similar) and verified to actually capture a test error
  • Database connection pooling configured correctly for serverless (see note below)
  • Custom domain + SSL configured, www vs apex redirect decided and consistent
  • robots.txt/sitemap configured correctly (don't accidentally block indexing on production while it was fine to block on preview)
  • Payment webhooks pointed at the production URL with production signing secrets (see payment-gateway-integration skill)
  • Rate limiting / abuse protection on public API routes and auth endpoints

Serverless/edge considerations

  • DB connections: serverless functions can exhaust a traditional DB connection pool under load — use a pooler (Prisma Accelerate, PgBouncer, or the DB provider's serverless-aware connection mode) rather than a plain long-lived pool per invocation.
  • Cold starts: keep serverless function bundle size lean (avoid bundling heavy unused dependencies) to minimize cold-start latency on infrequently-hit routes.
  • Edge vs Node runtime: use the Edge runtime only for latency-sensitive, lightweight logic (auth checks, redirects, geolocation-based routing) that doesn't need full Node APIs or heavy npm packages — most business logic and DB access stays on the Node serverless runtime.

CI/CD

  • Vercel's git integration handles preview deploys automatically per PR — pair with required status checks (typecheck, lint, tests) before merge to main to keep production deploys safe.
  • Run next build locally (or in CI) before assuming a deploy will succeed — type errors and dynamic-rendering issues sometimes only surface at build time, not in dev mode.

Rollback strategy

Vercel keeps prior deployments — know how to instantly promote a previous production deployment if a bad release ships, rather than scrambling to hotfix forward under pressure.

Anti-patterns to flag

  • Production secrets available in Preview deployments
  • No error tracking, meaning production bugs are only discovered via user reports
  • A long-lived DB connection pool pattern copied from a traditional server into a serverless function
  • Deploying straight to production with no preview/staging verification for a risky change

Example prompt this skill should trigger on

"Deploy this Next.js app to production on Vercel with a custom domain and make sure it's production-ready."

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.