Optimizes Dockerfiles and docker-compose files with multi-stage builds, image size reduction, build cache acceleration, and container security hardening. Produces optimized Dockerfiles, compose files, and security audit reports.
Ships in 10-platform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
适用于:优化某个 Dockerfile(瘦身/提速/层缓存)、编写或改进 docker-compose.yml、实现多阶段构建、审计容器安全、降低镜像体积、落地生产级容器约定。识别信号:用户手上有 Dockerfile,或想把某个项目容器化;提到镜像大、构建慢、是否安全、是否以 root 运行等。
不该用:不负责 Kubernetes / Helm 集群编排,不搭建 CI/CD 流水线本身(只产出被流水线消费的镜像),不做应用层代码漏洞修复(那属于代码审计/安全审查范畴)。这些场景应转交对应技能或人工处理。
三条主线,按需求选其一或组合。
.env.example。核心优化决策(保留源约束):
基础镜像
├── 用具体 tag,生产环境绝不用 :latest
├── 优先 slim/alpine(debian-slim > ubuntu > debian)
├── CI 中固定 digest 保证可复现:image@sha256:...
└── 基础镜像匹配运行需求(编译型二进制别用 python:3.12)
层优化 / 构建缓存
├── 相关 RUN 用 && \ 合并;最少变动的层放最前(依赖先于源码)
├── 包管理器缓存在同一 RUN 内清理(apt 用 rm -rf /var/lib/apt/lists/*)
├── 依赖清单(package.json / requirements.txt / go.mod)先于源码 COPY
├── 启用 BuildKit 缓存挂载:--mount=type=cache,target=/root/.cache
└── 避免在装依赖前就 COPY . .;用 .dockerignore 排除无关文件
多阶段构建
├── 阶段1 build:完整 SDK / 构建工具 / dev 依赖
├── 阶段2 runtime:最小基础镜像,仅生产产物
├── COPY --from=builder 只拷必需文件
└── 终镜像不含构建工具、源码、dev 依赖
校验脚本(来自源仓库 scripts/):
python3 scripts/dockerfile_analyzer.py Dockerfile # 层数与反模式
python3 scripts/dockerfile_analyzer.py Dockerfile --security # 安全聚焦
python3 scripts/dockerfile_analyzer.py Dockerfile --output json
python3 scripts/compose_validator.py docker-compose.yml --strict
安全高频项与修复:以 root 运行 → 建用户后 USER nonroot(Critical);ENV/ARG 藏密钥 → 改 BuildKit --mount=type=secret(Critical);保留全部能力 → cap_drop: [ALL] 仅按需加回(High);可写根文件系统 → compose read_only: true(Medium);缺 HEALTHCHECK → 补上(Medium)。绝不在生产挂载 /etc、/var/run/docker.sock。
基础镜像选型:编译型二进制 → distroless/static 或 scratch;需调试 shell → alpine;需 glibc → slim;需较多系统包 → debian-slim,否则 alpine + apk add。
Go 多阶段(编译型,终镜像 distroless):
FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/server ./cmd/server
FROM gcr.io/distroless/static-debian12
COPY --from=builder /app/server /server
USER nonroot:nonroot
ENTRYPOINT ["/server"]
Python 多阶段(builder 装到 /install,runtime 拷贝并切非 root 用户):
FROM python:3.12-slim AS builder
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt
FROM python:3.12-slim
WORKDIR /app
RUN groupadd -r appgroup && useradd -r -g appgroup appuser
COPY --from=builder /install /usr/local
COPY . .
USER appuser
EXPOSE 8000
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
Node.js 模式同理:deps → builder → runtime 三阶段,runtime 仅拷 dist 与 node_modules,建 1001 uid 的 appuser 并 USER appuser。
主动发现并主动指出(无需用户问):用了 :latest → 建议钉死版本 tag;无 .dockerignore → 至少排除 .git、node_modules、__pycache__、.env;装依赖前 COPY . . → 缓存击穿,重排序让依赖先装;以 root 运行 → 加 USER,生产无例外;密钥进 ENV/ARG → 改 BuildKit secret 挂载,绝不烤进层;镜像超 1GB → 必须多阶段;无 healthcheck → 补上,编排器(Compose/K8s)依赖它管理生命周期;apt-get 未在同层清理 → 同一 RUN 内 rm -rf /var/lib/apt/lists/*。
本条采编自 alirezarezvani/claude-skills(MIT)。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
66 skills in this plugin
/agentmail-email-infra当 AI 智能体需要真实邮箱完成注册/验证码/事务通信时使用;通过 AgentMail REST API 开通账号、收发邮件、注册 Webhook、查询 karma 余额并产出可执行调用;不适用于自建/企业 SMTP/IMAP 或个人邮箱代收。触发词:AgentMail、智能体邮箱、theagentmail.net/agentphone-voice-sms-agents当需要给 AI 代理配备电话号码、发起/接听语音通话、收发短信、查看通话转写或配置 Webhook 时使用;调用 AgentPhone REST API(base=https://api.agentphone.to/v1)完成代理/号码/通话/短信/Webhook/用量的全生命周期管理,产出可直接执行的 curl 与 Webhook 处理代码;不适用于自建 Twilio/SIP/STUN 等底层电信栈或非 AgentPhone 平台。触发词:电话代理、语音通话、短信、号码、Webhook、转写。/ai-native-cli-design当设计/改造供 AI 智能体调用的命令行工具时使用;按 core/recommended/ecosystem 三层产出 JSON 优先、可校验的 CLI 契约(默认 JSON、结构化错误、退出码、护栏、agent/ 目录与自描述);不适用于纯人类交互 CLI、GUI 或库 API 设计;触发词:agent CLI、AI 友好命令行、CLI JSON 输出、退出码规范、agent/ 目录/amazon-alexa-skill-builder当需要用 ASK CLI + AWS Lambda 开发 Amazon Alexa 语音技能、并以 Claude 作为对话大脑(含 DynamoDB 记忆、Polly 语音、APL 屏显、Smart Home 控制)时使用;做交互模型/Lambda 处理器/部署脚本的搭建与产出;不适用于纯网页/移动 App 或非 Alexa 平台语音助手;触发词:Alexa、ASK CLI、语音技能、Smart Home/apify-actor-development当需要创建、修改或调试 Apify Actor(无服务器 Docker 抓取/自动化程序)时使用;引导选模板、配 input/output schema 与 actor.json、写入口逻辑、本地 apify run 测试并 apify push 部署;不适用于已有现成 Actor 直接调用(用 apify-ecommerce-scraper)、无 APIFY_TOKEN、或普通网页抓取无需打包为 Actor。触发词:apify actor、apify create、apify push、input_schema、actor.json、爬虫部署、serverless scraper、crawlee/apify-actorization当需要把现有 JS/TS、Python 脚本或任意 CLI 工具改造成可在 Apify 平台运行的 Actor(接受 JSON 输入、产出结构化 JSON、打包为 Docker 镜像并部署/变现)时使用;做 apify init 初始化 + SDK 生命周期包裹 + 配置 input/output/actor schema + apify run 本地测试 + apify push 部署,产出可上架的 Actor;不适用于从零写新爬虫、单纯调用现成 Actor、或无 apify CLI/APIFY_TOKEN。触发词:apify actor、actorization、改造成 actor、apify push、apify init、input_schema、serverless 爬虫/10-platform:docker-container-optimizerfrom 10-platform
npx claudepluginhub findscripter/everything-skills --plugin 10-platformOther plugins' skills for the same job