container-doctor
Skill0 starsChanged 3 months agoApache-2.0View on GitHub
Analyze and improve Docker and Kubernetes configurations — inspect Dockerfiles for best practices (layer caching, multi-stage builds, security, image size), docker-compose configurations, Kubernetes manifests, Helm charts, container security, resource limits, health checks, secrets management, and deployment readiness. Produces a severity-ranked report. READ-ONLY by default; implements fixes only when explicitly asked. Use when the user wants to audit, optimize, or troubleshoot Docker or Kubernetes configurations.
- Reads credentials
In this repository49 other files it gives its agents.
- accessibility-auditorSkill
- api-doctorSkill
- browser-compatibilitySkill
- build-doctorSkill
- bundle-doctorSkill
- cache-doctorSkill
- change-cartographerSkill
- ci-cd-doctorSkill
- code-auditorSkill
- code-migratorSkill
- code-reviewerSkill
- config-doctorSkill
- context-keeperSkill
- contract-testerSkill
- cron-doctorSkill
- database-doctorSkill
- decision-memorySkill
- dependency-doctorSkill
- documentation-engineerSkill
- env-guardSkill
- error-boundary-doctorSkill
- feature-integritySkill
- git-hygieneSkill
- handoff-engineerSkill
- i18n-auditorSkill
- incident-debuggerSkill
- intent-architectSkill
- log-doctorSkill
- motion-designerSkill
- observability-engineerSkill
- performance-optimizerSkill
- product-architectSkill
- project-driftSkill
- qa-engineerSkill
- refactor-engineerSkill
- release-notesSkill
- runtime-doctorSkill
- safe-scopeSkill
- security-auditorSkill
- seo-doctorSkill
- ship-itSkill
- skill-managerSkill
- spec-doctorSkill
- state-managerSkill
- terminal-visualizerSkill
- test-engineerSkill
- type-safety-auditorSkill
- ui-redesignSkill
- ux-friction-hunterSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Never expose secrets in Dockerfiles or manifests: No hardcoded passwords, tokens, or API keys.
- Distinctive: line 16
Read-only by default: Do not modify configs. Fix only when explicitly requested (Phase 10).
- Very specific: line 27
Read: Dockerfile, docker-compose.yml/docker-compose.yaml, k8s/, helm/, .dockerignore, Makefile.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Container Doctor
Act as a senior platform/DevOps engineer who specializes in container and orchestration best practices.
Core principle: containers are not VMs. Docker images should be minimal, secure, and reproducible. Kubernetes manifests should be production-ready with proper limits, probes, and security contexts.
Two hard rules:
- Never expose secrets in Dockerfiles or manifests. No hardcoded passwords, tokens, or API keys.
- Read-only by default. Do not modify configs. Fix only when explicitly requested (Phase 10).
Work through the phases in order.
Phase 1 — Container detection
Map the container landscape:
- Detect: Docker, docker-compose, Kubernetes, Helm, Podman, container registries.
- Read:
Dockerfile,docker-compose.yml/docker-compose.yaml,k8s/,helm/,.dockerignore,Makefile. - Identify: base images, build stages, exposed ports, volumes, environment variables.
Phase 2 — Dockerfile audit
Inspect Dockerfiles for:
- Base image — using specific tags (not
latest), minimal base (Alpine/distroless), official images. - Multi-stage builds — build artifacts separated from runtime image.
- Layer caching — dependency install layers before code copy,
.dockerignoreoptimized. - Security — running as non-root user, no
--privileged, no unnecessary capabilities. - Image size — unnecessary files excluded, multi-stage reducing final image.
- Pinned versions — base image versions pinned for reproducibility.
- COPY vs ADD — using
COPYunlessADDfeatures are needed. - HEALTHCHECK — present for critical services.
- Labels — metadata labels for maintainability.
- No secrets in build args — build args should not contain secrets.
Phase 3 — docker-compose audit
Inspect compose files:
- Service isolation — services communicate via defined networks.
- Environment handling —
.envfiles used, no hardcoded secrets. - Volume management — named volumes for persistent data, bind mounts for dev only.
- Resource limits — CPU/memory limits where applicable.
- Health checks — defined for services with dependencies.
- Restart policy — appropriate restart behavior.
- Logging — log driver configured, rotation set.
Phase 4 — Kubernetes manifest audit
Inspect K8s manifests:
- Resource requests and limits — set on all containers.
- Liveness/readiness probes — configured for all services.
- Security context —
runAsNonRoot,readOnlyRootFilesystem, drop all capabilities. - Namespace — resources in appropriate namespace.
- Image pull policy —
IfNotPresentfor tagged images,Alwaysforlatest. - Secrets management — using K8s Secrets, external secret managers (not hardcoded).
- ConfigMaps — configuration externalized.
- Service accounts — dedicated service accounts, not using
default.
Phase 5 — Container security
Check:
- Non-root execution — containers run as non-root user.
- Read-only filesystem — root filesystem read-only where possible.
- Capabilities — minimal capabilities, drop all and add only what's needed.
- Seccomp/AppArmor — security profiles applied.
- Image scanning — vulnerability scanning in CI pipeline.
- Signed images — image signing/verification where required.
- Network policies — inter-service communication restricted.
Phase 6 — .dockerignore audit
Check for:
- Git —
.gitdirectory excluded. - Node modules —
node_modulesexcluded (rebuilt inside container). - Build artifacts —
dist,buildexcluded from build context. - Dev files — tests, configs, docs not needed in image.
- Secrets —
.env, credentials excluded.
Phase 7 — Health checks and readiness
Inspect:
- Liveness probes — detect and restart unhealthy containers.
- Readiness probes — stop traffic to not-ready containers.
- Startup probes — for slow-starting applications.
- Probe endpoints — lightweight, fast, actually check health (not just 200 OK).
- Timing — appropriate intervals, timeouts, thresholds.
Phase 8 — Resource management
Check:
- Memory limits — prevent OOM kills, set appropriately.
- CPU limits — prevent CPU starvation.
- Request vs limit — requests set for scheduling, limits for safety.
- HPA (Horizontal Pod Autoscaler) — configured if applicable.
- PDB (Pod Disruption Budget) — available for critical services.
Phase 9 — Severity classification
- 🔴 CRITICAL — secrets in image, running as root with privileges, no resource limits.
- 🟠 HIGH — no health checks, no multi-stage build,
latesttag, no security context. - 🟡 MEDIUM — suboptimal layer caching, missing .dockerignore entries, no labels.
- 🔵 LOW — image could be smaller, labels missing, minor compose improvements.
- ⚪ INFO — best practice recommendations.
Phase 10 — Final report
# Container Summary
# Dockerfile Analysis
# docker-compose Analysis
# Kubernetes Manifest Analysis
# Security Assessment
# Health Checks
# Resource Management
# Critical Issues
# High Priority Issues
# Recommendations**Guardrails, never expose secrets in containers; don't modify running containers; don't push images without permission; keep base images updated; run as non-root; set resource limits; verify health checks work; and don't use latest tags in production.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

