返回技能列表

deploy-to-vercel

pjt222
更新于 2 days ago
3 次查看
17
2
17
在 GitHub 上查看
其他ai

关于

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.

快速安装

Claude Code

推荐
主要方式
npx skills add pjt222/agent-almanac -a claude-code
插件命令备选方式
/plugin add https://github.com/pjt222/agent-almanac
Git 克隆备选方式
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/deploy-to-vercel

在 Claude Code 中复制并粘贴此命令以安装该技能

技能文档

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 仓库

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

相关推荐技能

llamaguard

其他

LlamaGuard是Meta推出的7-8B参数内容审核模型,专门用于过滤LLM的输入和输出内容。它能检测六大安全风险类别(暴力/仇恨、性内容、武器、违禁品、自残、犯罪计划),准确率达94-95%。开发者可通过HuggingFace、vLLM或Sagemaker快速部署,并能与NeMo Guardrails集成实现自动化安全防护。

查看技能

cost-optimization

其他

这个Claude Skill帮助开发者优化云成本,通过资源调整、标记策略和预留实例来降低AWS、Azure和GCP的开支。它适用于减少云支出、分析基础设施成本或实施成本治理策略的场景。关键功能包括提供成本可视化、资源规模调整指导和定价模型优化建议。

查看技能

quantizing-models-bitsandbytes

其他

这个Skill使用bitsandbytes库量化大语言模型,能在GPU内存有限时通过8位或4位量化减少50-75%内存占用,同时保持精度损失最小。它支持INT8、NF4、FP4等多种量化格式,可与HuggingFace Transformers无缝集成,适用于需要部署更大模型或加速推理的场景。还提供QLoRA训练和8位优化器支持,让开发者能轻松实现高效模型压缩。

查看技能

dispatching-parallel-agents

其他

该Skill用于并行处理3个以上无依赖关系的独立故障,可为每个问题域分派专属Claude代理同时执行调查修复。它通过并发处理多个独立问题显著提升故障排查效率,特别适用于测试文件、子系统等无共享状态的场景。

查看技能