dsh-skillport:在 DSH 中複用已有 Agent Skills

前言

很多開發者已經在 Claude Code、Cursor、Gemini CLI 等工具中積累了 SKILL.md、Cursor rules、Claude Code commands。問題通常不是缺少 skill 文件,而是 DSH 沒有直接發現這些文件,也沒有直接讀取這些相鄰格式。

dsh-skillport 是一個 DSH 插件 bundle,用來發現這些已有 skill,並把可轉換的格式接入 DSH 原生 skill registry。

這是什麼

dsh-skillport(倉庫:Jesse-njx/dsh-skillport)是 MIT 許可的 DSH 插件 bundle。它面向已經有多來源 skill 文件的開發者,主要解決三件事:

  1. 發現 DSH 默認不覆蓋的 SKILL.md 位置。
  2. 轉換 Cursor rules、Claude Code commands、上下文文件等相鄰格式。
  3. 提供 skills doctor、find_skill 等調試與檢索入口。

核心功能

發現已有 SKILL.md

插件會檢查以下 Agent Skills 位置:

.claude/skills
~/.claude/skills
~/.gemini/antigravity/skills
extraPaths
.dsh/skills
.agents/skills

當 DSH 原生 dsh-skill-filesystem provider 已經存在時,.dsh/skills 和 .agents/skills 會被跳過,避免重複掃描。

轉換相鄰格式

插件會把可轉換的相鄰格式轉成 DSH skill:

  • Cursor rules:.cursor/rules/*.mdc 轉成 model-invocable skills。
  • Claude Code commands:.claude/commands/*.md 轉成 user-invokable skills,調用形式爲 /name。
  • 上下文文件:AGENTS.md 和 CLAUDE.md 只在 DSH 原生 dsh-agent-instructions 插件不存在時注入爲 project context。如果原生插件存在,則以原生插件爲準。

接入 DSH 原生 registry

發現或轉換後的 skill 會進入 DSH 原生 skill registry ctx.skills。之後由 DSH 自身的 catalog injection、progressive-disclosure index 和 skill loader tool 展示或加載。

dsh-skillport 不提供獨立執行路徑。帶腳本的 skill 仍通過 DSH 正常 shell tool 在 sandbox 內運行,sandbox policy 是單一執行點。

卸載時清理

移除插件後,所有由它導入的 skill 都會被卸載:

dsh plugin remove @dsh-skillport/bundle

skills doctor 與 find_skill

skills doctor 用於檢查 skill 列表和觸發質量。會話內可以運行:

/skills doctor
/skills doctor deploy the app to production

終端中也可以運行:

skills-doctor --cwd ~/work/projectx list
skills-doctor --cwd ~/work/projectx test-fire "deploy the app to production"

find_skill 用於查找 skill candidates。當 maxIndexEntries 限制生效後,dsh-skillport 的 model-invocable candidates 會變成 user-invocable only,並由 find_skill 暴露。

固定 spec revision

插件包含固定的 Agent Skills spec revision,文件位置爲:

docs/spec-revision.md

同時附帶 conformance fixture suite,用於讓 spec drift 在 CI 中暴露。

安裝與啓用

運行環境需要 Node.js >= 20。

先添加插件:

dsh plugin --profile web add @dsh-skillport/bundle

然後在 DSH 會話中,要求模型加載一個你原本在 Claude Code 中維護的 skill。catalog 會列出它,skill loader tool 會加載它,bundled resources 也會一併解析。

如果後續要移除:

dsh plugin remove @dsh-skillport/bundle

典型用法

安裝後加載已有 skill

安裝完成後,先在會話中讓模型加載已有 skill,再確認 catalog 是否列出該 skill。

檢查 skill 觸發

會話內:

/skills doctor
/skills doctor deploy the app to production

終端中:

skills-doctor --cwd ~/work/projectx list
skills-doctor --cwd ~/work/projectx test-fire "deploy the app to production"

在 catalog 限制後查找候選

如果配置了 maxIndexEntries,部分 skill candidates 可能不會直接進入 model-invocable index。此時可以使用 find_skill 查找候選。

配置

所有配置項都是可選的,可以在 profile patch 或 cordis.patch.yml 中設置:

plugins:
  dsh-skillport:
    sources: [dsh, claude, agents, gemini]
    extraPaths: []
    convert:
      cursorRules: true
      contextFiles: true
      claudeCommands: true
    maxIndexEntries: 100
    providerName: skillport

各字段含義:

  • sources:選擇要掃描的發現集。
  • extraPaths:額外的 SKILL.md 目錄。
  • convert.cursorRules:是否轉換 .cursor/rules/*.mdc。
  • convert.contextFiles:是否注入 AGENTS.md / CLAUDE.md。如果 DSH 原生插件已處理,則跳過。
  • convert.claudeCommands:是否轉換 .claude/commands/*.md 爲 user-invokable skills。
  • maxIndexEntries:prompt-bloat cap。超過該值後,dsh-skillport 的 model-invocable candidates 會變成 user-invocable only,並通過 find_skill 暴露。
  • providerName:skill registry 中的 provider 名稱。

適用場景與注意

適合:

  • 已在 Claude Code、Cursor、Gemini CLI 中維護 SKILL.md 或相鄰格式。
  • 希望減少遷移成本,把這些 skill 接入 DSH 原生 registry。
  • 需要檢查 skill 觸發質量,或在 catalog 限制後檢索候選 skill。

注意:

  • 插件以當前 dsh 進程權限運行;安裝前應檢查源碼和許可證。許可證爲 MIT。
  • AGENTS.md / CLAUDE.md 不會重複注入。DSH 原生 dsh-agent-instructions 存在時,以原生插件爲準。
  • .dsh/skills 和 .agents/skills 不會被重複處理。DSH 原生 dsh-skill-filesystem provider 存在時,dsh-skillport 會跳過這些路徑。
  • Claude Code plugins / hooks / subagents 不做 port。
  • MCP config translation 不在範圍內。
  • Codex / Cursor extension binaries 不在範圍內。
  • dsh-skillport 不提供獨立執行路徑。帶腳本的 skill 仍通過 DSH 正常 shell tool 在 sandbox 內運行。

鏈接

GitHub:https://github.com/Jesse-njx/dsh-skillport

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

小夜