vercel-deployment
Skill0 starsChanged 9 months agoMITView on GitHub
Deploy Next.js and React applications to Vercel — project setup, environment variables, edge functions, build troubleshooting, preview deployments, monorepo configuration. NOT for AWS/GCP/Azure
- Reads credentials
- Commits and pushes
8 other projects use a version of this.
Adopted by
Most recently taken up by
- AtilaMedeiros/skillstheir own version, first seen Nov 16, 2026
- Ivan-propio/claude-skillstheir own version, first seen Nov 16, 2026
- AxlZero21/Skillstheir own version, first seen Nov 8, 2026
- xfstudio/skillstheir own version, first seen Oct 13, 2026
- lschGSL/claude_code_templatetheir own version, first seen Apr 9, 2026
- ai4brands-design/claude-skillstheir own version, first seen Mar 22, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- xfstudio/skills★ 9same name
- HamzaSheikh768/Agents-Skills-Lap★ 3same name
- ai4brands-design/claude-skills★ 2same name
- AtilaMedeiros/skills★ 1same name
- AxlZero21/Skills★ 1same name
- JDerekLomas/claude-code-skills★ 1same name
- lschGSL/claude_code_template★ 1same name
- Ivan-propio/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository185 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- 2000s-visualization-expertSkill
- 2026-legal-research-agentSkill
- adhd-daily-plannerSkill
- adhd-design-expertSkill
- admin-dashboardSkill
- agent-creatorSkill
- ai-engineerSkill
- ai-video-production-masterSkill
- anthropic-technical-deep-diveSkill
- api-architectSkill
- automatic-stateful-prompt-improverSkill
- background-job-orchestratorSkill
- bot-developerSkill
- caching-strategiesSkill
- career-biographerSkill
- chatbot-analyticsSkill
- checklist-disciplineSkill
- claude-ecosystem-promoterSkill
- clinical-diagnostic-reasoningSkill
- clip-aware-embeddingsSkill
- cloudflare-worker-devSkill
- code-architectureSkill
- code-necromancerSkill
- code-review-checklistSkill
- collage-layout-expertSkill
- color-contrast-auditorSkill
- color-theory-palette-harmony-expertSkill
- competitive-cartographerSkill
- component-template-generatorSkill
- computer-vision-pipelineSkill
- cost-accrual-trackerSkill
- cost-optimizerSkill
- cost-verification-auditorSkill
- crisis-detection-intervention-aiSkill
- crisis-response-protocolSkill
- cv-creatorSkill
- dark-mode-design-expertSkill
- database-design-patternsSkill
- data-pipeline-engineerSkill
- data-viz-2025Skill
- dependency-managementSkill
- design-accessibility-auditorSkill
- design-archivistSkill
- design-criticSkill
- design-justiceSkill
- design-system-creatorSkill
- design-system-documenterSkill
- design-system-generatorSkill
- design-trend-analyzerSkill
- devops-automatorSkill
- diagramming-expertSkill
- digital-estate-plannerSkill
- docker-containerizationSkill
- document-generation-pdfSkill
- drizzle-migrationsSkill
- drone-cv-expertSkill
- drone-inspection-specialistSkill
- email-composerSkill
- error-handling-patternsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 41
Add variable with appropriate scope:
- Distinctive: line 42
Production: Only production deployments
- Distinctive: line 264
Not suitable for production data storage
- Distinctive: line 292
Every git push creates a preview deployment:
- Distinctive: line 443
Use middleware for authentication checks (see Edge Functions above).
- Very specific: line 451
Never commit .env files
- Distinctive: line 452
Use Vercel's encrypted environment variables
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Vercel Deployment
This skill helps you deploy and configure Next.js applications on Vercel following best practices.
Quick Deploy Checklist
- Environment variables set in Vercel dashboard
- Build command configured (default:
next build) - Output directory correct (default:
.next) - Node.js version specified (20.x recommended)
- Database accessible from Vercel's network
- Secrets not committed to git
Environment Variables
Setting Variables
Vercel Dashboard (Recommended for secrets):
- Project Settings → Environment Variables
- Add variable with appropriate scope:
- Production: Only production deployments
- Preview: PR and branch previews
- Development: Local
vercel dev
Via CLI:
vercel env add VARIABLE_NAME production
vercel env pull .env.local # Pull to localVariable Naming
# Server-only (never exposed to browser)
DATABASE_URL=
SESSION_SECRET=
ANTHROPIC_API_KEY=
# Client-exposed (prefixed with NEXT_PUBLIC_)
NEXT_PUBLIC_APP_URL=
NEXT_PUBLIC_ANALYTICS_ID=Size Limits
| Context | Limit |
| Total per deployment | 64 KB |
| Edge Functions | 5 KB per variable |
| Single variable | 64 KB max |
Required Variables for This Project
# Authentication (required)
SESSION_SECRET=your-32-char-minimum-secret-here
# AI Integration (required for chat)
ANTHROPIC_API_KEY=sk-ant-api...
# Database (if using external)
DATABASE_URL=file:./data/app.db
# Push Notifications (optional)
VAPID_PUBLIC_KEY=
VAPID_PRIVATE_KEY=
VAPID_SUBJECT=mailto:admin@example.com
# OAuth (optional)
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
APPLE_CLIENT_ID=
APPLE_CLIENT_SECRET=vercel.json Configuration
{
"buildCommand": "npm run build",
"framework": "nextjs",
"regions": ["iad1"],
"headers": [
{
"source": "/api/(.*)",
"headers": [
{ "key": "Cache-Control", "value": "no-store, must-revalidate" }
]
},
{
"source": "/(.*)",
"headers": [
{ "key": "X-Content-Type-Options", "value": "nosniff" },
{ "key": "X-Frame-Options", "value": "DENY" },
{ "key": "X-XSS-Protection", "value": "1; mode=block" }
]
}
],
"redirects": [
{
"source": "/old-path",
"destination": "/new-path",
"permanent": true
}
],
"rewrites": [
{
"source": "/api/v1/:path*",
"destination": "/api/:path*"
}
]
}TypeScript Configuration (New in 2025)
// vercel.ts - Type-safe configuration
import { defineConfig } from '@vercel/config';
export default defineConfig({
regions: ['iad1'],
headers: async () => [
{
source: '/api/:path*',
headers: [
{ key: 'Cache-Control', value: 'no-store' },
],
},
],
redirects: async () => [
{
source: '/old',
destination: '/new',
permanent: true,
},
],
});Edge Functions
When to Use Edge
Good for:
- Authentication/authorization
- A/B testing
- Geolocation-based content
- Request/response transforms
- Simple, fast operations
Not suitable for:
- Database connections (use serverless instead)
- Long-running operations
- Large dependencies
Edge Function Example
// src/middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export const config = {
matcher: ['/api/:path*', '/protected/:path*'],
};
export function middleware(request: NextRequest) {
// Check auth token
const token = request.cookies.get('session')?.value;
if (!token && request.nextUrl.pathname.startsWith('/protected')) {
return NextResponse.redirect(new URL('/login', request.url));
}
// Add headers
const response = NextResponse.next();
response.headers.set('X-Request-Id', crypto.randomUUID());
return response;
}Edge Runtime in API Routes
// src/app/api/edge-example/route.ts
export const runtime = 'edge';
export async function GET(request: Request) {
// Limited to edge-compatible APIs
return Response.json({ timestamp: Date.now() });
}Build Configuration
package.json Scripts
{
"scripts": {
"build": "next build",
"postbuild": "npm run db:generate"
}
}Build Environment
# Set Node.js version
# In Vercel Dashboard → Settings → General → Node.js Version
# Or in package.json:
{
"engines": {
"node": "20.x"
}
}Build Output
# Check build locally
npm run build
# Analyze bundle
ANALYZE=true npm run buildDatabase Considerations
SQLite on Vercel
SQLite with better-sqlite3 works in Vercel's serverless functions, but:
- Filesystem is read-only except
/tmp - Data doesn't persist between invocations
- Not suitable for production data storage
Production Database Options
- Turso (SQLite edge database)
import { createClient } from '@libsql/client'; const db = createClient({ url: process.env.TURSO_DATABASE_URL!, authToken: process.env.TURSO_AUTH_TOKEN, }); - Vercel Postgres
import { sql } from '@vercel/postgres'; const result = await sql`SELECT * FROM users`; - PlanetScale (MySQL)
- Neon (Postgres)
Preview Deployments
Branch Previews
Every git push creates a preview deployment:
https://<project>-<branch>-<team>.vercel.app- Separate environment variables for preview
Preview Environment Variables
# Different values for preview vs production
# In Vercel Dashboard, set both:
DATABASE_URL (Production): postgres://prod-db...
DATABASE_URL (Preview): postgres://staging-db...Commenting on PRs
Vercel automatically comments on PRs with:
- Preview URL
- Build status
- Performance metrics
Troubleshooting
Build Failures
# Check build locally first
npm run build
# Common issues:
# - Missing environment variables
# - TypeScript errors
# - ESLint errors (strict mode)
# - Missing dependenciesEnvironment Variable Issues
# Verify variables are set
vercel env ls
# Pull to local for debugging
vercel env pull .env.localFunction Timeout
// Increase timeout (max 60s on Pro, 10s on Hobby)
// In vercel.json:
{
"functions": {
"api/long-running.ts": {
"maxDuration": 60
}
}
}Memory Issues
// Increase memory (affects cost)
{
"functions": {
"api/heavy-processing.ts": {
"memory": 1024
}
}
}Monitoring
Vercel Analytics
// src/app/layout.tsx
import { Analytics } from '@vercel/analytics/react';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics />
</body>
</html>
);
}Speed Insights
import { SpeedInsights } from '@vercel/speed-insights/next';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<SpeedInsights />
</body>
</html>
);
}Function Logs
# View logs via CLI
vercel logs <deployment-url>
# Real-time logs
vercel logs <deployment-url> --followDomains
Custom Domain Setup
- Vercel Dashboard → Domains
- Add domain
- Configure DNS:
- A record:
76.76.21.21 - Or CNAME:
cname.vercel-dns.com
- A record:
- SSL automatically provisioned
Redirects
// vercel.json
{
"redirects": [
{
"source": "/:path((?!api/).*)",
"has": [{ "type": "host", "value": "old-domain.com" }],
"destination": "https://new-domain.com/:path",
"permanent": true
}
]
}Security
Protected Routes
Use middleware for authentication checks (see Edge Functions above).
Rate Limiting
Implement application-level rate limiting since Vercel doesn't provide built-in rate limiting for serverless functions.
Secrets Management
- Never commit
.envfiles - Use Vercel's encrypted environment variables
- Rotate secrets regularly
- Different secrets for preview vs production
References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

