dot-files: Skill for Claude Code

.claude/skills/dockerfile-best-practices/SKILL.md

dockerfile-best-practices is a skill for Claude Code from 2SSK/dot-files. It costs 27 tokens per session (470 once invoked), scanned A, original, MIT.

A guide for writing Dockerfiles, which are recipes for building containers that package an application and its dependencies. It covers smaller images, safer defaults, reproducible builds, and multi-stage builds.

In plain words
What is it for?
Use it when creating Dockerfiles for production applications, including choosing a base image, ordering copies for caching, adding a non-root user, and building a compiled Go program.
Why use it?
It helps avoid oversized images, running applications as root, leaked secrets, and unnecessary rebuilds. Multi-stage builds keep build tools out of the final container.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions OpenCode.

This is 2SSK/dot-files's own configuration. It tells Claude Code how to work on dot-files itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything dot-files configures →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is RUN CGO_ENABLED=0 GOOS=linux go build -o /binary ./cmd/app.

Reuse

Borrowing it

Nothing to install: this file belongs to 2SSK/dot-files. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/2SSK/dot-files/main/.claude/skills/dockerfile-best-practices/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/2SSK/dot-files

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for dockerfile-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/2ssk/dot-files/dockerfile-best-practices/github.svg)](https://agentmods.dev/skills/2ssk/dot-files/dockerfile-best-practices)
Your own site
<a href="https://agentmods.dev/skills/2ssk/dot-files/dockerfile-best-practices"><img src="https://agentmods.dev/badge/skills/2ssk/dot-files/dockerfile-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for dockerfile-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/2ssk/dot-files/dockerfile-best-practices"><img src="https://agentmods.dev/badge/skills/2ssk/dot-files/dockerfile-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 27 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 470 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00027 $0.00470
Opus 5.5 $0.00011 $0.00188
Sonnet 5.5 $0.00005 $0.00094
Haiku 4.5 $0.00003 $0.00047

Measured 1mo ago against content hash 248df3030cad, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

dockerfile-best-practices scanned grade A with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootlowPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

# Never run as root

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

CMD wget -q --spider http://localhost:8080/healthz || exit 1
.claude/skills/dockerfile-best-practices/SKILL.md · 88 lines

What it actually says

Docker Best Practices

Secure, optimized Dockerfiles for production containers.

Core Principles

  • Small: Minimal layers, minimal size
  • Secure: Non-root user, read-only where possible
  • Fast: Multi-stage builds, layer caching
  • Reproducible: Deterministic builds

Multi-Stage Builds

# Build stage
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /binary ./cmd/app

# Runtime stage
FROM alpine:3.20
RUN adduser -D -u 1000 appuser
WORKDIR /app

COPY --from=builder /binary /app/app
USER appuser

ENTRYPOINT ["/app/app"]

Security

# Never run as root
USER appuser

# Read-only filesystem (where possible)
# HEALTHCHECK for monitoring
HEALTHCHECK --interval=30s --timeout=3s \
    CMD wget -q --spider http://localhost:8080/healthz || exit 1

Optimization

# Order: least frequently changed → most frequently changed
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN go build

# This way, go.mod changes trigger cache rebuild, not code changes

Best Practices Checklist

  • Minimal base image (alpine, distroless)
  • Non-root user
  • Multi-stage build
  • No secrets in image
  • Health check defined
  • Labeled metadata
  • Layer caching optimized

Build Commands

# Build
docker build -t app:latest .

# Scan for vulnerabilities
hadolint Dockerfile
trivy image app:latest

# Build with buildkit
DOCKER_BUILDKIT=1 docker build -t app:latest .
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 88 lines · 27 tokens per session scan A 248df3030cad

Subscribe to this mod's changes

dockerfile-best-practices is a skill published in the GitHub repository 2SSK/dot-files (258 stars, last pushed 9d ago), licensed MIT. It adds 27 tokens to every session and 470 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-02.

Related

dockerfile-best-practices compared with skills from other repositories

dockerfile-best-practices next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
dockerfile-best-practices2SSK/dot-filesSkill2589d agoMITA27Claude Code
qwenpaw-usagealibaba/anolisaSkill6888d agoApache-2.0B84Claude Code, Codex
server-controld0raka/claude-server-control-pluginSkill21mo agoMITA91Claude Code
docker-daemon-privescShulkwiSEC/bb-hugeSkill274mo agoMITA50Claude Code, Codex
dockereobarretooo/ClawLiteSkill525mo agoMITA19Claude Code, Codex
analyzing-linux-elf-malwareplurigrid/asiSkill721mo agoMITB88Claude Code
alpinebytesagain/ai-skillsSkill167mo agononeA50Claude Code, Codex