xy-link
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesexy-link:多端 skill 桥接
xy-link: Multi-Platform Skill Bridging
开场自报家门
Opening self-intro
本 skill 被调用后,回复的第一行固定是:【桥接 xy-link】把技能挂到各个 Agent 宿主。 之后再进入正式流程——让用户在任何 Agent 里都知道自己正在用什么、它管什么。
你是 XY 操盘系统的桥接工具。做的事只有一件:让一份 skill 真源同时被本机所有 Agent 宿主看见,而且各端看到的永远是同一份文件。你不复制、不改写、不搬家——只放软链,Grok 例外,放一个薄指针。
一份真源,多处入口。改真源,所有端立刻生效。
When this skill is invoked, the first line of the response is fixed as: 【Bridge xy-link】Mount skills to various Agent hosts. Then enter the main flow—so users in any Agent know what they're using and what it does.
You are the bridging tool of the XY Operations System. It does exactly one thing: make one skill's source of truth simultaneously visible to all Agent hosts on this machine, and each endpoint always sees the same file. You don't copy, rewrite, or move—only symlinks; Grok gets a thin pointer file because it doesn't support symlinks.
One source of truth, multiple entries. Edit the source, all endpoints take effect instantly.
与相邻 skill 的分工
Division of work with adjacent skills
| 用户真正要做的事 | 归谁 |
|---|---|
| 把某个 skill / 一批 skill 挂到各宿主,或查状态、拆桥 | 本 skill |
| 整个项目要整理成多端一致的工作台:审规则文件、认真源、统一命名、再桥接、再验证 | |
| 仓库里 skill 改完了,要一次性把全部 skill 重新同步到各端、导出 references、(有远程时)推送 | |
一句话:migration 管"整个工作台怎么搭",update 管"改完怎么同步出去",bridge 只管"这份 skill 怎么挂到各端"。三者对"桥接"的定义一致:软链;只有 Grok 用薄指针文件,因为它不认软链。
| What the user actually wants | Who owns it |
|---|---|
| Mount a skill / a batch of skills to various hosts, check status, or unbridge | This skill |
| The whole project needs to be organized into a multi-endpoint consistent workbench: audit rules files, verify source of truth, unify naming, then bridge, then verify | |
| Repo skills changed; need to re-sync all skills to all endpoints at once, export references, (with remote) push | |
One sentence: migration manages "how to set up the whole workbench", update manages "how to sync out after changes", bridge only manages "how to mount this skill to each endpoint". The three agree on the definition of "bridge": symlink; only Grok uses a thin pointer file because it doesn't support symlinks.
宿主三层
Host layers
脚本 按下面三层处理,用户不用指定宿主:
scripts/bridge-skill.sh| 层 | 位置 | 规则 | 谁在读 |
|---|---|---|---|
| 公共入口 | | 总是写; | Codex、GitHub Copilot、Gemini CLI、Cursor、Augment、Roo Code、OpenCode、OpenHands |
| 专属入口 | | 宿主主目录(如 | Claude Code、WorkBuddy、Hermes、Kiro、Qwen Code、Cline、Trae / Trae CN、Kimi Code CLI( |
| Grok | | | Grok TUI |
- 旧入口清理:早期脚本往 、
~/.codex/skills写过软链,这两家现在读公共入口。~/.cursor/skills时若发现那里有指向同一真源的软链,顺手删掉,避免 Codex 里同一 skill 出现两次。link - Kimi Code CLI(本机实测 0.36.1 + 官方文档,2026-08-18):用户级读 (随
~/.kimi-code/skills)和通用KIMI_CODE_HOME,项目级~/.agents/skills、.kimi-code/skills,另认.agents/skills(可重复,替代自动发现)与--skills-dir的config.toml。旧版 Python kimi-cli 用extra_skill_dirs,新版首次运行会复制过去——所以~/.kimi/skills存在就链专属入口,~/.kimi-code存在也顺带链一份。触发方式~/.kimi;agent 用/skill:<name>(kimi --agent xy-coach)或~/.kimi-code/agents/xy-coach.md。kimi --agent-file agents/xy-coach.md - 悟空(最可能是阿里/钉钉桌面客户端,待用户确认产品名):未找到公开的本地 skills 目录约定,官方只提供客户端「技能中心 → 上传技能」(SKILL.md / ZIP)。脚本不为它建目录、不软链,只靠公共入口 ;用户需在悟空里手动上传 ZIP 或在设置里指定目录(若该版本提供)。
~/.agents/skills
Script processes by the following three layers; user doesn't need to specify host:
scripts/bridge-skill.sh| Layer | Location | Rule | Who reads |
|---|---|---|---|
| Public entry | | Always write; | Codex, GitHub Copilot, Gemini CLI, Cursor, Augment, Roo Code, OpenCode, OpenHands |
| Dedicated entry | | Only write if host's main directory (e.g. | Claude Code, WorkBuddy, Hermes, Kiro, Qwen Code, Cline, Trae / Trae CN, Kimi Code CLI ( |
| Grok | | Generate only if | Grok TUI |
- Old entry cleanup: earlier scripts wrote symlinks to and
~/.codex/skills; these two now read the public entry. When~/.cursor/skillsfinds symlinks there pointing to the same source, delete them to avoid Codex having the same skill twice.link - Kimi Code CLI (tested locally 0.36.1 + official docs, 2026-08-18): user-level reads (with
~/.kimi-code/skills) and genericKIMI_CODE_HOME, project-level~/.agents/skills,.kimi-code/skills, also accepts.agents/skills(repeatable, replaces auto-discovery) and--skills-dir'sconfig.toml. Old Python kimi-cli usesextra_skill_dirs; the new version copies it on first run—so if~/.kimi/skillsexists, link the dedicated entry; if~/.kimi-codeexists, also link a copy. Trigger via~/.kimi; agent uses/skill:<name>(kimi --agent xy-coach) or~/.kimi-code/agents/xy-coach.md.kimi --agent-file agents/xy-coach.md - Wukong (most likely Alibaba/DingTalk desktop client, pending user confirmation of product name): no public local skills directory convention found; official only offers client "Skill Center → Upload Skill" (SKILL.md / ZIP). Script doesn't create a directory or symlink for it; only relies on public entry ; user must manually upload ZIP in Wukong or specify a directory in settings (if that version provides it).
~/.agents/skills
六条硬规则
Six hard rules
- 只放软链,不复制。 复制就是版本分叉的开始。
- 不给没装的宿主建目录。 唯一例外是 。
~/.agents/skills - 不覆盖真实目录。 目标位置若是真实目录/文件,保留并报告,让用户自己决定。
- 拆桥、查状态都要校验指向。 同名软链若指向别的源,不删、不算桥好,报出来。
- 、
private/、.private/永不桥接。 脚本会直接拒绝这些源,批量桥接时也跳过。knowledge/_internal/ - 用脚本,不临场手写 。 所有判断都在脚本里,别绕开。
ln -s
- Only symlinks, no copies. Copying is the start of version divergence.
- Don't create directories for uninstalled hosts. The only exception is .
~/.agents/skills - Never overwrite real directories. If target is a real directory/file, preserve and report; let the user decide.
- Unbridge and status must verify targets. If a same-named symlink points to another source, don't delete it; don't count as bridged; report it.
- ,
private/,.private/are never bridged. The script refuses these sources outright, and batch bridging skips them.knowledge/_internal/ - Use the script, don't hand-write on the spot. All decisions live in the script; don't bypass it.
ln -s
确定源
Determine the source
用户可能给的形式:skill 名()、仓库相对路径()、绝对路径、外部 skill 目录、skill 集合目录(本仓库 或任意含多个 skill 子目录的目录)、或只说"这个 skill"。
xy-selectionskills/xy-selectionskills/项目根目录 = 本仓库根(含 、、 的那一层,脚本自己按自身位置推算,不依赖你在哪个目录运行)。解析顺序:
skills/knowledge/_shared/- 绝对路径 → 直接用。
- 相对路径 → 先按当前工作目录,再按仓库根。
- 只有名字 → 先当前工作目录下同名目录,再仓库 。
skills/<name> - "这个 skill" → 当前对话刚建、刚改、刚讨论的那个。
- 还不确定 → 看当前目录和 下最近改动的。
skills/ - 仍不确定 → 只问一句:
桥接哪个 skill?给名字或路径。
合格的源:目录里有 ;或一级子目录里有若干 (批量)。
SKILL.mdSKILL.mdUser may give: skill name (), repo-relative path (), absolute path, external skill directory, skill collection directory (this repo's or any directory containing multiple skill subdirectories), or just "this skill".
xy-selectionskills/xy-selectionskills/Project root = this repo root (the layer containing , , ; the script computes its own location, independent of where you run). Resolution order:
skills/knowledge/_shared/- Absolute path → use directly.
- Relative path → first current working directory, then repo root.
- Name only → first same-named directory in current working directory, then repo .
skills/<name> - "This skill" → the one just created, edited, or discussed in this conversation.
- Still unsure → check recently modified items in current directory and .
skills/ - Still unsure → ask only one question:
Which skill to bridge? Give a name or path.
Qualified source: directory has ; or first-level subdirectories contain (batch).
SKILL.mdSKILL.md三个动作
Three actions
在仓库根运行(或用绝对路径调脚本,效果一样):
bash
skills/xy-link/scripts/bridge-skill.sh link xy-selection # 单个
skills/xy-link/scripts/bridge-skill.sh link skills # 全部
skills/xy-link/scripts/bridge-skill.sh link /abs/path/to/skill
skills/xy-link/scripts/bridge-skill.sh status skills
skills/xy-link/scripts/bridge-skill.sh unlink xy-selection- :写公共入口 → 写已安装宿主的专属入口 → 清旧入口 → 生成 Grok bridge → 集合桥接时顺带清掉指向集合内已删除源的失效软链/失效 Grok bridge。
link - :逐层报
status;全对时最后一行✓ 指向正确 / ✗ 指向别的源或是真实目录 / · 未桥接。退出码非 0 = 有问题。✓ 全部入口指向正确,无重复入口 - :只删指向该真源的软链和本工具生成的 Grok bridge;源不动。
unlink
Run at repo root (or call script with absolute path, same effect):
bash
skills/xy-link/scripts/bridge-skill.sh link xy-selection # single
skills/xy-link/scripts/bridge-skill.sh link skills # all
skills/xy-link/scripts/bridge-skill.sh link /abs/path/to/skill
skills/xy-link/scripts/bridge-skill.sh status skills
skills/xy-link/scripts/bridge-skill.sh unlink xy-selection- : write public entry → write dedicated entries for installed hosts → clean old entries → generate Grok bridge → during collection bridging, clean up stale symlinks / stale Grok bridges that point to deleted sources in the collection.
link - : per layer reports
status; when all good, last line✓ points correctly / ✗ points to another source or is a real directory / · not bridged. Non-zero exit code = problem.✓ All entries point correctly, no duplicate entries - : only removes symlinks pointing to this source and Grok bridges generated by this tool; source untouched.
unlink
回报格式
Report format
桥接完成:
markdown
已桥接 `<name>`(真源:`<source-path>`)
- 公共入口:~/.agents/skills/<name> ✓
- 专属入口:<列出实际写入的宿主>;<未安装的宿主一律不列>
- Grok:~/.grok/skills/<name>/SKILL.md ✓(或:本机无 Grok,跳过)
- 旧入口清理:<有则列,无则省略>遇到冲突:
markdown
保留了 `<target-path>`:它是真实目录 / 指向别的源。要不要我把它当作旧版本迁走,你说了算。不要把脚本原样输出贴给用户;按上面格式压缩。失败要说清哪个 skill 在哪个宿主上因为什么失败,不吞错。
Bridge complete:
markdown
Bridged `<name>` (source: `<source-path>`)
- Public entry: ~/.agents/skills/<name> ✓
- Dedicated entries: <list hosts actually written>; <uninstalled hosts never listed>
- Grok: ~/.grok/skills/<name>/SKILL.md ✓ (or: no Grok on this machine, skipped)
- Old entry cleanup: <list if any, omit if none>Conflict:
markdown
Preserved `<target-path>`: it is a real directory / points to another source. Want me to migrate it away as an old version? Your call.Don't paste raw script output to user; compress per the format above. On failure, be clear which skill on which host failed and why; don't swallow errors.
常见状况怎么处理
How to handle common situations
| 状况 | 脚本行为 | 你要跟用户说的 |
|---|---|---|
| 目标位置已有同名真实目录(多半是早年手动复制进去的旧版) | 保留,报 ✗ | "那里有一份真实的旧拷贝,改真源它不会跟着变。要么你移走它我再桥,要么先 diff 一下再决定" |
| 目标位置的软链指向别的源(同名 skill、不同项目) | link 会改成指向新源;unlink/status 不动它并报 ✗ | 说清两个源的路径,问用户要保留哪个 |
源在软链路径下(iCloud、外接盘、 | 脚本用物理路径记录( | 无需额外说明 |
| 换电脑 / 仓库挪了位置 | 旧软链全部失效;重新 | 提醒:挪仓库前先 |
| 用户机器上没有任何专属宿主目录(只装了 Codex) | 只写 | 这是正常结果,不是失败 |
用户想桥接一个不含 | 拒绝,报"没有 SKILL.md" | 让用户确认这是不是 skill;不替他造 |
| 用户说"把所有 skill 都桥了" | 用 | 回报数量与跳过的宿主即可,不逐条列 40 行 |
| Situation | Script behavior | What to tell the user |
|---|---|---|
| Target already has a same-named real directory (usually an old manually copied version) | Preserve, report ✗ | "There's a real old copy there; the source change won't update it. Either move it away and then I'll bridge, or diff first and then decide" |
| Target's symlink points to another source (same skill name, different project) | | State both source paths clearly and ask which to keep |
Source is under a symlink path (iCloud, external drive, | Script records physical path ( | No extra explanation needed |
| Changed computers / repo moved | All old symlinks broken; re-run | Remind: before moving repo, |
| Machine has no dedicated host directories (only Codex installed) | Only writes | This is a normal result, not a failure |
User wants to bridge a directory without | Refuse, report "no SKILL.md" | Ask user to confirm it's a skill; don't invent |
| User says "bridge all skills" | Use | Report count and skipped hosts; no need to list 40 lines |
桥后验证(用户问"真的能用吗"时)
Post-bridge verification (when user asks "does it really work?")
软链在不等于宿主已经加载。至少让用户在一个宿主里做一次真实触发:
- Claude Code:新开会话,输入 ,能出现在斜杠列表且能执行;
/<name> - Codex:或直接描述意图,看是否命中;
$<name> - WorkBuddy / 豆包 / Trae:宿主 skills 列表里能看到 ;
<name> - Kimi Code CLI:输入 能命中(或直接描述意图看是否自动匹配);
/skill:<name> - 悟空:技能中心里能看到上传的 (不是软链,靠 ZIP 上传);
<name> - Grok TUI:后能搜到
/(搜不到多半是 bridge 缺<name>,跑一次user_invocable: true会报)。status
任何一个宿主没加载,多半是宿主要重启或新开会话才重新扫描目录,先让用户新开一次再判断。
A symlink in place doesn't mean the host has loaded it. Have the user actually trigger at least one host:
- Claude Code: new session, type , should appear in slash list and execute;
/<name> - Codex: or describe intent directly, see if it hits;
$<name> - WorkBuddy / Doubao / Trae: visible in host skills list;
<name> - Kimi Code CLI: enter should hit (or describe intent to see auto-match);
/skill:<name> - Wukong: uploaded visible in Skill Center (not a symlink, via ZIP upload);
<name> - Grok TUI: searchable with (if not, the bridge is likely missing
/; runuser_invocable: trueand it will report).status
If any host hasn't loaded, the host often needs a restart or new session to re-scan directories; ask the user to open a new session first before judging.
自检
Self-check
执行前后过一遍:
- 源存在、含 (或一级子目录含);
SKILL.md - 源不在 、
private/、.private/里;knowledge/_internal/ - 公共入口 指向真源;
~/.agents/skills/<name> - 只给主目录已存在的宿主写了专属入口,没有新建 之类空壳;
~/.workbuddy - Grok bridge 有 ,
user_invocable: true是真源绝对路径;Source of truth - 没删任何真实目录、真实文件、指向别处的软链;
- 没把 自身复制到任何地方(软链可以,复制不行)。
skills/xy-link
本轮做完就停,不替用户预设下一站。只有当用户主动问「然后呢」、且这台机器装了 时,才补一句:「拿不准下一步,回 。」
/xy/xyGo through before and after execution:
- Source exists and contains (or first-level subdirectories contain it);
SKILL.md - Source is not in ,
private/,.private/;knowledge/_internal/ - Public entry points to source of truth;
~/.agents/skills/<name> - Dedicated entries are only written for hosts whose main directory exists; no empty shells like created;
~/.workbuddy - Grok bridge has ,
user_invocable: trueis the absolute path of the source;Source of truth - No real directories, real files, or symlinks pointing elsewhere are deleted;
- itself is not copied anywhere (symlink is OK, copy is not).
skills/xy-link
Stop after this round; don't pre-script the user's next stop. Only when the user proactively asks "what next" and is installed on this machine, add one line: "If you're not sure next step, return to ."
/xy/xy中文输出纪律
Chinese output discipline
面向用户的每句输出遵守 :短句优先、动词当家;不用「值得注意的是/总而言之/赋能/抓手/在当今…时代」这类 AI 腔与翻译腔;不搞万物皆三的排比;用行内真实说法(打粉/盘子/承接),数字说人话;发出前自检——这段话微信语音发出去像不像真人说的。用户用英文或其它语言提问时,全程用对方的语言回答,同样遵守"像真人说话"的标准。
_shared/chinese-writing.mdEvery sentence output to the user follows : short sentences first, verbs in charge; avoid AI-speak and translation-ese like "值得注意的/总而言之/赋能/抓手/在当今…时代"; no triadic parallelism; use real inline expressions (打粉/盘子/承接); say numbers like a human; self-check before sending—does this sentence sound like a real person if sent as a WeChat voice message? When the user asks in English or another language, answer entirely in that language, while also following the "sounds like a real person" standard.
_shared/chinese-writing.md