Skip to content
dsh.fish
Bundle

dsh-skill-editor

dsh-skill-editor: edit skill SKILL.md content (body + name/description) right from the DSH web Settings page. Local skills edit freely; bundled / built-in skills are read-only with a warning.

Source
bosinHU
License
MIT
Updated
Updated 5 days ago

Readme

# dsh-skill-editor

<p align="center">
  <img alt="license" src="https://img.shields.io/badge/license-MIT-green.svg">
  <img alt="dsh" src="https://img.shields.io/badge/dsh-plugin-web-blue.svg">
  <img alt="node" src="https://img.shields.io/badge/node-%3E%3D18-339933.svg">
  <img alt="platform" src="https://img.shields.io/badge/platform-web-brightgreen.svg">
</p>

在 dsh Web 设置页直接编辑 skill 的 `SKILL.md`(简介 + 正文),保存即写回磁盘、无需重启。一个独立、轻量、纯 `node:fs` 实现的 dsh 插件。
本项目所有代码由dsh完成,本人完全不会编程
## ✨ 特性

- **设置页即编即改**:`设置 → 技能编辑器`,列出所有技能,点开即可编辑。
- **安全分级(防手滑)**:
  - **本地技能**(`~/.dsh/skills`、`~/.agents/skills`、工作区 `.dsh/skills`):可编辑保存。
  - **系统/内置技能**(bundled / 插件内嵌):只读,显示风险提示。
- **保存即写盘**:写回 `SKILL.md`,技能热加载,刷新即生效。
- **只动正文 + name/description**:不碰其它 frontmatter 字段,原样保留。
- **零第三方依赖的读写逻辑**:用 `node:fs` 直接操作明文文件,不依赖任何 skill 插件内部实现,升级不失效。
- **可独立回滚**:删除本插件即可完全移除,不影响其它功能。

## 📦 安装

```bash
# 从 npm 安装(推荐,与 1024 Store 同源)
dsh plugin --profile web add dsh-skill-editor
# 或直接从 GitHub 仓库安装
dsh plugin --profile web add https://github.com/bosinHU/dsh-skill-editor
```

npm 包:[dsh-skill-editor@0.1.0](https://www.npmjs.com/package/dsh-skill-editor)(MIT)

> 本插件在 `dsh.client.platform: web` 下自动注入,无需手动改 `cordis.patch.yml`。

安装后重启 web 服务(`dsh --profile web`),刷新页面,设置页即出现「技能编辑器」。

## 🚀 使用

1. 进入 dsh Web 设置 →「技能编辑器」。
2. 展开某个技能,编辑 `description` 或正文(`SKILL.md` 中 `---` 分隔线之后的部分)。
3. 点击「保存」,内容立即写回磁盘。

## 🖼️ 界面预览

> 图为 dsh Web 设置页「技能编辑器」的真实界面:左侧为设置导航,右侧列出全部技能(`全局`/`内置`),展开后可编辑 `name`、`description` 与正文(`SKILL.md`)。

![技能编辑器真实界面](./interface-preview.png)

## 🗂️ 项目结构

```
dsh-skill-editor/
├── package.json        # 包声明(dsh.client / dsh.bundle.patch)
├── cordis.patch.yml    # bundle patch(注册 host 插件)
├── lib/
│   ├── index.js        # host:skillEditor 远程服务(list/content/saveContent)
│   └── client.js       # client:设置页「技能编辑器」UI
├── README.md
└── LICENSE
```

## 🧠 技术细节(typert 协议)

- host 端 `lib/index.js` 的 `MANIFEST` 中,每个参数都带 `codec` 字段(新版 typert 强制要求):
  - 标量参数(`name` / `sessionId`)用 `codec: { mode: "src-json" }`;
  - 对象参数(`payload`)用 `codec: { mode: "strict", typeSymbol: "...", schema }`。
- `apply(ctx)` 里显式调用 `ctx.typert.register(MANIFEST)`,否则前端 `remote.skillEditor` 连不上后端。

## ❓ 常见问题

**Q: 保存后要重启 dsh 吗?**
不需要,技能是热加载的,刷新页面即可生效。

**Q: 系统/内置技能为什么不能改?**
防止误改内置技能导致 dsh 异常。如需修改,请在本地 `~/.dsh/skills` 下新建同名技能,或改用本地副本。

## 📄 License

[MIT](./LICENSE) © 2025 [bosinHU](https://github.com/bosinHU)

---

所有代码内容由 dsh 自主完成。

Install

dsh plugin --profile web add github:bosinHU/dsh-skill-editor

Profile: web

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