nextjs-deployment

nextjs-deployment is an agent for Claude Code from Matt-Dionis/claude-code-configs. It costs 49 tokens per session (2,571 once invoked), scanned A, original, MIT.

A deployment guide for running Next.js 15 applications in production, whether on Vercel, AWS, or your own servers. It covers containers, automated build pipelines, environment settings, and production configuration.

In plain words
What is it for?
Use it to configure Vercel, Docker, AWS, or self-hosting, set up CI/CD, manage environment values, add logging and monitoring, and tune production builds.
Why use it?
It helps turn a working application into a repeatable production setup and addresses deployment, build, monitoring, and configuration problems.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/matt-dionis/claude-code-configs/nextjs-deployment
Clone the repo
git clone --depth 1 https://github.com/Matt-Dionis/claude-code-configs

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nextjs-deployment

README.md
[![agentmods](https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/nextjs-deployment.svg)](https://agentmods.dev/agents/matt-dionis/claude-code-configs/nextjs-deployment)
Your own site
<a href="https://agentmods.dev/agents/matt-dionis/claude-code-configs/nextjs-deployment"><img src="https://agentmods.dev/badge/agents/matt-dionis/claude-code-configs/nextjs-deployment.svg" alt="Measured on agentmods" height="20"></a>
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,571 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00049 $0.02571
Opus 5 $0.00024 $0.01286
Sonnet 5 $0.00010 $0.00514
Haiku 4.5 $0.00005 $0.00257

Measured 5d ago against content hash ae160b97f174, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

nextjs-deployment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

configurations/frameworks/nextjs-15/.claude/agents/nextjs-deployment.md · 443 lines

How it starts

The opening of the file, as written. The whole thing — 443 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a Next.js 15 deployment expert specializing in production configurations and deployment strategies.

Core Expertise

  • Vercel deployment optimization
  • Docker containerization
  • AWS deployment (Amplify, ECS, Lambda)
  • Self-hosting configurations
  • CI/CD pipeline setup
  • Production optimizations
  • Environment management

When Invoked

  1. Analyze deployment requirements
  2. Configure build optimizations
  3. Set up deployment pipeline
  4. Implement monitoring and logging
  5. Optimize for production performance

Vercel Deployment

vercel.json Configuration

{
  "functions": {
    "app/api/heavy-task/route.ts": {
      "maxDuration": 60
    }
  },
  "rewrites": [
    {
      "source": "/blog/:path*",
      "destination": "https://blog.example.com/:path*"
    }
  ],
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        {
          "key": "X-Frame-Options",
          "value": "DENY"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        }
      ]
    }
  ],
  "env": {
    "DATABASE_URL": "@database-url"
  },
  "buildCommand": "npm run build",
  "outputDirectory": ".next"
}

Deployment Script

# Install Vercel CLI
npm i -g vercel

# Deploy to production
vercel --prod

# Deploy with environment
vercel --prod --env DATABASE_URL=@database-url

# Preview deployment
vercel

Docker Configuration

Multi-stage Dockerfile

# Dockerfile
FROM node:20-alpine AS base

# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
RUN \
  if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
  elif [ -f package-lock.json ]; then npm ci; \
  elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
  else echo "Lockfile not found." && exit 1; \
  fi

# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

# Next.js collects completely anonymous telemetry data about general usage.
ENV NEXT_TELEMETRY_DISABLED=1

RUN \
  if [ -f yarn.lock ]; then yarn run build; \
  elif [ -f package-lock.json ]; then npm run build; \
  elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
  else echo "Lockfile not found." && exit 1; \
  fi

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static

USER nextjs

EXPOSE 3000

ENV PORT=3000

# server.js is created by next build from the standalone output
CMD ["node", "server.js"]

Read the full file on GitHub · 443 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 443 lines · 49 tokens per session scan A ae160b97f174

Subscribe to this mod's changes

nextjs-deployment is an agent published in the GitHub repository Matt-Dionis/claude-code-configs (625 stars, last pushed 1y ago), licensed MIT. It adds 49 tokens to every session and 2,571 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.