跳到主内容
智客 ZICQ

技能库 智客分类:运维与云 docker-destructive-guardrails

Docker Destructive Guardrails

在运行,或推荐任何删除,擦拭,重置,或以其他方式不可逆转地改变状态的多克命令之前,使用这一技能——即使用户只是说"清理","清理缓存","开始新鲜","抹去一切","警告","重置","强制去除",或"挖出"多克资源. 涵盖非由更具体技能拥有的通用多克CLI破坏行动——`多克rm'、`多克rm'、`多克集装箱prune'、`多克杀死'、`多克系统prune'、`多克rmi'/`多克图像rm'、`多克图像prune'、`多克网络rm'、`多克建筑者prune'、`多克建筑rm'、`多克背景rm'和独立的(非立体)`多克体积rm'/`多克卷prune。 同时索引由其它多克技能拥有的破坏性命令(作曲,沙盒,桌面). 核心规则——准确说明将丢失哪些内容并首先得到明确确认,但狭小而低温的一级集装箱清理除外.

1665 安装量

官方网址:skills.sh

技能介绍

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

做什么

在运行,或推荐任何删除,擦拭,重置,或以其他方式不可逆转地改变状态的多克命令之前,使用这一技能——即使用户只是说"清理","清理缓存","开始新鲜","抹去一切","警告","重置","强制去除",或"挖出"多克资源. 涵盖非由更具体技能拥有的通用多克CLI破坏行动——`多克rm'、`多克rm'、`多克集装箱prune'、`多克杀死'、`多克系统prune'、`多克rmi'/`多克图像rm'、`多克图像prune'、`多克网络rm'、`多克建筑者prune'、`多克建筑rm'、`多克背景rm'和独立的(非立体)`多克体积rm'/`多克卷prune。 同时索引由其它多克技能拥有的破坏性命令(作曲,沙盒,桌面). 核心规则——准确说明将丢失哪些内容并首先得到明确确认,但狭小而低温的一级集装箱清理除外.

何时用

这个技能

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:Docker Destructive Command Guardrails、Overview、When to use this skill、Do not use this skill when、Core guidance、Tier 1 — low-friction container cleanup。

文件分析

文件分析:除 SKILL.md 外,正文引用了 references/docker-cli-destructive-commands.md、references/cross-skill-destructive-command-index.md,属于带资源的技能包,这些文件按需再读。

官方 description(原文)

Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`, `docker rm -f`, `docker container prune`, `docker kill`, `docker system prune`, `docker rmi`/`docker image rm`, `docker image prune -a`, `docker network rm`, `docker network prune`, `docker builder prune`, `docker buildx rm`, `docker context rm`, and standalone (non-Compose) `docker volume rm`/`docker volume prune`. Also indexes destructive commands owned by other Docker skills (Compose, sandbox, Desktop). Core rule — state exactly what will be lost and get explicit confirmation first, except narrow, low-friction Tier 1 container cleanup.

Docker Destructive Command GuardrailsOverviewWhen to use this skillDo not use this skill whenCore guidanceTier 1 — low-friction container cleanupTier 2 — container commands needing confirmation`docker stop` — reversible, outside the tier modelRelated skillsReferencesAssetsChecks

兼容:Applies to any Docker CLI version. This is a behavioral guardrail skill, not a Dockerfile or Compose authoring skill. · 许可:Apache-2.0

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
name
docker-destructive-guardrails
description
Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`, `docker rm -f`, `docker container prune`, `docker kill`, `docker system prune`, `docker rmi`/`docker image rm`, `docker image prune -a`, `docker network rm`, `docker network prune`, `docker builder prune`, `docker buildx rm`, `docker context rm`, and standalone (non-Compose) `docker volume rm`/`docker volume prune`. Also indexes destructive commands owned by other Docker skills (Compose, sandbox, Desktop). Core rule — state exactly what will be lost and get explicit confirmation first, except narrow, low-friction Tier 1 container cleanup.
compatibility
Applies to any Docker CLI version. This is a behavioral guardrail skill, not a Dockerfile or Compose authoring skill.
许可
Apache-2.0
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。
指令中引用的文件 · 2
  • references/docker-cli-destructive-commands.md
  • references/cross-skill-destructive-command-index.md

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

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

安装这个技能

Skills CLI ↗

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

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

交给 Agent 安装

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

