К основному содержанию
скилл CX Codex

docker-local-dev — скилл для Claude Code: локальный Docker Compose

Скилл docker-local-dev для Claude Code пишет и правит локальную Docker-обвязку проекта: compose-сервисы, dev-Dockerfile, монтирования, сеть и healthcheck. Задача — собрать или починить Docker-окружение.

Apache-2.0 210 установок ★ 69 обновлён 2026-10-01

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add thienanblog/awesome-ai-agent-skills --skill docker-local-dev -a claude-code
Открыть на GitHub

Что делает docker-local-dev

Скилл собирает и чинит локальное окружение в Docker: compose.yaml, dev-Dockerfile, .dockerignore, монтирования, сеть и healthcheck. Работает в Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode.

Сначала осматривает проект: версии docker и docker compose, готовые compose-файлы, lockfiles, .devcontainer/, git status. В комплекте три скрипта — detect-stack.sh отдаёт JSON о стеке, detect-images.sh и detect-network.sh показывают локальные образы и сети. Дальше читаются только нужные справочники: порты и прокси, healthcheck, слияние с существующими файлами, отдельный гайд по WordPress, Drupal и Joomla.

Установки по умолчанию осторожные: container_name не ставится, потому что мешает масштабировать сервис и создаёт коллизии между проектами, плавающий тег latest в файлы не попадает, порты висят на 127.0.0.1. Секреты уходят в игнорируемый env-файл плюс безопасный пример. Удаление volumes, сброс данных и миграции требуют отдельного разрешения — на просьбу «настрой контейнеры» скилл их не запустит.

Какие задачи решает

  • собрать compose.yaml под монорепу с двумя приложениями
  • починить монтирование исходников, из-за которого не работает live-reload
  • добавить healthcheck и дождаться готовности базы перед стартом приложения
  • вынести секреты из закоммиченного compose-файла в игнорируемый env
  • привести старый docker-compose.yml к аккуратной локальной схеме без потери сервисов

Примеры запросов агенту

  • Подними локальное окружение для этого проекта в Docker Compose: приложение, Postgres и Redis, порты только на localhost.
  • Почему в контейнере не подхватываются изменения? Проверь монтирование и поправь compose.yaml.
  • Добавь healthcheck для базы и сделай так, чтобы приложение стартовало после неё.

Как установить docker-local-dev

1Через Skills CLI (Vercel)

npx skills add thienanblog/awesome-ai-agent-skills --skill docker-local-dev -a claude-code

2Вручную: положить файлы

~/.claude/skills/docker-local-dev/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/docker-local-dev/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о docker-local-dev

Как установить docker-local-dev в Claude Code?

Выполните npx skills add thienanblog/awesome-ai-agent-skills --skill docker-local-dev -a claude-code. Файл скилла появится в ~/.claude/skills/docker-local-dev/SKILL.md.

Что делает docker-local-dev?

Пишет и правит локальную Docker-обвязку: compose-сервисы, dev-Dockerfile, монтирования, сеть и проверки готовности. Продакшн-образы, секреты и деплой оставляет в стороне.

Трогает ли скилл мои данные?

Удаление volumes, разрушительные сбросы и миграции он выполняет только при отдельном разрешении. Запрос на настройку контейнеров такого права не даёт.

Исходный текст

SKILL.md · Apache-2.0
---
name: docker-local-dev
description: Create or repair local Docker Compose services, Dockerfiles, mounts, networking, and readiness checks. Use when container configuration is the deliverable; ordinary container commands and production deployment are separate concerns.
---

# Docker Local Development

## Delegation

Run in the main conversation by default. Delegation can increase usage: obtain explicit approval for the proposed agent count and scope before using subagents. Reuse that approval within its bounds; ask again before expanding the approved count or scope.

## Guardrails

- Design for local development. Keep production images, secrets, deployment, certificates, and runtime topology separate.
- Inspect before asking questions or proposing services. Treat detection as evidence, not authority.
- Preserve existing Docker files and unrelated working-tree changes. Keep a semantic diff for material stack changes. Ordinary configuration edits are covered by a setup or repair request; volume deletion, destructive resets, and data migrations need authorization covering those effects.
- Generate only services the project uses or the user explicitly requests. A database is not mandatory when the project uses SQLite, a host service, or an external database.
- Prefer direct foreground commands and one concern per service. Add Supervisor or PM2 only when the project already requires it or production-parity testing justifies it.
- Prefer a stable top-level Compose `name:` and role-based service names. Do not set `container_name` by default because it prevents service scaling and creates cross-project collisions.
- Select images by project constraints, team or production compatibility, trusted publisher, supported version, and architecture. Treat an already-downloaded image only as a tie-breaker. Avoid floating `latest` tags in generated files.
- Publish only ports needed by the host. Bind local-only ports to `127.0.0.1` by default; keep databases, caches, SMTP, PHP-FPM, and internal APIs unexposed when possible.
- Keep secrets out of committed files, generated documentation, command output, and frontend or proxy containers. Generate an ignored local env file plus a safe example when configuration is needed.

## Workflow

### 1. Inspect the project

Run project commands from the target project directory. Resolve bundled helpers through `<skill-directory>/scripts/`; their location is separate from the project working directory. Check Docker and Compose capabilities before selecting syntax:

```bash
docker version
docker compose version
```

Inspect, when present:

- `compose.yaml`, `compose.yml`, `docker-compose*.yml`, and override files
- `Dockerfile*`, `.dockerignore`, `.devcontainer/`, Makefiles, and package scripts
- application manifests, lockfiles, runtime-version files, env examples, and monorepo/workspace files
- existing local proxy conventions, Compose project names, networks, volumes, and host port mappings
- Git status and repository instructions before editing tracked files

Use stack detection when it adds useful evidence; direct inspection is enough for a known, narrow repair. Resolve the script from this skill directory:

```bash
"<skill-directory>/scripts/detect-stack.sh" "<project-root>"
```

The script emits JSON on stdout and diagnostics on stderr. Confirm uncertain findings from source files without printing secret values.

When Docker is available, optionally inspect local images and networks:

```bash
"<skill-directory>/scripts/detect-images.sh"
"<skill-directory>/scripts/detect-network.sh"
```

Do not let cached images or a detected network override project compatibility or isolation requirements.

### 2. Resolve the design

Infer and summarize:

- apps in scope, dev commands, internal ports, shared packages, and live-reload needs
- runtime and package-manager versions from constraints and lockfiles
- database, cache, queue, scheduler, mail, and debugging services actually used
- existing reverse proxy, explicit `.localhost` hostnames, same-origin `/api` routing, and required host exposure
- bind mounts versus Compose Watch; use Watch only when supported by the installed Compose version
- merge versus focused repair versus replacement of existing Docker files

Resolve ordinary setup choices from evidence. Ask only when missing information changes the apps in scope, data compatibility, network exposure, or a material replacement not already requested.

### 3. Load only relevant references

| Need | Read |
|---|---|
| Detection rules and monorepo discovery | `references/tech-stack-detection.md` |
| Images, processes, dependencies, mounts, environment, Dockerfiles | `references/service-configuration-guide.md` |
| WordPress, Drupal, or Joomla | `references/cms-configuration-guide.md` |
| Ports, proxies, domains, networks, host access | `references/networking-ports-guide.md` |
| Existing Compose or Dockerfile changes | `references/merge-backup-strategy.md` |
| Readiness checks and smoke tests | `references/health-check-patterns.md` |

Use assets as starting points, not immutable output. Remove unselected services and adapt placeholders, healthchecks, commands, paths, users, and versions to the detected project.

### 4. Preview and generate

For a material change to an existing stack, state what will change — files, services and versions, host ports and domains, mount strategy — as part of doing it.

Generate the smallest coherent setup within the existing authorization. Depending on the project that is a dev Dockerfile or build target, `.dockerignore`, `compose.yaml` without the obsolete top-level `version`, the selected proxy or process configuration, and, when configuration is needed, an env example plus an ignored local env file. Add usage notes only when useful or requested.

Prefer:

- bind-mounted source with named dependency volumes for straightforward active development
- Compose Watch with `sync`, `sync+restart`, or `rebuild` rules for large trees, native dependencies, or projects that benefit from granular sync
- one-shot dependency installers only when they solve a real bind-mount or monorepo problem; mark them as expected to exit successfully
- separate worker and scheduler services using the same image as the app
- Compose profiles for optional debugging and administration tools
- health-gated dependencies only when the dependency defines a valid healthcheck

Run migrations, seeds, CMS installers, destructive cleanup, or database write tests only when authorization covers their data effects. A request to configure containers alone does not imply those actions.

### 5. Verify

Run static checks first:

```bash
docker compose config --quiet
docker build --check .
```

Use `docker build --check` only when the installed Docker version supports it. Build and start when the request includes running or verifying the local setup. For file-generation-only requests, keep execution within that narrower scope:

```bash
docker compose build
docker compose up -d --wait
docker compose ps -a
```

If `--wait` is unavailable, start detached and poll declared healthchecks with a bounded timeout. Inspect logs for failed or restarting services.

Run the bundled checks when applicable:

```bash
"<skill-directory>/scripts/health-check.sh"
"<skill-directory>/scripts/db-test.sh"          # connection/read-only query
"<skill-directory>/scripts/db-test.sh" --crud   # explicit temporary-table CRUD check
```

Also run a stack-specific smoke check such as `php artisan about`, `wp core version`, `drush status`, `python manage.py check`, or the application's health endpoint. When runtime verification is in scope, verify hot reload with a harmless temporary edit and restore it afterward. Reuse passing checks unless relevant configuration or runtime conditions change.

### 6. Report

Report:

- generated or modified files
- selected services, versions, local URLs, and explicit host exposure
- exact verification commands and results
- expected stopped one-shot services
- assumptions, skipped checks, and platform-specific limitations

Never include secret values in the report.

## Host Port Registry

Persistent host-port tracking is optional. First check:

```bash
PORT_REGISTRY_FILE="${DOCKER_LOCAL_DEV_PORT_REGISTRY:-${XDG_STATE_HOME:-$HOME/.local/state}/docker-local-dev/HOST_PORT_REGISTRY.md}"
test -f "$PORT_REGISTRY_FILE" && sed -n '1,220p' "$PORT_REGISTRY_FILE"
```

Creating or refreshing a registry scans beyond the current project and records local paths. Establish authorization for the scan root and output path; reuse it if already given. Then run:

```bash
node "<skill-directory>/scripts/scan-host-ports.mjs" --root "<approved-root>" --out "$PORT_REGISTRY_FILE" --yes
```

Treat registered ports as reserved even when no process is currently listening. For a single project without a registry, a live port check is sufficient.

## Acceptance Criteria

- Generated Compose configuration parses without unresolved placeholders.
- Selected images and commands match project constraints and contain no unreviewed floating tags.
- App containers reach dependencies by Compose service name, not `localhost`.
- Optional services are absent or profile-gated.
- Host ports are minimal, conflict-free, and loopback-bound unless broader access was requested.
- Healthchecks invoke commands available in their images and test readiness rather than process presence alone.
- Source changes reload as intended; lockfile changes follow the documented install or rebuild path.
- No secrets, production data, private domains, or unauthorized mutations appear in generated files or reports.

© thienanblog · Apache-2.0 · thienanblog/awesome-ai-agent-skills

Похожие скиллы

Все скиллы по теме «DevOps и инфраструктура» →
docker-local madsnorgaard Скилл docker-local помогает ассистенту управлять локальным окружением на базе Docker Compose без DDEV. Подсказывает конфигурации сервисов, вызовы команд и решение частых сбоев. CX Codex +1 109установок docker-essentials sundial-org Скилл docker-essentials для Claude Code — шпаргалка по Docker для запуска контейнеров, просмотра логов, выполнения команд, сборки образов и работы с Compose, сетями и томами. CX Codex +1 166установок docker-patterns affaan-m Скилл docker-patterns с проверенными шаблонами Dockerfile и Docker Compose: локальная разработка, сети, тома, безопасность контейнеров. CX Codex +1 8 600установок docker-compose-orchestration manutej Скилл docker-compose-orchestration помогает описывать многоконтейнерные приложения в Docker Compose: сервисы, сети, тома, healthcheck и порядок запуска. CX Codex +1 3 000установок docker-compose-patterns docker Скилл docker-compose-patterns для Claude Code задаёт правила сборки, отладки и связывания сервисов в compose.yaml. Настраивает проверки готовности, тома и оверрайды для локальной разработки. CX Codex +1 2 900установок docker-project-foundations docker Скилл docker-project-foundations настраивает первичное окружение Docker для нового проекта. Он сразу создаёт базовую тройку файлов: .dockerignore, Dockerfile и compose.yaml. CX Codex +1 1 700установок

Из того же набора2

Спонсоры проекта

Компании, которые помогают держать аналитику открытой