/stackwise:docker-expertfrom stackwise
Builds, debugs, secures, and optimizes Docker 27+ images and Docker Compose services. Guides multi-stage builds, cache behavior, health checks, and non-root execution.
Ships in stackwise. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Build small, reproducible, non-root Docker images using Docker 27+ and BuildKit.
Dockerfiledocker-compose.yml or compose.yaml.dockerignore, health checks, or non-root executionInspect the runtime contract - identify the app start command, listening port, required files, environment variables, native dependencies, and health endpoint. Read existing Dockerfiles, Compose files, lockfiles, and .dockerignore before making changes.
Design build and runtime stages - separate build dependencies from runtime dependencies. Pin an explicit maintained base-image version, use named build stages, and copy only required runtime artifacts into the final image.
Implement Dockerfile and ignore rules - order layers from least frequently changed to most frequently changed: base image, OS packages, dependency manifests, dependency installation, then application source. Add .dockerignore before relying on COPY . ..
Verify the image build - run docker build --progress=plain -t app:local .; fix every reported issue and re-run until clean. Change only an application source file, rebuild, and confirm dependency installation is cached.
Run the container - run docker run --rm --name app-local -p 8080:8080 app:local, replacing 8080 with the real application port. Check logs with docker logs app-local, verify the endpoint, fix failures, and re-run until clean.
Implement Compose configuration when needed - use Compose for multi-service applications or local development. Define explicit services, ports, networks, volumes, health checks, and dependency readiness.
Verify Compose configuration - run docker compose config; fix every reported issue and re-run until clean. Then run docker compose up --build --wait, inspect docker compose ps and docker compose logs, verify the application endpoint, and run docker compose down --volumes after testing.
Harden the final image - run as an unprivileged user, avoid latest tags, do not copy secrets into the image, and add a health check for long-running HTTP services. Run docker image inspect app:local; fix identified security or runtime problems and re-run until clean.
Load detailed guidance only when the task needs it:
| Topic | Reference | Load When |
|---|---|---|
| Production Dockerfiles | references/production-dockerfiles.md | Creating, optimizing, or reviewing a Dockerfile |
| Compose development | references/compose-development.md | Working with Compose services, volumes, networks, or local dependencies |
| Security and health checks | references/security-healthchecks.md | Hardening an image, handling secrets, or adding health checks |
Use multi-stage builds so compilers, source code, and development dependencies do not ship in the runtime image:
# syntax=docker/dockerfile:1.7
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY . .
RUN npm run build
FROM node:22-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
RUN groupadd --system app && useradd --system --gid app app
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci --omit=dev
COPY --from=build /app/dist ./dist
USER app
EXPOSE 8080
CMD ["node", "dist/server.js"]
Copy lockfiles before application source so dependency installation remains cached:
COPY package.json package-lock.json ./
RUN --mount=type=cache,target=/root/.npm npm ci
COPY . .
Wait for healthy dependencies in Compose instead of treating container startup as readiness:
services:
api:
build: .
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:8080/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
latest image tags - builds are not reproducible. Use an explicit maintained tag such as node:22-bookworm-slim..dockerignore - build contexts can include node_modules, Git history, test output, and secrets. Exclude files that are not needed.depends_on as readiness - startup order does not prove the dependency is ready. Define health checks and use condition: service_healthy.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
16 skills in this plugin
/engineering-rulesUse when writing, modifying, or reviewing code in any language or framework. Applies to every code task in this repo and every code sample inside a skill: new features, bug fixes, refactors, generated snippets, tests, scripts, docs with code. Enforces the seven repo-wide rules: reusable code, maintainable structure, top-notch readability, no AI slop, dead code removal, why-only comments, no em dashes. Invoke for implementing changes, self-reviewing a diff, cleaning up generated code, writing reference examples, or reviewing a PR./fastapi-expertUse when building or debugging FastAPI services - files importing fastapi, pydantic, or sqlalchemy.ext.asyncio; projects with pyproject.toml using uv/ruff/mypy; mentions of FastAPI, Pydantic v2, APIRouter, Depends, async endpoints, OAuth2/JWT auth, or pytest with httpx. Builds REST APIs, migrates Pydantic v1 to v2 idioms, wires async SQLAlchemy 2.0, adds auth and settings, writes async tests. Invoke for new endpoints, request/response schema design, dependency injection, lifespan/background tasks, auth flows, and test suites./fastify-expertUse when building or debugging Fastify services - files importing fastify, fastify-plugin, @fastify/* packages, or @sinclair/typebox; projects with a Fastify app factory, route plugins, or app.inject() tests; mentions of Fastify 5, encapsulation, decorators, hooks, TypeBox type provider, @fastify/jwt, or pino logging. Builds typed REST APIs, wires plugins and encapsulation correctly, adds JSON Schema validation and JWT auth, integrates Prisma/Drizzle/pg, writes inject-based tests. Invoke for new routes/plugins, schema-first request typing, auth flows, error handling, database wiring, and test suites.npx claudepluginhub aarvion-ai/stackwise-skills --plugin stackwise