把 Agent Skill「docker-destructive-guardrails」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-182ab35e23754c9b-%E5%A4%9A%E5%85%8B%E7%A0%B4%E5%9D%8F%E5%BC%8F%E6%8A%A4%E6%A0%8F.html
请存为 .cursor/skills/docker-destructive-guardrails/SKILL.md 或 .claude/skills/docker-destructive-guardrails/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。
该技能还带 scripts/、references/、assets/ 等文件,请从 https://github.com/docker/skills 取完整目录,不要只建一个 SKILL.md。

GitHub 完整包 ↗

终端安装 · Skills CLI

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

npx skills add 'https://github.com/docker/skills' --list

npx skills add 'https://github.com/docker/skills' --skill 'docker-destructive-guardrails'

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

阅读排版
--- name: docker-destructive-guardrails description: Use this skill before running, or recommending, any Docker command that deletes, wipes, resets, or otherwise irreversibly changes state — even if the user just says to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources. Covers generic Docker CLI destructive operations not owned by a more specific skill — `docker rm`, `docker rm -f`, `docker container prune`, `docker kill`, `docker system prune`, `docker rmi`/`docker image rm`, `docker image prune -a`, `docker network rm`, `docker network prune`, `docker builder prune`, `docker buildx rm`, `docker context rm`, and standalone (non-Compose) `docker volume rm`/`docker volume prune`. Also indexes destructive commands owned by other Docker skills (Compose, sandbox, Desktop). Core rule — state exactly what will be lost and get explicit confirmation first, except narrow, low-friction Tier 1 container cleanup. license: Apache-2.0 compatibility: Applies to any Docker CLI version. This is a behavioral guardrail skill, not a Dockerfile or Compose authoring skill. --- # Docker Destructive Command Guardrails ## Overview This skill provides the cross-product policy for handling destructive or irreversible Docker CLI operations: commands that delete data, remove resources, or otherwise cannot be undone. Use it whenever a task could reasonably lead to running one of these commands, even if the user never names the command directly. It covers the generic Docker CLI commands with no home in a more specific skill, and it indexes where other destructive commands (Compose, sandbox, Desktop) are documented. ## When to use this skill Activate this skill when: - The user asks to "clean up", "clear the cache", "start fresh", "wipe everything", "nuke it", "reset", "force remove", or "tear down" Docker resources without naming a specific command - The agent is considering `docker rm`, `docker rm -f`, `docker container prune`, `docker kill`, `docker stop`, `docker system prune`, `docker rmi`, `docker image rm`, `docker image prune -a`, `docker network rm`, `docker network prune`, `docker builder prune`, `docker buildx rm`, `docker context rm`, or standalone (non-Compose) `docker volume rm`/`docker volume prune` as a fix for an unrelated problem (disk space, a stuck container, a stale network, a broken build cache, an old builder or volume) - The user wants a cross-product overview of destructive commands across Docker skills ## Do not use this skill when Do not use this skill when: - The destructive command in question is Compose-specific (`docker compose down -v`, `docker compose rm -v`, `docker volume rm`/`docker volume prune` in a Compose project) — use `docker-compose-patterns` directly, which owns that guidance in full detail - The task is authoring or reviewing a Dockerfile or `compose.yaml` with no cleanup or deletion involved - The operation is non-Docker (git, filesystem, cloud resources) — this skill covers Docker CLI operations only ## Core guidance The core rule for every command below: **state exactly what will be deleted, stopped, or lost, and get explicit confirmation from the user before running it.** Never run a destructive command as a default troubleshooting or "just clean it up" reflex — disk space, stuck containers, and stale caches almost always have a narrower, non-destructive fix. See `references/docker-cli-destructive-commands.md` for exact flags and the safe, scoped alternative for each. The container-lifecycle commands — `docker rm`, `docker rm -f`, `docker container prune`, and `docker kill` — don't all carry the same risk, so they're split into two tiers below instead of one flat rule. `docker stop` follows a related but distinct reversible-action rule right after the tiers. Every other command in this list follows the flat rule stated above with no exceptions: state what's lost, get explicit confirmation, and wait for the user's answer before running it. ### Tier 1 — low-friction container cleanup Applies only to `docker rm ` on an already-stopped container and `docker rm -f ` on a container the agent itself created and started earlier in the same session purely for testing or debugging — the `-f` carve-out applies even when the container is still running, since that's the only reason `-f` would be needed. All of the following must hold: the container is already stopped, or was created/started by the agent itself this session for testing/debugging; there's no known unpersisted state at risk; the action targets one specific, identified container rather than an unscoped sweep; and the agent is acting on an explicit user ask this session, not its own initiative. When every condition holds, the agent removes the container, states what it did, and proceeds — no blocking confirmation is required first. Tier 2's `docker rm -f` rule below applies to every other case. ### Tier 2 — container commands needing confirmation `docker kill` is always Tier 2 (see the reference for why no stopped-container exception exists for it). Also Tier 2: `docker container prune` (it always sweeps every stopped container on the host, never just the one the agent is cleaning up), `docker rm -f` on any container that doesn't meet every Tier 1 condition above (in particular, a running container the agent didn't create/start this session, or one it did but is acting on without an explicit user ask), any other unscoped sweep regardless of container state (e.g. `docker rm -f $(docker ps -aq)`, "remove/kill all containers"), a container the agent didn't create and has no context on, and any action taken on the agent's own initiative rather than an explicit user ask. These carry the same confirmation bar as every flat-rule command in this skill: state exactly what will be lost and get explicit confirmation before running anything — no exception carved out. ### `docker stop` — reversible, outside the tier model `docker stop` doesn't remove anything — the container still exists and can be restarted with `docker start` — so it sits outside the Tier 1/Tier 2 removal model above. It's still in scope for this skill because it interrupts a running process (SIGTERM, then SIGKILL after the timeout) and discards any unpersisted in-container state. On the agent's own test/debug container from this session, treat it like Tier 1: stop it and state what happened, no blocking confirmation required. On any other container, state that it will stop running and any unsaved in-memory state will be lost, then get confirmation first. - **`docker system prune`** — deletes stopped containers, unused networks, dangling images, and build cache; `-a` also deletes unused tagged images, and `--volumes` also deletes unused *anonymous* volumes (named volumes are untouched — deleting those needs a separate `docker volume rm`). - **`docker rmi` / `docker image rm`** — deletes a specific image; see the reference for `-f`'s exact (partly unverified) override behavior on multi-tag/referenced images. - **`docker image prune -a`** — deletes every image not referenced by any container, running or stopped, not just dangling ones. - **`docker network rm`** — deletes the specifically named network(s) passed as arguments; see the reference for how its `-f` flag differs from `docker context rm -f` below. - **`docker network prune`** — deletes every custom network not attached to a container. - **`docker builder prune`** — clears the BuildKit cache; `-a`/`--all` also removes internal helper/frontend images and cache shared with other build outputs, forcing a cold rebuild for anyone using that cache. - **`docker buildx rm`** — removes a builder *instance*, distinct from the cache `docker builder prune` clears — see the reference for flag details. - **`docker context rm`** — deletes a context's local connection config; doesn't affect remote resources but may not be trivially reconstructable. Unlike `docker network rm -f` above, `docker context rm -f` genuinely forces removal even if the context is currently in use. - **`docker volume rm` / `docker volume prune`** (standalone, no Compose project in play) — deletes volume data directly and irreversibly; `docker volume prune -a`/`--all` widens the default anonymous-only scope to named volumes too. For a Compose project's own volumes, use `docker-compose-patterns` instead (see Related skills); for a volume declared `external: true` in a compose.yaml but not managed by that Compose project, this skill's guidance applies since Compose won't touch it via `down -v`. ## Related skills - For Compose-specific destructive commands (`docker compose down -v`, `docker compose rm -v`, `docker volume rm`/`docker volume prune` in a Compose context), use `docker-compose-patterns` — it owns that guidance in full detail; this skill only indexes it. This skill owns the standalone (non-Compose) case for `docker volume rm`/`docker volume prune` itself — see Core guidance and `references/docker-cli-destructive-commands.md`. - For Dockerfile internals, build caching, and image size optimization (non-destructive concerns), use `docker-build-strategies`. - For first-time Docker project scaffolding, use `docker-project-foundations`. - For sandbox (sbx) destructive commands (`sbx rm`, `sbx prune`), use `docker-sandboxes-lifecycle` — it owns that guidance in full detail; this skill only indexes it. Docker Desktop destructive-command guardrails will live in their own skill once merged (see `references/cross-skill-destructive-command-index.md` for tracking status); do not assume their content until that skill ships. ## References - `references/docker-cli-destructive-commands.md` — Per-command breakdown of exact flags, what's deleted, and the safe/scoped alternative for each generic Docker CLI destructive command. - `references/cross-skill-destructive-command-index.md` — Cross-product table of destructive commands across all Docker skills, including a pending placeholder for Docker Desktop. ## Assets This skill has no bundled assets. ## Checks - `checks/verification.md` — Manual review runbook, including example bad/good dialogues for handling destructive-command requests.

相关技能

运维与云

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 部署命令带有内置…