/idea-to-code:dockerfile-guidelinesfrom idea-to-code
Provides Dockerfile best practices for optimal layer caching by ordering instructions from most stable to least stable, resulting in faster builds.
Ships in idea-to-code. 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.
When creating or modifying Dockerfiles for this project, follow these guidelines:
Dockerfile instructions should be ordered from most stable (least likely to change) to least stable (most likely to change). This maximizes Docker layer caching efficiency, resulting in faster builds.
FROM) - Changes rarelyRUN apt-get, RUN apk add) - Changes infrequentlyENV) - Changes occasionallyWORKDIR) - Changes rarelyCOPY package.json, COPY requirements.txt) - Changes when dependencies changeRUN npm install, RUN pip install) - Changes when dependencies changeCOPY . .) - Changes frequently during developmentRUN npm run build) - Changes when code changesEXPOSE, CMD, ENTRYPOINT) - Changes occasionally# 1. Base image (most stable)
FROM node:20-alpine
# 2. System dependencies
RUN apk add --no-cache tini
# 3. Environment variables
ENV NODE_ENV=production
# 4. Working directory
WORKDIR /app
# 5. Copy dependency manifests first
COPY package.json package-lock.json ./
# 6. Install dependencies (cached unless manifests change)
RUN npm ci --only=production
# 7. Copy application code (least stable - changes often)
COPY . .
# 8. Build step
RUN npm run build
# 9. Runtime configuration
EXPOSE 3000
CMD ["/sbin/tini", "--", "node", "dist/index.js"]
# Base image (most stable)
FROM eclipse-temurin:17-jre
WORKDIR /app
# Install system tools (stable - rarely changes)
RUN apt-get update && apt-get install -y curl ca-certificates wget && \
wget -O step-cli.tar.gz https://dl.smallstep.com/gh-release/cli/gh-release-header/v0.27.4/step_linux_0.27.4_$(dpkg --print-architecture).tar.gz && \
tar -xzf step-cli.tar.gz && \
mv step_0.27.4/bin/step /usr/local/bin/step && \
rm -rf step-cli.tar.gz step_0.27.4 && \
apt-get clean && rm -rf /var/lib/apt/lists/*
EXPOSE 8443
# Copy entrypoint script (changes occasionally)
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Copy application JAR (changes frequently)
COPY build/libs/app.jar /app/app.jar
ENTRYPOINT ["/app/entrypoint.sh"]
Docker builds images in layers. When a layer changes, all subsequent layers must be rebuilt. By placing stable instructions first:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub humansintheloop-dev/humansintheloop-dev-workflow-and-tools --plugin idea-to-code24 skills in this plugin
/apply-design-patternsConsult the design pattern catalog before implementing or refactoring code./ask-a-friendWhen stuck on a problem, formulate a well-structured question and copy it to the clipboard for pasting into ChatGPT. Claude should use this skill when debugging efforts stall or when an outside perspective would help./brainstorm-ideaUse when refining an idea in an idea directory through questions and answers and classifying it.Other plugins' skills for the same job