xy-link

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

xy-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
整个项目要整理成多端一致的工作台:审规则文件、认真源、统一命名、再桥接、再验证
xy-workbench
(它的桥接那一步直接调本 skill 的脚本)
仓库里 skill 改完了,要一次性把全部 skill 重新同步到各端、导出 references、(有远程时)推送
xy-sync
(本地同步部分 = 调本 skill 批量桥接
skills/
)
一句话:migration 管"整个工作台怎么搭",update 管"改完怎么同步出去",bridge 只管"这份 skill 怎么挂到各端"。三者对"桥接"的定义一致:软链;只有 Grok 用薄指针文件,因为它不认软链。

What the user actually wantsWho owns it
Mount a skill / a batch of skills to various hosts, check status, or unbridgeThis 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
xy-workbench
(its bridging step directly calls this skill's scripts)
Repo skills changed; need to re-sync all skills to all endpoints at once, export references, (with remote) push
xy-sync
(local sync part = calling this skill's batch bridge on
skills/
)
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
按下面三层处理,用户不用指定宿主:
层位置规则谁在读
公共入口
~/.agents/skills/<name>
总是写;
~/.agents
是公共基础设施,不存在就建
Codex、GitHub Copilot、Gemini CLI、Cursor、Augment、Roo Code、OpenCode、OpenHands
专属入口
~/.claude/skills
、
~/.workbuddy/skills
、
~/.hermes/skills
、
~/.kiro/skills
、
~/.qwen/skills
、
~/.cline/skills
、
~/.trae/skills
、
~/.trae-cn/skills
、
~/.kimi-code/skills
、
~/.kimi/skills
宿主主目录(如
~/.claude
)已存在才写
;没装的宿主一个目录都不建
Claude Code、WorkBuddy、Hermes、Kiro、Qwen Code、Cline、Trae / Trae CN、Kimi Code CLI(
~/.kimi
是旧版 kimi-cli 目录)
Grok
~/.grok/skills/<name>/SKILL.md
~/.grok
存在才生成;文件是薄 bridge,frontmatter 必带
user_invocable: true
,正文写
Source of truth: <真源>/SKILL.md
Grok TUI
  • 旧入口清理:早期脚本往
    ~/.codex/skills
    、
    ~/.cursor/skills
    写过软链,这两家现在读公共入口。
    link
    时若发现那里有指向同一真源的软链,顺手删掉,避免 Codex 里同一 skill 出现两次。
  • 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
    的
    extra_skill_dirs
    。旧版 Python kimi-cli 用
    ~/.kimi/skills
    ,新版首次运行会复制过去——所以
    ~/.kimi-code
    存在就链专属入口,
    ~/.kimi
    存在也顺带链一份。触发方式
    /skill:<name>
    ;agent 用
    kimi --agent xy-coach
    (
    ~/.kimi-code/agents/xy-coach.md
    )或
    kimi --agent-file agents/xy-coach.md
    。
  • 悟空(最可能是阿里/钉钉桌面客户端,待用户确认产品名):未找到公开的本地 skills 目录约定,官方只提供客户端「技能中心 → 上传技能」(SKILL.md / ZIP)。脚本不为它建目录、不软链,只靠公共入口
    ~/.agents/skills
    ;用户需在悟空里手动上传 ZIP 或在设置里指定目录(若该版本提供)。

Script
scripts/bridge-skill.sh
processes by the following three layers; user doesn't need to specify host:
LayerLocationRuleWho reads
Public entry
~/.agents/skills/<name>
Always write;
~/.agents
is public infrastructure, create if absent
Codex, GitHub Copilot, Gemini CLI, Cursor, Augment, Roo Code, OpenCode, OpenHands
Dedicated entry
~/.claude/skills
、
~/.workbuddy/skills
、
~/.hermes/skills
、
~/.kiro/skills
、
~/.qwen/skills
、
~/.cline/skills
、
~/.trae/skills
、
~/.trae-cn/skills
、
~/.kimi-code/skills
、
~/.kimi/skills
Only write if host's main directory (e.g.
~/.claude
) already exists
; never create a directory for uninstalled hosts
Claude Code, WorkBuddy, Hermes, Kiro, Qwen Code, Cline, Trae / Trae CN, Kimi Code CLI (
~/.kimi
is old kimi-cli directory)
Grok
~/.grok/skills/<name>/SKILL.md
Generate only if
~/.grok
exists; file is a thin bridge, frontmatter must include
user_invocable: true
, body writes
Source of truth: <source>/SKILL.md
Grok TUI
  • Old entry cleanup: earlier scripts wrote symlinks to
    ~/.codex/skills
    and
    ~/.cursor/skills
    ; these two now read the public entry. When
    link
    finds symlinks there pointing to the same source, delete them to avoid Codex having the same skill twice.
  • Kimi Code CLI (tested locally 0.36.1 + official docs, 2026-08-18): user-level reads
    ~/.kimi-code/skills
    (with
    KIMI_CODE_HOME
    ) and generic
    ~/.agents/skills
    , project-level
    .kimi-code/skills
    ,
    .agents/skills
    , also accepts
    --skills-dir
    (repeatable, replaces auto-discovery) and
    config.toml
    's
    extra_skill_dirs
    . Old Python kimi-cli uses
    ~/.kimi/skills
    ; the new version copies it on first run—so if
    ~/.kimi-code
    exists, link the dedicated entry; if
    ~/.kimi
    exists, also link a copy. Trigger via
    /skill:<name>
    ; agent uses
    kimi --agent xy-coach
    (
    ~/.kimi-code/agents/xy-coach.md
    ) or
    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
    ~/.agents/skills
    ; user must manually upload ZIP in Wukong or specify a directory in settings (if that version provides it).

