Skip to content
cccskills
FreePublished on GitHub

vercel-patterns

Apply Vercel deployment, edge function, and environment variable patterns. Use when deploying to Vercel.

The English summary is being prepared. Showing the original description.

Works withVercel
See how to install

Files included (1)

  • SKILL.md2.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

SKILL: Vercel Patterns

vercel.json Configuration

{
  "framework": "nextjs",
  "buildCommand": "npm run build",
  "devCommand": "npm run dev",
  "installCommand": "npm ci",
  "regions": ["iad1"],
  "headers": [
    {
      "source": "/api/(.*)",
      "headers": [
        { "key": "X-Content-Type-Options", "value": "nosniff" },
        { "key": "X-Frame-Options", "value": "DENY" },
        { "key": "Strict-Transport-Security", "value": "max-age=31536000" }
      ]
    }
  ],
  "rewrites": [],
  "redirects": [
    {
      "source": "/old-path",
      "destination": "/new-path",
      "permanent": true
    }
  ]
}

Runtime Selection

// Edge Runtime (low-latency, streaming, middleware)
export const runtime = 'edge';

// Node.js Runtime (heavy compute, native modules, file system)
export const runtime = 'nodejs';

// ISR (static with revalidation)
export const revalidate = 3600; // seconds

Environment Variables

# Pull env vars for local development
vercel env pull .env.local

# Add env var
vercel env add SECRET_KEY production

# List env vars
vercel env ls

Deployment Workflow

# Build locally first (catch errors before deploy)
vercel build

# Deploy prebuilt (faster, recommended for CI)
vercel deploy --prebuilt

# Deploy to production
vercel deploy --prod --prebuilt

Middleware Pattern

// middleware.ts (runs at edge, before every request)
import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';

export function middleware(request: NextRequest) {
  // Auth check, rate limiting, A/B testing, etc.
  const token = request.cookies.get('token');
  if (!token && request.nextUrl.pathname.startsWith('/dashboard')) {
    return NextResponse.redirect(new URL('/login', request.url));
  }
  return NextResponse.next();
}

export const config = {
  matcher: ['/dashboard/:path*', '/api/protected/:path*'],
};

Rules

  • Run vercel build locally before deploying to catch errors.
  • Use vercel env pull to sync environment variables locally.
  • Prefer Edge runtime for middleware and simple API routes.
  • Use Node.js runtime for heavy compute or native module requirements.
  • Set security headers for all API routes.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Run WCAG 2.2 Level AA accessibility audits against generated UI. Use when a story has ui:true or when asked to audit accessibility.

The English summary is being prepared. Showing the original description.

kinncj/Heimdall70Updated Sep 2, 2026

Generate a complete component file tree wired to design tokens with tests and Gherkin spec. Use when scaffolding a new UI component.

The English summary is being prepared. Showing the original description.

kinncj/Heimdall70Updated Sep 2, 2026

Extract Gherkin scenarios from story markdown files into runnable .feature files and generate step definition stubs. Use when syncing stories to test suites.

The English summary is being prepared. Showing the original description.

kinncj/Heimdall70Updated Sep 2, 2026

Read and write design tokens in W3C DTCG format (tokens.json) and emit CSS, Tailwind, and Mantine outputs. Use when modifying or generating design tokens.

The English summary is being prepared. Showing the original description.

kinncj/Heimdall70Updated Sep 2, 2026

Apply Docker and Docker Compose best practices for containerising services. Use when writing or reviewing Dockerfiles and compose configs.

The English summary is being prepared. Showing the original description.

kinncj/Heimdall70Updated Sep 2, 2026

Identify and annotate cloud cost implications of architectural decisions. Use when reviewing infrastructure changes or designing new services.

The English summary is being prepared. Showing the original description.

kinncj/Heimdall70Updated Sep 2, 2026

See all skills by kinncj

Report a problem with this skill