Skip to content
dsh.fish
Bundle

dsh-local-skills

Local SKILL browser plugin for DeepSeek Harness: discovers local skills with live filesystem updates and surfaces them in the web UI with a Use button that explains how to invoke each skill.

Source
asakumizy
stars
1 stars
License
MIT
Updated
Updated 5 days ago

Readme

# dsh-local-skills

A DeepSeek Harness plugin that gives you a **local SKILL browser** in the web UI.

- **获取本地 skill** — 扫描本地目录(默认 `~/.dsh/local-skills`,可用 `skillDirs` 配置更多目录),识别目录形式的 `<name>/SKILL.md` 和扁平 `<name>.md` 两种 skill 文件(带 YAML frontmatter)。
- **实时更新** — 用 chokidar 监听这些目录,skill 新增 / 修改 / 删除后,模型目录和网页 UI 都会实时刷新。
- **在网页查看 skill** — 在 Settings(设置)里新增一个 **Skills(技能)** 页面,列出所有可用 skill 的名称、描述和适用场景。
- **使用按钮** — 每个 skill 都有「使用」按钮,点击后会告诉你**如何让模型使用这个 skill**(输入 `/name` 或直接点名 skill),并可以一键复制示例提示。

## Skill 文件格式

目录形式(推荐,可带资源文件):

```markdown
---
name: code-review
description: Review code for correctness, style, and security
whenToUse: When the user asks to review or audit a diff
# disable-model-invocation: true   # 可选:禁止模型自动调用
# user-invocable: false            # 可选:禁止用户直接调用
---

(这里是 skill 的正文说明)
```

扁平形式:直接把上面的内容保存为 `code-review.md`。

> `name` 必须是 kebab-case(小写字母、数字、连字符),如 `code-review`。

## 安装

```bash
dsh plugin --profile web add <path-to-this-package>
```

安装后重启 web:

```bash
dsh web
```

## 配置

在 web 的 Plugins 设置页(或 `cordis.patch.yml`)里配置 `local-skills`:

- `skillDirs`: 要扫描的额外目录(绝对路径或 `~` 开头的路径);留空则默认扫描 `~/.dsh/local-skills`。
- `watch`: 是否实时监听文件变化(默认 `true`)。
- `providerName`: skill 的 provider 标签(默认 `local-skills`)。

也可以在 `~/.dsh/profiles/web/cordis.patch.yml` 里覆盖:

```yaml
- id: local-skills
  config:
    skillDirs:
      - ~/my-skills
      - D:/work/skills
```

## 工作原理

- **Host 半**(`lib/index.js`):一个 `SkillProvider`,注册进 host 的 `ctx.skills` 注册表;扫描目录 + chokidar 监听 + `control.invalidate()` 实时失效。
- **Client 半**(`lib/client.js`):一个 Settings 区块,读取已有的 `skill.list` API(它会合并 host 全局与当前 preset 作用域的 skill),每 3 秒轮询一次并订阅会话切换,实现实时展示。


## 平台兼容性(web / desktop / tui / headless)

- **Host 半**(`lib/index.js`)是纯 Cordis 插件,只依赖 `ctx.skills`(由 `dsh-base` 在任何 profile 都提供),因此天然兼容 web、desktop(内嵌 Web 界面的桌面 App)、tui、headless 等任意 profile —— 只要该 profile 装了本插件 bundle 且挂了 `dsh-skill` 就会生效,缺 `skills` 服务时只是不激活、不会崩。
- **Client 半**(`lib/client.js`,`dsh.client.platform: "web"`)是浏览器 bundle,在 web 浏览器和任何以浏览器内核渲染的桌面端都会显示「设置 → 技能」页;纯终端(tui)没有浏览器 UI,不加载 client 半。
- 安装到任意 profile:`dsh plugin --profile <name> add <path>`(pnpm 需要可用),或手动把包放进 `$DSH_HOME/profiles/node_modules` 并把包名加入该 profile 的 `dsh.profile.bundles`。

```markdown
[![skills.sh](https://skills.sh/b/<owner>/<repo>)](https://skills.sh/<owner>/<repo>)
```

Install

dsh plugin --profile web add github:asakumizy/dsh-local-skills

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source