dsh-lean-router 1.0.9 → 2.0.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.
Files changed (148) hide show
  1. package/NOTICE.md +2 -4
  2. package/README.en.md +47 -43
  3. package/README.md +45 -41
  4. package/cordis.patch.yml +4 -26
  5. package/docs/agents/domain.md +1 -1
  6. package/docs/architecture.en.md +51 -86
  7. package/docs/architecture.md +46 -77
  8. package/docs/changelog.en.md +32 -1
  9. package/docs/changelog.md +32 -1
  10. package/docs/configuration.en.md +25 -56
  11. package/docs/configuration.md +14 -45
  12. package/docs/install.en.md +2 -2
  13. package/docs/install.md +2 -2
  14. package/docs/quickstart.en.md +29 -34
  15. package/docs/quickstart.md +11 -16
  16. package/docs/release-checklist.en.md +3 -4
  17. package/docs/release-checklist.md +5 -6
  18. package/docs//350/267/257/347/224/261-/350/256/276/350/256/241/350/257/264/346/230/216.md +2 -2
  19. package/lib/index.js +9 -61
  20. package/lib/router.js +15 -148
  21. package/package.json +4 -15
  22. package/presets/base/frag-lean.patch.yml +1 -5
  23. package/presets/base/frag-preset.patch.yml +1 -3
  24. package/presets/base/frag-router.patch.yml +1 -12
  25. package/presets/base/frag-toolface.patch.yml +0 -2
  26. package/presets/base/lean-router.patch.yml +1 -4
  27. package/scripts/doctor.mjs +15 -10
  28. package/test/integration-preset.test.mjs +4 -3
  29. package/test/plugin-entry.test.mjs +15 -50
  30. package/test/router.test.mjs +7 -47
  31. package/assets/gating.weights.json +0 -13
  32. package/assets/skills/ask-matt/PHASE-BOUNDARIES.md +0 -55
  33. package/assets/skills/ask-matt/SKILL.md +0 -80
  34. package/assets/skills/ask-matt/agents/openai.yaml +0 -5
  35. package/assets/skills/chief-of-staff/SKILL.md +0 -76
  36. package/assets/skills/chief-of-staff/agents/openai.yaml +0 -5
  37. package/assets/skills/code-review/SKILL.md +0 -91
  38. package/assets/skills/code-review/agents/openai.yaml +0 -5
  39. package/assets/skills/codebase-design/DEEPENING.md +0 -37
  40. package/assets/skills/codebase-design/DESIGN-IT-TWICE.md +0 -44
  41. package/assets/skills/codebase-design/SKILL.md +0 -116
  42. package/assets/skills/codebase-design/agents/openai.yaml +0 -5
  43. package/assets/skills/diagnosing-bugs/SKILL.md +0 -140
  44. package/assets/skills/diagnosing-bugs/agents/openai.yaml +0 -5
  45. package/assets/skills/diagnosing-bugs/scripts/hitl-loop.template.sh +0 -44
  46. package/assets/skills/domain-modeling/ADR-FORMAT.md +0 -47
  47. package/assets/skills/domain-modeling/GLOSSARY-FORMAT.md +0 -60
  48. package/assets/skills/domain-modeling/SKILL.md +0 -76
  49. package/assets/skills/domain-modeling/agents/openai.yaml +0 -5
  50. package/assets/skills/grilling/SKILL.md +0 -52
  51. package/assets/skills/grilling/agents/openai.yaml +0 -5
  52. package/assets/skills/handoff/SKILL.md +0 -17
  53. package/assets/skills/handoff/agents/openai.yaml +0 -5
  54. package/assets/skills/implement/SKILL.md +0 -55
  55. package/assets/skills/implement/agents/openai.yaml +0 -5
  56. package/assets/skills/improve-codebase-architecture/HTML-REPORT.md +0 -123
  57. package/assets/skills/improve-codebase-architecture/SKILL.md +0 -72
  58. package/assets/skills/improve-codebase-architecture/agents/openai.yaml +0 -5
  59. package/assets/skills/loop-me/SKILL.md +0 -33
  60. package/assets/skills/loop-me/agents/openai.yaml +0 -5
  61. package/assets/skills/pr/CREDITS.md +0 -3
  62. package/assets/skills/pr/SKILL.md +0 -172
  63. package/assets/skills/pr/agents/openai.yaml +0 -5
  64. package/assets/skills/prototype/LOGIC.md +0 -67
  65. package/assets/skills/prototype/SKILL.md +0 -28
  66. package/assets/skills/prototype/UI.md +0 -112
  67. package/assets/skills/prototype/agents/openai.yaml +0 -5
  68. package/assets/skills/research/SKILL.md +0 -14
  69. package/assets/skills/research/agents/openai.yaml +0 -5
  70. package/assets/skills/retro/SKILL.md +0 -45
  71. package/assets/skills/retro/agents/openai.yaml +0 -5
  72. package/assets/skills/setup-matt-pocock-skills/SKILL.md +0 -121
  73. package/assets/skills/setup-matt-pocock-skills/agents/openai.yaml +0 -5
  74. package/assets/skills/setup-matt-pocock-skills/domain.md +0 -51
  75. package/assets/skills/setup-matt-pocock-skills/issue-tracker-github.md +0 -50
  76. package/assets/skills/setup-matt-pocock-skills/issue-tracker-gitlab.md +0 -46
  77. package/assets/skills/setup-matt-pocock-skills/issue-tracker-local.md +0 -30
  78. package/assets/skills/setup-matt-pocock-skills/triage-labels.md +0 -15
  79. package/assets/skills/setup-ts-deep-modules/SKILL.md +0 -103
  80. package/assets/skills/setup-ts-deep-modules/agents/openai.yaml +0 -5
  81. package/assets/skills/setup-ts-deep-modules/dependency-cruiser.config.cjs +0 -95
  82. package/assets/skills/software-factory/EXAMPLE-TASKS.md +0 -80
  83. package/assets/skills/software-factory/GIT-HOSTS.md +0 -84
  84. package/assets/skills/software-factory/OBSERVABILITY-PLATFORMS.md +0 -75
  85. package/assets/skills/software-factory/RUNNERS.md +0 -94
  86. package/assets/skills/software-factory/SKILL.md +0 -99
  87. package/assets/skills/software-factory/TICKET-TRACKERS.md +0 -85
  88. package/assets/skills/tdd/SKILL.md +0 -40
  89. package/assets/skills/tdd/agents/openai.yaml +0 -5
  90. package/assets/skills/tdd/mocking.md +0 -59
  91. package/assets/skills/tdd/tests.md +0 -77
  92. package/assets/skills/teach/GLOSSARY-FORMAT.md +0 -35
  93. package/assets/skills/teach/LEARNING-RECORD-FORMAT.md +0 -46
  94. package/assets/skills/teach/MISSION-FORMAT.md +0 -31
  95. package/assets/skills/teach/RESOURCES-FORMAT.md +0 -32
  96. package/assets/skills/teach/SKILL.md +0 -141
  97. package/assets/skills/teach/agents/openai.yaml +0 -5
  98. package/assets/skills/to-questionnaire/SKILL.md +0 -55
  99. package/assets/skills/to-questionnaire/agents/openai.yaml +0 -5
  100. package/assets/skills/to-spec/SKILL.md +0 -76
  101. package/assets/skills/to-spec/agents/openai.yaml +0 -5
  102. package/assets/skills/to-tickets/SKILL.md +0 -106
  103. package/assets/skills/to-tickets/agents/openai.yaml +0 -5
  104. package/assets/skills/triage/AGENT-BRIEF.md +0 -207
  105. package/assets/skills/triage/OUT-OF-SCOPE.md +0 -105
  106. package/assets/skills/triage/SKILL.md +0 -113
  107. package/assets/skills/triage/agents/openai.yaml +0 -5
  108. package/assets/skills/wait-what/SKILL.md +0 -8
  109. package/assets/skills/wait-what/agents/openai.yaml +0 -5
  110. package/assets/skills/wayfinder/SKILL.md +0 -129
  111. package/assets/skills/wayfinder/agents/openai.yaml +0 -5
  112. package/assets/skills/wizard/SKILL.md +0 -46
  113. package/assets/skills/wizard/agents/openai.yaml +0 -5
  114. package/assets/skills/wizard/template.sh +0 -223
  115. package/assets/skills/writing-beats/SKILL.md +0 -44
  116. package/assets/skills/writing-beats/agents/openai.yaml +0 -5
  117. package/assets/skills/writing-for-agents/SKILL-MECHANICS.md +0 -22
  118. package/assets/skills/writing-for-agents/SKILL.md +0 -83
  119. package/assets/skills/writing-for-agents/agents/openai.yaml +0 -5
  120. package/assets/skills/writing-fragments/SKILL.md +0 -80
  121. package/assets/skills/writing-fragments/agents/openai.yaml +0 -5
  122. package/assets/skills/writing-shape/SKILL.md +0 -59
  123. package/assets/skills/writing-shape/agents/openai.yaml +0 -5
  124. package/assets/skills.matrix.json +0 -311
  125. package/docs/HANDOFF-2026-11-22.md +0 -155
  126. package/docs/matrix.en.md +0 -57
  127. package/docs/matrix.md +0 -57
  128. package/docs//346/212/200/350/203/275/351/227/250/346/216/247-/350/256/276/350/256/241/350/257/264/346/230/216.md +0 -134
  129. package/docs//351/235/242/346/235/277-/350/256/276/350/256/241/350/257/264/346/230/216.md +0 -205
  130. package/lib/audit-commands.js +0 -289
  131. package/lib/audit-sink.js +0 -137
  132. package/lib/client.js +0 -276
  133. package/lib/gate-runner.js +0 -179
  134. package/lib/skill-provider.js +0 -167
  135. package/lib/skillgate.js +0 -396
  136. package/lib/skills-panel.js +0 -322
  137. package/scripts/check-drift.mjs +0 -24
  138. package/skills.manifest.json +0 -287
  139. package/test/audit-commands.test.mjs +0 -325
  140. package/test/audit-sink.test.mjs +0 -150
  141. package/test/client-plugin.test.mjs +0 -123
  142. package/test/gate-run.test.mjs +0 -173
  143. package/test/manifest.test.mjs +0 -25
  144. package/test/provider.test.mjs +0 -21
  145. package/test/skillgate-provider.test.mjs +0 -122
  146. package/test/skillgate.test.mjs +0 -217
  147. package/test/skills-panel.test.mjs +0 -114
  148. package/ui/go.json +0 -19
@@ -1,311 +0,0 @@
1
- {
2
- "_meta": {
3
- "decided_at": "2026-11-20T13:26:44.272Z",
4
- "decided_by": "主人逐条拍板(ask_user_question,6 批 33 题)",
5
- "source": "~/.dsh/skills(31 个 mattpocock 技能;pptx=宿主 office 自带、_shared=共享素材,不进矩阵)",
6
- "keywords_policy": "先空着,实测后再填",
7
- "counts": {
8
- "both": 13,
9
- "modelOnly": 10,
10
- "userOnly": 8
11
- }
12
- },
13
- "skills": [
14
- {
15
- "name": "ask-matt",
16
- "dir": "ask-matt",
17
- "model": false,
18
- "user": true,
19
- "scenario": "meta",
20
- "scenarioZh": "元交互·路由",
21
- "keywords": [],
22
- "note": "技能路由器与本插件路由层重叠,主人点名才用"
23
- },
24
- {
25
- "name": "chief-of-staff",
26
- "dir": "chief-of-staff",
27
- "model": true,
28
- "user": true,
29
- "scenario": "process",
30
- "scenarioZh": "流程·统筹",
31
- "keywords": []
32
- },
33
- {
34
- "name": "code-review",
35
- "dir": "code-review",
36
- "model": true,
37
- "user": true,
38
- "scenario": "engineering",
39
- "scenarioZh": "工程·评审",
40
- "keywords": []
41
- },
42
- {
43
- "name": "codebase-design",
44
- "dir": "codebase-design",
45
- "model": true,
46
- "user": true,
47
- "scenario": "engineering",
48
- "scenarioZh": "工程·设计",
49
- "keywords": []
50
- },
51
- {
52
- "name": "diagnosing-bugs",
53
- "dir": "diagnosing-bugs",
54
- "model": true,
55
- "user": false,
56
- "scenario": "engineering",
57
- "scenarioZh": "工程·诊断",
58
- "keywords": [],
59
- "note": "主人选仅模型"
60
- },
61
- {
62
- "name": "domain-modeling",
63
- "dir": "domain-modeling",
64
- "model": true,
65
- "user": false,
66
- "scenario": "engineering",
67
- "scenarioZh": "工程·建模",
68
- "keywords": [],
69
- "note": "主人选仅模型"
70
- },
71
- {
72
- "name": "grilling",
73
- "dir": "grilling",
74
- "model": false,
75
- "user": true,
76
- "scenario": "meta",
77
- "scenarioZh": "元交互·审讯",
78
- "keywords": [],
79
- "note": "重交互,主人点名才用"
80
- },
81
- {
82
- "name": "handoff",
83
- "dir": "handoff",
84
- "model": true,
85
- "user": true,
86
- "scenario": "process",
87
- "scenarioZh": "流程·交接",
88
- "keywords": []
89
- },
90
- {
91
- "name": "implement",
92
- "dir": "implement",
93
- "model": true,
94
- "user": true,
95
- "scenario": "engineering",
96
- "scenarioZh": "工程·实现",
97
- "keywords": []
98
- },
99
- {
100
- "name": "improve-codebase-architecture",
101
- "dir": "improve-codebase-architecture",
102
- "model": true,
103
- "user": true,
104
- "scenario": "engineering",
105
- "scenarioZh": "工程·体检",
106
- "keywords": []
107
- },
108
- {
109
- "name": "loop-me",
110
- "dir": "loop-me",
111
- "model": false,
112
- "user": true,
113
- "scenario": "meta",
114
- "scenarioZh": "元交互·工作流",
115
- "keywords": [],
116
- "note": "重交互,主人点名才用"
117
- },
118
- {
119
- "name": "pr",
120
- "dir": "pr",
121
- "model": true,
122
- "user": true,
123
- "scenario": "process",
124
- "scenarioZh": "流程·PR",
125
- "keywords": []
126
- },
127
- {
128
- "name": "prototype",
129
- "dir": "prototype",
130
- "model": false,
131
- "user": true,
132
- "scenario": "engineering",
133
- "scenarioZh": "工程·原型",
134
- "keywords": [],
135
- "note": "主人选仅手动"
136
- },
137
- {
138
- "name": "research",
139
- "dir": "research",
140
- "model": true,
141
- "user": true,
142
- "scenario": "research",
143
- "scenarioZh": "调研·取证",
144
- "keywords": []
145
- },
146
- {
147
- "name": "retro",
148
- "dir": "retro",
149
- "model": false,
150
- "user": true,
151
- "scenario": "process",
152
- "scenarioZh": "流程·复盘",
153
- "keywords": [],
154
- "note": "主人选仅手动"
155
- },
156
- {
157
- "name": "setup-matt-pocock-skills",
158
- "dir": "setup-matt-pocock-skills",
159
- "model": true,
160
- "user": false,
161
- "scenario": "setup",
162
- "scenarioZh": "配置·初始化",
163
- "keywords": [],
164
- "note": "主人理由:会话开始即在,仅模型"
165
- },
166
- {
167
- "name": "setup-ts-deep-modules",
168
- "dir": "setup-ts-deep-modules",
169
- "model": true,
170
- "user": false,
171
- "scenario": "engineering",
172
- "scenarioZh": "工程·配置",
173
- "keywords": [],
174
- "note": "主人选仅模型"
175
- },
176
- {
177
- "name": "software-factory",
178
- "dir": "software-factory",
179
- "model": true,
180
- "user": false,
181
- "scenario": "process",
182
- "scenarioZh": "流程·工厂",
183
- "keywords": [],
184
- "note": "主人选仅模型"
185
- },
186
- {
187
- "name": "tdd",
188
- "dir": "tdd",
189
- "model": true,
190
- "user": false,
191
- "scenario": "engineering",
192
- "scenarioZh": "工程·测试",
193
- "keywords": [],
194
- "note": "主人选仅模型"
195
- },
196
- {
197
- "name": "teach",
198
- "dir": "teach",
199
- "model": false,
200
- "user": true,
201
- "scenario": "teaching",
202
- "scenarioZh": "教学",
203
- "keywords": [],
204
- "note": "主人选仅手动"
205
- },
206
- {
207
- "name": "to-questionnaire",
208
- "dir": "to-questionnaire",
209
- "model": true,
210
- "user": false,
211
- "scenario": "process",
212
- "scenarioZh": "流程·问卷",
213
- "keywords": [],
214
- "note": "主人选仅模型"
215
- },
216
- {
217
- "name": "to-spec",
218
- "dir": "to-spec",
219
- "model": true,
220
- "user": true,
221
- "scenario": "process",
222
- "scenarioZh": "流程·定稿",
223
- "keywords": []
224
- },
225
- {
226
- "name": "to-tickets",
227
- "dir": "to-tickets",
228
- "model": true,
229
- "user": true,
230
- "scenario": "process",
231
- "scenarioZh": "流程·拆票",
232
- "keywords": []
233
- },
234
- {
235
- "name": "triage",
236
- "dir": "triage",
237
- "model": true,
238
- "user": true,
239
- "scenario": "process",
240
- "scenarioZh": "流程·分诊",
241
- "keywords": []
242
- },
243
- {
244
- "name": "wait-what",
245
- "dir": "wait-what",
246
- "model": false,
247
- "user": true,
248
- "scenario": "meta",
249
- "scenarioZh": "元交互·打断",
250
- "keywords": [],
251
- "note": "主人选仅手动"
252
- },
253
- {
254
- "name": "wayfinder",
255
- "dir": "wayfinder",
256
- "model": true,
257
- "user": true,
258
- "scenario": "process",
259
- "scenarioZh": "流程·大规划",
260
- "keywords": []
261
- },
262
- {
263
- "name": "wizard",
264
- "dir": "wizard",
265
- "model": false,
266
- "user": true,
267
- "scenario": "process",
268
- "scenarioZh": "流程·向导",
269
- "keywords": [],
270
- "note": "主人选仅手动"
271
- },
272
- {
273
- "name": "writing-beats",
274
- "dir": "writing-beats",
275
- "model": true,
276
- "user": true,
277
- "scenario": "writing",
278
- "scenarioZh": "写作·成稿",
279
- "keywords": []
280
- },
281
- {
282
- "name": "writing-for-agents",
283
- "dir": "writing-for-agents",
284
- "model": true,
285
- "user": false,
286
- "scenario": "writing",
287
- "scenarioZh": "写作·技能文档",
288
- "keywords": [],
289
- "note": "主人选仅模型"
290
- },
291
- {
292
- "name": "writing-fragments",
293
- "dir": "writing-fragments",
294
- "model": true,
295
- "user": false,
296
- "scenario": "writing",
297
- "scenarioZh": "写作·碎片",
298
- "keywords": [],
299
- "note": "主人选仅模型"
300
- },
301
- {
302
- "name": "writing-shape",
303
- "dir": "writing-shape",
304
- "model": true,
305
- "user": false,
306
- "scenario": "writing",
307
- "scenarioZh": "写作·打磨",
308
- "keywords": []
309
- }
310
- ]
311
- }
@@ -1,155 +0,0 @@
1
- # 交接:dsh-lean-router(技能面板 B 路进行中)
2
-
3
- 日期:2026-11-22 | 仓库:`D:\Agent Workspace\dsh-lean-router`(branch main)
4
-
5
- ## 一句话现状
6
-
7
- 1.0.4 **已发布到 npm 并装进用户 dsh**(`/band` 可视化改造 + 技能面板阶段 1 客户端骨架);**正等用户重启验证顶栏「技能」按钮**。
8
-
9
- ## 立即要做的(下个会话第一件事)
10
-
11
- **问用户:重启 dsh 后,顶栏右侧有没有出现「技能」按钮,点了会不会弹出「技能面板 · 骨架」。**
12
-
13
- - 出现 → 阶段 1 成功,直接进阶段 2(接 31 技能真实数据)
14
- - 没出现 → 查客户端加载日志;重点怀疑 `dsh.client` 扫描是否覆盖到本包
15
- - 白屏/报错 → **立刻回滚**(见文末「回滚」),再用更小的步子重试
16
-
17
- ## 已完成
18
-
19
- ### A. /band 可视化改造(1.0.4,已发布 npm)
20
-
21
- 按用户三选定的样式改完,实机预览已确认:
22
-
23
- ```
24
- ▲ react · 已按首条消息分类,关键词不再改带 · 可选 spec / react / weak
25
-
26
- | 档位 | 定位 | 工具面 |
27
- |---|---|---|
28
- | auto | 按首条用户消息自动分类 | — |
29
- | spec | 先查后改(读优先) | 窄 |
30
- | **▲ react** | 直接产出(写优先) | 宽 |
31
- | weak | 交给模型自判 | 窄 |
32
-
33
- 最近一次自动分类:react(build 词 6 · fix 词 0;命中 写一个、游戏、从零)
34
- 用法:/band spec | react | weak | auto · /band react task=发布 MVP · /band help
35
- ```
36
-
37
- 改动点:
38
- - `lib/bands.js`:新增 `explainClassification(text)` → `{band, reactHits, specHits, signals}`;`classifyTask` 变成它的薄封装(分类结果与 1.0.3 逐字符一致)
39
- - `lib/router.js`:state 增加 `manual`(手动指定 vs 自动分类)与 `last`(最近一次关键词分类结果);`/band` 无参 = `/band help` 输出状态面板;改档确认 = `▲ x · 已切换`
40
- - `test/router.test.mjs`:断言升级为「第一行是状态 / 有三带表格 / 当前档位粗体 ▲ / 无消息时明确说明」
41
- - 版本与文档 bump 到 1.0.4(package.json、README 双语、changelog 双语、quickstart 双语)
42
- - `npm run verify` PASS,`npm test` 203/202 pass/0 fail/1 skip
43
-
44
- ### B. 技能面板:阶段 1 客户端骨架(提交 `0b1fc3e`)
45
-
46
- - 新增 `lib/client.js`(约 4.3KB):顶栏「技能」按钮 + 用 `ReactDOM.createPortal` 挂到 body 的全屏浮层
47
- - `package.json`:加 `dsh.client = { platform: "web" }` 与 `exports["./client"] = { default: "./lib/client.js" }`
48
- - 离线验证全过:`node --check` 通过;用假 `__ModuleLoader__` + fake react 跑通「load 被调用 → factory 返回 apply → 注册到 `conversation.session.header.utilities` → 组件可渲染」
49
- - **通过 npm 正式安装**:`dsh plugin --profile desktop add npm:dsh-lean-router@1.0.4`(exit 0,1.0.3 → 1.0.4);已安装副本核对:`dsh.client` ✓、`exports['./client']` ✓、`lib/client.js` 4295B ✓、patch 无 `ptc-runtime` ✓
50
- - ⚠️ 早期手工部署时的备份 `package.json.orig-1.0.3` **已被 npm 安装清掉**,别再指望它
51
-
52
- ## 阻塞项
53
-
54
- ### ~~1. npm 发布 403~~(已解决)
55
-
56
- 旧的 granular token 能 `whoami` 但无发布所需的 2FA bypass 权限 → `npm publish` 403。用户提供了一个新的 granular token 后**发布成功**(exit 0,75 秒后 registry 可下载)。注意:那个 token 已出现在对话记录里,**用户被建议去 npmjs.com 撤销**;下次发布若再 403,须在生成 token 时勾上「Bypass two-factor authentication」。
57
-
58
- ### 2. 阶段 1 真机验证(等用户重启)
59
-
60
- ## 技能面板方案(已与用户拍板)
61
-
62
- 用户明确要求:**不要侧边栏、不要命令输出,要独立面板** → 选 B 路「dsh 内置 tab/浮层面板」,接受 2–3 天成本。
63
-
64
- 阶段划分(每阶段单独验收):
65
-
66
- | 阶段 | 内容 | 验收 | 状态 |
67
- |---|---|---|---|
68
- | 1 | 客户端插件骨架(按钮 + 空面板) | 重启后能看到按钮与面板 | 代码完成,**等用户重启验证** |
69
- | 2 | 数据通道:31 技能 + 审计统计 | 面板里看到 31 个技能名 | 未开始 |
70
- | 3 | 面板 UI:分组表 + 开关 + 命中分 + 历史统计 + 6 条工作流 | 可日常使用 | 未开始 |
71
-
72
- 面板必须显示的四类信息(用户点名):31 技能清单+功能说明、每个技能开关(model/user/关闭)、本轮/最近命中分与依据、历史命中统计(哪些从没用过)。
73
-
74
- ### 已确认的 6 套一键工作流
75
-
76
- | 名字 | 技能序列 |
77
- |---|---|
78
- | 审查 review | code-review → grilling |
79
- | 提质 harden | improve-codebase-architecture → codebase-design → domain-modeling |
80
- | 修 bug fix | diagnosing-bugs → tdd → code-review |
81
- | 计划 plan | grilling → to-spec → to-tickets |
82
- | 开工 build | implement → tdd → code-review → pr |
83
- | 复盘 retro | retro(会话级) |
84
-
85
- ## 客户端插件技术契约(本次逆向所得,别重新踩)
86
-
87
- - 入口文件 `lib/client.js`,形式:`window.__ModuleLoader__.load({ id: "包名", factory: (require) => { ... return { apply } } })`
88
- - `factory(require)` 里的 `require` 取**宿主提供的模块**:`react`、`react-dom`、`react/jsx-runtime`、`@deepseek-ai/dsh-client-ui-primitives` 等;插件自身依赖不打包
89
- - 插件导出 `{ apply, inject }`(cordis 形);`apply` 可为 generator,`yield` 的 effect 卸载时自动回收
90
- - UI 注册:`ctx.slots.register({ name, id, order }, Component)`;另有 `ctx.inject(slotName, () => ctx.register({...}, C))` 写法(dsh-cost-meter 用后者)
91
- - 正文视图 API 另有一条:`ctx.uiConversation.views.register({ target, ... })`(dsh-client-ui-trajectory 用),但它是会话事件流视图,静态面板不建议走
92
- - 加载条件:`dsh-client-modules` 扫描**宿主 Loader entries** 中声明了 `dsh.client` 的包,且要求 `exports["./client"]` 存在,否则抛「client bundle not found; run `pnpm run build` before launch」
93
- - 参考实现(npm 安装目录里可反编译看):`dsh-cost-meter`、`dsh-ops`、`dsh-smooth-stream`
94
-
95
- ### 可用的非侧边栏 slot(已枚举 614 个中的关键几个)
96
-
97
- - `conversation.session.header.utilities` ← 顶栏工具区(当前阶段 1 用它)
98
- - `conversation.input.overlay` ← 输入框上方浮层(官方 `/` 命令面板同位置)
99
- - `shell.overlay` ← 全屏遮罩层
100
- - `conversation.chat.turnTail` ← 每条回答下方
101
- - `settings.section` ← 设置页分区
102
- - `conversation.session.header.views.actions` ← 正文 tab 切换区
103
-
104
- ## 数据通路(阶段 2 直接用)
105
-
106
- - 技能目录:`ctx.skills.list({ scope: agent })`(宿主侧)→ 含 name/description/invocation
107
- - 技能开关与中文分类:`assets/skills.matrix.json`(`_meta` + `skills[]`,每项有 `model`/`user`/`scenario`/`scenarioZh`/`note`;计数 13 both / 10 modelOnly / 8 userOnly)
108
- - 最近一轮命中:`getAuditChannel().entries()`(内存环形 256 条,每条形如 `{seq, kind:"skillgate-round", scores, decision, band, complex}`)
109
- - 历史统计:审计 JSONL 落盘,读法见 `lib/audit-sink.js` 的 `readAuditEntries`,`lib/audit-commands.js` 已用它做 `/lean-audit stats`
110
- - **审计已开启**:`cordis.patch.yml:585` 是 `audit: true`,所以面板一开始就有真实数据(用户特意要求确认这点)
111
-
112
- ## 关键文件
113
-
114
- - `lib/router.js`:`/band` `/skill` `/lean-audit` 注册与实现;`capture`(状态机)、`guideTextFor`(近场文本)
115
- - `lib/bands.js`:三带配置表、关键词词表、`classifyTask`/`explainClassification`、`parseRouterDirective`
116
- - `lib/skillgate.js`:打分/分档/裁决/软降/审计通道(`createAuditChannel`、`getAuditChannel`、`round`)
117
- - `lib/gate-runner.js`:每轮门控接线(`gate: true` 才创建)
118
- - `lib/client.js`:**新增**,客户端插件
119
- - `cordis.patch.yml`:装配产物(`presets/base/*.yml` + `scripts/integrate-preset.mjs` 生成,勿手改)
120
- - `assets/skills.matrix.json`:31 技能开关与场景
121
- - `assets/skills/`:31 个技能目录(frontmatter 里有英文 description)
122
-
123
- ## 陷阱与教训(都是这轮真实踩过的)
124
-
125
- 1. **preset 的 plugins 里绝不能挂宿主层服务插件**(如 `ptc-runtime`)——preset 在独立 scope 激活,重复挂载会让整条 preset 注册失败、从预设列表消失(1.0.3 事故)
126
- 2. **cordis 插件的 apply 不能返回普通对象**——返回值必须是 dispose 函数 / null / undefined / thenable,否则真宿主报 `Invalid effect`(1.0.2 事故)
127
- 3. **`dsh plugin add` 会做 overlay 校验**,YAML 缩进错会让整个安装回滚
128
- 4. **别信 CI 全绿**:模块测试与真机装配是两件事,上述两次事故 CI 都绿
129
- 5. **`ui/go.json` 不是 dsh 原生机制**——它是给第三方 dsh-Go 用的,而用户环境**没装 dsh-Go**(`@stardustlc` 是空目录),别指望它渲染面板
130
- 6. **`propose_action`(个性化页面)在本会话工具面里不存在**——虽然 `dsh-personalized-recommendations` 已装且工具真实存在,但没暴露出来,所以官方「页面卡片」通道走不通
131
- 7. **npm 发布**:默认 registry 是 npmmirror(只读),必须 `--registry=https://registry.npmjs.org`
132
- 8. 在 PowerShell 里重定向 YAML 用 `Out-File -Encoding utf8`(`*>` 会写 UTF-16,js-yaml 报 null byte)
133
-
134
- ## 回滚(客户端插件出问题时)
135
-
136
- ```powershell
137
- # 装回上一个可用版本(现在是唯一可靠的回滚路径)
138
- & "D:\Deepseek Harness\resources\runtime\cli\bin\dsh.cmd" plugin --profile desktop add npm:dsh-lean-router@1.0.3
139
- ```
140
- 仓库侧:`git revert 0b1fc3e`(客户端骨架)或 `git revert 2aad876`(/band 改造)。改完重启 dsh。
141
-
142
- ## 用户偏好(务必遵守)
143
-
144
- - **先说结果,再解释**;中文;称呼「主人」
145
- - **不确定就问**,每次提问用 `ask_user_question`(可批量、timeoutMs 给足)——用户明确说「试错的成本远远比问问题大」
146
- - 讨厌「要展开才看得清」的 UI,喜欢一眼看清、可视化优先
147
- - 系统侧操作(启动项、安装等)由助手代劳,不让用户手抄命令;但**涉及密码/2FA 必须用户本人**
148
- - 长任务要分阶段通报,不要攒到最后
149
-
150
- ## 建议下个会话加载的技能
151
-
152
- - `/handoff` — 再次交接时用
153
- - `/ds-plan-loop` — 阶段 2/3 是多文件改造,先出带验收的编号计划
154
- - `/ds-verify-loop` — 每次改客户端插件后跑最窄的真检查(离线 harness + 重启验证)
155
- - `/ds-blast-radius` — 改 `lib/router.js` / `package.json` 前评估影响面
package/docs/matrix.en.md DELETED
@@ -1,57 +0,0 @@
1
- # Skill matrix
2
-
3
- > The model/user invocation matrix for the 31 mattpocock skills; source of truth is `assets/skills.matrix.json` (decided by the owner item by item: 6 batches, 33 questions, decided_at 2026-11-20). Chinese original: [matrix.md](./matrix.md).
4
-
5
- ## Sources and how to read it
6
-
7
- - **Matrix**: assets/skills.matrix.json — 31 rows with name / dir / model / user / scenario / scenarioZh / keywords / note. keywords are empty for now (`keywords_policy: "先空着,实测后再填"` = "left empty, filled after measurement"); once filled, gate signal B (keyword hits) activates.
8
- - **Manifest**: skills.manifest.json — the shipping snapshot of the same 31 rows (doctor checks its length is 31).
9
- - **Invocation flags are independent of the source tier** (skill-provider.js L85-88): whether a skill comes from ~/.dsh/skills (tier user) or the assets/skills copies (tier bundled), model/user always follow this matrix.
10
- - The gate only admits model-invocable skills into auto/hint (skillgate.js L187-189); user-only skills remain fully visible and are invoked manually via /skill.
11
- - Counts: **13 both / 10 model-only / 8 user-only** (the value checked by doctor's 7th item).
12
-
13
- ## The 31 skills (alphabetical)
14
-
15
- | # | Skill | Scenario | Invocation | Note (owner's wording) |
16
- |---|---|---|---|---|
17
- | 1 | ask-matt | meta | user-only | 技能路由器与本插件路由层重叠,主人点名才用 |
18
- | 2 | chief-of-staff | process | model+user | |
19
- | 3 | code-review | engineering | model+user | |
20
- | 4 | codebase-design | engineering | model+user | |
21
- | 5 | diagnosing-bugs | engineering | model-only | 主人选仅模型 |
22
- | 6 | domain-modeling | engineering | model-only | 主人选仅模型 |
23
- | 7 | grilling | meta | user-only | 重交互,主人点名才用 |
24
- | 8 | handoff | process | model+user | |
25
- | 9 | implement | engineering | model+user | |
26
- | 10 | improve-codebase-architecture | engineering | model+user | |
27
- | 11 | loop-me | meta | user-only | 重交互,主人点名才用 |
28
- | 12 | pr | process | model+user | |
29
- | 13 | prototype | engineering | user-only | 主人选仅手动 |
30
- | 14 | research | research | model+user | |
31
- | 15 | retro | process | user-only | 主人选仅手动 |
32
- | 16 | setup-matt-pocock-skills | setup | model-only | 主人理由:会话开始即在,仅模型 |
33
- | 17 | setup-ts-deep-modules | engineering | model-only | 主人选仅模型 |
34
- | 18 | software-factory | process | model-only | 主人选仅模型 |
35
- | 19 | tdd | engineering | model-only | 主人选仅模型 |
36
- | 20 | teach | teaching | user-only | 主人选仅手动 |
37
- | 21 | to-questionnaire | process | model-only | 主人选仅模型 |
38
- | 22 | to-spec | process | model+user | |
39
- | 23 | to-tickets | process | model+user | |
40
- | 24 | triage | process | model+user | |
41
- | 25 | wait-what | meta | user-only | 主人选仅手动 |
42
- | 26 | wayfinder | process | model+user | |
43
- | 27 | wizard | process | user-only | 主人选仅手动 |
44
- | 28 | writing-beats | writing | model+user | |
45
- | 29 | writing-for-agents | writing | model-only | 主人选仅模型 |
46
- | 30 | writing-fragments | writing | model-only | 主人选仅模型 |
47
- | 31 | writing-shape | writing | model-only | |
48
-
49
- ## Scenario vocabulary
50
-
51
- engineering / process / research / meta / setup / teaching / writing. Gate signal A awards points per scenario via sceneMap (see [configuration.en.md](./configuration.en.md)).
52
-
53
- ## Relation to the provider and the gate
54
-
55
- - lib/skill-provider.js treats the matrix as the single source of truth for invocation (`model: row.model !== false`), with the rank-350 semantics unchanged.
56
- - lib/skillgate.js scores all 31 rows every turn (all 31 scored, owner's decision); model skills outside the admitted set stay in list()'s full catalog — gating only affects the near-field channel.
57
- - The 31 directories of this table are exactly the bundled copies under assets/skills/ (doctor's 6th check counts 31).
package/docs/matrix.md DELETED
@@ -1,57 +0,0 @@
1
- # 技能矩阵(matrix)
2
-
3
- > 31 个 mattpocock 技能的 invocation 双开矩阵(模型可调 / 用户可调),数据源 `assets/skills.matrix.json`(主人逐条拍板:6 批 33 题,decided_at 2026-11-20)。英文版:[matrix.en.md](./matrix.en.md)。
4
-
5
- ## 数据源与读法
6
-
7
- - **矩阵**:`assets/skills.matrix.json`——31 行,字段 name / dir / model / user / scenario / scenarioZh / keywords / note。keywords 现为空(`keywords_policy: "先空着,实测后再填"`),填上后门控信号 B(关键词命中)即生效。
8
- - **清单**:`skills.manifest.json`——同 31 行的发布快照(doctor 校验其长度为 31)。
9
- - **invocation 开关不受来源层级影响**(skill-provider.js L85-88):无论技能来自 `~/.dsh/skills`(tier user)还是 `assets/skills` 副本(tier bundled),model/user 一律按本矩阵。
10
- - 门控只放行 model-invocable 技能进 auto/hint(skillgate.js L187-189);user-only 技能仍全量可见、走 `/skill` 人工点名。
11
- - 计数:**13 双开 / 10 仅模型 / 8 仅用户**(doctor 第 7 项校验值)。
12
-
13
- ## 31 技能表(按字母序)
14
-
15
- | # | 技能 | 场景 | 调用 | 备注(主人拍板原文) |
16
- |---|---|---|---|---|
17
- | 1 | ask-matt | 元交互·路由 | 仅用户 | 技能路由器与本插件路由层重叠,主人点名才用 |
18
- | 2 | chief-of-staff | 流程·统筹 | 模型+用户 | |
19
- | 3 | code-review | 工程·评审 | 模型+用户 | |
20
- | 4 | codebase-design | 工程·设计 | 模型+用户 | |
21
- | 5 | diagnosing-bugs | 工程·诊断 | 仅模型 | 主人选仅模型 |
22
- | 6 | domain-modeling | 工程·建模 | 仅模型 | 主人选仅模型 |
23
- | 7 | grilling | 元交互·审讯 | 仅用户 | 重交互,主人点名才用 |
24
- | 8 | handoff | 流程·交接 | 模型+用户 | |
25
- | 9 | implement | 工程·实现 | 模型+用户 | |
26
- | 10 | improve-codebase-architecture | 工程·体检 | 模型+用户 | |
27
- | 11 | loop-me | 元交互·工作流 | 仅用户 | 重交互,主人点名才用 |
28
- | 12 | pr | 流程·PR | 模型+用户 | |
29
- | 13 | prototype | 工程·原型 | 仅用户 | 主人选仅手动 |
30
- | 14 | research | 调研·取证 | 模型+用户 | |
31
- | 15 | retro | 流程·复盘 | 仅用户 | 主人选仅手动 |
32
- | 16 | setup-matt-pocock-skills | 配置·初始化 | 仅模型 | 主人理由:会话开始即在,仅模型 |
33
- | 17 | setup-ts-deep-modules | 工程·配置 | 仅模型 | 主人选仅模型 |
34
- | 18 | software-factory | 流程·工厂 | 仅模型 | 主人选仅模型 |
35
- | 19 | tdd | 工程·测试 | 仅模型 | 主人选仅模型 |
36
- | 20 | teach | 教学 | 仅用户 | 主人选仅手动 |
37
- | 21 | to-questionnaire | 流程·问卷 | 仅模型 | 主人选仅模型 |
38
- | 22 | to-spec | 流程·定稿 | 模型+用户 | |
39
- | 23 | to-tickets | 流程·拆票 | 模型+用户 | |
40
- | 24 | triage | 流程·分诊 | 模型+用户 | |
41
- | 25 | wait-what | 元交互·打断 | 仅用户 | 主人选仅手动 |
42
- | 26 | wayfinder | 流程·大规划 | 模型+用户 | |
43
- | 27 | wizard | 流程·向导 | 仅用户 | 主人选仅手动 |
44
- | 28 | writing-beats | 写作·成稿 | 模型+用户 | |
45
- | 29 | writing-for-agents | 写作·技能文档 | 仅模型 | 主人选仅模型 |
46
- | 30 | writing-fragments | 写作·碎片 | 仅模型 | 主人选仅模型 |
47
- | 31 | writing-shape | 写作·打磨 | 仅模型 | |
48
-
49
- ## 场景(scenario)词汇
50
-
51
- engineering(工程)/ process(流程)/ research(研究)/ meta(元交互·路由)/ setup(初始化)/ teaching(教学)/ writing(写作)。门控信号 A 按 `sceneMap` 给不同场景加分(见 [configuration.md](./configuration.md))。
52
-
53
- ## 与 provider/门控的关系
54
-
55
- - `lib/skill-provider.js` 以矩阵为唯一 invocation 真源(`model: row.model !== false`),rank 350 语义不变。
56
- - `lib/skillgate.js` 每轮对这 31 行全量打分(31 个全打,主人定案);未进放行集合的 model 技能仍留在 `list()` 全量里,门控只影响近场通道。
57
- - 本表 31 个目录即 `assets/skills/` 下的内置副本(doctor 第 6 项校验目录数 = 31)。