关于
This skill deploys a Next.js application to Vercel, handling project linking, environment variables, and deployment configuration. It is designed for initial deployments, setting up preview deployments for pull requests, and configuring custom domains. Use it to manage the full deployment lifecycle from setup to production on Vercel.
快速安装
Claude Code
推荐npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/deploy-to-vercel在 Claude Code 中复制并粘贴此命令以安装该技能
技能文档
Deploy to Vercel
Deploy a Next.js application to Vercel with production configuration.
When to Use
- Deploying a Next.js app for the first time
- Setting up preview deployments for pull requests
- Configuring custom domains
- Managing environment variables in production
Inputs
- Required: Next.js application that builds successfully locally
- Required: GitHub repository (recommended) or local project
- Optional: Custom domain
- Optional: Environment variables for production
Procedure
Step 1: Verify Local Build
npm run build
Got: Build succeeds with no errors.
If fail: Fix build errors before deploying. Common: TypeScript errors, missing dependencies, invalid imports.
Step 2: Install Vercel CLI
npm install -g vercel
Got: The vercel command is available globally and vercel --version prints the installed version.
If fail: 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.
Step 3: Link and 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
Got: Preview URL provided (e.g., https://my-app-xxx.vercel.app).
If fail: 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.
Step 4: Configure Environment Variables
# 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.
Got: vercel env ls shows all required environment variables configured for the correct environments (production, preview, development).
If fail: 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.
Step 5: Deploy to Production
vercel --prod
Got: Production URL available (e.g., https://my-app.vercel.app).
If fail: 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.
Step 6: Connect GitHub for Auto-Deploy (Recommended)
- Go to https://vercel.com/new
- Import your GitHub repository
- Vercel automatically deploys on:
- Push to main -> Production deployment
- Pull request -> Preview deployment
Got: The Vercel dashboard shows the GitHub repository connected, and subsequent pushes to main trigger production deployments automatically.
If fail: 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.
Step 7: Configure Custom Domain
vercel domains add my-domain.com
Or through dashboard: Project Settings > Domains.
Update DNS records as instructed by Vercel (typically CNAME or A record).
Got: vercel domains ls shows the custom domain as configured, and after DNS propagation (up to 48 hours), the domain resolves to the Vercel deployment.
If fail: 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.
Step 8: Optimize Configuration
Create vercel.json for advanced settings:
{
"framework": "nextjs",
"regions": ["iad1"],
"headers": [
{
"source": "/api/(.*)",
"headers": [
{ "key": "Cache-Control", "value": "no-store" }
]
}
]
}
Got: vercel.json is saved in the project root and the next deployment picks up the configuration (visible in the Vercel dashboard build logs).
If fail: 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.
Validation
-
npm run buildsucceeds locally - Preview deployment works and is accessible
- Production deployment serves the application correctly
- Environment variables are available in production
- Custom domain resolves (if configured)
- GitHub integration triggers deployments on push
Pitfalls
- Build failing on Vercel but not locally: Vercel uses a clean environment. Ensure all dependencies are in
package.json, not installed globally. - Environment variables missing: Variables must be added to Vercel, not
.env.local. Different environments (production, preview, development) have separate variable sets. - Node.js version mismatch: Set the Node.js version in Project Settings or
package.jsonengines field. - Large deployments: Vercel has size limits. Use
.vercelignoreto exclude unnecessary files. - API route timeouts: Vercel serverless functions have a 10s timeout on the Hobby plan. Optimize or upgrade.
Related Skills
scaffold-nextjs-app- create the app to deploysetup-tailwind-typescript- configure styling before deploymentconfigure-git-repository- Git setup for auto-deploy integration
GitHub 仓库
Frequently asked questions
What is the deploy-to-vercel skill?
deploy-to-vercel is a Claude Skill by pjt222. Skills package instructions and resources that Claude loads on demand, so Claude can perform deploy-to-vercel-related tasks without extra prompting.
How do I install deploy-to-vercel?
Use the install commands on this page: add deploy-to-vercel to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does deploy-to-vercel belong to?
deploy-to-vercel is in the Other category, tagged ai.
Is deploy-to-vercel free to use?
Yes. deploy-to-vercel is listed on AIMCP and free to install. It runs inside Claude, so no separate service account is required to use the skill itself.
相关推荐技能
LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。
这个Claude Skill帮助开发者优化云成本,通过资源调整、标记策略和预留实例来降低AWS、Azure和GCP的开支。它适用于减少云支出、分析基础设施成本或实施成本治理策略的场景。关键功能包括提供成本可视化、资源规模调整指导和定价模型优化建议。
该Skill为开发者提供体育博彩数据分析工具,可分析盘口、大小球和特殊投注,识别价值投注机会。它整合历史数据和情景统计,生成包含时间戳的结构化Markdown报告。适用于需要快速获取博彩市场洞察的娱乐或教育类应用开发。
这个Skill使用bitsandbytes库量化大语言模型,能在GPU内存有限时通过8位或4位量化减少50-75%内存占用,同时保持精度损失最小。它支持INT8、NF4、FP4等多种量化格式,可与HuggingFace Transformers无缝集成,适用于需要部署更大模型或加速推理的场景。还提供QLoRA训练和8位优化器支持,让开发者能轻松实现高效模型压缩。
