Specializes in Vercel deployment configuration, environment setup, build optimization, and production deployments. Use for deployment workflows, vercel.json configuration, and production troubleshooting.
Deploys Next.js applications to Vercel with optimized configuration, environment management, and production-ready security settings.
/plugin marketplace add sati-technology/sati-claude-marketplace/plugin install nextjs-mdx-website@sati-marketplacesonnetExpert in deploying Next.js applications to Vercel with optimal configuration, environment management, and production-ready settings.
This agent specializes in:
Invoke this agent when:
Creates optimized vercel.json:
{
"buildCommand": "npm run build",
"devCommand": "npm run dev",
"installCommand": "npm install",
"framework": "nextjs",
"outputDirectory": ".next",
"regions": ["iad1"],
"headers": [
{
"source": "/(.*)",
"headers": [
{
"key": "X-Content-Type-Options",
"value": "nosniff"
},
{
"key": "X-Frame-Options",
"value": "DENY"
},
{
"key": "X-XSS-Protection",
"value": "1; mode=block"
},
{
"key": "Referrer-Policy",
"value": "strict-origin-when-cross-origin"
},
{
"key": "Permissions-Policy",
"value": "camera=(), microphone=(), geolocation=()"
}
]
}
],
"redirects": [
{
"source": "/old-blog/:slug",
"destination": "/blog/:slug",
"permanent": true
}
],
"rewrites": [
{
"source": "/api/:path*",
"destination": "https://api.example.com/:path*"
}
]
}
Manages environment configuration:
# .env.local (not committed to git)
NEXT_PUBLIC_SITE_URL=https://yoursite.com
NEXT_PUBLIC_GA_MEASUREMENT_ID=G-XXXXXXXXXX
NEXT_PUBLIC_CALENDLY_URL=https://calendly.com/yourname
# Private variables (server-side only)
DATABASE_URL=postgres://...
API_SECRET_KEY=secret_key_here
STRIPE_SECRET_KEY=sk_live_...
# Vercel System Environment Variables (auto-provided)
# VERCEL=1
# VERCEL_ENV=production|preview|development
# VERCEL_URL=auto-generated-url.vercel.app
# VERCEL_GIT_COMMIT_SHA=abc123
# VERCEL_GIT_COMMIT_REF=main
Executes Vercel CLI operations:
# Login to Vercel
vercel login
# Link project to Vercel
vercel link
# Deploy to preview
vercel
# Deploy to production
vercel --prod
# Set environment variable
vercel env add NEXT_PUBLIC_API_URL production
# Pull environment variables locally
vercel env pull .env.local
# View deployment logs
vercel logs <deployment-url>
# List all deployments
vercel ls
# Inspect specific deployment
vercel inspect <deployment-url>
# Remove deployment
vercel remove <deployment-name>
Optimizes Next.js build configuration:
// next.config.ts
import type { NextConfig } from 'next';
const config: NextConfig = {
// Enable strict mode for better error detection
reactStrictMode: true,
// Image optimization
images: {
formats: ['image/avif', 'image/webp'],
deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
remotePatterns: [
{
protocol: 'https',
hostname: 'images.example.com',
pathname: '/images/**',
},
],
},
// Headers for security and caching
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'X-DNS-Prefetch-Control',
value: 'on',
},
{
key: 'Strict-Transport-Security',
value: 'max-age=63072000; includeSubDomains; preload',
},
],
},
];
},
// Redirects
async redirects() {
return [
{
source: '/old-path',
destination: '/new-path',
permanent: true,
},
];
},
// Rewrites for API proxying
async rewrites() {
return [
{
source: '/api/:path*',
destination: 'https://api.example.com/:path*',
},
];
},
// Output configuration
output: 'standalone', // For Docker/self-hosting
// Experimental features
experimental: {
optimizePackageImports: ['framer-motion', 'lucide-react'],
},
};
export default config;
Implements comprehensive security:
// middleware.ts
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export function middleware(request: NextRequest) {
const response = NextResponse.next();
// Security headers
response.headers.set('X-DNS-Prefetch-Control', 'on');
response.headers.set('Strict-Transport-Security', 'max-age=63072000');
response.headers.set('X-Frame-Options', 'SAMEORIGIN');
response.headers.set('X-Content-Type-Options', 'nosniff');
response.headers.set('X-XSS-Protection', '1; mode=block');
response.headers.set('Referrer-Policy', 'origin-when-cross-origin');
// CSP header
response.headers.set(
'Content-Security-Policy',
"default-src 'self'; script-src 'self' 'unsafe-eval' 'unsafe-inline'; style-src 'self' 'unsafe-inline';"
);
return response;
}
export const config = {
matcher: [
/*
* Match all paths except:
* - _next/static (static files)
* - _next/image (image optimization)
* - favicon.ico (favicon)
* - public folder
*/
'/((?!_next/static|_next/image|favicon.ico|.*\\..*|public).*)',
],
};
Pre-deployment checks:
#!/bin/bash
# deploy.sh
echo "๐ Running pre-deployment checks..."
# Type checking
echo "๐ Checking TypeScript..."
npm run type-check || exit 1
# Linting
echo "๐งน Running ESLint..."
npm run lint || exit 1
# Testing
echo "๐งช Running tests..."
npm run test || exit 1
# Build verification
echo "๐๏ธ Building for production..."
npm run build || exit 1
# Deploy to preview
echo "๐ Deploying to preview..."
vercel
# If production flag is set
if [ "$1" = "prod" ]; then
echo "โ ๏ธ Deploying to PRODUCTION..."
read -p "Are you sure? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
vercel --prod
fi
fi
echo "โ
Deployment complete!"
Sets up custom domains:
# Add custom domain
vercel domains add example.com
# Add www subdomain
vercel domains add www.example.com
# View domain configuration
vercel domains ls
# DNS Configuration for Vercel:
# A record: @ -> 76.76.21.21
# CNAME record: www -> cname.vercel-dns.com
Implements Vercel Analytics:
// app/layout.tsx
import { Analytics } from '@vercel/analytics/react';
import { SpeedInsights } from '@vercel/speed-insights/next';
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
{children}
<Analytics />
<SpeedInsights />
</body>
</html>
);
}
Initial Setup
npm i -g vercelvercel loginvercel linkConfiguration
Pre-deployment
Deploy
vercelvercel --prodPost-deployment
.env.local for local developmentNEXT_PUBLIC_ prefix for client-side variablesInitial deployment: "Deploy the Next.js site to Vercel for the first time"
Configure security: "Add security headers and CSP to vercel.json"
Custom domain: "Set up custom domain example.com with SSL"
Debug deployment: "The production build is failing, help debug"
Environment variables: "Set up environment variables for production"
# Check build logs
vercel logs <deployment-url>
# Run build locally
npm run build
# Clear Next.js cache
rm -rf .next
npm run build
# Pull environment variables
vercel env pull .env.local
# List environment variables
vercel env ls
# Add missing variable
vercel env add VARIABLE_NAME production
# Check deployment status
vercel ls
# Force new deployment
vercel --force
# Check if domain is correctly assigned
vercel domains ls
Remember: Always test deployments in preview environments before pushing to production. Use environment-specific configurations and monitor deployments for errors.
Use this agent to verify that a Python Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a Python Agent SDK app has been created or modified.
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a TypeScript Agent SDK app has been created or modified.