DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

railgun52 /

railgun52/dsh-user-rules

Verified

User rules settings page for the dsh web GUI: a list editor over a profile-config namespace whose rules are injected as a systemPrompt section

★ 1 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHub
READMESource: main@04fdf73f

dsh-user-rules — User rules settings page

npm

English | 中文

A profile-config settings page for DeepSeek Harness that injects your own development rules into every session's system prompt.

Rules you add here are concatenated into a user-rules systemPrompt section, so the model obeys them on the next turn — edit and it takes effect without a restart. The page is a list editor over the user-rules profile-config namespace; the Host half owns the schema and the systemPrompt section, the browser half owns the editor card.

Features

Feature Description
Settings page A first-level Settings section 用户规则 with add/edit/remove/reorder card list
systemPrompt injection The resolved rules become a numbered systemPrompt section named user-rules (order -50)
Live edits rules is declared .volatile(); the section text reads the live value at assembly time, so new turns pick up edits with no remount
Profile-config backed Values persist to the active profile's plugin config; the page reads/writes through the shared configForms namespace

Architecture

dsh-user-rules/
|-- src/
|   |-- index.ts               # host half: Config schema (volatile rules) + systemPrompt section
|   |-- user-rules-schema.ts   # UserRulesSchema
|   |-- invariant.ts
|   `-- client/
|       |-- index.ts           # browser half: configForms.whileServed + settings.section card
|       |-- UserRulesSection.tsx
|       |-- UserRulesSection.module.css
|       `-- locales.ts         # zh/en nav + page copy
`-- cordis.patch.yml           # bundle patch: inserts the user-rules plugin row
  • Namespace: user-rules. The owning profile entry id must equal this string; the plugin's Config schema IS the namespace under the profile-config settings model.
  • Injection: apply registers a systemPrompt.section whose text reads config.rules.get() on every assembly, so the rules always reflect the current value.
  • Browser bundle: rides the window.__ModuleLoader__.load contract; React and @deepseek-ai/dsh-client-ui-primitives resolve from the loader's module table (external); CSS Modules are inlined by lightningcss as <style data-plugin>.

Install

### From a local directory (development)
dsh plugin --profile web add link:/absolute/path/to/dsh-user-rules

### From npm (recommended)
dsh plugin --profile web add @railgun52/dsh-user-rules@latest

After installing, restart dsh web. Open Settings → 用户规则 to manage rules. In link mode, run pnpm build and refresh the page after a code change; no reinstall needed.

Development

pnpm install
pnpm build        # tsc -b (types+declarations) && tsdown (node half + browser bundle)
pnpm typecheck    # type check only

The browser bundle is produced with the harness clientBundle helper; building from a fresh clone requires the DeepSeek Harness repository available (the tsdown.config.ts imports its clientBundle). The shipped lib/ is pre-built, so consumers never build.

License

MIT

—/ 5

No ratings yet

Verified DSH bundle

Commit 04fdf73f5dfb

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout