跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 docker-local-dev

Docker Local Dev

负责创建、修理或实际扩展本地开发的Docker Compose、Docker files、数据库和支助服务的协调专家。 在项目开发后使用将当地的集装箱地貌作为主要工作,或者在明确援引或安装独立时直接使用。 不要仅仅用来运行现有的集装箱指令,或者用于生产部署和VPS操作.

203 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

负责创建、修理或实际扩展本地开发的Docker Compose、Docker files、数据库和支助服务的协调专家。 在项目开发后使用将当地的集装箱地貌作为主要工作,或者在明确援引或安装独立时直接使用。 不要仅仅用来运行现有的集装箱指令,或者用于生产部署和VPS操作.

何时用

官方 description 未单独写出 Use when。按规范,代理会在用户任务与这段 description 的关键词匹配时激活本技能。

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Docker Local Development、Guardrails、Workflow、1. Inspect the project、2. Resolve the design、3. Load only relevant references。 其中含规范建议的小节:分步指令。

文件分析

文件分析:除 SKILL.md 外,正文引用了 scripts/detect-stack.sh、scripts/detect-images.sh、scripts/detect-network.sh、references/tech-stack-detection.md、references/service-configuration-guide.md、references/cms-configuration-guide.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Coordinator-routed specialist for creating, repairing, or materially extending local-development Docker Compose, Dockerfiles, databases, and supporting services. Use after project-development-mindset makes local container topology the primary work, or directly when explicitly invoked or installed standalone. Do not use merely to run existing container commands, or for production deployment and VPS operations.

Docker Local DevelopmentGuardrailsWorkflow1. Inspect the project2. Resolve the design3. Load only relevant references4. Preview and generate5. Verify6. ReportHost Port RegistryAcceptance Criteria

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
docker-local-dev
description
Coordinator-routed specialist for creating, repairing, or materially extending local-development Docker Compose, Dockerfiles, databases, and supporting services. Use after project-development-mindset makes local container topology the primary work, or directly when explicitly invoked or installed standalone. Do not use merely to run existing container commands, or for production deployment and VPS operations.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 11
  • scripts/detect-stack.sh
  • scripts/detect-images.sh
  • scripts/detect-network.sh
  • references/tech-stack-detection.md
  • references/service-configuration-guide.md
  • references/cms-configuration-guide.md
  • references/networking-ports-guide.md
  • references/merge-backup-strategy.md
  • references/health-check-patterns.md
  • scripts/health-check.sh
  • scripts/db-test.sh

以下路径提取自原文;文件是否齐全请以来源仓库中的完整目录为准。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

该技能引用了附属文件,请从来源获取完整目录;仅复制 SKILL.md 可能缺少依赖。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「docker-local-dev」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-8c8e14bd89036656-%E5%B5%8C%E5%85%A5%E5%99%A8%E6%9C%AC%E5%9C%B0-Dev.html
请存为 .cursor/skills/docker-local-dev/SKILL.md 或 .claude/skills/docker-local-dev/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/thienanblog/awesome-ai-agent-skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/thienanblog/awesome-ai-agent-skills' --list

npx skills add 'https://github.com/thienanblog/awesome-ai-agent-skills' --skill 'docker-local-dev'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版
--- name: docker-local-dev description: Coordinator-routed specialist for creating, repairing, or materially extending local-development Docker Compose, Dockerfiles, databases, and supporting services. Use after project-development-mindset makes local container topology the primary work, or directly when explicitly invoked or installed standalone. Do not use merely to run existing container commands, or for production deployment and VPS operations. --- # Docker Local Development Run this skill in the main conversation. Do not spawn subagents, agent teams, or delegated parallel workers unless the user explicitly approves the proposed count and scope after being told that doing so can increase usage. Ask again before expanding an approved 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. - Ask only about unresolved choices that materially change the result. Group related questions and recommend a default; do not force a fixed questionnaire. - Preserve existing Docker files and unrelated working-tree changes. Show a semantic diff before replacing or materially restructuring a working stack. Never commit, reset, delete volumes, run migrations or seeds, or overwrite files unless the user authorized that action. - 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 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 Run stack detection from this skill directory, passing the project root: ```bash ./scripts/detect-stack.sh "" ``` 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 ./scripts/detect-images.sh ./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 Ask for confirmation only where evidence is absent or conflicting. Typical high-impact questions are the apps to run, database parity, reverse-proxy integration, externally reachable ports, and whether an existing stack may be restructured. ### 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 Before writing, present: - files to create or modify - inferred services and versions - host ports and domains - source/dependency mount strategy - important changes to an existing stack After approval where required, generate the smallest coherent setup: 1. local env example and ignored local env file when needed 2. dev Dockerfile or dev build target 3. `.dockerignore` 4. `compose.yaml` without the obsolete top-level `version` 5. selected proxy, process, and helper configuration 6. concise 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 Do not automatically run migrations, seeds, CMS installers, destructive cleanup, or database write tests. ### 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. Then build and start after the user has approved container execution: ```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 ./scripts/health-check.sh ./scripts/db-test.sh # connection/read-only query ./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. Verify hot reload by changing a harmless source file only when the user authorized runtime testing. ### 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" ``` Before creating or refreshing the registry, explain the exact output path and scan root and obtain confirmation because the report may contain local project names and paths. Then run: ```bash node ./scripts/scan-host-ports.mjs --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.

相关技能

运维与云

Docker Essentials

用于容器管理,图像操作,调试的基本道克命令和工作流程.

运维与云

Find Skills

从开放的代理技能生态系统中发现并安装技能. 使用时:(1)用户问"我如何做X",X可能拥有现有技能,(2)用户说"为X找到技能"或"是否为X有技能",(3)用户问"你能否做X",X是专门能力,(4)用户想扩展代理能力,(5)用户想搜索工具,模板,或工作流程,(6)用户提到他们希望…

运维与云

Microsoft Foundry

构建,部署,评价,优化,微调,管理微软创始代理,模型,资源最终结束. 用法:铸造、azd ai代理、azd 提供/部署、托管代理脚手架/开发/运行/部署/拖放、即时代理创建、创建代理、更新代理、添加代理工具、援引代理、代理.yaml、评估代理、批量活化、连续活化、持续监测、代理C…

运维与云

Azure Deploy

执行已有.azure/部署计划.md和基础设施文件的ALREADY-PREPARED应用程序的Azure部署。 当用户向 CREATE 请求新应用程序时, 请不要使用此技能 。 这种技能运行了 azd上行, azd 部署, trarraform 应用, 和 az 部署命令带有内置…