dbs-bridge

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

dbs-bridge:双端 skill 桥接

dbs-bridge: Cross-Agent Skill Bridging

把任意包含
SKILL.md
的 skill 源目录,或包含多个 skill 子目录的集合目录,用软链同时挂到:
  • ~/.claude/skills/<skill-name>
  • ~/.codex/skills/<skill-name>
这样 Claude Code 和 Codex 都能通过同一个源目录调用该 skill。源目录改动后,两端自动同步。源目录可以在 dbskill 仓库内,也可以在外部项目、
~/.claude/skills
以外的本地目录、iCloud 目录或其他工作区。

Bridge any source skill directory containing
SKILL.md
, or a collection directory with multiple skill subdirectories, to both:
  • ~/.claude/skills/<skill-name>
  • ~/.codex/skills/<skill-name>
This allows both Claude Code and Codex to call the skill from the same source directory. Changes to the source directory will automatically sync to both ends. The source directory can be within the dbskill repository, in an external project, a local directory outside
~/.claude/skills
, an iCloud directory, or other workspaces.

核心原则

Core Principles

  1. 只用软链。 不复制 skill 文件,避免两端出现版本分叉。
  2. 源目录可以在任何位置。 桥接目录只指向源目录。
  3. 绝不覆盖真实目录。 如果目标位置已有同名真实目录,停下来报告,让用户手动处理。
  4. 拆桥只删软链。 取消桥接时只移除
    ~/.claude/skills
    ~/.codex/skills
    下的链接,不删除源目录。
  5. 优先用脚本执行。 使用本 skill 自带脚本
    scripts/bridge-skill.sh
    ,不要临场重写桥接命令。

  1. Use only symlinks. Do not copy skill files to avoid version divergence between the two ends.
  2. Source directories can be anywhere. Bridged directories only point to the source directory.
  3. Never overwrite real directories. If a real directory with the same name already exists at the target location, stop and report it, letting the user handle it manually.
  4. Unbridge only removes symlinks. When canceling the bridge, only remove the links under
    ~/.claude/skills
    and
    ~/.codex/skills
    , do not delete the source directory.
  5. Prioritize script execution. Use the skill's built-in script
    scripts/bridge-skill.sh
    instead of writing bridge commands on the spot.

确定源 skill

Identify the Source Skill

用户可能给:
  • skill 名称:
    dbs-hook
  • 相对路径:
    skills/dbs-hook
  • 绝对路径:
    /Users/.../dbskill/skills/dbs-hook
  • 外部绝对路径:
    /Users/.../.agents/skills/lark-doc
  • skill 集合目录:
    /Users/.../dbskill/skills
  • 当前上下文刚创建或刚修改的 skill
按优先级判断:
  1. 用户明确给了绝对路径,直接使用该路径。
  2. 用户给了相对路径,先按当前工作目录解析,再按 dbskill 仓库根目录解析。
  3. 用户只给 skill 名称,优先查当前工作目录下的同名目录,再查 dbskill 仓库
    skills/<name>
  4. 用户只说“这个 skill”,使用当前对话里刚创建、刚改名或刚讨论的 skill。
  5. 仍不确定时,查看当前工作目录和仓库
    skills/
    下最近修改的 skill。
  6. 还是无法确定时,只问一句:
    桥接哪个 skill?给我 skill 名称或路径。
源目录必须满足其中一种条件:
  • 目录本身包含
    SKILL.md
  • 目录的一级子目录里包含多个
    SKILL.md
    ,用于批量桥接。

Users may provide:
  • Skill name:
    dbs-hook
  • Relative path:
    skills/dbs-hook
  • Absolute path:
    /Users/.../dbskill/skills/dbs-hook
  • External absolute path:
    /Users/.../.agents/skills/lark-doc
  • Skill collection directory:
    /Users/.../dbskill/skills
  • A skill just created or modified in the current context
Determine priority as follows:
  1. If the user explicitly provides an absolute path, use that path directly.
  2. If the user provides a relative path, first resolve it against the current working directory, then against the dbskill repository root directory.
  3. If the user only provides a skill name, first check for a directory with the same name in the current working directory, then check
    skills/<name>
    in the dbskill repository.
  4. If the user only says "this skill", use the skill just created, renamed, or discussed in the current conversation.
  5. If still uncertain, check the most recently modified skills in the current working directory and the repository's
    skills/
    directory.
  6. If still unable to determine, only ask:
    Which skill to bridge? Provide the skill name or path.
