@dreanzy/dsh-skill-pack 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md ADDED
@@ -0,0 +1,75 @@
1
+ # @dreanzy/dsh-skill-pack
2
+
3
+ Per-workspace skill visibility for the DeepSeek Harness. A workspace binds exactly one pack; a pack is a named table of switches. Unbound workspaces evaluate against `default`.
4
+
5
+ **English** | [简体中文](README.md)
6
+
7
+ ## What it solves
8
+
9
+ Once you install enough skills, every request pays for the whole catalogue again: the skill directory re-enters the context, too many candidates make the model pick wrong, and one project's private capability keeps occupying space in another.
10
+
11
+ This plugin turns "which skills may the model auto-invoke right now" into a set of switches, and makes each workspace choose once:
12
+
13
+ ```
14
+ bound pack ?? default pack ?? default on
15
+ ```
16
+
17
+ `??` means the first ring that has a decision wins. A pack stores explicit decisions only: a missing key means follow, and `false` is a real value, not follow.
18
+
19
+ A batch of workspaces — say five art projects — shares one pack, and one edit applies everywhere.
20
+
21
+ ## Groups
22
+
23
+ A group declares "which items belong together"; it is not a switch by itself:
24
+
25
+ - A skill belongs to at most one group; anything unassigned is simply ungrouped.
26
+ - A pack can switch a whole group, and members added later follow that decision.
27
+ - Group definitions are shared across workspaces; renaming a group invalidates nothing.
28
+
29
+ ## Install
30
+
31
+ ```sh
32
+ dsh plugin --profile <profile> add @dreanzy/dsh-skill-pack
33
+ ```
34
+
35
+ Restart the Host and refresh the page. Two entry points: the chip at the right of the composer, and Settings → Skill Pack. The chip itself can be turned off in Settings.
36
+
37
+ ## Editing and saving
38
+
39
+ The pack and workspace pages write immediately; there is no draft. Creating, renaming, and deleting groups, and moving a skill between groups, also write immediately.
40
+
41
+ > Earlier builds had a "保存 / 撤销" draft inside the sidebar panel. It was removed together with the sidebar entry. See [docs/adr/0005-draft-and-save.md](docs/adr/0005-draft-and-save.md) (no longer applicable).
42
+
43
+ ## Interface
44
+
45
+ - Settings → Skill Pack has three pages: `分组` / `分包` / `工作区`.
46
+ - Groups fold by group; expand one to reassign members inline. Search matches both skill names and group names.
47
+ - Packs edits the pack list and the switches inside a pack. On `default` there are only on and off — it is the end of the chain, with no layer above.
48
+ - Workspaces lists directories that have sessions plus manually added paths, one pack dropdown per row.
49
+
50
+ ## Files
51
+
52
+ | Path | Contents |
53
+ | --- | --- |
54
+ | `$DSH_HOME/packs/skill/packs.json` | Pack list: item- and group-level decisions per pack, plus UI switches (chip visibility, default page) |
55
+ | `$DSH_HOME/packs/skill/groups.json` | Group definitions and membership, shared across workspaces |
56
+ | `$DSH_HOME/packs/skill/workspaces.json` | Workspace → pack bindings, plus manually added paths |
57
+
58
+ Workspace directories produce no files at all: the binding table lives in the global home, so project directories stay clean.
59
+
60
+ ## Write semantics
61
+
62
+ Every toggle submits a set of **intents** (`{key, value|null}`); the server reads, mutates, and writes under a cross-process file lock, comparing no revisions at all. Intents are idempotent and commutative, and the last writer of one key wins, so conflicts such as `stale-revision` cannot occur. `null` deletes the key, returning to follow — writing a same value is not the same thing.
63
+
64
+ See [docs/adr/0001-intent-writes.md](docs/adr/0001-intent-writes.md).
65
+
66
+ ## Known limits
67
+
68
+ - **Skills only.** Per-workspace MCP switching is out of scope; DSH offers no clean narrowing point for MCP tools. See [docs/adr/0004-skill-only-scope.md](docs/adr/0004-skill-only-scope.md).
69
+ - Changing the working directory mid-session does not re-evaluate; reopening the session restores the expected state.
70
+ - Same-layer first-wins: if another plugin registered a skill of the same name into the same layer first, that skill cannot be hidden. The panel greys it out and states the reason.
71
+ - Official `@deepseek-ai` skills are hidden from the panel by default (the rule lives in `src/inventory.ts`) but stay model-invokable; turn "显示官方技能" on to switch them individually.
72
+
73
+ ## Relationship to dsh-skill-scope
74
+
75
+ Both plugins register shadow copies into the same Agent layer, so they **cannot coexist**. Remove dsh-skill-scope first. This plugin does not read its configuration; migration is manual.
package/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # @dreanzy/dsh-skill-pack
2
+
3
+ 按工作区控制 skill 可见性的 DSH 插件。工作区只绑一个 pack,pack 是一张具名的开关表;未绑定按 `default` 求值。
4
+
5
+ [English](README.en.md) | **简体中文**
6
+
7
+ ## 它解决什么问题
8
+
9
+ 装得多之后,每一轮请求都要重新付一遍清单成本:skill 目录进上下文、候选太多让模型选错、A 项目的专用能力在 B 项目里一直占位。
10
+
11
+ 本插件把「模型此刻能自动调用哪些 skill」变成一组开关,并让工作区只做一次选择:
12
+
13
+ ```
14
+ 工作区绑定的 pack ?? default pack ?? 默认开
15
+ ```
16
+
17
+ `??` 表示「前一环有记录就不读后面的」。pack 里只存**显式决定**:键不存在就是跟随,`false` 是有效取值,不是跟随。
18
+
19
+ 同一批工作区(比如五个美术项目)共用一张 pack,改一次全部生效。
20
+
21
+ ## 分组
22
+
23
+ 分组只说明「哪些项是一类」,本身不是开关:
24
+
25
+ - 一个 skill 最多属于一个分组,未归属的就是未分组。
26
+ - pack 可以按分组设开关,组内后加入的成员自动跟随这条决定。
27
+ - 组定义跨工作区共享,改组名不影响任何 pack 里的组级决定。
28
+
29
+ ## 安装
30
+
31
+ 需要 DSH `0.2.x`(`0.2.0-rc.2` 及以上)。
32
+
33
+ **在 Web 界面安装**:设置 → 插件 → 添加插件 → 安装第三方插件,输入包名:
34
+
35
+ ```
36
+ @dreanzy/dsh-skill-pack
37
+ ```
38
+
39
+ **命令行安装**:
40
+
41
+ ```sh
42
+ dsh plugin --profile <profile> add @dreanzy/dsh-skill-pack
43
+ ```
44
+
45
+ 装完重启 Host、刷新页面。两个入口:输入框右侧的 chip,和 设置 → Skill Pack。chip 的显示可以在设置里关掉。
46
+
47
+ 从源码安装(需要 pnpm 允许该包执行构建):
48
+
49
+ ```sh
50
+ dsh plugin --profile <profile> add "github:dreanzy/dsh-plg#<sha>&path:/packages/dsh-skill-pack"
51
+ ```
52
+
53
+ ## 编辑与保存
54
+
55
+ 分包页与工作区页的每次改动即时写入,没有草稿;分组的新建、改名、删除与归属调整同样是即时写入。
56
+
57
+ > 早期版本侧栏面板有「保存 / 撤销」草稿,随侧栏入口一并移除。见 [docs/adr/0005-draft-and-save.md](docs/adr/0005-draft-and-save.md)(已不适用)。
58
+
59
+ ## 界面
60
+
61
+ - 设置 → Skill Pack 分三页:`分组` / `分包` / `工作区`。
62
+ - 「分组」按组折叠展示成员,展开后在行内改归属;搜索同时匹配技能名与分组名。
63
+ - 「分包」编辑 pack 名册与包内开关。选中「默认」时开关只有开与关——它是求值链的终点,没有上一层。
64
+ - 「工作区」列出开过会话的目录与手动添加的路径,每行一个 pack 下拉。
65
+
66
+ ## 文件
67
+
68
+ | 路径 | 内容 |
69
+ | --- | --- |
70
+ | `$DSH_HOME/packs/skill/packs.json` | pack 名册:每张 pack 的项级与组级决定,加上界面开关(是否显示 chip、默认分页) |
71
+ | `$DSH_HOME/packs/skill/groups.json` | 分组定义与成员归属,跨工作区共享 |
72
+ | `$DSH_HOME/packs/skill/workspaces.json` | 工作区 → pack 的绑定,以及手动添加的路径 |
73
+
74
+ 工作区目录不再产生任何文件:绑定表放在全局,工程目录保持干净。
75
+
76
+ ## 写入语义
77
+
78
+ 每一次开关提交的是一组**意图**(`{键, 值|null}`),服务端在文件锁内读—改—写,不比对任何版本。命令幂等、可交换,写同一键即后点者赢,因此不存在 `stale-revision` 这类冲突。`null` 表示删掉这条键、回到跟随——写一个同值不等于跟随。
79
+
80
+ 详见 [docs/adr/0001-intent-writes.md](docs/adr/0001-intent-writes.md)。
81
+
82
+ ## 已知边界
83
+
84
+ - **只管 skill**。MCP 的按工作区开关不在本包范围(MCP 一侧在 DSH 里没有干净的收窄点)。见 [docs/adr/0004-skill-only-scope.md](docs/adr/0004-skill-only-scope.md)。
85
+ - 会话中途切换工作目录不会重算策略,重开会话即恢复。
86
+ - 同层 first-wins:若别的插件先把同名 skill 注册进同一层,那条关不掉,面板会在该行标出「关不掉」。
87
+ - 官方 `@deepseek-ai` 技能默认不在面板出现(判定见 `src/inventory.ts`),但模型仍可调用;打开「显示官方技能」后可逐项关闭。
88
+
89
+ ## 与 dsh-skill-scope 的关系
90
+
91
+ 两者都往 Agent 同层注册遮蔽副本,**不能共存**,装本插件前请卸载它。本插件不读它的配置,迁移需要手动重配。