dsh-lean-router 1.1.0 → 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 +24 -1
  9. package/docs/changelog.md +24 -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 -203
  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 -117
  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,80 +0,0 @@
1
- ---
2
- name: writing-fragments
3
- description: "Writing, explore: mine raw fragments, no structure yet."
4
- disable-model-invocation: true
5
- user-invocable: true
6
- ---
7
-
8
- <what-to-do>
9
-
10
- This is pure **explore**: widen the space of what could be written without committing to structure. Committing is _exploit_, a separate skill's job. Run a grilling session that produces fragments, interviewing the user relentlessly about whatever they want to write about. Imposing phases, outlines, or article structure is out of scope here.
11
-
12
- As fragments emerge from either side of the conversation, append them to a single markdown file.
13
-
14
- If the user did not pass a path, ask once where to save the document, then remember it for the rest of the session.
15
-
16
- Capture fragments from the very first thing the user says, including the initial prompt.
17
-
18
- On first write, put a single H1 at the top with a working title (it can change later) and nothing else: no metadata, no TOC, no date.
19
-
20
- </what-to-do>
21
-
22
- <supporting-info>
23
-
24
- ## What is a fragment
25
-
26
- A fragment is any piece of text that might survive into the final article. It must be _readable by the author_ (the author can tell what it means), but it does not need to define its terms or be comprehensible to a cold reader. The bar is "is this a piece of good writing?", not "is this a self-contained argument?"
27
-
28
- Fragments are deliberately heterogeneous. Examples of what could be a fragment:
29
-
30
- - A sharp sentence you'd want to deploy somewhere but don't yet know where.
31
- - A claim with a one-line justification.
32
- - A vignette: a thing that happened, a code snippet, a scenario, an analogy.
33
- - A half-thought: "something about how X feels like Y, work this out later."
34
- - A quote, a piece of dialogue, an overheard line.
35
- - A list of related observations that hang together by feel.
36
- - A complaint, a confession, a punchline.
37
- - A **leading word**: a compact metaphor or coinage the whole piece can hang on (one term that names the idea, the way _tracer bullets_ or _fog of war_ names a whole pattern).
38
-
39
- Of these, the leading word is the most valuable fragment to land. It is load-bearing: name the right one in explore and it shapes the structure, the transitions, and the title later, paying dividends through the entire exploit phase. When the conversation circles a recurring idea, push to coin a word for it.
40
-
41
- The novelist's diary is the model: years of unstructured noticings that later get mined for raw material. Fragments are noticings.
42
-
43
- ## File format
44
-
45
- ```markdown
46
- # Working title
47
-
48
- A first fragment lives here.
49
-
50
- It can be multiple paragraphs. It can include lists, code, quotes: whatever
51
- shape the fragment naturally takes.
52
-
53
- ---
54
-
55
- A second fragment.
56
-
57
- ---
58
-
59
- > A quoted line that the user wants to keep around.
60
-
61
- A reaction to it.
62
-
63
- ---
64
-
65
- - A cluster of related observations
66
- - That hang together by feel
67
- - And want to be near each other
68
- ```
69
-
70
- Fragments are separated by a horizontal rule (`\n---\n`). No headings inside the body. No tags. No order beyond the order they were added.
71
-
72
- ## Writing rhythm
73
-
74
- Append silently. Don't ask permission for each fragment. Mention what you added in passing ("adding that"), but don't interrupt the conversation with save dialogs.
75
-
76
- Before every write: re-read the file from disk. The user may have edited, reordered, or deleted fragments between turns, so preserve their changes. Never overwrite the file; only append (or, if the user asks, edit a specific fragment in place).
77
-
78
- The user can say "cut the last one", "rewrite that one sharper", "merge those two" at any time. Treat those as first-class instructions.
79
-
80
- </supporting-info>
@@ -1,5 +0,0 @@
1
- interface:
2
- display_name: "Writing Fragments"
3
- short_description: "Mine raw writing fragments"
4
- policy:
5
- allow_implicit_invocation: false
@@ -1,59 +0,0 @@
1
- ---
2
- name: writing-shape
3
- description: "Writing, exploit: shape raw material into an article, paragraph by paragraph."
4
- disable-model-invocation: true
5
- user-invocable: true
6
- ---
7
-
8
- <what-to-do>
9
-
10
- The user has passed (or will pass) a markdown file of raw material. Treat it as the input pile: anything from a tidy list of fragments to a wall of unstructured prose to a transcript. The format does not matter. Read it end-to-end before doing anything else.
11
-
12
- Read `../_shared/WRITING-MECHANICS.md` once now: it holds the grounding accounting, how to pull from the pile, and the writing rhythm that this skill runs on.
13
-
14
- Then run a shaping session that produces a separate article document. This is **exploit**: the exploring is done, the pile is fixed: commit to a structure and mine the pile to fill it. Do not edit the raw material file: it is read-only to this skill.
15
-
16
- If the user did not say where to save the article, ask once and remember the path.
17
-
18
- </what-to-do>
19
-
20
- <supporting-info>
21
-
22
- ## The loop
23
-
24
- 1. **Read the pile.** Read the input file in full. Form a sense of what's in it.
25
- 2. **Establish the prerequisites.** Settle with the user what the reader knows walking in: the concepts that are **grounded** from the start. Everything else must be grounded by a block before a later block can lean on it.
26
- 3. **Draft 2–3 candidate openings.** Each opening should imply a different thesis or angle for the article. Show all of them. Force the user to pick or compose a hybrid. The chosen opening defines what the rest of the article must do.
27
- 4. **Grow paragraph by paragraph.** After the opening lands, ask "given this opening, what does the reader need to hear next?" Pull material from the pile to answer. The next block may only lean on grounded concepts, and grounds new ones as it lands. Argue about the form the next block takes: a paragraph, a list, a table, a callout, a quote, a code block. Each format choice should be deliberate and defensible.
28
- 5. **Append to the article file as you go.** Don't batch. Write each agreed paragraph or block immediately so the user can see the article taking shape.
29
- 6. **Loop step 4 until the article is done.** The user decides when it's done.
30
-
31
- ## Conversational feel
32
-
33
- This is a grilling session inverted. In ideation, the question was "what are you actually noticing?" Here it's "what is this article actually arguing, and in what order does the reader need to hear it?" Push back. Refuse to let weak transitions slide. If a paragraph doesn't earn its place, cut it.
34
-
35
- Specific moves to keep using:
36
-
37
- - "What does this paragraph do for the reader that the previous one didn't?"
38
- - "If I cut this, what breaks?"
39
- - "Is this prose, or should it be a list? Why prose?"
40
- - "This sentence is doing two jobs: split it or pick one."
41
- - "The opening promised X. We've drifted to Y. Either re-thread it or change the opening."
42
-
43
- ## Format arguments to actually have
44
-
45
- When choosing how to render a block, weigh these tradeoffs out loud with the user, not silently:
46
-
47
- - **Prose vs. list.** Prose carries argument; lists carry parallel items. If items aren't truly parallel, prose is better. If they are, a list is faster to scan.
48
- - **Inline vs. callout.** Tips, warnings, and asides go in callouts (`> [!TIP]`, `> [!NOTE]`), but only if they'd genuinely derail the main argument inline. Otherwise leave them inline.
49
- - **Table vs. repeated structure.** If the same shape repeats 3+ times with the same fields, a table. Otherwise prose with bold leads.
50
- - **Quote vs. paraphrase.** Quote when the original wording is the point. Paraphrase when only the idea matters.
51
- - **Code block vs. inline code.** Multi-line, runnable, or illustrative → block. Single token or identifier → inline.
52
-
53
- ## Out of scope
54
-
55
- - Mining for new fragments that aren't in the pile (handle gaps as "Pulling from the pile" describes in the shared page).
56
- - Editing the raw material file.
57
- - Publishing, formatting for a specific platform, or adding frontmatter the user didn't ask for.
58
-
59
- </supporting-info>
@@ -1,5 +0,0 @@
1
- interface:
2
- display_name: "Writing Shape"
3
- short_description: "Shape raw material into an article"
4
- policy:
5
- allow_implicit_invocation: false
@@ -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` 前评估影响面