Skip to content
Back to skills

Write Docker Compose

ASecurity

Writes a Docker Compose local development setup that mirrors production dependencies, with health checks, named volumes, seed data, env files and a one-command start. Use when onboarding developers.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 26, 2026
ai-agentsgoshelldockergitapidatabasedevops

Works with

  • cli
  • api

Security analysis

A100/100

Scanned November 26, 2026

npx -y skills add hermes-hq/hodios-dist --skill write-docker-compose --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Docker Compose?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Docker Compose
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hermes-hq-write-docker-compose/badge)](https://www.skillsdirectory.com/skills/hermes-hq-write-docker-compose)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-docker-compose
description: Writes a Docker Compose local development setup that mirrors production dependencies, with health checks, named volumes, seed data, env files and a one-command start. Use when onboarding developers.
license: CC0-1.0
arguments:
  - services
  - stack
  - production_notes
argument-hint: <services> [stack] [production_notes]
disable-model-invocation: true
metadata:
  version: 1.0.0
  kind: prompt
  category: devops
  source: https://hermes-ide.com/prompts/write-docker-compose
  catalog: 2026.1014.1
---

# Write a Docker Compose dev environment

## Inputs

- `services` (required): The application services and every dependency they need locally (databases, caches, queues, object storage, email, search, third-party APIs), with how each app service is built and run.
- `stack` (optional): Languages and frameworks of the app services, and the package manager.
- `production_notes` (optional): What production runs - engine versions, managed services, configuration that matters (extensions, auth, TLS) - so local can match it.

Arguments fill these in order. If a required value is empty, take it from the user’s message or ask for it once.

<context>
A local environment earns its keep when a new developer can clone the repo, run one command and have a working app with realistic data in minutes, and when "works on my machine" bugs stop coming from version drift. Compose files usually fall short in the same ways: `latest` images that differ from production, apps that start before the database accepts connections, data lost on every restart, secrets committed in the file, ports exposed on every network interface, and no seed data, so everyone builds their own by hand.
</context>

<task>
Write a Docker Compose development environment for:
$services
Only if stack was provided: 

Stack: $stack
Only if production_notes was provided: 

Production: $production_notes

1. If the repository is available, read the existing Dockerfiles, dependency manifests, environment variable usage and any current compose file first, and build on them.
2. Pin every dependency image to the same major and minor version as production (for example `postgres:16.4`), never `latest`. Where production uses a managed service with no local equivalent, choose a compatible local stand-in and record the gap.
3. Write `compose.yaml` following the current Compose Specification (no top-level `version:` key):
   - App services built from the repo's Dockerfile, using a development target or stage if one exists, with the source bind-mounted for hot reload (or a `develop.watch` section), and dependency folders kept inside the container so host and container builds do not clash.
   - A `healthcheck` on every dependency using its own readiness command (`pg_isready`, `redis-cli ping`, an HTTP health endpoint), and `depends_on` with `condition: service_healthy` on the app services.
   - Named volumes for all persistent data; no anonymous volumes for data that should survive a restart.
   - Ports published on `127.0.0.1` only, with defaults that avoid common clashes and can be overridden from the env file.
   - Optional services (admin UIs, observability, workers that are not always needed) behind `profiles`.
4. Put configuration in an env file: write `.env.example` with every variable, safe local defaults and a comment per variable; the real `.env` stays git-ignored. Never put production credentials or real secrets anywhere.
5. Provide seed data: database init scripts or a one-shot seed service that runs after the database is healthy (`condition: service_completed_successfully` for services that depend on it), is idempotent, and creates a few realistic, clearly fake records, including a known login for local use.
6. Give the one-command start (`docker compose up --wait` or a `make dev` / script wrapper), plus reset, logs, shell and test commands.
7. List every remaining difference from production and its consequence, and a short troubleshooting section (port in use, CPU architecture mismatches on ARM machines, stale volumes, file-watching on mounted folders).

If a service's build or start command is unknown and the repository is not available, ask for it rather than inventing one.
</task>

<constraints>
- Every image is pinned. Every dependency has a health check. Every data store has a named volume.
- No secrets, tokens or real personal data in any file. Local passwords are obviously local (for example `localdev`).
- Do not add services that were not asked for, except a local stand-in for a dependency that has none; say why each was added.
- Keep it runnable on macOS, Linux and Windows with WSL; call out anything that is not.
- Before saying the work is done, run the check that proves it (tests, build, type check or the command the user gave) and report the real result.
- If you could not run a check, say so plainly and say which one.
</constraints>

<output_format>
## Assumptions
Bullets, only those that shaped the setup.

## compose.yaml
One `yaml` code block, with short comments on non-obvious lines.

## .env.example
One code block.

## Seed data
The seed scripts or seed service, and what records they create.

## Commands
A table: task | command. Include start, stop, reset data, logs, shell, run tests.

## Differences from production
Table: area | production | local | consequence.

## Troubleshooting
Short bullets: symptom, then fix.
</output_format>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.