docker
Docker containerization for development and production. Covers Dockerfiles, multi-stage builds, layer caching, Compose services, networking, volumes, health checks, security hardening, and production deployment patterns. Use when writing Dockerfiles, optimizing image size, configuring Compose services, debugging container networking, setting up health checks, hardening containers for production, or troubleshooting build cache issues.
What this skill does
# Docker ## Overview Docker packages applications into isolated containers that run consistently across environments. A Dockerfile defines the image build steps, Compose orchestrates multi-container services, and production patterns ensure small, secure, performant images. **When to use:** Containerizing applications, creating reproducible dev environments, orchestrating multi-service stacks, deploying to container platforms (ECS, Kubernetes, Fly.io, Railway, Coolify). **When NOT to use:** Simple static sites with no backend (use CDN deploy), single-binary CLI tools (distribute the binary), or when the target platform has native buildpacks (Heroku, Vercel) and you don't need container control. ## Quick Reference | Pattern | Approach | Key Points | | -------------------- | ---------------------------------------------- | ---------------------------------------------------- | | Multi-stage build | Separate `builder` and `production` stages | 80%+ image size reduction, no dev deps in production | | Layer caching | Copy lockfile first, install, then copy source | Dependency layer cached across builds | | Non-root user | `RUN adduser` + `USER` in final stage | Never run production containers as root | | Health check | `HEALTHCHECK CMD curl` or node/python check | Enables orchestrator restart on failure | | `.dockerignore` | Exclude `node_modules`, `.git`, `.env` | Smaller build context, faster builds | | Compose services | `compose.yaml` with service definitions | Dev environment in one command | | Compose override | `compose.prod.yaml` with production settings | Environment-specific config without duplication | | Named volumes | `volumes:` in Compose for persistent data | Survives container recreation | | Build cache mount | `RUN --mount=type=cache,target=/root/.npm` | Persistent cache across builds | | Secrets in build | `RUN --mount=type=secret,id=token` | Never bake secrets into image layers | | Image pinning | Pin to major.minor or digest | Reproducible builds, avoid surprise breakage | | Container networking | Custom bridge networks with service discovery | Containers resolve each other by service name | | Compose watch | `develop.watch` with sync/rebuild actions | Live reload without volume mounts | | Init process | `--init` flag or `tini` entrypoint | Proper signal handling and zombie reaping | | Multi-platform | `docker buildx build --platform` | ARM (Apple Silicon, Graviton) + x86 in one image | | Monorepo prune | `turbo prune app --docker` | Minimal build context from workspace dependencies | | CI layer caching | `cache-from`/`cache-to` with GHA or registry | Avoid full rebuilds in CI pipelines | | Debug containers | `docker exec`, `docker logs`, `dive` | Inspect running containers and image layers | ## Common Mistakes | Mistake | Correct Pattern | | ----------------------------------------------- | ---------------------------------------------------------------- | | Installing dev dependencies in production image | Multi-stage build: install in builder, copy artifacts to runtime | | Copying source before installing dependencies | Copy lockfile first, `npm ci`, then copy source for cache reuse | | Running as root in production | Create non-root user, `USER` directive in final stage | | Hardcoding secrets in Dockerfile or ENV | Use build secrets (`--mount=type=secret`) or runtime env | | Using `latest` tag for base images | Pin to specific version (`node:24-alpine`) | | No `.dockerignore` file | Exclude `node_modules`, `.git`, `.env`, build artifacts | | Using `npm install` instead of `npm ci` | `npm ci` for deterministic, lockfile-based installs | | HEALTHCHECK missing | Add health check for orchestrator integration | | Large base images (`node:24`) | Use alpine variants (`node:24-alpine`) for smaller images | | Ignoring `.env` file precedence in Compose | `environment:` in Compose overrides `.env` file values | | Building entire monorepo for one service | Use `turbo prune --docker` for minimal build context | | No layer caching in CI | Use `cache-from`/`cache-to` with GHA or registry backend | | Building only for x86 when deploying to ARM | Use `docker buildx` with `--platform linux/amd64,linux/arm64` | ## Delegation - **Dockerfile review**: Use `Task` agent to audit Dockerfiles for size, security, and caching - **Compose exploration**: Use `Explore` agent to discover existing Docker configurations - **Architecture decisions**: Use `Plan` agent for container orchestration strategy > If the `ci-cd-architecture` skill is available, delegate CI/CD pipeline and deployment strategy to it. > If the `application-security` skill is available, delegate container security scanning and hardening review to it. ## References - [Dockerfile patterns: multi-stage builds, layer caching, and image optimization](references/dockerfile-patterns.md) - [Compose: services, networking, volumes, and environment management](references/compose.md) - [Security: non-root users, secrets, scanning, and production hardening](references/security.md) - [Buildx: multi-platform builds for ARM and x86](references/buildx-and-multiplatform.md) - [CI: GitHub Actions caching, registry push, and automated builds](references/ci-caching.md) - [Monorepo: Turborepo prune, pnpm workspaces, and selective builds](references/monorepo-builds.md) - [Debugging: logs, exec, inspect, layer analysis, and network troubleshooting](references/debugging.md)
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.