The source directory must meet one of the following conditions:
  • The directory itself contains
    SKILL.md
    ;
  • The first-level subdirectories of the directory contain multiple
    SKILL.md
    files, for batch bridging.

执行桥接

Execute Bridging

在 dbskill 仓库根目录运行:
bash
skills/dbs-bridge/scripts/bridge-skill.sh link <skill-name-or-path>
例子:
bash
skills/dbs-bridge/scripts/bridge-skill.sh link dbs-hook
skills/dbs-bridge/scripts/bridge-skill.sh link skills/dbs-beta-framework-builder
skills/dbs-bridge/scripts/bridge-skill.sh link skills
skills/dbs-bridge/scripts/bridge-skill.sh link "/absolute/path/to/skill"
skills/dbs-bridge/scripts/bridge-skill.sh link "/Users/me/external-skills/my-skill"
skills/dbs-bridge/scripts/bridge-skill.sh link "/Users/me/external-skills"
执行后把脚本输出里的两条链接结果回给用户。

Run in the dbskill repository root directory:
bash
skills/dbs-bridge/scripts/bridge-skill.sh link <skill-name-or-path>
Examples:
bash
skills/dbs-bridge/scripts/bridge-skill.sh link dbs-hook
skills/dbs-bridge/scripts/bridge-skill.sh link skills/dbs-beta-framework-builder
skills/dbs-bridge/scripts/bridge-skill.sh link skills
skills/dbs-bridge/scripts/bridge-skill.sh link "/absolute/path/to/skill"
skills/dbs-bridge/scripts/bridge-skill.sh link "/Users/me/external-skills/my-skill"
skills/dbs-bridge/scripts/bridge-skill.sh link "/Users/me/external-skills"
Return the two link results from the script output to the user after execution.

查看状态

Check Status

用户问“桥好了没”“查看桥接状态”时运行:
bash
skills/dbs-bridge/scripts/bridge-skill.sh status <skill-name-or-path>
输出应说明 Claude Code 和 Codex 两端分别指向哪里。

When the user asks "Is the bridge ready?" or "Check bridge status", run:
bash
skills/dbs-bridge/scripts/bridge-skill.sh status <skill-name-or-path>
The output should indicate where each end (Claude Code and Codex) points to.

取消桥接

Cancel Bridging

用户说“取消桥接”“拆桥”“unlink”时运行:
bash
skills/dbs-bridge/scripts/bridge-skill.sh unlink <skill-name-or-path>
拆桥完成后告诉用户:源 skill 没有被删除,只移除了两端软链。

When the user says "unbridge", "remove bridge", or "unlink", run:
bash
skills/dbs-bridge/scripts/bridge-skill.sh unlink <skill-name-or-path>
After unbridging, inform the user: The source skill has not been deleted, only the symlinks at both ends have been removed.

输出规范

Output Specifications

桥接完成后,简短回报:
markdown
已桥接 `<skill-name>`
- Claude Code:`~/.claude/skills/<skill-name>` -> `<source-path>`
- Codex:`~/.codex/skills/<skill-name>` -> `<source-path>`
如果遇到同名真实目录:
markdown
没有覆盖 `<target-path>`,因为那里已经是一个真实目录。需要你先手动确认这个目录能否移走。

After successful bridging, report briefly:
markdown
Bridged `<skill-name>`:

- Claude Code: `~/.claude/skills/<skill-name>` -> `<source-path>`
- Codex: `~/.codex/skills/<skill-name>` -> `<source-path>`
If a real directory with the same name exists:
markdown
Did not overwrite `<target-path>` because it is already a real directory. Please manually confirm if this directory can be moved first.

自检

Self-Check

每次执行前确认:
  • 源目录存在;
  • 源目录含
    SKILL.md
    ,或其一级子目录包含
    SKILL.md
  • 外部路径必须使用绝对路径,或能从当前工作目录解析;
  • 目标位置如果存在,必须是软链才允许更新;
  • 不能删除源目录;
  • 不能把
    skills/dbs-bridge
    自身复制到两端,只能软链。
Confirm the following before each execution:
  • The source directory exists;
  • The source directory contains
    SKILL.md
    , or its first-level subdirectories contain
    SKILL.md
    ;
  • External paths must use absolute paths or be resolvable from the current working directory;
  • If the target location exists, it must be a symlink to allow updates;
  • Do not delete the source directory;
  • Do not copy
    skills/dbs-bridge
    itself to both ends, only use symlinks.