Skip to main content
prompt GP ChatGPT

Dockerfile and CI taste — Claude & Claude.ai prompt: build rules

A prompt that lists rules for Dockerfiles and CI: multi-stage builds, non-root user, image scanning. Useful when you ask an AI to write or review a build config.

Open on GitHub

What Dockerfile and CI taste does

This is a prompt with a checklist for container builds. Each line carries a confidence score. Multi-stage builds ship only runtime artifacts in the final stage. Base images get pinned to a version tag, and to a digest for production. Slim or distroless images are preferred over a full OS, and the container runs as a non-root user. Layer order matters too: dependency manifests are copied and installed before source code.

Secrets never go into the image. Pass them at runtime or use build secrets. CMD is written in exec form so the process receives signals correctly. For package manager caches the prompt suggests BuildKit cache mounts, and a .dockerignore should exclude node_modules, .git and local env files.

The CI section covers scanning images with Trivy and failing on critical vulnerabilities, caching dependencies in GitHub Actions keyed on the lockfile hash, and running lint, type check and tests as separate parallel jobs. Images are tagged with the git SHA, never with latest. No lockfile in the repo means no hash to key the cache on, so that one is worth checking first.

What it helps with

  • write a Dockerfile with a multi-stage build and a small final image
  • move secrets out of the image into runtime or build secrets
  • scan images in CI and fail the build on critical vulnerabilities
  • split lint, type check and tests into parallel jobs
  • cache dependencies in GitHub Actions keyed on the lockfile hash

Example prompts for the agent

  • Write a Dockerfile for this project following the prompt: multi-stage build, non-root user, slim final image.
  • Review my GitHub Actions workflow: cache keyed on the lockfile, separate lint and test jobs, tag by git SHA.
  • Set up Trivy image scanning and make the build fail on critical vulnerabilities.

How to install Dockerfile and CI taste

How to use

Paste the text at the start of a chat or into project instructions

Questions about Dockerfile and CI taste

How do I install Dockerfile and CI taste in Claude?

There is no install command. Copy the prompt text into a chat or save it as custom instructions so the rules apply to your Dockerfile and CI questions.

What does Dockerfile and CI taste do?

It gives the AI a checklist for container builds and pipelines: multi-stage builds, pinned base images, a non-root user, secrets kept out of the image, scanning and dependency caching.

Does it work with Claude?

Yes, the file lives at .claude/commands/prompts.csv.md. In Claude and Claude.ai you paste it as plain text.

Source text

prompts.csv · CC0-1.0
# Dockerfile and CI taste
- Use multi-stage builds and ship only the runtime artifacts in the final stage. Confidence: 0.95
- Pin base images to a specific version tag, and to a digest for production. Confidence: 0.90
- Prefer slim or distroless final images over full OS images. Confidence: 0.85
- Run the container as a non-root user. Confidence: 0.95
- Order layers so dependency manifests are copied and installed before source code. Confidence: 0.95
- Always keep a .dockerignore that excludes node_modules, .git and local env files. Confidence: 0.95
- Add a HEALTHCHECK or an equivalent readiness probe. Confidence: 0.80
- Use BuildKit cache mounts for package manager caches. Confidence: 0.80
- Never bake secrets into images; pass them at runtime or use build secrets. Confidence: 0.95
- Use exec-form CMD so the process receives signals correctly. Confidence: 0.90
- Scan images with Trivy in CI and fail on critical vulnerabilities. Confidence: 0.80
- Cache dependencies in GitHub Actions keyed on the lockfile hash. Confidence: 0.85
- Run lint, type check and tests as separate parallel CI jobs. Confidence: 0.80
- Tag images with the git SHA and never rely on the latest tag for deploys. Confidence: 0.90
- Keep workflows short and move repeated steps into reusable workflows. Confidence: 0.70

© f · CC0-1.0 · f/prompts.chat

Similar prompts

All prompts for DevOps and infrastructure →

From the same set77

The whole set →
React State Management taste A ruleset for picking React state tools: when to use useState, Zustand, Context and TanStack Query. Helps avoid overbuilt global stores and duplicated state. GP ChatGPT ★ 174,597repo stars Observability taste A prompt that tells an AI assistant how to wire traces, metrics and logs into a service. Handy when you ask a model to write instrumented code. GP ChatGPT ★ 174,597repo stars Python Packaging taste A prompt that hands the model a fixed set of Python packaging rules: pyproject.toml, src/, uv, Ruff. Useful when a new package needs one consistent style. GP ChatGPT ★ 174,597repo stars Open Source Release Checklist Builder (YAML) This prompt turns an upcoming open-source release into a YAML checklist for versions, tests, artifacts, security notes, rollback, and announcements. GP ChatGPT ★ 174,597repo stars Senior Code Reviewer (severity-ranked) A code review prompt that ranks findings from blockers down to nits and closes with a verdict. Useful when you need to know what in a patch actually breaks. GP ChatGPT ★ 174,597repo stars TypeScript Library taste A prompt that pins down conventions for a TypeScript library: pnpm, strict tsconfig, tsup, vitest, Changesets. Useful when a project needs one style from the first commit. GP ChatGPT ★ 174,597repo stars Claude Web Page Redesign Planning Prompt A prompt that makes the model audit the current markup and code first, then hand back a redesign plan in markdown. No edits get made. GP ChatGPT ★ 174,597repo stars Automated Text Typing Every 5 Minutes with Python This prompt turns the chat into a Python automation engineer that writes a script typing your text on a timer. Handy when the same line has to go into another window without you touching the keyboard. GP ChatGPT ★ 174,597repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor