dsh-prompt-customizer 0.5.1 → 0.12.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 (55) hide show
  1. package/README.en.md +116 -278
  2. package/README.md +132 -284
  3. package/build.mjs +236 -0
  4. package/client/client.js +8411 -3465
  5. package/client/client.js.map +7 -1
  6. package/cordis.patch.yml +6 -3
  7. package/docs/guide.md +266 -0
  8. package/docs/images/prompt.png +0 -0
  9. package/docs/images/tool.png +0 -0
  10. package/docs/upgrades/README.md +154 -0
  11. package/docs/upgrades/dsh-0.2.2-rc1.md +49 -0
  12. package/docs/upgrades/rc2-migration.md +70 -0
  13. package/lib/index.js +16965 -983
  14. package/lib/index.js.map +7 -0
  15. package/package.json +53 -39
  16. package/scripts/fixtures/rc2-mode.mjs +12 -0
  17. package/scripts/fixtures/rc2-preview.snapshot.json +35 -0
  18. package/scripts/fixtures/rc2-runtime.mjs +85 -0
  19. package/scripts/fixtures/rc2.cordis.yml +31 -0
  20. package/scripts/fixtures/rc2.overlay.yml +9 -0
  21. package/scripts/simulate-rescan.mjs +180 -0
  22. package/scripts/smoke-client.mjs +382 -0
  23. package/scripts/smoke-host.mjs +130 -0
  24. package/scripts/test-skill-manager.mjs +170 -0
  25. package/scripts/verify-panel-browser.mjs +298 -0
  26. package/lib/catalog.js +0 -131
  27. package/lib/effective.js +0 -161
  28. package/lib/promotion.js +0 -76
  29. package/lib/schema.js +0 -125
  30. package/lib/sectionOps.d.mts +0 -67
  31. package/lib/sectionOps.mjs +0 -269
  32. package/lib/store.js +0 -124
  33. package/lib/vars.js +0 -147
  34. package/lib/zh/cordis.mjs +0 -110
  35. package/lib/zh/core.mjs +0 -47
  36. package/lib/zh/index.d.mts +0 -8
  37. package/lib/zh/index.mjs +0 -23
  38. package/lib/zh/sdk.mjs +0 -22
  39. package/lib/zh/teams.mjs +0 -19
  40. package/lib/zh/undo.mjs +0 -18
  41. package/src/client/Panel.tsx +0 -532
  42. package/src/client/PresetsPane.tsx +0 -298
  43. package/src/client/PreviewPane.tsx +0 -73
  44. package/src/client/PreviewTools.tsx +0 -33
  45. package/src/client/SectionsPane.tsx +0 -331
  46. package/src/client/ToolsPane.tsx +0 -230
  47. package/src/client/error-boundary.tsx +0 -48
  48. package/src/client/index.ts +0 -97
  49. package/src/client/locales.ts +0 -301
  50. package/src/client/nav.tsx +0 -284
  51. package/src/client/preset-io.ts +0 -226
  52. package/src/client/presets.ts +0 -413
  53. package/src/client/shell.tsx +0 -179
  54. package/src/client/styles.ts +0 -59
  55. package/src/client/types.ts +0 -125
