dsh-role-prompts: Injecting fixed job roles into the entire conversation

Preface

When building agents or fixed workflows in DeepSeek Harness (DSH), a common practice is to write “who you are and how you should output” into every message, or rely on the model to remember context from previous turns. The former is repetitive labor, while the latter tends to drift off track in long conversations. If a job role is treated merely as a standard user prompt, it is easily diluted by subsequent topics.

dsh-role-prompts turns “job roles” into session-level mandatory instructions: once a role is selected, every subsequent request includes that role definition in the system prompt, without occupying conversation bubbles or altering the body of your input. The following introduces the plugin’s positioning, installation method, and typical usage.

What is this

dsh-role-prompts is a DSH community plugin maintained by Justin-Mai. It is categorized as “Workflow” in the SkillHub directory. The current package.json version is 0.1.0, licensed under MIT.

The problem the plugin solves is clear: transforming job instructions like “Code Reviewer” or “Requirements Analyst” from soft prompts that can be ignored into system-layer constraints that remain effective throughout the entire session.

Core Features

Session-level System Prompt Injection

The plugin hooks into the node side at two points:

  1. agent/inbox/inserted: When a message enters the queue, it parses if the beginning is -RoleName or @RoleName, records the current role for this session, and makes it effective for the current turn.
  2. system-prompt/assemble: Before invoking the model each turn, it appends the current session role as a segment of the system prompt marked with role_activation, containing job responsibilities and execution requirements.

Therefore, the chat box only displays the content you wrote; the role setting does not appear as a full block in the bubble. The same role remains effective for every subsequent turn in the session without needing to be pasted repeatedly.

Role Selection within the Input Box

On the browser side, it provides a role overlay via conversation.input.overlay and registers a role reference source in inputTriggers. Typing - at the beginning of the input box triggers a role candidate popup; after confirmation, the query term becomes a role chip similar to @files, and the cursor lands after the chip so you can write the body text directly.

It also supports writing -RoleName BodyText or @RoleName BodyText in the message to send: this activates the role immediately and continues to be effective for subsequent turns in the session.

Settings Page and Local Storage

After installation, a “Role Instructions” section appears in the left column of DSH Settings. You can create new roles, filling in the Role Name and Job Role Instructions (identity, responsibilities, output format, prohibitions, etc.).

Role definitions are saved in a human-readable Markdown file, which the plugin re-reads on every request:

~/.dsh/dsh-role-prompts.md

Session activation state is stored separately in ~/.dsh/dsh-role-prompts.state.json. If this file is corrupted or the version does not match, it will be renamed to .bak and then reset. If a role is deleted, the corresponding activation will be silently removed, and the non-existent role will not be injected.

Installation and Activation

Requires DSH Desktop or Web version. It is recommended to install via DSH’s built-in CLI:

dsh plugin add github:Justin-Mai/dsh-role-prompts

After installation, press Ctrl+R in DSH to refresh the page, and you will see “Role Instructions” in the settings.

For development or code modification, the README also provides a method to mount from a local directory (symlink; just reload the plugin after making changes). For daily use, stick to the CLI command above.

Typical Usage

  1. Open Settings → Role Instructions, click “New Role”, and fill in the name (e.g., Code Reviewer) and the job role instruction body.
  2. Return to the conversation and type - at the beginning of the input box. Use ↑ and ↓ in the overlay to select, Enter or Tab to confirm, and Esc to cancel; you can continue typing to filter, e.g., -review.
  3. After confirmation, the - query term becomes a role chip. Write your question after the chip and send it.
  4. To switch roles: type - again to reselect. To deactivate the current session role: type - and select “Deactivate ‘RoleName’” at the bottom of the overlay.

The role file can also be hand-written or edited directly, for example:

## Code Reviewer

You are a senior code reviewer; you only perform reviews, do not rewrite the entire code.

If the role content requires section headings like ## Workflow, the plugin will escape the leading ## at the start of lines when writing to disk and restore them when reading back, to prevent them from being mistakenly split into multiple role entries.

Differences from Standard Prompts

Aspect Standard One-line Role Description dsh-role-prompts
Injection Location Usually in user messages or easily ignored context System prompt, assembled every turn
Session Persistence Requires repetition every turn or relies on model memory Automatically included every turn in the session after activation
UI Representation Role text may appear in the bubble Bubble contains only user text; role is activated via chip or prefix marker

Use Cases and Notes

Suitable for scenarios requiring a fixed job perspective: code review, document proofreading, output according to templates, clear prohibitions (e.g., not directly modifying the repository), etc. Roles are maintained centrally on the settings page; multiple sessions can each activate different roles.

Please note before use:

  • Trigger words must be at the beginning of the draft: The - must be immediately followed by the role name without spaces; list items like - Help me make a list will not be misidentified as activation.
  • Names do not contain whitespace: Spaces in names will be replaced with -.
  • The plugin runs with the permissions of the current DSH process. Before installation, it is recommended to view the source code and MIT license on the GitHub repository to ensure compliance with your environment policy.
  • The community directory SkillHub is not officially affiliated with DeepSeek / High-Flyer; the DSH ecosystem philosophy is “Everything is a plugin”, and this plugin is one of the community workflow extensions.

The maintainer provides an offline self-check: npm test runs test/basic.mjs and test/fixes.mjs using a temporary DSH_HOME, and will not read or write real role data in your local ~/.dsh.

Conclusion

If you want job roles to remain stable throughout the conversation without stuffing large settings blocks into every message, dsh-role-prompts uses system prompt injection and the input box - overlay to make this a reusable configuration. Directory page: https://www.skillhub.cn/plugins/Justin-Mai/dsh-role-prompts; Source code and README: https://github.com/Justin-Mai/dsh-role-prompts.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye