cleanup

GitHub

清理 Learn Docker & K8s 游戏产生的容器、网络、卷和镜像等资源。支持按章节或全部清理,执行前需确认并警告进度丢失风险,清理后更新玩家进度文件以重置挑战状态。

.claude/skills/cleanup/SKILL.md ericboy0224/learn-docker-and-k8s

Trigger Scenarios

用户想要清理游戏资源 用户想要重置学习环境 用户需要释放磁盘空间

Install

npx skills add ericboy0224/learn-docker-and-k8s --skill cleanup -g -y
More Options

Non-standard path

npx skills add https://github.com/ericboy0224/learn-docker-and-k8s/tree/main/.claude/skills/cleanup -g -y

Use without installing

npx skills use ericboy0224/learn-docker-and-k8s@cleanup

指定 Agent (Claude Code)

npx skills add ericboy0224/learn-docker-and-k8s --skill cleanup -a claude-code -g -y

安装 repo 全部 skill

npx skills add ericboy0224/learn-docker-and-k8s --all -g -y

预览 repo 内 skill

npx skills add ericboy0224/learn-docker-and-k8s --list

SKILL.md

Frontmatter
{
    "name": "cleanup",
    "description": "Clean up Docker resources created by the Learn Docker & K8s game. Removes all learn-* containers, networks, volumes, and images. Use when the user wants to clean up, reset, or free disk space.",
    "argument-hint": "[chapter|all]",
    "disable-model-invocation": true
}

Cleanup Game Resources

This is a destructive operation. Always confirm with the player first.

Step 1: Show What Exists

echo "=== Containers ==="
docker ps -a --filter "label=app=learn-docker-k8s" --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
echo ""
echo "=== Networks ==="
docker network ls --filter "label=app=learn-docker-k8s" --format "table {{.Name}}\t{{.Driver}}"
echo ""
echo "=== Volumes ==="
docker volume ls --filter "label=app=learn-docker-k8s" --format "table {{.Name}}\t{{.Driver}}"
echo ""
echo "=== Images ==="
docker images --filter "reference=learn-*" --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}"

Step 2: Confirm

Show the player what will be removed and ask for confirmation.

If $ARGUMENTS is a specific chapter (e.g., "ch01", "ch03"):

  • Only remove resources with the matching chapter label
  • Tell them: "I'll only remove Chapter X resources. Everything else stays."

If $ARGUMENTS is "all" or empty:

  • Run bash engine/cleanup.sh
  • Also check for kind clusters: kind get clusters 2>/dev/null | grep learn

Step 3: Clean

After confirmation, execute the cleanup and report what was removed.

If they're in the middle of a chapter, warn them: "You have in-progress work in Chapter X. Cleaning up means you'll need to redo the challenges. Continue?"

Step 4: Update Progress (if needed)

If cleaning a specific chapter, update .player/progress.yaml:

  • Reset that chapter's challenges to empty
  • Set status back to "in-progress" (keep lesson progress)

Version History

  • da325b6 Current 2026-07-25 07:24

Same Skill Collection

.claude/skills/engage-check/SKILL.md
.claude/skills/env-check/SKILL.md
.claude/skills/hint/SKILL.md
.claude/skills/next/SKILL.md
.claude/skills/play/SKILL.md
.claude/skills/progress/SKILL.md
.claude/skills/skip-to/SKILL.md
.claude/skills/verify/SKILL.md

Metadata

Files
0
Version
da325b6
Hash
4e2cc5ee
Indexed
2026-07-25 07:24

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-22 03:53
浙ICP备14020137号-1 $mapa de visitantes$