package/README.en.md CHANGED
@@ -1,278 +1,116 @@
1
- <p align="center">
2
- <img src="assets/logo.svg" alt="dsh-prompt-customizer" width="180">
3
- </p>
4
-
5
- <h1 align="center">dsh-prompt-customizer</h1>
6
-
7
- <p align="center">
8
- <strong>System-prompt &amp; tool-catalog customizer for DeepSeek Harness.<br>
9
- Block / replace / inject / reorder prompt sections by name, layered by session phase and agent preset — all from a settings-panel UI.</strong>
10
- </p>
11
-
12
- <p align="center">
13
- <strong>English</strong> ·
14
- <a href="README.md">简体中文</a>
15
- </p>
16
-
17
- <p align="center">
18
- <a href="#installation">Installation</a> •
19
- <a href="#features">Features</a> •
20
- <a href="#usage">Usage</a> •
21
- <a href="#how-it-works">How it works</a> •
22
- <a href="#known-limitations">Known limitations</a>
23
- </p>
24
-
25
- <p align="center">
26
- <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/releases"><img src="https://img.shields.io/badge/version-0.4.2-blue.svg" alt="Version"></a>
27
- <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License"></a>
28
- <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/DeepSeek_Harness-Plugin-blueviolet.svg" alt="DeepSeek Harness Plugin"></a>
29
- <a href="https://www.npmjs.com/package/dsh-prompt-customizer"><img src="https://img.shields.io/npm/v/dsh-prompt-customizer" alt="npm version"></a>
30
- <a href="https://www.npmjs.com/package/dsh-prompt-customizer"><img src="https://img.shields.io/npm/dm/dsh-prompt-customizer" alt="npm downloads"></a>
31
- <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/stargazers"><img src="https://img.shields.io/github/stars/DreamsTOF/dsh-prompt-customizer?style=social" alt="GitHub Stars"></a>
32
- </p>
33
-
34
- <p align="center">
35
- <b>⭐ GitHub repo: <a href="https://github.com/DreamsTOF/dsh-prompt-customizer">DreamsTOF/dsh-prompt-customizer</a></b> — if you find it useful, please drop a star; bug reports and feature requests go to <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/issues">Issues</a>
36
- </p>
37
-
38
- <p align="center">
39
- <img src="assets/banner.svg" alt="system prompt → block · replace · inject · sort" width="900">
40
- </p>
41
-
42
- ---
43
-
44
- A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin that lets you control the **system prompt** and the **tool catalog** from a settings-panel UI.
45
-
46
- Plugin-injected prompt sections can pollute your system prompt. This plugin lets you **block**, **replace**, **inject** and **reorder** prompt sections by name, and **hide tools** from the model-facing catalog — live, without touching any other plugin.
47
-
48
- Two ideas run through the whole design:
49
-
50
- - **Per session phase.** Bootstrap (before promotion) / resident (after promotion) / compaction-controlled (after a compaction, before re-promotion) each get their **own block list, their own ordering space and their own tool catalog**. One preset can therefore show the model 1 tool and a handful of sections on the first turn, then open everything up after promotion.
51
- - **Per agent preset.** The selector at the top chooses where edits land: `Target: global default` edits the defaults; picking an agent preset writes a field-level override for that preset only (set fields take over, unset fields keep falling back to global).
52
-
53
- ## How the session phases flow
54
-
55
- The phases are not a fixed three-beat rhythm — they are **derived from durable session
56
- events**: the first durable `tool/call` or `assistant/message` promotes, and a
57
- `compaction/end` resets that promotion. The three parts of the panel map to those states.
58
-
59
- <table>
60
- <tr align="center">
61
- <td width="28%"><b>① Session starts</b><br><code>bootstrap</code><br><b>Guide period</b></td>
62
- <td width="6%">→</td>
63
- <td width="28%"><b>② First durable signal</b><br><code>tool/call</code> · <code>assistant/message</code><br><b>Resident period</b> <code>active</code></td>
64
- <td width="6%">→</td>
65
- <td width="32%"><b>③ A compaction</b><br><code>compaction/end</code><br><b>Compaction-controlled</b> <code>compaction</code></td>
66
- </tr>
67
- <tr>
68
- <td colspan="5" align="center">
69
- ④ another durable signal after the compaction → <b>back to the resident period</b>; compact again and it falls back to compaction-controlled
70
- </td>
71
- </tr>
72
- </table>
73
-
74
- Every transition (note the guide period can reach compaction-controlled without passing through resident):
75
-
76
- | Current phase | Event | Next |
77
- | --------------------- | ----------------------------------------------- | ------------------------- |
78
- | Guide | first durable `tool/call` / `assistant/message` | **Resident** |
79
- | Guide | `compaction/end` | **Compaction-controlled** |
80
- | Resident | `compaction/end` (promotion reset) | **Compaction-controlled** |
81
- | Compaction-controlled | a new durable signal after the compaction | **Resident** |
82
- | Any | subagent session (`delegationDepth > 0`) | always **Resident** |
83
- | Any | read with no session (inventory, preview) | always **Resident** |
84
-
85
- What each phase resolves to — the three panel parts map one-to-one onto config fields:
86
-
87
- | Panel part | Effective section blocks | Injected `phase` | Effective tool blacklist |
88
- | -------------------------------------- | ------------------------ | ------------------------- | ------------------------------------------------------------------ |
89
- | Guide-period sections / tools | `sectionsBootstrap` | `bootstrap` (+ `always`) | `tools.bootstrap.exclude`, falling back to static when unset |
90
- | Resident-period sections / tools | `sections` | `active` (+ `always`) | `tools.exclude` (static) |
91
- | Compaction-controlled sections / tools | `sectionsCompaction` | `compaction` (+ `always`) | `tools.compaction.exclude`, falling back to bootstrap, then static |
92
-
93
- Two things that bite:
94
-
95
- - **`always` injections are present in all three phases**, and each phase has its own ordering space — which is why this plugin emits phase entries _after_ the `always` group: the assembly applies inject records in array order and the last write wins, so the phase order is what survives.
96
- - **A phase view is "what this state resolves to", not "what the session has been".** Native preset phase rules (zero-tool bootstrap, warmup, …) are in play at the same moment and may still change the result after other plugins — see [Known limitations](#known-limitations).
97
-
98
- ## UI
99
-
100
- ![Prompt tab: four tabs, edit-target selector, section rows](docs/images/prompt-sections.png)
101
-
102
- ![Three phase parts, each with its own section list](docs/images/prompt-resident.png)
103
-
104
- ![Tools tab: three phase catalogs with enabled/total counts](docs/images/tools-phases.png)
105
-
106
- ![Config tab: save current config / save as agent preset / import](docs/images/config-tab.png)
107
-
108
- ![Preview tab: model-view prompt switchable per phase, with the yellow warning for a complete-section takeover](docs/images/preview-tab.png)
109
-
110
- ## Features
111
-
112
- ### Prompt sections
113
-
114
- - **Block** — remove a section by name. A blocked row does not disappear: it stays draggable and editable and can be restored at any time. Blocking only means "not injected into the model".
115
- - **Replace** — edit a section's text; the editor is pre-filled with the text currently in effect (dynamically generated sections are resolved first so you see real content).
116
- - **Inject** — every phase part has its own name + text box to add a brand-new section, badged `manual` and deletable.
117
- - **Reorder** — drag a whole row (an insert line appears above/below the target row) or use ↑/↓. Order is stored as a contiguous 0-based virtual index, so there are never duplicate or fractional orders and no number to type by hand.
118
- - **Independent per phase** — bootstrap blocks go to `sectionsBootstrap`, compaction blocks to `sectionsCompaction`, resident blocks to `sections`; each phase has its own ordering space, so "5 sections during bootstrap, everything when resident" is expressible.
119
-
120
- ### Tool catalog
121
-
122
- - **Blacklist only** (`exclude`) — unchecking a tool hides it **in that phase**; checking it back restores it. There is no whitelist mode: it silenced `exclude` entirely, and a single drag could quietly switch off every other tool in the phase while offering no expressive gain.
123
- - **Dragging in = make that one tool visible in the phase** (remove it from the phase blacklist); dragging back to _All system tools_ hides it there. Every action touches only the tool you dragged.
124
- - **Phase catalogs** — bootstrap and compaction each have their own blacklist. Runtime precedence is **compaction > bootstrap > static**: after a compaction with a compaction catalog configured, it applies; otherwise an un-promoted session uses the bootstrap catalog; everything else uses the static filter.
125
- - **Narrowing only, never widening** — the filter operates on the catalog the assembly already produced. A tool a phase never had cannot be made to appear here; that means editing the preset's composition.
126
- - Only the model-facing catalog is affected; the tools themselves and routing keep working.
127
-
128
- ### Model-view preview
129
-
130
- The Preview tab shows the final system prompt and tool catalog after **all** plugins have filtered, switchable per phase. It reads the same assembly as the prompt and tools tabs, so what you see is what the model sees. The tools view reports "visible to the model / registry total" side by side — presets such as PTC or Code Mode wrap the whole catalog into a single `run_code`, so the registry alone misleads.
131
-
132
- ### Prompt template variables
133
-
134
- The host registers only `provider` / `model` / `cwd` as template variables; referencing any other `{{name}}` in section text makes the whole assembly fail. This plugin adds two more families through the official extension point:
135
-
136
- - **Built-in system facts**: `date` / `time` / `datetime` / `weekday` / `hostname` / `platform` / `arch` / `username` / `home` / `shell` / `locale` / `node_version`, computed fresh at every assembly.
137
- - **Every environment variable**: each `process.env` key maps to `env_<lowercase, non-alphanumerics collapsed to _>`, e.g. `PATH` → `{{env_path}}`, `USER.NAME` → `{{env_user_name}}`.
138
-
139
- **Blocklist (`envBlocklist`)**: environment variables often carry secrets, and anything in the prompt is sent to the model with every request, so keys matching the blocklist are never registered. The prefilled entries cover common credential-style keys (`SECRET` / `TOKEN` / `PASSWORD` / `API_KEY` / `*_DSN` and friends); entries support `*` wildcards and are case-insensitive. The environment variable blocklist card in the panel lets you add or remove entries at any time, and its collapsible list shows the variables actually registered right now. Blocklist changes take effect at the next assembly (whether you edit the panel or `config.yaml` by hand).
140
-
141
- **Carried by export / import**: exporting a preset writes the current blocklist along with it; import merges it in by union (grow-only), consistent with the snapshot library semantics.
142
-
143
- The cost of strict rendering: referencing an unregistered name (such as a key the blocklist blocks) makes the **whole assembly fail** rather than rendering empty — only use names that appear in the panel's variable list.
144
-
145
- ### Config snapshots and agent presets
146
-
147
- - **Save current config** — capture the complete customization of the current scope (per-phase block lists, per-phase ordering and phase tool catalogs) as a reusable snapshot.
148
- - **Apply** — same-name sections are overridden, current sections outside the snapshot list are blocked, and snapshot sections that do not match the current system are skipped (cross-system imports never fabricate sections). Phase fields the snapshot does not carry keep your current values instead of being wiped. Only one snapshot is active at a time.
149
- - **Export / import** — snapshots round-trip as JSON (native save/open dialogs under Tauri, download / file picker on web); same-name presets are skipped. Order is stored relatively (each section records which section it follows), so snapshots stay portable across different section sets.
150
- - **Save as agent preset** — **copy** the whole preset directory of the current edit target (composition file, companion scripts, skill directories) into the user preset root, then write the current customization into its override. The new preset immediately appears in the target selector: a real switchable agent preset, not merely a config copy.
151
-
152
- ### Cross-preset registry pool
153
-
154
- _All system sections_ / _All system tools_ do not follow the edit target: they are a **union across presets that only ever grows** (same name — last seen wins; new name — appended), filled in as you browse presets and stored in the derived cache `catalog.yaml`, which rebuilds itself if deleted.
155
-
156
- ## How it works
157
-
158
- The full path a change takes from the panel to the model:
159
-
160
- <table>
161
- <tr align="center">
162
- <td width="19%"><b>① Settings panel</b><br>sections / tools / config / preview<br><i>edits an in-memory draft only</i></td>
163
- <td width="3%">→</td>
164
- <td width="19%"><b>② Plugin routes</b><br><code>/config</code> · <code>/config/apply</code><br><code>/preview</code> · <code>/inventory</code> · <code>/presets</code></td>
165
- <td width="3%">→</td>
166
- <td width="19%"><b>③ config.yaml</b><br>global fields + <code>overrides[preset]</code><br><i>mtime-lazy reload, hand edits apply at once</i></td>
167
- <td width="3%">→</td>
168
- <td width="34%"><b>④ Assembly waterfall</b><br>the <code>system-prompt/assemble</code> hook derives the phase from the session, resolves the effective config and filters</td>
169
- </tr>
170
- <tr>
171
- <td colspan="9" align="center"><b>inside ④, in order</b>: <code>mergeConfig(global, overrides[session preset])</code> → sections: block → replace → inject → sort by <code>order</code>; tools: <code>pickToolsFilter</code> (compaction &gt; bootstrap &gt; static) → <code>applyToolFilter</code></td>
172
- </tr>
173
- <tr>
174
- <td colspan="9" align="center">
175
- <b>⑤ one last move before handing in</b>: after the waterfall the host restores the single <code>complete: true</code> section as the whole <code>sections</code> array when one exists — exactly why the panel shows a yellow warning for such presets (the tool catalog is unaffected)
176
- </td>
177
- </tr>
178
- <tr>
179
- <td colspan="9" align="center"><b>⑥ the model receives</b>: the final system prompt + visible tool catalog; the Preview tab reads this very result</td>
180
- </tr>
181
- </table>
182
-
183
- Code map:
184
-
185
- | Path | Role |
186
- | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
187
- | `lib/index.js` | host half: assembly hook, five HTTP routes, agent-preset fork, one-off legacy cleanup |
188
- | `lib/effective.js` | pure functions: field-level override merge, phase selection (injections / tool catalogs), blacklist filtering |
189
- | `lib/promotion.js` | derives `{promoted, boundary}` from durable events — compaction resets, subagents always promoted |
190
- | `lib/vars.js` | prompt variables: built-in system facts + full env mapping / blocklist, lazily re-synced at the assembly entry by signature |
191
- | `lib/sectionOps.mjs` | phase-state pure functions **shared by the panel and the unit tests** (which list to write, injection identity, reorder, per-phase persistence) |
192
- | `lib/store.js` / `lib/catalog.js` | atomic write + last-good fallback config store; cross-preset section/tool accumulation cache |
193
- | `src/client/` | the panel (React written with `h()`, no JSX sugar), bundled into `client/client.js` |
194
-
195
- The key convention: phase logic exists once. `lib/sectionOps.mjs` is both bundled into the
196
- browser by tsdown and imported directly by `node --test`, so there is no second
197
- implementation standing between "tests pass" and "the UI behaves".
198
-
199
- ## Installation
200
-
201
- ```bash
202
- dsh plugin --profile web add dsh-prompt-customizer
203
- ```
204
-
205
- Or from a local checkout:
206
-
207
- ```bash
208
- dsh plugin --profile web add /path/to/dsh-prompt-customizer
209
- ```
210
-
211
- Then open the dsh web UI → **Settings** → **提示词定制** (Prompt Customizer) in the sidebar.
212
-
213
- ## Usage
214
-
215
- ### Prompt tab
216
-
217
- The three phase parts (bootstrap / resident / compaction-controlled) are **always rendered** — if a preset has no such phase, that part is simply empty rather than hidden. Each row offers:
218
-
219
- - a **checkbox** to block / unblock (`未屏蔽` / `已屏蔽` badge)
220
- - **Edit** to replace the section text; replaced rows carry an `已替换` badge and a restore button
221
- - **↑/↓** and a **drag handle** to reorder within the phase; `#N` is the current virtual index
222
- - a `system` / `manual` badge for provenance — only `manual` sections can be deleted
223
-
224
- `阶段可见 N` next to each title is the number of rows in that part. The name + text box at the bottom injects into that part, with the phase already fixed.
225
-
226
- ### Tools tab
227
-
228
- One part per phase, chip-listing the catalog entering that phase's filter, titled `阶段可见 enabled / total`. Check to keep a tool visible in that phase, uncheck to hide it; dragging a tool in from _All system tools_ only makes **that one tool** visible in the phase, and dragging it back hides it there. For what the model actually receives, use the tools view in the Preview tab.
229
-
230
- ### Config tab
231
-
232
- Five cards: **Save current config** (snapshot), **Save as agent preset** (fork the current target's preset directory), **Import config**, **Environment variable blocklist** (add/remove entries, inspect the variables actually registered right now), **Force override switch**. Each snapshot row is Apply / Export / Delete, and the active row carries an "in use" badge.
233
-
234
- ### Edit target and saving
235
-
236
- The selector at the top decides where changes land. The prompt and tools tabs share one unsaved draft, and **Save** writes it in a single request; switching to the config / preview tabs or changing the edit target discards the draft (after confirming). Nothing you mistype reaches the file until you press Save.
237
-
238
- ## Where the config lives
239
-
240
- - `~/.dsh/prompt-customizer/config.yaml` — the single source of truth. On first start, if this file is missing but the legacy `settings.yaml` has the section, it is migrated once (the master document is left intact and stays rollback-able). Hand edits take effect on the next read, no restart needed.
241
- - `~/.dsh/prompt-customizer/catalog.yaml` — the cross-preset accumulation cache for the pools above. Purely derived; delete it and it rebuilds as you browse.
242
-
243
- ## Known limitations
244
-
245
- All of the below are measured, and the panel shows a yellow warning in exactly these situations rather than leaving you to guess:
246
-
247
- - **Some presets have no section-composed prompt.** If a section is registered with `complete: true` (dsh-persona's wholesale takeover), the host restores that single section as the entire `sections` array **after** the assembly waterfall — so this plugin's blocking / replacement / injection / ordering never reaches the model (tool filtering still applies). The panel says so explicitly ("taken over wholesale by `deployment:persona`"). The only way to make section customization work is to turn off `complete` in that agent preset.
248
- - **Dropping sections has more than one cause.** Besides `complete` takeover, a preset can also trim sections itself for a specific phase (measured: 20 → 1 sections during bootstrap, with no `complete` section in the registry). The panel therefore also compares names mechanically: it diffs the sections this plugin emitted against the final assembly and reports "emitted N, model sees M" when they disagree.
249
- - **The synthetic session behind a preview can degrade.** Phase views are driven by a fabricated session; some preset plugins throw on it, so that phase falls back to an agent-less assembly and is marked degraded — i.e. it shows the result _without_ native phase narrowing.
250
- - **Replacing a dynamically generated section freezes its content.** Sections like `app:web-surface` are generated at assembly time (embedding the current web port and so on). After replacing, the text is fixed at the value you edited and no longer tracks runtime state. To keep following it, block the section instead.
251
- - **Dynamic text resolution is best-effort.** The panel calls a dynamic section's generator with a minimal context to echo real content; sections that need richer context and throw fall back to `<动态生成>`, with no other effect. Also, sections containing `{{model}}` / `{{cwd}}` style variables show the **unsubstituted template** in the list — the Preview tab is where the substituted final text appears.
252
- - **Export depends on the host allowing downloads.** The web fallback uses a browser download: if the host webview silently drops it, the panel still reports "exported" while no file lands. Import (file picker) is unaffected.
253
- - **Tool catalogs cannot be widened** — see "narrowing only" above.
254
-
255
- ## Development
256
-
257
- ```bash
258
- npm install
259
- npm run check # typecheck + build + full test suite
260
- ```
261
-
262
- The browser half is built with [tsdown](https://github.com/rolldown/tsdown) into `client/client.js` (a `__ModuleLoader__` factory bundle); the host half lives in `lib/`. Phase state logic sits in `lib/sectionOps.mjs`: the same pure functions are bundled into the UI and exercised directly by `node --test`, so the tests are the shipped code.
263
-
264
- ## License
265
-
266
- [MIT](LICENSE) © 2026 DreamsTOF
267
-
268
- ---
269
-
270
- ## Star History
271
-
272
- [![Star History Chart](https://api.star-history.com/svg?repos=DreamsTOF/dsh-prompt-customizer&type=Date)](https://star-history.com/#DreamsTOF/dsh-prompt-customizer&Date)
273
-
274
- ---
275
-
276
- <p align="center">
277
- <strong>⭐ If this plugin keeps your system prompt cleaner and your tool catalog tamer, give it a star!</strong>
278
- </p>
1
+ <p align="center">
2
+ <img src="assets/logo.svg" alt="dsh-prompt-customizer" width="180">
3
+ </p>
4
+
5
+ <h1 align="center">dsh-prompt-customizer</h1>
6
+
7
+ <p align="center">
8
+ <strong>The DeepSeek Harness capability desk: prompt customization + skill collection management + MCP server integration.<br>
9
+ Manage prompt sections, import and toggle skills, and connect MCP servers from the sidebar "Capabilities" panel.</strong>
10
+ </p>
11
+
12
+ <p align="center">
13
+ <strong>English</strong> ·
14
+ <a href="README.md">简体中文</a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/releases"><img src="https://img.shields.io/npm/v/dsh-prompt-customizer" alt="npm version"></a>
19
+ <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License"></a>
20
+ <a href="https://github.com/deepseek-ai/deepseek-harness"><img src="https://img.shields.io/badge/DeepSeek_Harness-Plugin-blueviolet.svg" alt="DeepSeek Harness Plugin"></a>
21
+ <a href="https://github.com/DreamsTOF/dsh-prompt-customizer/stargazers"><img src="https://img.shields.io/github/stars/DreamsTOF/dsh-prompt-customizer?style=social" alt="GitHub Stars"></a>
22
+ </p>
23
+
24
+ <p align="center">
25
+ <img src="assets/banner.svg" alt="system prompt → block · replace · inject · sort" width="900">
26
+ </p>
27
+
28
+ ---
29
+
30
+ ## What it is
31
+
32
+ A [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) plugin. It adds an independent "Capabilities" panel to the sidebar that brings three otherwise configuration-heavy jobs into one visual surface:
33
+
34
+ - **Prompt customization**: block, replace, inject and reorder system-prompt sections by name;
35
+ - **Skill collection management**: import, group and toggle skills;
36
+ - **MCP server integration**: add MCP servers and apply preset-level or tool-level masking.
37
+
38
+ All changes go through documented plugin extension points. No DSH source is modified, and prompt/tool changes take effect for the model as soon as they are saved.
39
+
40
+ ## Features
41
+
42
+ - **Prompt sections**: block / replace / inject / drag-reorder prompt sections, with a live preview of the final system prompt the model receives.
43
+ - **Phase and preset layering**: bootstrap, resident and compaction-controlled phases each have their own section lists, ordering space and tool catalog; the top preset selector scopes edits to one agent preset.
44
+ - **Tool catalog**: hide or add back tools per phase, with a "model-visible / registry total" comparison that also handles PTC / Code Mode `run_code` wrapping.
45
+ - **Skill management**: skill bundles, ZIP / folder import, global and preset toggles, skill-root and membership health checks.
46
+ - **MCP management**: paste JSON / YAML to connect, preset-owned server rows, global / preset masking, per-tool enable/disable, recommended templates.
47
+ - **Prompt variables**: built-in date / host / environment facts plus `process.env` mapping with a secret blocklist.
48
+
49
+ ## UI
50
+
51
+ Open **Capabilities** in the sidebar. The panel has three tabs: **SKILL**, **MCP** and **Prompts**.
52
+
53
+ ![Prompt mode: checkbox list on the left, live preview on the right](docs/images/prompt.png)
54
+
55
+ ![Tool mode: phase catalog checkboxes and model-visible tool preview](docs/images/tool.png)
56
+
57
+ ## Installation
58
+
59
+ Web profile:
60
+
61
+ ```bash
62
+ dsh plugin --profile web add dsh-prompt-customizer
63
+ ```
64
+
65
+ Desktop (DeepSeek Harness Desktop):
66
+
67
+ ```bash
68
+ dsh plugin --profile desktop add dsh-prompt-customizer
69
+ ```
70
+
71
+ Or install from a local checkout:
72
+
73
+ ```bash
74
+ dsh plugin --profile web add /path/to/dsh-prompt-customizer
75
+ ```
76
+
77
+ Current release targets **DSH 0.2.2-rc.1**. Version compatibility, per-release changes and migration notes live in [docs/upgrades/README.md](docs/upgrades/README.md).
78
+
79
+ ## Quick start
80
+
81
+ 1. Open the dsh Web UI and click **Capabilities** in the sidebar.
82
+ 2. Switch to the **Prompts** tab and choose an agent preset at the top.
83
+ 3. Edit in Prompt / Tool / Config mode, then click **Save**. The right-hand preview shows exactly what the model will receive.
84
+
85
+ Prompt sections and tools can be configured separately for the bootstrap, compaction-controlled and resident phases; switch the phase tab to see that phase's own checkbox state and preview.
86
+
87
+ ## Where the configuration lives
88
+
89
+ - `~/.dsh/prompt-customizer/config.yaml`: prompt customization and per-phase tool catalog.
90
+ - `~/.dsh/prompt-customizer/catalog.yaml`: cross-preset section / tool catalog cache (derived; safe to delete).
91
+ - Skill and MCP ledgers live under the plugin's directory in `$DSH_HOME` and the relevant workspace directories.
92
+
93
+ ## Development
94
+
95
+ ```bash
96
+ npm install
97
+ npm run check # build + full unit tests + host / client smoke
98
+ ```
99
+
100
+ Build artifacts: `lib/index.js` (host half) and `client/client.js` (browser half).
101
+
102
+ ## Documentation
103
+
104
+ - [Full usage and implementation guide (Chinese)](docs/guide.md)
105
+ - [Version upgrade and migration records](docs/upgrades/README.md)
106
+ - [DSH 0.2.2-rc.1 migration record](docs/upgrades/dsh-0.2.2-rc1.md)
107
+ - [DSH 0.2.1-rc.2 migration record](docs/upgrades/rc2-migration.md)
108
+
109
+ ## Credits
110
+
111
+ - The SKILL and MCP UI and host modules reference [Kr-ATG/dsh-triad](https://github.com/Kr-ATG/dsh-triad).
112
+ - The prompt panel derives from this repository's standalone 0.5.x implementation.
113
+
114
+ ## License
115
+
116
+ [MIT](LICENSE) © 2026 DreamsTOF