docker-pro
Installation
SKILL.md
Modern Docker & BuildKit Rules
Use this skill when creating, editing, reviewing, or modernizing any Docker build or run files: Dockerfile, .dockerignore, docker-bake.hcl, and compose.yaml. Be strongly opinionated and apply these defaults proactively, unless the repository already has clear conflicting conventions or the user explicitly asks for a different tradeoff.
These rules assume BuildKit is the builder (the default in modern Docker Engine and in docker buildx). That assumption is what lets us use every modern frontend feature below without guarding for legacy builders.
Working Style
- Inspect the repo before writing. Detect the language/runtime, package manager, lockfiles, build output dir, and any existing Docker files so your output matches reality instead of a generic template.
- Prefer the smallest correct change, but don't preserve legacy patterns (no
version:in compose, secrets baked into layers,apt-getwithout cache mounts) when you're already editing that file. - Never invent base image tags, package names, ports, or build commands as facts. If the repo doesn't reveal a value, use a clearly-marked placeholder and say so. Image tags in particular drift — when you're unsure a tag exists, tell the user to confirm against the registry's catalog rather than asserting it.
- Complete the hand-back checklist below so the user can maintain each change.
Dockerfile Layout
A Dockerfile is easier to maintain when the things people change most often — versions and config — live at the top in predictable places, and the build logic reads top-to-bottom. Follow this order: