Bridge any Skill source directory containing SKILL.md , or a collection directory containing multiple Skill subdirectories, to Agents already installed on the local machine.
The user always uses the same command. The script automatically selects the public entry point or the dedicated entry point; the user does not need to determine the host type or add a mode parameter.
Automatic routing
Public entry point
The script always writes the Skill symlink to:
- General Agents:
~/.agents/skills/<skill-name>
The following clients can read this public entry point, so their dedicated directories are no longer written to:
- Codex;
- GitHub Copilot;
- Gemini CLI;
- Cursor;
- Augment;
- Roo Code;
- OpenCode;
- OpenHands。
The same Skill will not appear in both ~/.agents/skills and the dedicated directories of the above clients. This avoids duplicate display in clients such as Codex.
Dedicated entry point
The following clients currently still use dedicated directories. The script creates the symlink only when the corresponding home directory already exists:
- Claude Code:
~/.claude/skills/<skill-name>; - WorkBuddy:
~/.workbuddy/skills/<skill-name>; - Hermes Agent:
~/.hermes/skills/<skill-name>; - Kiro:
~/.kiro/skills/<skill-name>; - Qwen Code:
~/.qwen/skills/<skill-name>; - Cline:
~/.cline/skills/<skill-name>。
Grok thin bridge
When ~/.grok exists on the local machine, the script generates:
~/.grok/skills/<skill-name>/SKILL.md
This file must contain user_invocable: trueand point to the true source SKILL.md。
Automatic cleanup
Each time link is executed, the script also handles historical leftovers:
- Delete redundant symlinks in dedicated directories of clients compatible with the public entry point that point to the same true source;
- Delete host symlinks previously written by older script versions that are no longer maintained;
- Delete old aliases in the same host that point to the same true source and whose canonical name already exists;
- During collection bridging, delete broken symlinks and Grok bridges that point to invalid source directories within the collection;
- Keep real directories, real files, and symlinks pointing to other sources, and report conflicts;
- Do not delete the source Skill.
Core principles
- One public entry point. Clients that support the general Agents directory uniformly read
~/.agents/skills。 - Add a dedicated entry point when necessary. Create symlinks only for clients that still rely on native directories.
- The user does not need to choose a mode. The script does not require the user to provide routing parameters.
- Keep only one copy for public-compatible clients. Clients such as Codex cannot have both the public entry point and the dedicated entry point at the same time.
- Each host uses only symlinks. Grok is the only host that uses a thin bridge.
- Do not create Agent home directories that do not exist.
~/.agentsIt is public bridging infrastructure and can be created by the script; if other Agent home directories do not exist, skip them directly. - Do not overwrite real directories. If a real directory or file already exists at the target location, keep it and report it.
- Unbridging deletes only derived artifacts.
unlinkDelete only symlinks pointing to the specified true source, as well as Grok bridges generated by this tool. - Prefer using the script. Use the
scripts/bridge-skill.shincluded with this Skill; do not rewrite the bridging command on the fly.
Determine the source Skill
The user may provide:
- Skill name:
dbs-hook; - Relative path:
skills/dbs-hook; - Absolute path:
/Users/.../dbskill/skills/dbs-hook; - External Skill:
/Users/.../external-skills/lark-doc; - Skill collection directory:
/Users/.../dbskill/skills; - The Skill that was just created or just modified in the current context.
Determine by the following priority:
- If the user gave an absolute path, use it directly;
- If the user gave a relative path, first resolve it against the current working directory, then against the dbskill repository root;
- If the user gave only a Skill name, first check the current working directory, then check the dbskill repository
skills/<name>; - If the user only said "this Skill", use the Skill that was just created, renamed, or discussed in the current conversation;
- If still uncertain, check the current working directory and the repository
skills/for the most recently modified Skill; - If still unable to determine, ask only one question:
桥接哪个 Skill?给我 Skill 名称或路径。
The source directory must satisfy any one of the following conditions:
- The directory itself contains
SKILL.md; - One or more of the directory's first-level subdirectories contain
SKILL.md。
Execute bridging
Run in the dbskill repository root:
skills/dbs-bridge/scripts/bridge-skill.sh link <skill-name-or-path>
Example:
skills/dbs-bridge/scripts/bridge-skill.sh link dbs-hook
skills/dbs-bridge/scripts/bridge-skill.sh link skills/my-custom-skill
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"
After execution completes, report the common entry, dedicated entry, Grok bridge, and redundant cleanup results based on the script output.
Check status
When the user asks "is the bridge done", "are there duplicates", or "check bridge status", run:
skills/dbs-bridge/scripts/bridge-skill.sh status <skill-name-or-path>
When the status is normal, the script must output:
✓ 未发现冗余入口
When a dedicated directory of a public compatible client still has a same-source symlink, the status returns failure and reports:
✗ 发现冗余入口:<target> -> <source>
Unbridge
When the user says "unbridge", "tear down the bridge", or "unlink", run:
skills/dbs-bridge/scripts/bridge-skill.sh unlink <skill-name-or-path>
After completion, tell the user: the source Skill has not been deleted; only derived artifacts such as the common entry, dedicated entry, and Grok bridge were removed.
Output specification
After bridging completes, briefly report:
已桥接 `<skill-name>`:
- 公共入口:`~/.agents/skills/<skill-name>`;
- 专属入口:仅写入本机已安装且仍需要专属目录的 Agent;
- Grok:`~/.grok/skills/<skill-name>/SKILL.md`(本机已安装时);
- 去重:已清理指向同一真源的历史冗余软链。
When encountering a real directory or other source:
已保留 `<target-path>`,因为它是一个真实目录、真实文件或指向其他来源。需要你手动确认后再处理。
Self-check
Confirm before and after each execution:
- The source directory exists;
- The source directory contains
SKILL.md, or its first-level subdirectories containSKILL.md; - External paths use absolute paths, or can be resolved from the current working directory;
~/.agents/skills/<name>is the public specification entry;- There is no same-source symlink in the dedicated directory of public compatible clients such as Codex;
- If the dedicated host target location exists, it must be a symlink for updates to be allowed;
- If the Grok target location exists, it must be the Grok bridge generated by this tool for updates to be allowed;
- Real directories, real files, and symlinks from other sources have not been deleted;
- The source directory has not been deleted;
private/and.private/have not been read, copied, staged, or bridged.
After completing the current task, end directly. Only when the user explicitly asks about the next step and the current environment already has /dbs installed, briefly prompt: "When unsure about the next step, you can enter /dbs。」