/build-image
Build a Docker image with best practices for caching, security, and size optimization.
$ npx -y skills add rohitg00/awesome-claude-code-toolkit --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/build-image
Context preview
What this command does when you run it.
Build a Docker image with best practices for caching, security, and size optimization.
Command definition
build-image.mdname: build-image
description: Build a Docker image with best practices for caching, security, and size optimization.
Build a Docker image with best practices for caching, security, and size optimization.
Steps
1. Read the existing Dockerfile or generate one if missing. 2. Analyze the build context:
- Check `.dockerignore` exists and excludes unnecessary files.
- Identify the base image and its size.
- Map build stages and layer count.
3. Build the image with build arguments:
- `docker build -t <name>:<tag> --build-arg VERSION=<ver> .`
- Use BuildKit for improved caching: `DOCKER_BUILDKIT=1`.
- Add `--platform linux/amd64,linux/arm64` for multi-arch if needed.
4. Verify the build:
- Check final image size: `docker images <name>:<tag>`.
- Run a quick smoke test: `docker run --rm <name>:<tag> <health-command>`.
- Scan for vulnerabilities: `docker scout cves <name>:<tag>`.
5. Tag appropriately:
- `<name>:latest` for development.
- `<name>:<version>` for releases.
- `<name>:<git-sha-short>` for CI builds.
6. Report build results and image details.
Format
Docker Build: <name>:<tag>
Base: <base-image>
Size: <size>MB (layers: <N>)
Build time: <duration>
Vulnerabilities: <C>critical, <H>high, <M>medium
Smoke test: <pass/fail>
Push: docker push <registry>/<name>:<tag>
Rules
- Always use specific base image tags, not `latest`.
- Include a `.dockerignore` to minimize build context.
- Run as non-root user in the final image.
- Use multi-stage builds to keep the final image minimal.
- Add health check instruction (`HEALTHCHECK`) for production images.
Read more
name: build-image description: Build a Docker image with best practices for caching, security, and size optimization.
Build a Docker image with best practices for caching, security, and size optimization.
Steps
1. Read the existing Dockerfile or generate one if missing. 2. Analyze the build context:
- Check `.dockerignore` exists and excludes unnecessary files.
- Identify the base image and its size.
- Map build stages and layer count.
3. Build the image with build arguments:
- `docker build -t <name>:<tag> --build-arg VERSION=<ver> .`
- Use BuildKit for improved caching: `DOCKER_BUILDKIT=1`.
- Add `--platform linux/amd64,linux/arm64` for multi-arch if needed.
4. Verify the build:
- Check final image size: `docker images <name>:<tag>`.
- Run a quick smoke test: `docker run --rm <name>:<tag> <health-command>`.
- Scan for vulnerabilities: `docker scout cves <name>:<tag>`.
5. Tag appropriately:
- `<name>:latest` for development.
- `<name>:<version>` for releases.
- `<name>:<git-sha-short>` for CI builds.
6. Report build results and image details.
Format
Docker Build: <name>:<tag> Base: <base-image> Size: <size>MB (layers: <N>) Build time: <duration> Vulnerabilities: <C>critical, <H>high, <M>medium Smoke test: <pass/fail> Push: docker push <registry>/<name>:<tag>
Rules
- Always use specific base image tags, not `latest`.
- Include a `.dockerignore` to minimize build context.
- Run as non-root user in the final image.
- Use multi-stage builds to keep the final image minimal.
- Add health check instruction (`HEALTHCHECK`) for production images.
The most comprehensive toolkit for Claude Code -- 135 agents, 35 curated skills (+400,000 via SkillKit), 42 commands, 176+ plugins, 20 hooks, 15 rules, 7 templates, 15 MCP configs, 26 companion apps, 53 ecosystem entries, and more.
Repo: rohitg00/awesome-claude-code-toolkit
Other commands on rohitg00-claude-code-toolkit.
- /adr
Write an Architecture Decision Record documenting a significant technical decision.
Open command - /design-review
Conduct a structured design review of a module, feature, or system component.
Open command - /diagram
Generate Mermaid diagrams from codebase analysis or description.
Open command - /migrate
Plan and execute a framework or library migration incrementally.
Open command - /plan
Create a structured implementation plan for the requested feature or change.
Open command - /refactor
Perform a systematic refactoring of the specified code area.
Open command

