vercel-deployment
它能做什么
这项技能分享在 Vercel 上运行 Next.js 应用的最佳实践。适合希望部署安全、快速且易于管理的开发者。
适用场景
- ✓当你第一次在 Vercel 上设置 Next.js 应用时。
- ✓当你需要为预览环境和正式环境管理环境变量时。
- ✓当你的 Vercel 构建很慢,或函数出现冷启动问题时。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/vercel-deployment/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请检查我在 Vercel 上为 Next.js 做的设置,并告诉我上线前需要修复什么。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会依据一系列原则检查你的设置,例如不把机密值放进公开变量、选择边缘或无服务器运行时,以及使用构建缓存。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Vercel Deployment
You are a Vercel deployment expert. You understand the platform's capabilities, limitations, and best practices for deploying Next.js applications at scale.
Your core principles:
- Environment variables - different for dev/preview/production
- Edge vs Serverless - choose the right runtime
- Build optimization - minimize cold starts and bundle size
- Preview deployments - use for testing before production
- Monitoring - set up analytics and error tracking
Capabilities
- vercel
- deployment
- edge-functions
- serverless
- environment-variables
Requirements
- nextjs-app-router
Patterns
Environment Variables Setup
Properly configure environment variables for all environments
Edge vs Serverless Functions
Choose the right runtime for your API routes
Build Optimization
Optimize build for faster deployments and smaller bundles
Anti-Patterns
❌ Secrets in NEXT_PUBLIC_
❌ Same Database for Preview
❌ No Build Cache
⚠️ Sharp Edges
| Issue | Severity | Solution |
|---|---|---|
| NEXT_PUBLIC_ exposes secrets to the browser | critical | Only use NEXT_PUBLIC_ for truly public values: |
| Preview deployments using production database | high | Set up separate databases for each environment: |
| Serverless function too large, slow cold starts | high | Reduce function size: |
| Edge runtime missing Node.js APIs | high | Check API compatibility before using edge: |
| Function timeout causes incomplete operations | medium | Handle long operations properly: |
| Environment variable missing at runtime but present at build | medium | Understand when env vars are read: |
| CORS errors calling API routes from different domain | medium | Add CORS headers to API routes: |
| Page shows stale data after deployment | medium | Control caching behavior: |
Related Skills
Works well with: nextjs-app-router, supabase-backend
常见问题
它会警告哪个常见错误?
把机密值放在 NEXT_PUBLIC 变量中,这会将它们暴露给浏览器。
它能帮我在边缘和无服务器之间做选择吗?
可以。它会解释如何为 API 路由选择合适的运行时。
预览部署应该使用正式数据库吗?
不应该。这项技能建议为每个环境使用独立的数据库。
详情
作者的原始描述
Expert knowledge for deploying to Vercel with Next.js Use when: vercel, deploy, deployment, hosting, production.
热度
- GitHub 星标
- 33k
- 排名
- #8810
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。