npx skills add ...
npx skills add alirezarezvani/claude-skills --skill docker-development
Docker and container development agent skill and plugin for Dockerfile optimization, docker-compose orchestration, multi-stage builds, and container security hardening. Use when: user wants to optimize a Dockerfile, create or improve docker-compose configurations, implement multi-stage builds, audit container security, reduce image size, or follow container best practices. Covers build performance, layer caching, secret management, and production-ready container patterns.
npx skills add alirezarezvani/claude-skills --skill docker-development
Smaller images. Faster builds. Secure containers. No guesswork.
Opinionated Docker workflow that turns bloated Dockerfiles into production-grade containers. Covers optimization, multi-stage builds, compose orchestration, and security hardening.
Not a Docker tutorial — a set of concrete decisions about how to build containers that don't waste time, space, or attack surface.
| Command | What it does |
|---|---|
/docker:optimize | Analyze and optimize a Dockerfile for size, speed, and layer caching |
/docker:compose | Generate or improve docker-compose.yml with best practices |
/docker:security | Audit a Dockerfile or running container for security issues |
Recognize these patterns from the user:
If the user has a Dockerfile or wants to containerize something → this skill applies.
/docker:optimize — Dockerfile OptimizationAnalyze current state
Apply optimization checklist
Generate optimized Dockerfile
Validate
/docker:compose — Docker Compose ConfigurationIdentify services
Apply compose best practices
Generate compose file
/docker:security — Container Security AuditDockerfile audit
| Check | Severity | Fix |
|---|---|---|
| Running as root | Critical | Add USER nonroot after creating user |
| Using :latest tag | High | Pin to specific version |
| Secrets in ENV/ARG | Critical | Use BuildKit secrets: --mount=type=secret |
| COPY with broad glob | Medium | Use specific paths, add .dockerignore |
| Unnecessary EXPOSE | Low | Only expose ports the app uses |
| No HEALTHCHECK | Medium | Add HEALTHCHECK with appropriate interval |
| Privileged instructions | High | Avoid --privileged, drop capabilities |
| Package manager cache retained | Low | Clean in same RUN layer |
Runtime security checks
| Check | Severity | Fix |
|---|---|---|
| Container running as root | Critical | Set user in Dockerfile or compose |
| Writable root filesystem | Medium | Use read_only: true in compose |
| All capabilities retained | High | Drop all, add only needed: cap_drop: [ALL] |
| No resource limits | Medium | Set mem_limit and cpus |
| Host network mode | High | Use bridge or custom network |
| Sensitive mounts | Critical | Never mount /etc, /var/run/docker.sock in prod |
| No log driver configured | Low | Set logging: with size limits |
Generate security report
scripts/dockerfile_analyzer.pyCLI utility for static analysis of Dockerfiles.
Features:
Usage:
scripts/compose_validator.pyCLI utility for validating docker-compose files.
Features:
Usage:
Flag these without being asked:
.git, node_modules, __pycache__, .env.rm -rf /var/lib/apt/lists/* in the same RUN.