From agent-almanac
Deploys a Next.js application to Vercel with linking, environment variables, preview deployments, and custom domains.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-almanac:deploy-to-vercelThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Deploy a Next.js application to Vercel with production configuration.
Deploy a Next.js application to Vercel with production configuration.
npm run build
Expected: Build succeeds with no errors.
On failure: Fix build errors before deploying. Common: TypeScript errors, missing dependencies, invalid imports.
npm install -g vercel
Expected: The vercel command is available globally and vercel --version prints the installed version.
On failure: If permission errors occur, use sudo npm install -g vercel or configure npm to use a user-local prefix. Verify Node.js is installed with node --version.
# 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
Expected: Preview URL provided (e.g., https://my-app-xxx.vercel.app).
On failure: If vercel login fails, check internet connectivity and try browser-based authentication. If the deploy fails, review the build output for errors -- Vercel uses a clean environment, so all dependencies must be in package.json.
# Add environment variables
vercel env add DATABASE_URL production
vercel env add API_KEY production preview
# List environment variables
vercel env ls
Or configure through the Vercel dashboard: Project Settings > Environment Variables.
Expected: vercel env ls shows all required environment variables configured for the correct environments (production, preview, development).
On failure: If variables are not appearing at runtime, verify the target environment matches (production vs preview). Redeploy after adding variables -- existing deployments do not pick up new variables automatically.
vercel --prod
Expected: Production URL available (e.g., https://my-app.vercel.app).
On failure: Check deployment logs with vercel logs or in the Vercel dashboard. Common issues include missing environment variables in the production environment and build commands differing from local setup.
Expected: The Vercel dashboard shows the GitHub repository connected, and subsequent pushes to main trigger production deployments automatically.
On failure: If the repository does not appear in the import list, check that the Vercel GitHub app has access to the repository. Go to GitHub Settings > Applications > Vercel and grant access.
vercel domains add my-domain.com
Or through dashboard: Project Settings > Domains.
Update DNS records as instructed by Vercel (typically CNAME or A record).
Expected: vercel domains ls shows the custom domain as configured, and after DNS propagation (up to 48 hours), the domain resolves to the Vercel deployment.
On failure: If the domain shows "Invalid Configuration," verify DNS records match Vercel's instructions exactly. Use dig my-domain.com or an online DNS checker to confirm propagation.
Create vercel.json for advanced settings:
{
"framework": "nextjs",
"regions": ["iad1"],
"headers": [
{
"source": "/api/(.*)",
"headers": [
{ "key": "Cache-Control", "value": "no-store" }
]
}
]
}
Expected: vercel.json is saved in the project root and the next deployment picks up the configuration (visible in the Vercel dashboard build logs).
On failure: If the configuration is ignored, verify vercel.json is valid JSON with jq . vercel.json. Check the Vercel docs for your framework version, as some settings may have moved to next.config.ts.
npm run build succeeds locallypackage.json, not just installed globally..env.local. Different environments (production, preview, development) have separate variable sets.package.json engines field..vercelignore to exclude unnecessary files.scaffold-nextjs-app - create the app to deploysetup-tailwind-typescript - configure styling before deploymentconfigure-git-repository - Git setup for auto-deploy integrationnpx claudepluginhub pjt222/agent-almanacProvides expert guidance for deploying Next.js applications on Vercel, including environment variable setup, edge vs. serverless function decisions, and build optimization.
Vercel deployment configuration and optimization for Next.js applications including vercel.json setup, environment variables, build optimization, edge functions, and deployment troubleshooting. Use when deploying to Vercel, configuring deployment settings, optimizing build performance, setting up environment variables, configuring edge functions, or when user mentions Vercel deployment, production setup, build errors, or deployment optimization.
Generates Next.js deployment configs for Vercel (vercel.json), self-hosted Node.js (PM2), Docker (Dockerfile, docker-compose), static export, Edge Runtime, GitHub Actions CI/CD, env vars, health checks, monitoring, and Turbopack builds.