六条硬规则

Six hard rules

  1. 只放软链,不复制。 复制就是版本分叉的开始。
  2. 不给没装的宿主建目录。 唯一例外是
    ~/.agents/skills
    。
  3. 不覆盖真实目录。 目标位置若是真实目录/文件,保留并报告,让用户自己决定。
  4. 拆桥、查状态都要校验指向。 同名软链若指向别的源,不删、不算桥好,报出来。
  5. private/
    、
    .private/
    、
    knowledge/_internal/
    永不桥接。
    脚本会直接拒绝这些源,批量桥接时也跳过。
  6. 用脚本,不临场手写
    ln -s
    。
    所有判断都在脚本里,别绕开。

  1. Only symlinks, no copies. Copying is the start of version divergence.
  2. Don't create directories for uninstalled hosts. The only exception is
    ~/.agents/skills
    .
  3. Never overwrite real directories. If target is a real directory/file, preserve and report; let the user decide.
  4. 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.
  5. private/
    ,
    .private/
    ,
    knowledge/_internal/
    are never bridged.
    The script refuses these sources outright, and batch bridging skips them.
  6. Use the script, don't hand-write
    ln -s
    on the spot.
    All decisions live in the script; don't bypass it.

确定源

Determine the source

用户可能给的形式:skill 名(
xy-selection
)、仓库相对路径(
skills/xy-selection
)、绝对路径、外部 skill 目录、skill 集合目录(本仓库
skills/
或任意含多个 skill 子目录的目录)、或只说"这个 skill"。
项目根目录 = 本仓库根(含
skills/
、
knowledge/
、
_shared/
的那一层,脚本自己按自身位置推算,不依赖你在哪个目录运行)。解析顺序:
  1. 绝对路径 → 直接用。
  2. 相对路径 → 先按当前工作目录,再按仓库根。
  3. 只有名字 → 先当前工作目录下同名目录,再仓库
    skills/<name>
    。
  4. "这个 skill" → 当前对话刚建、刚改、刚讨论的那个。
  5. 还不确定 → 看当前目录和
    skills/
    下最近改动的。
  6. 仍不确定 → 只问一句:
    桥接哪个 skill?给名字或路径。
合格的源:目录里有
SKILL.md
;或一级子目录里有若干
SKILL.md
(批量)。

User may give: skill name (
xy-selection
), repo-relative path (
skills/xy-selection
), absolute path, external skill directory, skill collection directory (this repo's
skills/
or any directory containing multiple skill subdirectories), or just "this skill".
Project root = this repo root (the layer containing
skills/
,
knowledge/
,
_shared/
; the script computes its own location, independent of where you run). Resolution order:
  1. Absolute path → use directly.
  2. Relative path → first current working directory, then repo root.
  3. Name only → first same-named directory in current working directory, then repo
    skills/<name>
    .
  4. "This skill" → the one just created, edited, or discussed in this conversation.
  5. Still unsure → check recently modified items in current directory and
    skills/
    .
  6. Still unsure → ask only one question:
    Which skill to bridge? Give a name or path.
Qualified source: directory has
SKILL.md
; or first-level subdirectories contain
SKILL.md
(batch).

三个动作

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
  • link
    :写公共入口 → 写已安装宿主的专属入口 → 清旧入口 → 生成 Grok bridge → 集合桥接时顺带清掉指向集合内已删除源的失效软链/失效 Grok bridge。
  • status
    :逐层报
    ✓ 指向正确 / ✗ 指向别的源或是真实目录 / · 未桥接
    ;全对时最后一行
    ✓ 全部入口指向正确,无重复入口
    。退出码非 0 = 有问题。
  • unlink
    :只删指向该真源的软链和本工具生成的 Grok bridge;源不动。

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
  • link
    : 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.
  • status
    : per layer reports
    ✓ points correctly / ✗ points to another source or is a real directory / · not bridged
    ; when all good, last line
    ✓ All entries point correctly, no duplicate entries
    . Non-zero exit code = problem.
  • unlink
    : only removes symlinks pointing to this source and Grok bridges generated by this tool; source untouched.

