nextjs-deployment
Provides comprehensive patterns for deploying Next.js applications to production. Use when configuring Docker containers, setting up GitHub Actions CI/CD pipelines, managing environment variables, implementing preview deployments, or setting up monitoring and logging for Next.js applications. Covers standalone output, multi-stage Docker builds, health checks, OpenTelemetry instrumentation, and production best practices.
Security Assessment
About nextjs-deployment
nextjs-deployment provides a curated set of production deployment patterns for Next.js applications. It addresses the recurring difficulty of getting a Next.js app reliably into production: choosing the right output mode, building small container images, wiring CI/CD, handling environment variables and secrets correctly, and adding health checks and observability. The skill packages battle-tested configurations rather than requiring the developer to assemble them from scattered docs.
Capabilities span standalone output configuration in next.config.ts, multi-stage Dockerfiles (non-root nextjs user, HEALTHCHECK against an /api/health endpoint, multi-arch builds), and GitHub Actions workflows for lint/type-check/test/build, Docker build-and-push to GHCR, deploys to AWS ECS and Vercel, and security scanning (npm audit, CodeQL, Trivy). It documents the distinction between NEXT_PUBLIC_ build-time/browser variables and server-only secrets, and shows generating a Server Actions encryption key at build time with openssl. Secrets are passed via GitHub Actions secrets and OIDC role assumption rather than being hardcoded, and reference files expand on Docker patterns, GitHub Actions, monitoring (OpenTelemetry), and deployment platforms.
It targets Next.js developers and DevOps engineers who are containerizing an app, setting up CI/CD pipelines, configuring preview/staging environments, or adding monitoring and health checks. The allowed tools (Read, Write, Edit, Bash) let it scaffold Dockerfiles, workflow YAML, and config files. The security-relevant operations it shows — key generation and secret handling — follow standard, non-exfiltrating practices.
FAQ
What output mode should I use for containers?
The skill recommends output: 'standalone' for Docker/container deployment, output: 'export' for static sites, and the default (next start) for a Node.js server deployment.
How are secrets handled?
Server-only values (database URLs, secrets) have no NEXT_PUBLIC_ prefix, while NEXT_PUBLIC_ variables are exposed to the browser. In CI, secrets come from GitHub Actions secrets and AWS access uses OIDC role assumption; the Server Actions encryption key is generated at build time with openssl rand rather than hardcoded.
Which deployment targets are covered?
GitHub Container Registry (GHCR) image builds, AWS ECS deployments, and Vercel deployments, each with a complete example workflow.
Does it include security scanning?
Yes — the reference workflows include npm audit (high level), GitHub CodeQL analysis, and Trivy image scanning with SARIF upload.
What monitoring is supported?
The skill covers health-check endpoints and OpenTelemetry instrumentation via an instrumentation.ts setup for tracing and logging.
Install nextjs-deployment
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
giuseppe-trisciuoglio/developer-kit