From devkit
Use when the user asks to install a proxy, set up Mihomo, configure Clash subscription proxy, or set up proxy wrappers for dev tools (Cursor, Claude, Copilot). Handles full lifecycle — install, configure, verify, and uninstall — in pure user-space (no root required).
How this skill is triggered — by the user, by Claude, or both
Slash command
/devkit:mihomo-proxy-setupThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A skill for installing and managing a **Mihomo-based proxy** in user-space. Supports Linux (systemd user services) and macOS (launchd agents). No root/sudo required.
A skill for installing and managing a Mihomo-based proxy in user-space. Supports Linux (systemd user services) and macOS (launchd agents). No root/sudo required.
Trigger when the user asks to:
┌─────────────────────────────────────────────────┐
│ User Space │
│ │
│ ┌───────────┐ ┌──────────────────────────┐ │
│ │ Mihomo │◄──│ Clash Subscription YAML │ │
│ │ (daemon) │ │ + Local Overrides │ │
│ │ │ └──────────────────────────┘ │
│ │ mixed:7890│ │
│ │ ctrl:29090│──► MetaCubeXD Web UI │
│ └───────────┘ │
│ ▲ │
│ │ HTTP_PROXY / SOCKS5 │
│ ┌────┴──────────────────────────┐ │
│ │ Proxy Wrappers │ │
│ │ with-proxy <cmd> │ │
│ │ proxy-agent (Cursor) │ │
│ │ proxy-copilot (GH Copilot) │ │
│ │ proxy-claude (Claude CLI) │ │
│ └───────────────────────────────┘ │
│ │
│ Service Manager: │
│ Linux → systemd --user │
│ macOS → launchd (~/Library/LaunchAgents) │
└─────────────────────────────────────────────────┘
Follow this checklist in order. Use ask_user for interactive parameter collection.
uname -s → Linux or Darwinuname -m → x86_64/amd64 or aarch64/arm64~/.local/bin/mihomo, ~/.config/mihomo/~/.local/bin is on PATH; if not, warn user and add to shell profilesystemctl --user status works) or launchd (macOS)Ask the user one question at a time using ask_user:
| Parameter | Question | Default | Required |
|---|---|---|---|
subscription_url | "请提供你的 Clash/Mihomo 订阅链接" | — | Yes |
mixed_port | "代理混合端口 (HTTP+SOCKS5)" | 7890 | No |
controller_port | "Web UI 控制器端口" | 29090 | No |
controller_secret | "Web UI 访问密码" | random 12-char | No |
enable_webui | "是否安装 MetaCubeXD Web 管理面板?" | Yes | No |
extra_no_proxy | "额外的 NO_PROXY 地址(逗号分隔)" | — | No |
IMPORTANT: Never log, echo, or commit the subscription URL. Store it only in
~/.config/mihomo/subscription.urlwith mode 600.
Install Mihomo binary
mihomo-{os}-{arch}-latest.gz where:
mihomo-linux-amd64-compatible-latest.gzmihomo-linux-arm64-latest.gzmihomo-darwin-amd64-latest.gzmihomo-darwin-arm64-latest.gzgzip -d), install to ~/.local/bin/mihomo, chmod +x~/.local/bin/mihomo -vInstall yq (YAML merge tool)
yq_{os}_{arch} where:
yq_linux_amd64yq_linux_arm64yq_darwin_amd64yq_darwin_arm64~/.local/bin/yq, chmod +x~/.local/bin/yq --versionInstall MetaCubeXD Web UI (if enabled)
compressed-dist.tgz~/.local/share/mihomo-ui/index.htmlCreate directory structure:
~/.config/mihomo/ # Main config directory
~/.config/proxy/ # Shared proxy env
Write ~/.config/mihomo/subscription.url (mode 600) with the subscription URL
Write ~/.config/mihomo/overrides.yaml — see config-templates.md for template. Key fields:
mixed-port: {{mixed_port}}
allow-lan: false
external-controller: 127.0.0.1:{{controller_port}}
log-level: info
external-ui: ~/.local/share/mihomo-ui # expand ~ to $HOME
secret: {{controller_secret}}
Write ~/.config/proxy/env.sh — see config-templates.md. Uses mixed_port parameter.
Write ~/.local/bin/update-mihomo-config — subscription fetch + merge + validate script. See config-templates.md for the full template.
Run initial subscription update: ~/.local/bin/update-mihomo-config
config.yamlLinux (systemd user):
~/.config/systemd/user/mihomo.service~/.config/systemd/user/mihomo-update.service~/.config/systemd/user/mihomo-update.timersystemctl --user daemon-reloadsystemctl --user enable --now mihomo.servicesystemctl --user enable --now mihomo-update.timerloginctl enable-linger $(whoami) (may need sudo — skip if unavailable, just warn user)macOS (launchd):
~/Library/LaunchAgents/com.mihomo.proxy.plist~/Library/LaunchAgents/com.mihomo.update.plistlaunchctl load ~/Library/LaunchAgents/com.mihomo.proxy.plistlaunchctl load ~/Library/LaunchAgents/com.mihomo.update.plist~/.local/bin/with-proxy — see config-templates.md~/.local/bin/proxy-agent — Cursor wrapper with fallback to cursor-agent~/.local/bin/proxy-copilot — GitHub Copilot CLI wrapper~/.local/bin/proxy-claude — Claude CLI wrapperchmod +x all wrapper scripts~/.bash_aliases with aliases and proxy-help function — see config-templates.md~/.bashrc sources ~/.bash_aliases (add . ~/.bash_aliases if missing)Run ALL of these checks. Report results to the user.
systemctl --user is-active mihomo (Linux) or launchctl list | grep mihomo (macOS)ss -tlnp | grep {{mixed_port}} (Linux) or lsof -iTCP:{{mixed_port}} (macOS)curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:{{controller_port}}curl -x http://127.0.0.1:{{mixed_port}} -s -o /dev/null -w '%{http_code}' https://www.google.com — expect 200with-proxy curl -s https://httpbin.org/ipsystemctl --user is-active mihomo-update.timer (Linux)After successful installation, print a summary:
✅ Mihomo proxy installed successfully!
📋 Configuration:
Mixed port: 127.0.0.1:{{mixed_port}}
Controller: 127.0.0.1:{{controller_port}}
Web UI secret: {{controller_secret}}
Config dir: ~/.config/mihomo/
🌐 Web UI Access:
SSH tunnel: ssh -L {{controller_port}}:127.0.0.1:{{controller_port}} user@server
Then open: http://127.0.0.1:{{controller_port}}/ui
🛠 Commands:
with-proxy <cmd> — Run any command through proxy
proxy-agent — Launch Cursor with proxy
proxy-copilot — Launch GitHub Copilot CLI with proxy
proxy-claude — Launch Claude CLI with proxy
proxy-help — Show all proxy commands
📝 Subscription auto-updates every 30 minutes.
When user asks to uninstall/remove the proxy, follow this checklist:
Stop services
systemctl --user disable --now mihomo.service mihomo-update.timerlaunchctl unload ~/Library/LaunchAgents/com.mihomo.proxy.plist ~/Library/LaunchAgents/com.mihomo.update.plistRemove service files
rm ~/.config/systemd/user/mihomo.service ~/.config/systemd/user/mihomo-update.service ~/.config/systemd/user/mihomo-update.timer && systemctl --user daemon-reloadrm ~/Library/LaunchAgents/com.mihomo.proxy.plist ~/Library/LaunchAgents/com.mihomo.update.plist Remove binaries: rm ~/.local/bin/mihomo ~/.local/bin/yq ~/.local/bin/update-mihomo-config
Remove wrapper scripts: rm ~/.local/bin/with-proxy ~/.local/bin/proxy-agent ~/.local/bin/proxy-copilot ~/.local/bin/proxy-claude
Remove config directories: rm -rf ~/.config/mihomo ~/.config/proxy
Remove Web UI: rm -rf ~/.local/share/mihomo-ui
Clean bash aliases: Remove proxy-related content from ~/.bash_aliases
Confirm removal — verify no mihomo processes running, ports freed
When the user reports proxy issues, see troubleshooting.md for common problems and solutions.
ask_user, don't assume values.npx claudepluginhub zhpeng24/devkit --plugin devkitProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.