Communitygithub.com

huiyonghkw/hekouwang-env-doctor-skill

开发环境体检器 · Claude Code Skill|不问「哪个目录大」,问「这个工具你还在用吗」——四信号揪出换掉却没卸干净的旧工具,配交互式清理选择器(数据类锁死·逐项勾选·确认才执行)

hekouwang-env-doctor-skill 是什么?

hekouwang-env-doctor-skill is a Claude Code agent skill that 开发环境体检器 · Claude Code Skill|不问「哪个目录大」,问「这个工具你还在用吗」——四信号揪出换掉却没卸干净的旧工具,配交互式清理选择器(数据类锁死·逐项勾选·确认才执行).

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add huiyonghkw/hekouwang-env-doctor-skill

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Development Environment Doctor · env-doctor

"Doctor Family" third piece: claude-md-doctor (config) → skill-doctor (skills) → env-doctor (environment). The first two examine files, this one examines the machine.

How It Differs from Off-the-Shelf Cleaners (Read This First – It Defines All Behavior)

Off-the-shelf Mac cleaners answer "which directory is big." This tool answers "do you still use this tool."

Size can be scanned; identity can only be inferred — to tell if nvm is leftover, you must simultaneously check who shell configs load, who's in PATH, who actually provides node, and how long the directory has been untouched. This is the only differentiator of this tool, and no change should weaken it.


⛔ Three Iron Laws (see details in references/safety.md)

  1. Deletion only comes from user per-item selection (via scripts/clean.sh). The model itself does not compose rm to run; if the user says "just delete it for me" → guide them to run the selector. Default: nothing selected, data classes locked, only whitelisted commands run, user must input yes to proceed.
  2. Read-only scanning. scripts/scan.sh contains no write operations.
  3. If unsure, say unsure. When signals conflict, label it honestly, don't guess for a prettier report.

Standard Workflow

Step 1 · Scan

bash scripts/scan.sh                      # Full scan (includes home directory large-folder discovery, ~30–60 sec)
bash scripts/scan.sh --quick              # Quick scan (skips discovery scan, ~20 sec)
bash scripts/scan.sh --profile ai-dev     # Quick scan for AI dev machine (Agent host directory + skip large-folder discovery)

Outputs six sections of raw data: DISK · SIZES · MANAGERS · RUNTIME · AI_AGENTS (if Agent host present) · DISCOVER (full scan only).

Step 2 · Classification

Compare against references/rules.md:

  • Three-class method (data / cache / leftover) assigns an identity to each directory;
  • Four-signal decision table (shell_loaded × cmd_in_path × runtime owner × last_modified) determines whether a version manager is active or leftover;
  • Same version installed by two managers → list as a separate note.

Step 3 · Report

Follow the four-step conversation flow in references/report.md: give the conclusion first → present in three groups (leftovers → cache → data) → ask the user per group → generate command block only after confirmation.

⚠️ Don't dump dozens of lines at the user at once; ⚠️ Every suggestion must include five elements: "what it is / how big / why classified / official command / cost".

Step 4 · When Cleaning, Hand Over to the Selector

bash scripts/clean.sh --dry-run   # Preview without executing (strongly recommended first time)
bash scripts/clean.sh             # Select and clean after checking

Interactive selection: Space to select · ↑↓ to move · a for all · n for none · Enter to confirm · q to quit. Data classes have 🔒 lock and cannot be selected; the confirmation page lists each command and its cost, then prompts for yes to proceed.


Routing

What to doWhich to read
Determine which class a directory belongs to and its official cleanup commandreferences/rules.md
How to write the report and guide the conversationreferences/report.md
Boundaries and what is absolutely forbiddenreferences/safety.md
Scanner implementation and self-checksscripts/scan.sh
Cleanup selector (the only place deletion is allowed)scripts/clean.sh

Standard Answers to Common Follow-ups

  • "Just delete it for me" → I won't press Enter for you. Run bash scripts/clean.sh to select items; it will first show you the commands and costs. If you want to preview without executing, add --dry-run.
  • "Can I delete the largest one" → Check identity first, not size. The largest is often model weights or container volumes (data class), which should precisely not be deleted.
  • "What happens after deletion" → Every item has a "cost" column; cache items always "will redownload, costing time and bandwidth", while leftover items are pure gain.
  • "Why classify this as leftover" → Report the original four signals so the user can verify themselves.

Boundaries

  • Only covers development tool usage (version managers / package managers / build caches / containers / AI models). System caches, photos, email attachments, and WeChat are out of scope — leave those to the system "Storage" pane.
  • Scans within the home directory only; does not touch system directories or other users.
  • No network access, no upload of any scan results.

Doctor Family Cross-links

LayerSkillWhen to Hand Off
Confighekouwang-claude-md-doctor-skillAGENTS.md/CLAUDE.md duplicates, routing errors, missing frontmatter
Skillshekouwang-claude-skill-doctor-skillSKILL.md structure, dead links, OpenClaw declaration
Environmentthis skillDisk full, version manager leftovers, AI host directory bloat

If the report finds config/skill issues, name the other two doctors and do not perform file content audits within this report.

相关技能