Back to Skills

deploy-to-vercel

pjt222
Updated 2 days ago
8 views
17
2
17
View on GitHub
Otherai

About

This skill automates deploying a Next.js application to Vercel, handling project linking, environment variable configuration, and deployment setups. It is designed for initial deployments, setting up preview deployments for pull requests, and configuring custom domains. Use it to streamline the process of managing production and preview environments on Vercel.

Quick Install

Claude Code

Recommended
Primary
npx skills add pjt222/agent-almanac -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/pjt222/agent-almanac
Git CloneAlternative
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/deploy-to-vercel

Copy and paste this command in Claude Code to install this skill

Documentation

Deploy to Vercel

Next.js → Vercel w/ prod config.

Use When

  • First-time Next.js deploy
  • Preview deploys → PRs
  • Custom domains
  • Prod env vars

In

  • Required: Next.js app builds locally
  • Required: GitHub repo (rec) or local
  • Optional: Custom domain
  • Optional: Prod env vars

Do

Step 1: Verify local build

npm run build

→ Build OK, no errs.

If err: Fix build before deploy. Common: TS errs, missing deps, bad imports.

Step 2: Install Vercel CLI

npm install -g vercel

vercel cmd available, vercel --version works.

If err: Perm errs → sudo or user-local prefix. node --version.

Step 3: Link + deploy

# Login to Vercel
vercel login

# Deploy (first time: creates project)
vercel

# Follow prompts:
# - Set up and deploy? Y
# - Which scope? (select your account)
# - Link to existing project? N (for new projects)
# - Project name: my-app
# - Directory: ./
# - Override settings? N

→ Preview URL (e.g., https://my-app-xxx.vercel.app).

If err: vercel login fail → check net, try browser auth. Deploy fail → review build out. Clean env → all deps in package.json.

Step 4: Env vars

# Add environment variables
vercel env add DATABASE_URL production
vercel env add API_KEY production preview

# List environment variables
vercel env ls

Or dashboard: Project Settings > Environment Variables.

vercel env ls shows all vars in correct envs.

If err: Not at runtime → target env matches. Redeploy → existing deploys don't pick up new vars.

Step 5: Prod deploy

vercel --prod

→ Prod URL (e.g., https://my-app.vercel.app).

If err: vercel logs or dashboard. Common: missing prod env vars, build cmd diff from local.

Step 6: GitHub auto-deploy (rec)

  1. https://vercel.com/new
  2. Import GH repo
  3. Auto-deploy on:
    • Push main → prod
    • PR → preview

→ Dashboard shows repo connected, pushes trigger prod auto.

If err: Repo not in list → Vercel GH app access. GitHub Settings > Applications > Vercel.

Step 7: Custom domain

vercel domains add my-domain.com

Or dashboard: Project Settings > Domains. Update DNS per Vercel.

vercel domains ls shows configured, after propagation (≤48h) resolves.

If err: "Invalid Configuration" → DNS matches exactly. dig my-domain.com or DNS checker.

Step 8: Optimize config

vercel.json:

{
  "framework": "nextjs",
  "regions": ["iad1"],
  "headers": [
    {
      "source": "/api/(.*)",
      "headers": [
        { "key": "Cache-Control", "value": "no-store" }
      ]
    }
  ]
}

vercel.json in root, next deploy picks up.

If err: Ignored → jq . vercel.json valid. Framework ver → some moved to next.config.ts.

Check

  • npm run build OK locally
  • Preview deploy works
  • Prod deploy serves app
  • Env vars in prod
  • Custom domain resolves (if config'd)
  • GH integration triggers deploys

Traps

  • Build fail Vercel not local: Clean env → all deps in package.json, not just global
  • Env vars missing: Add to Vercel not .env.local. Envs separate.
  • Node ver mismatch: Set in Project Settings or package.json engines
  • Large deploys: Size limits. .vercelignore excludes.
  • API timeout: Hobby plan 10s. Optimize or upgrade.

  • scaffold-nextjs-app — create app to deploy
  • setup-tailwind-typescript — config styling pre-deploy
  • configure-git-repository — Git setup for auto-deploy

GitHub Repository

pjt222/agent-almanac
Path: i18n/caveman-ultra/skills/deploy-to-vercel
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

Related Skills

llamaguard

Other

LlamaGuard is Meta's 7-8B parameter model for moderating LLM inputs and outputs across six safety categories like violence and hate speech. It offers 94-95% accuracy and can be deployed using vLLM, Hugging Face, or Amazon SageMaker. Use this skill to easily integrate content filtering and safety guardrails into your AI applications.

View skill

cost-optimization

Other

This Claude Skill helps developers optimize cloud costs through resource rightsizing, tagging strategies, and spending analysis. It provides a framework for reducing cloud expenses and implementing cost governance across AWS, Azure, and GCP. Use it when you need to analyze infrastructure costs, right-size resources, or meet budget constraints.

View skill

quantizing-models-bitsandbytes

Other

This skill quantizes LLMs to 8-bit or 4-bit precision using bitsandbytes, achieving 50-75% memory reduction with minimal accuracy loss. It's ideal for running larger models on limited GPU memory or accelerating inference, supporting formats like INT8, NF4, and FP4. The skill integrates with HuggingFace Transformers and enables QLoRA training and 8-bit optimizers.

View skill

dispatching-parallel-agents

Other

This Claude Skill dispatches multiple agents to investigate and fix 3+ independent problems concurrently. It is designed for scenarios involving unrelated failures that can be resolved without shared state or dependencies. The core capability is parallel problem-solving, assigning one agent per independent problem domain to maximize efficiency.

View skill