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 doctorfind_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.mdCLAUDE.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 doctorfind_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

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

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

小夜