Skip to content
Back to search

dsh-capability-menu

一个面向 DeepSeek Harness 的统一能力管理插件,为 Tools/Skills 提供常驻、按需、禁用三档暴露策略,以减少上下文占用并支持运行时动态发现与执行。

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/PKUfudawei/dsh-capability-menu with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/PKUfudawei/dsh-capability-menu'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/pkufudawei--dsh-capability-menu/badge.svg)](/listings/pkufudawei--dsh-capability-menu)

HTML

<a href="/listings/pkufudawei--dsh-capability-menu"><img src="/api/listings/pkufudawei--dsh-capability-menu/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 193 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <h1 align="center">dsh-capability-menu</h1>
  2. <p align="center">
  3. <strong>统一管理 DeepSeek Harness 工具与技能,高效检索、按需调用,节省上下文</strong>
  4. </p>
  5. <p align="center">
  6. <a href="https://www.npmjs.com/package/@deepseek-ai/dsh"><img src="https://img.shields.io/badge/DeepSeek%20Harness-0.2.2--rc.1-4D6BFE.svg?style=flat-square&labelColor=161b22&logo=deepseek&logoColor=white" alt="DeepSeek Harness 0.2.2-rc.1"/></a>
  7. <a href="https://www.npmjs.com/package/@daweifu/capability-menu"><img src="https://img.shields.io/npm/v/@daweifu/capability-menu.svg?style=flat-square&color=CB3837&labelColor=161b22&logo=npm&logoColor=white" alt="npm version"/></a>
  8. <a href="https://github.com/PKUfudawei/dsh-capability-menu/actions"><img src="https://img.shields.io/github/actions/workflow/status/PKUfudawei/dsh-capability-menu/ci.yml?branch=master&label=CI&style=flat-square&labelColor=161b22&logo=github&logoColor=white" alt="CI"/></a>
  9. <a href="https://www.npmjs.com/package/@daweifu/capability-menu"><img src="https://img.shields.io/npm/d18m/@daweifu/capability-menu.svg?style=flat-square&color=CB3837&labelColor=161b22&logo=npm&logoColor=white" alt="downloads"/></a>
  10. <a href="https://github.com/PKUfudawei/dsh-capability-menu"><img src="https://img.shields.io/github/stars/PKUfudawei/dsh-capability-menu?style=flat-square&color=dbab09&labelColor=161b22&logo=github&logoColor=white" alt="GitHub stars"/></a>
  11. <a href="https://github.com/awesome-dsh-plugin/awesome-dsh-plugin"><img src="https://img.shields.io/badge/featured%20in-awesome--dsh--plugin-8250DF?style=flat-square&labelColor=161b22&logo=github&logoColor=white" alt="featured in awesome-dsh-plugin"/></a>
  12. </p>
  13. <p align="center">
  14. <strong>中文</strong> · <a href="./README.en.md">English</a>
  15. </p>
  16. ## 目录
  17. - [能力总览](#能力总览)
  18. - [能力模型](#能力模型)
  19. - [能力菜单](#能力菜单)
  20. - [安装与卸载](#安装与卸载)
  21. - [从 npm 安装(推荐)](#从-npm-安装推荐)
  22. - [从源码安装](#从源码安装)
  23. - [验证安装](#验证安装)
  24. - [卸载](#卸载)
  25. - [策略与目录](#策略与目录)
  26. - [能力暴露规则](#能力暴露规则)
  27. - [按需检索目录](#按需检索目录)
  28. - [参与贡献](#参与贡献)
  29. ---
  30. ## 能力总览
  31. - 为 DeepSeek Harness 的 tools(包括 MCP 工具和内置工具)与 skills 建立统一能力目录:`ctx.capability`。
  32. - 提供**常驻 / 按需 / 禁用**三档策略,管理能力的暴露与调用。
  33. - 按需能力只在需要时提供给 Agent,减少单次请求携带的工具定义,节省 token 和上下文。
  34. ### 能力模型
  35. Capability 是本插件引入的上位概念:Tool / Skill 是不同类型的 capability。
  36. | kind | 对 Agent 提供 | action | 备注 |
  37. | --- | --- | --- | --- |
  38. | `tool` | 执行一个动作(MCP 工具或内置原生工具) | `execute` | 由 `ctx.tools` 索引 |
  39. | `skill` | 某类任务的方法/流程/知识 | `load` | 由 `ctx.skills` 索引 |
  40. 模型获得两个元工具:
  41. | 工具 | 作用 | 对应 entry |
  42. | --- | --- | --- |
  43. | `meta_search` | 搜索当前会话可用的按需能力;列表返回匹配总数、已返回数及是否截断,详情返回说明和工具参数 schema | `@daweifu/capability-menu/search` |
  44. | `meta_invoke` | 统一执行面:Tool 真执行(走完整 `ctx.tools` 管线)+ Skill 加载;`force: true` 可重载已更新的 Skill | `@daweifu/capability-menu/invoke` |
  45. ### 能力菜单
  46. <p align="center">
  47. <img src="assets/screenshot-tools_chinese.png" alt="能力菜单的 Tools 页面:按服务器管理工具的暴露档位与检索描述" width="48%"/>
  48. <img src="assets/screenshot-skills_chinese.png" alt="能力菜单的 Skills 页面:按来源管理技能的暴露档位与检索描述" width="48%"/>
  49. </p>
  50. 安装后,在「设置」导航中选择「能力菜单」,即可管理 Tools 和 Skills。
  51. | 操作 | 用法 |
  52. | --- | --- |
  53. | 更改档位 | 点击能力旁的圆点;也可以点击顶部档位计数,批量切换该组能力 |
  54. | 查找能力 | 使用页签下方的过滤框搜索名称或分组;支持正则表达式,不区分大小写 |
  55. | 查看能力详情 | 点击 Tool 查看定义;点击 Skill 展开文件列表并预览文件,内容按 Markdown 渲染 |
  56. | 注册能力 | 点击右上角「注册能力」,添加 MCP 服务器或 Skill 目录;Skill 支持本机目录或公开 GitHub 链接 |
  57. | 编辑或移除 | 在 Tools 的服务器分组或 Skills 的技能项中点击「编辑」 |
  58. | 查看规则和按需目录 | 点击页头右侧的「策略与目录」,查看生效规则及按需能力摘要;可在按需检索目录中调整描述上限 |
  59. | 编辑检索描述 | 将 Tool 或 Skill 设为「按需」后,点击旁边的「检索描述」,在来源描述的简短版本上修改 |
  60. - **启动状态**:能力菜单在后台挂载远程接口;接口就绪前显示加载状态,挂载失败时显示错误信息。
  61. - **MCP 名称**:分组内省略 `mcp__服务器名__` 前缀;悬停可看全名,检索和调用仍用完整 ID。
  62. - **注册位置**:MCP 写入 patch 配置(自动创建缺失的文件和目录);请求头等凭据也保存在其中,请妥善保管。Skill 在所选技能根目录创建链接或导入目录。
  63. - **GitHub Skill**:支持公开仓库的默认分支根目录(含 `SKILL.md`)、指定分支根目录 `.../tree/{branch}` 或其下的技能目录 `.../tree/{branch}/{skill-directory}`;也支持本机目录。导入需在运行 dsh 的机器上安装 Git;插件会校验 `SKILL.md`,只复制所选目录。
  64. - **Skill 更新**:从 GitHub 导入的 Skill 会在打开菜单时检查更新,页面打开期间每小时再检查一次;也可在 Skills 页手动检查、查看差异并单个或批量更新。只比较导入的 Skill 目录;本地修改会阻止覆盖。本地软链和预设 Skill 不支持自动更新。
  65. - 旧版普通目录可输入原 GitHub 链接关联当前或历史快照;历史搜索最多检查 200 个不同目录版本,限时 60 秒(不含初始检出),达到限制会明确提示,且不写入来源。支持修改或解除来源,验证失败保留旧来源,解除关联保留技能文件。含 `.git` 的目录可关联和检查,但需通过 Git 更新,不参与菜单单个或批量更新。内容比较仅排除技能根目录的 `.git` 元数据,不忽略其他本地文件。
  66. ## 安装与卸载
  67. 前置:[Node.js](https://nodejs.org/en/download),以及已安装的 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(确保终端中可运行 `dsh` 命令)。DSH `0.2.2-rc.1` 要求 Node.js `>=24.9.0`。从 npm 安装无需单独安装 pnpm;从源码安装需要 pnpm。
  68. 插件 `0.1.9` 适配 DSH `0.2.2-rc.1`,支持 Tool 三档分层和 `meta_invoke` 转发。
  69. ### 从 npm 安装(推荐)
  70. ```sh
  71. dsh plugin --profile web add @daweifu/capability-menu
  72. ```
  73. ### 从源码安装
  74. ```sh
  75. git clone https://github.com/PKUfudawei/dsh-capability-menu.git
  76. cd dsh-capability-menu
  77. pnpm install
  78. dsh plugin --profile web add .
  79. ```
  80. ### 验证安装
  81. ```sh
  82. cd "${DSH_HOME:-$HOME/.dsh}/profiles/web" && pnpm list @daweifu/capability-menu && dsh --profile web --dump-config | grep -m1 '== @daweifu/capability-menu'
  83. ```
  84. ### 卸载
  85. ```sh
  86. dsh plugin --profile web remove @daweifu/capability-menu
  87. ```
  88. ## 策略与目录
  89. 这一章对应能力菜单中的「策略与目录」弹窗。
  90. ### 能力暴露规则
  91. 所有能力(Tool 与 Skill)按 **暴露程度**(模型在上下文中看到什么)与 **执行方式** 分为三档:
  92. | 档位 | 能力 | 模型能看到什么 | 如何找到 | 如何使用 |
  93. | --- | --- | --- | --- | --- |
  94. | **常驻** | tool | 工具定义始终随请求提供 | 无需查找 | 直接调用;运行时经过完整 `ctx.tools` 管线 |
  95. | | skill | 名称和简介显示在 `<available_skills>` 中 | 无需查找 | `skill` 工具按需加载正文 |
  96. | **按需** | tool | 不随请求提供工具定义 | 用 `meta_search` 搜索候选项 | 按精确 ID 查看参数后,用 `meta_invoke` 调用 |
  97. | | skill | 不显示在 `<available_skills>` 中 | 用 `meta_search` 搜索 | 用 `meta_invoke` 加载 `SKILL.md` |
  98. | **禁用** | tool | 不随请求提供工具定义 | `meta_search` 中不可见 | 调用会被拒绝 |
  99. | | skill | 不显示在 `<available_skills>` 中 | `meta_search` 中不可见 | 加载会被拒绝 |
  100. 适用范围与例外:
  101. - MCP 工具和可编目的 DSH 原生工具都支持三档;原生工具归入 `built-in` 分组。请勿将 MCP 服务器命名为 `built-in`,以免与该分组冲突。
  102. - `meta_search` 和 `meta_invoke` 默认常驻,不能在菜单中禁用。DSH Code Mode 的入口 `run_code` 不进入本插件的目录或菜单;手写通配规则仍可能匹配它,请勿将其设为按需或禁用。
  103. - 高频工具建议保持常驻;按需工具可通过 `meta_search` 找 ID、查看参数 schema,再调用。
  104. #### 规则配置与保存
  105. 弹窗显示的是当前生效规则,由手写规则和菜单选择合成,并非另一份 YAML 文件。手写规则位于 `capability-menu-policy` entry 的 `config` 下。以下是配置片段;完整安装补丁见 [cordis.patch.yml](./cordis.patch.yml)。
  106. - 默认 patch 是 `${DSH_HOME:-~/.dsh}/cordis.patch.yml`;Profile 也可在自己的 patch 中覆盖该 entry。
  107. - 菜单中的档位调整立即生效,停手约 1.5 秒后写入 `stateFile`;检索描述和描述上限也保存在这里。这些写入不会触发 DSH 配置重载。手写规则仍是基础;界面选择覆盖同一能力的精确规则,禁用通配规则仍优先。
  108. - `stateFile` 默认在 `${DSH_HOME:-~/.dsh}/capability-menu-policy.json`(默认 patch 的同目录),各 Profile 共用;需要隔离时,在 policy 和 registry 两个 entry 中指定同一个 `stateFile`。要清除界面选择,停止 DSH 后删除状态文件;原有 patch 规则仍会生效。
  109. ```yaml
  110. config:
  111. tools:
  112. on-demand: # 按需
  113. - 'mcp__example__*' # 某个 MCP 服务器下的工具
  114. disabled: # 禁用
  115. - 'mcp__secret__*'
  116. skills:
  117. on-demand: # 按需
  118. - example_skill # 未列出的能力默认常驻
  119. ```
  120. 通常只需设置 `tools` 和 `skills`。文件路径与防抖等可选项使用默认值即可;完整参数见 [policy 配置](./src/policy.ts) 和 [registry 配置](./src/registry.ts)。
  121. **规则优先级:** 按序匹配;禁用优先。在常驻与按需之间,精确规则优先于通配;同为精确或同为通配时,常驻优先。未命中任何规则则常驻。
  122. | 优先级 | 规则 | 示例 |
  123. | --- | --- | --- |
  124. | 1 | `disabled` 精确或通配 | `disabled: [forbidden_skill, 'mcp__secret__*']` |
  125. | 2 | `resident` 精确 | `resident: [bash]` |
  126. | 3 | `on-demand` 精确 | `on-demand: [example_skill]` |
  127. | 4 | `resident` 通配 | `resident: ['mcp__gongfeng__*']` |
  128. | 5 | `on-demand` 通配 | `on-demand: ['mcp__*']` |
  129. | 默认 | 未命中任何规则 | — |
  130. 能力菜单点击档位会写入精确规则。若更高优先级规则覆盖了所选档位,界面会提示「分类未生效」。
  131. ### 按需检索目录
  132. `meta_search` 是 Agent 检索按需 Tool 和 Skill 的唯一入口。「策略与目录 → 按需检索目录」直接显示同一内存索引中的按需能力摘要,不生成单独的 YAML 文件。Agent 的检索结果还会按当前会话的可用范围过滤。
  133. - **检索描述:** 按需能力默认使用来源描述的摘要(最多 320 字符),可在菜单中编辑。`meta_search` 的列表与关键词匹配使用该摘要;编辑不会修改来源定义。
  134. - **描述上限:** 在「策略与目录 → 按需检索目录」设置,最小 20 字符。降低上限前需先缩短超限的自定义描述。
  135. - **检索与调用:** 用 `meta_search({query})` 查找能力,再用 `meta_search({id, kind})` 查看参数,最后用 `meta_invoke({id, kind, args})` 调用或加载。已在当前会话加载的 Skill 可传 `force: true` 重新加载。
  136. ## 参与贡献
  137. 欢迎提交问题、文档修正和代码。贡献流程与合入标准见 [CONTRIBUTING.md](./CONTRIBUTING.md);issue 和 PR 可以使用中文或英文。
  138. ## License
  139. 本项目遵循 [Apache License 2.0](LICENSE)。

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.