跳到正文
Skillpedia
部署与云(DevOps)33k · #8810

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/vercel-deployment/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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:

  1. Environment variables - different for dev/preview/production
  2. Edge vs Serverless - choose the right runtime
  3. Build optimization - minimize cold starts and bundle size
  4. Preview deployments - use for testing before production
  5. 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.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#8810
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能