nextjs-coolify-image

nextjs-coolify-image is a skill for Claude Code from KhaledSaeed18/dotclaude. It costs 52 tokens per session (1,228 once invoked), scanned A, original, MIT.

A way to package a Next.js web application as a runtime-only container image with a health check and quick shutdown. The build happens in CI, and the container carries the standalone server, static files, and public files it needs.

In plain words
What is it for?
Use it when containerising a Next.js app, reducing its image contents, configuring build-time public settings, or checking readiness and shutdown during deployment.
Why use it?
It avoids putting build work on the production server and helps rolling updates replace containers without dropping requests. The health route also prevents an unready container from receiving traffic.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the deploy plugin — 9 skills, 3 commands, 1 agent shipped together

Good fit Use it when containerising a Next.js app, reducing its image contents, configuring build-time public settings, or checking readiness and shutdown during deployment.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/khaledsaeed18/dotclaude/nextjs-coolify-image
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.

Any agent
npx skills add KhaledSaeed18/dotclaude --skill nextjs-coolify-image
Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install deploy, the plugin that ships this one along with the rest of its 9 skills, 3 commands, 1 agent.

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-coolify-image

README.md
[![agentmods](https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/nextjs-coolify-image/github.svg)](https://agentmods.dev/skills/khaledsaeed18/dotclaude/nextjs-coolify-image)
Your own site
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/nextjs-coolify-image"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/nextjs-coolify-image/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nextjs-coolify-image

Your own site · 80×15
<a href="https://agentmods.dev/skills/khaledsaeed18/dotclaude/nextjs-coolify-image"><img src="https://agentmods.dev/badge/skills/khaledsaeed18/dotclaude/nextjs-coolify-image.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,228 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00052 $0.01228
Opus 5.5 $0.00021 $0.00491
Sonnet 5.5 $0.00010 $0.00246
Haiku 4.5 $0.00005 $0.00123

Measured 11d ago against content hash 07cb4f22a121, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nextjs-coolify-image scanned grade A with 1 finding 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 11d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (templates/healthcheck.js, templates/healthz-route.ts, templates/shutdown.cjs), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Run the container with the memory limit and check, in order: Docker reports `healthy` within 30 s; `id -u` is not 0; `/healthz` 200; a page per locale (`dir="rtl"` present where expected); an unauthenticated protected ro
.claude-plugin/plugins/deploy/skills/nextjs-coolify-image/SKILL.md · 58 lines

How it starts

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

The image contains the standalone server and nothing else: the build runs natively in CI, the Dockerfile only copies output, and the container proves its own readiness and leaves within a second when asked. Those three properties make rolling updates safe and images small; everything below enforces them.

Hard rules: never break these

  • Build on the runner, never in Docker and never on the server. Registry installs inside container builds hang; the server has no spare CPU. The Dockerfile copies .next/standalone, .next/static and public only.
  • output: "standalone" with no NEXT_DIST_DIR override at build time, so the output lands in .next.
  • Public env is baked at build time. Every NEXT_PUBLIC_* value and the /api rewrite destination are inlined; set them in the workflow before next build and verify them in .next/routes-manifest.json. Only server-only runtime secrets go to Coolify.
  • The health route lives outside anything proxied or localised. /healthz sits beside app/api, not under it, and the proxy matcher excludes it.
  • Exit within a second on SIGTERM. Next waits for in-flight requests; a long-lived stream (SSE, a WebSocket) keeps the old container alive for the whole grace period while the proxy still routes to it.
  • No latest tags, no root user, no host ports.

Step 1: Audit the app

grep -n "output\|distDir\|rewrites\|headers" next.config.*
grep -rn "process.env" app components lib proxy.ts middleware.ts 2>/dev/null | grep -v NEXT_PUBLIC_ | grep -v node_modules
grep -rln "next/image" app components | head

Classify every env read as build-time (NEXT_PUBLIC_*, anything in next.config) or runtime (read on the server at request time). Note whether next/image optimises local images: sharp is traced into the standalone output automatically when installed, so the runtime image needs no extra packages, but the smoke test must prove it.

Step 2: Add the runtime files

Copy and adapt, from templates/:

Read the full file on GitHub · 58 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 11d ago First seen · 58 lines · 52 tokens per session scan A 07cb4f22a121

Subscribe to this mod's changes

nextjs-coolify-image is a skill published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 2d ago), licensed MIT. It adds 52 tokens to every session and 1,228 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-05.