回报格式

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、外接盘、
~/Desktop
里的软链)
脚本用物理路径记录(
pwd -P
),软链换了源不受影响
无需额外说明
换电脑 / 仓库挪了位置旧软链全部失效;重新
link skills
会写新路径,
clean_stale
只清指向新集合内失效项,旧路径的悬空软链要用
unlink
(在旧位置)或手动清
提醒:挪仓库前先
unlink skills
,挪完再
link skills
用户机器上没有任何专属宿主目录(只装了 Codex)只写
~/.agents/skills
和(有的话)Grok,其余全跳过
这是正常结果,不是失败
用户想桥接一个不含
SKILL.md
的目录
拒绝,报"没有 SKILL.md"让用户确认这是不是 skill;不替他造
SKILL.md
用户说"把所有 skill 都桥了"用
link skills
(仓库
skills/
整目录)
回报数量与跳过的宿主即可,不逐条列 40 行

SituationScript behaviorWhat 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)
link
will switch to new source;
unlink
/
status
leave it and report ✗
State both source paths clearly and ask which to keep
Source is under a symlink path (iCloud, external drive,
~/Desktop
symlink)
Script records physical path (
pwd -P
), symlink source changes don't affect it
No extra explanation needed
Changed computers / repo movedAll old symlinks broken; re-run
link skills
writes new paths;
clean_stale
only clears invalid items pointing to new collection; dangling symlinks from old paths need
unlink
(in old location) or manual cleanup
Remind: before moving repo,
unlink skills
; after moving,
link skills
Machine has no dedicated host directories (only Codex installed)Only writes
~/.agents/skills
and (if any) Grok, skips all others
This is a normal result, not a failure
User wants to bridge a directory without
SKILL.md
Refuse, report "no SKILL.md"Ask user to confirm it's a skill; don't invent
SKILL.md
for them
User says "bridge all skills"Use
link skills
(repo
skills/
whole directory)
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>
    能命中(或直接描述意图看是否自动匹配);
  • 悟空:技能中心里能看到上传的
    <name>
    (不是软链,靠 ZIP 上传);
  • Grok TUI:
    /
    后能搜到
    <name>
    (搜不到多半是 bridge 缺
    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
    /<name>
    , should appear in slash list and execute;
  • Codex:
    $<name>
    or describe intent directly, see if it hits;
  • WorkBuddy / Doubao / Trae:
    <name>
    visible in host skills list;
  • Kimi Code CLI: enter
    /skill:<name>
    should hit (or describe intent to see auto-match);
  • Wukong: uploaded
    <name>
    visible in Skill Center (not a symlink, via ZIP upload);
  • Grok TUI: searchable with
    /
    (if not, the bridge is likely missing
    user_invocable: true
    ; run
    status
    and it will report).
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
时,才补一句:「拿不准下一步,回
/xy
。」
Go through before and after execution:
  • Source exists and contains
    SKILL.md
    (or first-level subdirectories contain it);
  • Source is not in
    private/
    ,
    .private/
    ,
    knowledge/_internal/
    ;
  • Public entry
    ~/.agents/skills/<name>
    points to source of truth;
  • Dedicated entries are only written for hosts whose main directory exists; no empty shells like
    ~/.workbuddy
    created;
  • Grok bridge has
    user_invocable: true
    ,
    Source of truth
    is the absolute path of the source;
  • No real directories, real files, or symlinks pointing elsewhere are deleted;
  • skills/xy-link
    itself is not copied anywhere (symlink is OK, copy is not).

Stop after this round; don't pre-script the user's next stop. Only when the user proactively asks "what next" and
/xy
is installed on this machine, add one line: "If you're not sure next step, return to
/xy
."

中文输出纪律

Chinese output discipline

面向用户的每句输出遵守
_shared/chinese-writing.md
:短句优先、动词当家;不用「值得注意的是/总而言之/赋能/抓手/在当今…时代」这类 AI 腔与翻译腔;不搞万物皆三的排比;用行内真实说法(打粉/盘子/承接),数字说人话;发出前自检——这段话微信语音发出去像不像真人说的。用户用英文或其它语言提问时,全程用对方的语言回答,同样遵守"像真人说话"的标准。
Every sentence output to the user follows
_shared/chinese-writing.md
: 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.