mcpField
C
clash-doctor

clash-doctor

github.com/majiayu000Cloud & DevOps288136 installsUpdated 1d ago
Repository

About clash-doctor

clash-doctor is a skill for inspecting Clash Verge and mihomo, managing profile routing, and diagnosing connectivity. It separates read-only checks from writes that require confirmation, and includes local-hub and multi-machine alignment procedures.

Key features

  1. 01Diagnose connectivity and runtime status
  2. 02List local and remote profiles
  3. 03Compare configurations across machines
  4. 04Write profile changes after confirmation
  5. 05Verify YAML and routing results

Use cases

  1. 01Troubleshoot Clash Verge or mihomo connectivity
  2. 02Compare configurations on multiple machines
  3. 03Check health before switching nodes
  4. 04Adjust routing or TUN exclusions with confirmation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/majiayu000/spellbook --skill clash-doctor

After installing, type/clash-doctorin Claude Code to confirm it loaded.

Bundled filesreferences/full-guide.mdreferences/local-hub.md

Details

From the project README

Clash Verge Diagnostics

Inspect Clash Verge or mihomo, manage profile-specific routing, and diagnose connectivity.

Routing

  • Confirm the target profile, constraints, requested access path, and done-when signal.
  • Load references/full-guide.md for commands, templates, and diagnosis matrices.
  • Load references/local-hub.md before hub, align, roles, clone, setup-ai, or switch, and whenever the user says a previous sync did not apply.
  • Keep the change limited to the requested target.

Safety

  • Diagnose and align are read-only. Writes require a shown summary and explicit confirmation.
  • Edit enhancement overlays or the confirmed local-hub YAML. Do not edit raw subscription dumps.
  • tun.route-exclude-address is union-only. DIRECT is not a TUN bypass.
  • Never invent or print node IPs, credentials, subscription UIDs, or machine hostnames.
  • After an overlay or hub-YAML write, quit and reopen Clash Verge. PUT /configs does not re-merge overlays.

Modes

ArgumentMode
empty or a hostnamediagnose
profiles / list / lslist local and remote profiles
statuslive kernel, TUN, and selected nodes
hub / roleslocal-hub topology
align / sync-checkread-only multi-machine comparison
switch-check / healthpre-switch health
clone / setup-ai / switchconfirmed profile writes
rustdesk / bypassTUN exclusion for a relay IP

Resolve the named target before setup-ai. Apply airport-style enhancement overlays only when that target is type: remote; edit the named hub YAML when it is type: local.

Verify

  • Parse the target YAML after every write.
  • Query mihomo by trying both Unix sockets and then the configured HTTP controller; fall back on request failure, not socket existence alone.
  • For routes, chains[-1] is the matched group and chains[0] is the dialed node.
  • Report files changed, commands run, evidence, and remaining risk.

References

  • references/full-guide.md — commands, templates, and diagnosis matrix
  • references/local-hub.md — hub ownership, node roles, alignment, and landmines

Comments

Markdown supported