metacubexd
Copilot instructions4.6k starsChanged 3 months agoMITView on GitHub
metacubexd is the official dashboard and managed runtime for the Mihomo proxy kernel. Keep changes inside the owning workspace and preserve the boundary between Mihomo's Clash API and metacubexd's Control API. - CONTEXT.md defines the project's domain language. - packages/ui/PRODUCT.md defines the product and its users. - packages/ui/DESIGN.md defines the UI design system. - packages/agent/MANUAL.md contains real-kernel smoke tests that are intentionally outside CI. - README.md documents supported deployment forms. This is a pnpm 10 workspace with four workspaces: Do…
- Installs packages
We split this copilot-instructions.md into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 28
Do not move host-specific behavior into packages/ui.
- Very specific: line 46
Default server ports are 8080 for UI + Control API, 9090 for the Clash API, and 7890 for the mixed proxy.
- Distinctive: line 62
Do not send Clash API traffic through the Control API.
- Very specific: line 79
Use <script setup lang="ts">, explicit props/emits types, computed values for derived state, and watchers only for side effects.
- Very specific: line 82
Do not assume Zod, tailwind-merge, tailwind-variants, or @tanstack/vue-table exists in this repository.
- Very specific: line 88
All user-facing UI text must use useI18n().
- Distinctive: line 93
Add the same key to every locale and preserve valid JSON.
- Distinctive: line 98
Run commands from the repository root unless noted.
- Distinctive: line 136
Prefer a targeted Vitest invocation while iterating, then run the owning workspace's full test and typecheck scripts before handoff.
- Very specific: line 149
Add regression coverage in the workspace that owns the behavior.
- Distinctive: line 156
Keep Control API route and UI contract changes synchronized.
- Very specific: line 161
Do not hand-edit generated output: .nuxt/, .nitro/, .output/, packages/ui/.output/, apps/server/.output/, apps/desktop/out/, …
- Very specific: line 164
Do not hand-edit downloaded kernel artifacts in apps/desktop/resources/ (mihomo, mihomo.exe, wintun.dll, or .mihomo-target).
- Very specific: line 167
Do not edit CHANGELOG.md; release-please owns it.
- Very specific: line 168
Do not edit pnpm-lock.yaml manually.
≈ “Common” is an estimate: at least 1 in 5 of the 3,669 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot Instructions for metacubexd
metacubexd is the official dashboard and managed runtime for the Mihomo proxy kernel. Keep changes inside the owning workspace and preserve the boundary between Mihomo's Clash API and metacubexd's Control API.
Read First
- CONTEXT.md defines the project's domain language.
- packages/ui/PRODUCT.md defines the product and its users.
- packages/ui/DESIGN.md defines the UI design system.
- packages/agent/MANUAL.md contains real-kernel smoke tests that are intentionally outside CI.
- README.md documents supported deployment forms.
Monorepo Map
This is a pnpm 10 workspace with four workspaces:
| Workspace | Responsibility |
packages/ui | Nuxt 4/Vue 3 dashboard shared by every runtime form |
packages/agent | Framework-neutral Control API, profile store, kernel supervisor, scheduler, and shared types |
apps/server | Nitro all-in-one server that serves the UI and mounts the agent |
apps/desktop | Electron shell, local control server, OS integration, privileged TUN helper, and bundled kernel packaging |
Do not move host-specific behavior into packages/ui. Put reusable lifecycle,
profile, and Control API behavior in packages/agent; keep Docker/Nitro wiring in
apps/server and Electron/OS wiring in apps/desktop.
Runtime Forms
There are three runtime forms:
- Hosted panel: the static UI connects directly to a user-managed Mihomo. There is no Control Agent, so agent-only features remain hidden. The standalone panel Docker image is another distribution of this form.
- Desktop app: Electron serves the bundled UI from a loopback control server, runs a local Control Agent, and supervises a bundled Mihomo. The preload bridge injects the per-launch Control and Clash endpoints.
- All-in-one server: Nitro serves the UI and
/api/controlon the control port and supervises the bundled Mihomo in the same container. The Clash API and mixed proxy remain separate ports.
Default server ports are 8080 for UI + Control API, 9090 for the Clash API,
and 7890 for the mixed proxy. Desktop ports are selected from free loopback
ports at startup; never hard-code them in UI code.
API Boundary
- Clash API is Mihomo's
external-controllerHTTP/WebSocket surface. It owns proxies, proxy groups, traffic, connections, rules, configs, version, and live Clash log data. UI access is centered onpackages/ui/composables/useApi.ts,useWebSocket.ts, and the endpoint store. - Control API is metacubexd's
/api/control/**surface. It owns kernel lifecycle and subprocess logs, profiles, runtime config, subscriptions, kernel/Geo asset management, WebDAV backup, System Proxy, and TUN. UI access goes throughpackages/ui/composables/useControlApi.ts; features are gated by the agent's advertised capabilities.
Do not send Clash API traffic through the Control API. In server mode the UI talks directly to the published Clash API port because Nitro does not proxy the required WebSocket streams. Do not confuse Clash WebSocket logs with the agent's kernel-process SSE logs.
UI Stack and Conventions
- Nuxt 4, Vue 3, strict TypeScript, CSR-only rendering, and hash routing.
- Pinia owns shared client state; persistent state commonly uses VueUse
useLocalStorage. - TanStack Vue Query owns server-state queries and invalidation. Keep query keys stable and invalidate affected data after mutations.
kyv2 is the HTTP client. This version usesprefix, notprefixUrl.- Tailwind CSS v4 and daisyUI v5 provide styling. Follow semantic daisyUI roles and the design system rather than hard-coded theme colors.
- Vue, Nuxt, VueUse, project composables, stores, utilities, constants, types,
and components are auto-imported according to
packages/ui/nuxt.config.ts. - Use
<script setup lang="ts">, explicit props/emits types, computed values for derived state, and watchers only for side effects.
Do not assume Zod, tailwind-merge, tailwind-variants, or
@tanstack/vue-table exists in this repository. Tables and conditional classes
use project components and normal Vue/Tailwind patterns.
Internationalization
All user-facing UI text must use useI18n(). Keep the seven JSON locale files
in packages/ui/i18n/locales/ aligned:
en.json, fa.json, fr.json, ja.json, ko.json, ru.json, zh.json.
Add the same key to every locale and preserve valid JSON. Do not create legacy TypeScript locale modules.
Commands
Run commands from the repository root unless noted.
Root scripts
pnpm install # install the workspace
pnpm dev # alias for dev:ui; pure-panel Nuxt development
pnpm dev:ui # Nuxt UI development server
pnpm dev:server # generate the UI, then start Nitro development
pnpm dev:desktop # fetch Mihomo and run Nuxt + Electron with renderer HMR
pnpm build:ui # nuxt generate -> packages/ui/.output/public
pnpm build:server # build the Nitro/agent workspace only
pnpm build:desktop # electron-vite build only; does not package installers
pnpm build # build:ui, then build:server
pnpm generate # build:ui, then copy packages/ui/.output to root .output
pnpm typecheck # run workspace typecheck scripts
pnpm lint # runs available lint scripts; currently UI only and auto-fixesDesktop installers require the additional renderer generation/copy, kernel
staging, and electron-builder steps shown in .github/workflows/release.yml.
The package-level pnpm --filter @metacubexd/desktop package script only invokes
electron-builder; it assumes those prerequisites already exist.
Package checks
pnpm --filter @metacubexd/ui test:unit
pnpm --filter @metacubexd/ui test:e2e
pnpm --filter @metacubexd/ui typecheck
pnpm --filter @metacubexd/agent test
pnpm --filter @metacubexd/agent typecheck
pnpm --filter @metacubexd/server test
pnpm --filter @metacubexd/server typecheck
pnpm --filter @metacubexd/desktop test
pnpm --filter @metacubexd/desktop typecheckPrefer a targeted Vitest invocation while iterating, then run the owning workspace's full test and typecheck scripts before handoff.
Test Locations
- UI unit specs live beside their areas under
**/__tests__/**/*.spec.ts; UI browser-flow specs live inpackages/ui/e2e/. - Agent tests live in
packages/agent/src/**/*.test.tsand use injected process, filesystem, fetch, and timer seams instead of a real kernel. - Server tests live under
apps/server/**/__tests__/. - Desktop tests live under
apps/desktop/src/**/__tests__/and must not perform real elevation or OS changes.
Add regression coverage in the workspace that owns the behavior. Use
packages/agent/MANUAL.md only when real Mihomo or network behavior must be
verified outside the deterministic test suite.
Editing and Quality Rules
- Preserve strict TypeScript types and existing dependency-injection seams.
- Keep Control API route and UI contract changes synchronized.
- Route profile and kernel state changes through the agent/controller rather than mutating them from a view.
pnpm lintinvokes ESLint with--fix; inspect resulting changes and do not run it casually across unrelated work.- Do not hand-edit generated output:
.nuxt/,.nitro/,.output/,packages/ui/.output/,apps/server/.output/,apps/desktop/out/,apps/desktop/renderer/, orapps/desktop/dist/. - Do not hand-edit downloaded kernel artifacts in
apps/desktop/resources/(mihomo,mihomo.exe,wintun.dll, or.mihomo-target). The trackeddefault-config.yamlis source and may be edited intentionally. - Do not edit
CHANGELOG.md; release-please owns it. - Do not edit
pnpm-lock.yamlmanually; regenerate it through pnpm when a dependency change is intentional.
Trending
Less talk lately.about the whole repository
Who's talking about MetaCubeX/metacubexd
- vernesong/OpenClash“[Feature] 添加metacubexd面板支持”GitHub · Sep 28, 2023 · 5 reactions
- SagerNet/sing-box“安卓root问题”GitHub · Jan 12, 2026 · 3 reactions
- MetaCubeX/mihomo“[Bug] 对 external-ui 的存放路径进行检查导致 AUR 安装的 mihomo & metacubex 无法启动”GitHub · May 1, 2025 · 1 reactions
- SagerNet/sing-box“clash_api rule 分类命名问题”GitHub · Jan 15, 2025 · 1 reactions
- CHIZI-0618/box4magisk“IPv6相关配置开启后代理问题”GitHub · Jan 15, 2025 · 1 reactions
The biggest 5 of 50 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 50
Talked about on GitHub (50 times).
On GitHub · 50
- Sep 28, 2023[Feature] 添加metacubexd面板支持 — vernesong/OpenClash5 reactions · 7 comments
- Jan 12, 2026安卓root问题 — SagerNet/sing-box3 reactions · 2 comments
- May 1, 2025[Bug] 对 external-ui 的存放路径进行检查导致 AUR 安装的 mihomo & metacubex 无法启动 — MetaCubeX/mihomo1 reaction · 4 comments
- Jan 15, 2025clash_api rule 分类命名问题 — SagerNet/sing-box1 reaction · 2 comments
- Jan 15, 2025IPv6相关配置开启后代理问题 — CHIZI-0618/box4magisk1 reaction · 1 comment
45 more on GitHub
- Oct 18, 2024[BUG] 路由器正常,局域网设备访问部分国外网站失败,且 dns 响应不正确 — nikkinikki-org/OpenWrt-nikki1 reaction · 12 comments
- Sep 29, 2024关于tun_device & fswatch: watcher removed — CHIZI-0618/box4magisk1 reaction · 6 comments
- Sep 17, 2024New mihomo UI — zerolabnet/SSClash1 reaction · 5 comments
- Sep 17, 2024貌似遇到DNS的问题,不知道如何解决 — CHIZI-0618/box4magisk1 reaction · 2 comments
- Mar 21, 2024metacubexd: init at 1.140.0 — NixOS/nixpkgs1 reaction · 6 comments
- Feb 13, 2024[Bug] DNS开启后内存泄漏 — MetaCubeX/mihomo1 reaction
- Jan 28, 2024[Bug] 断网环境下macOS从睡眠中唤醒时内核高CPU占用 — MetaCubeX/mihomo1 reaction · 19 comments
- Oct 16, 2026[Bug] 设置了 external-ui,但对于管理远程机器来说不生效。 — Sitoi/ClashBar0 reactions · 1 comment
- Sep 28, 2026Add MetaCubeXD — AppImage/appimage.github.io0 reactions · 1 comment
- Sep 16, 20261.8-alpha-11启动报错start service: pre-starting clash api: open cache file: timeout — LIghtJUNction/sing-box0 reactions
- Sep 16, 2026warp出站"system_interface": true,数据通,服务器、客户端clashapi dashboard测速无延迟;ios客户端测速延迟翻了10倍多! — LIghtJUNction/sing-box0 reactions
- Sep 16, 2026sfa某些情况下的local DNS会对节点域名返回fake-ip导致无法连接 — LIghtJUNction/sing-box0 reactions
- Sep 16, 2026SFM 无法打开external ui — LIghtJUNction/sing-box0 reactions
- Sep 16, 2026启动sing-box 后,每隔一段时间出现 dns exchange failed 、use of closed network connection、等日志信息 — LIghtJUNction/sing-box0 reactions
- Sep 15, 2026tun 入站时,ping 请求超时 — LIghtJUNction/sing-box0 reactions
- Sep 15, 2026windows 使用 sing-box_1.12.0-alpha.12,dns 使用 local 类型,ping 网站时,提示“Ping 请求找不到主机 xxx 。请检查该名称,然后重试” — LIghtJUNction/sing-box0 reactions
- Sep 15, 2026macOS Sequoia DNS query loopback in transport — LIghtJUNction/sing-box0 reactions
- Sep 15, 2026咨询:通过代理后,Chrome没有使用http3/quic协议访问网站 — LIghtJUNction/sing-box0 reactions
- Sep 15, 2026安卓root问题 — LIghtJUNction/sing-box0 reactions
- Sep 15, 2026clash log api does not respect loglevel parameter — LIghtJUNction/sing-box0 reactions
- Sep 13, 2026订阅输出增加账户流量与到期信息 — pickrui/oixcloud-external-proxy-program0 reactions · 1 comment
- Sep 12, 2026metacubexd: 1.273.0 -> 1.273.1 — NixOS/nixpkgs0 reactions · 1 comment
- Sep 12, 2026pkgs: 2026-Sep-12 — MidAutumnMoon/TaysiTsuki0 reactions
- Aug 22, 2026metacubexd: 1.271.0 -> 1.273.0 — NixOS/nixpkgs0 reactions
- Aug 17, 2026pkgs: 2026-Aug-17 — MidAutumnMoon/TaysiTsuki0 reactions
- Aug 17, 2026pkgs: 2026-Aug-17 — MidAutumnMoon/TaysiTsuki0 reactions
- Aug 4, 2026如何在Linux服务器中安装Clash Verge (Mihomo) — fireLhq/fireLhq.github.io0 reactions
- Aug 3, 2026pkgs: 2026-Aug-03 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 28, 2026pkgs: 2026-Jul-28 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 28, 2026pkgs: 2026-Jul-28 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 25, 2026pkgs: 2026-Jul-25 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 24, 2026pkgs: 2026-Jul-24 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 23, 2026[Bug] Telegram 客户端无法联网 — MetaCubeX/mihomo0 reactions · 12 comments
- Jul 21, 2026pkgs: 2026-Jul-21 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 20, 2026pkgs: 2026-Jul-20 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 20, 2026現在這個面板功能太重了,配置文件保存都大了7、8MB。 — VIKINGYFY/packages0 reactions · 3 comments
- Jul 13, 2026pkgs: 2026-Jul-13 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 9, 2026pkgs: 2026-Jul-09 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 7, 2026pkgs: 2026-Jul-08 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 6, 2026pkgs: 2026-Jul-06 — MidAutumnMoon/TaysiTsuki0 reactions
- Jul 4, 2026pkgs: 2026-Jul-04 — MidAutumnMoon/TaysiTsuki0 reactions
- Jun 29, 2026pkgs: 2026-Jun-29 — MidAutumnMoon/TaysiTsuki0 reactions
- Jun 27, 2026pkgs: 2026-Jun-27 — MidAutumnMoon/TaysiTsuki0 reactions
- Jun 25, 2026pkgs: 2026-Jun-25 — MidAutumnMoon/TaysiTsuki0 reactions
- Jun 22, 2026pkgs: 2026-Jun-22 — MidAutumnMoon/TaysiTsuki0 reactions
Where files are headingNew Copilot instructions files have more rules about branches and pull requests, and fewer about code style.
Of the Copilot instructions files we read, the 2,297 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

