Preface¶
DeepSeek Harness (DSH) injects instruction files from the workspace into agent sessions: the user’s global ~/.dsh/AGENTS.md, plus AGENTS.md, CLAUDE.md and their corresponding .local.md overlays along the chain from the project root to the working directory. Editing these files day-to-day typically requires switching to an editor or terminal, which doesn’t align with the Web settings, byte budgets, or loader discovery rules. The following introduces the community plugin dsh-agent-instructions-editor (maintainer MaRi23333), which adds a “Personalized Instructions” page inside the DSH Web GUI settings, mirroring Codex-style “personalization” settings and centrally viewing and saving files using the same discovery rules.
What Is This¶
dsh-agent-instructions-editor is a DSH client-class plugin (npm package name dsh-agent-instructions-editor, current README version 0.2.3, targeting DSH 0.2, adaptation baseline 0.2.0-rc.2). It contributes a “Personalized Instructions” entry to the Settings sidebar, composed of a global editor, a project-chain browser, and overlay editing, and displays byte budgets plus a “takes effect in new sessions” hint. The desktop client reuses the same Web plugin UI, so no separate desktop package is needed.
Project repository: GitHub — MaRi23333/dsh-agent-instructions-editor; catalog page: skillhub.cn/plugins/MaRi23333/dsh-agent-instructions-editor. This plugin is an independent community project, not affiliated with or endorsed by DeepSeek; the DSH ecosystem follows the “everything is a plugin” direction, and catalogs such as skillhub are community sites rather than official app stores.
Core Features¶
Global Instructions¶
The settings page provides a resident editor that reads and writes ~/.dsh/AGENTS.md, and displays the byte budget (default 65,536 bytes).
Project Instruction Chain¶
The project instruction area is collapsed by default. First select a target via the project selector: auto-discovery comes from the workspace registry and recent session directories, or you can manually paste a path. After selection, entries are displayed layer by layer along the “project root → working directory” path, with four candidate slots per layer:
AGENTS.mdCLAUDE.mdAGENTS.local.mdCLAUDE.local.md
Existing files can be clicked to enter editing; non-existent ones can be created. The discovery logic is consistent with the @deepseek-ai/dsh-agent-instructions loader: marker upward traversal, ancestor-chain walking, candidate probing, and sha1(trim) deduplication by directory content (duplicates carry a ⧉ badge in the UI); the byte total and budget bar likewise follow loader rules.
Saving and Safe Writing¶
Constraints are applied on the write side to avoid writing to wrong paths and silent overwrites:
- Filename whitelist (the four candidates above).
- The directory
realpathmust fall within the “project root → working directory” ancestor chain of a registered project. - mtime conflict detection: if the modification time on disk is older than the baseline carried by the save request, a 409 is returned, with options to reload or overwrite.
- Temp file + atomic
renamereplacement; writes to the same file within the samedsh webprocess are serialized in an in-memory queue.
After a successful save, the UI prompts to create a new session: the editor will not directly replace instructions already loaded in existing sessions; when existing sessions re-read instructions is determined by the host loader.
Host HTTP and UI¶
The Host half provides the routes /agent-instructions/api/{projects,chain,file}; the list of manually registered projects is stored in this plugin’s profile entry, read and written via DSH 0.2’s SettingsForms, with revision conflict detection. The Client half contributes the settings page to settings.section; the editor is a plain textarea (no additional UI dependencies). The README notes that the current UI text is mostly hardcoded Chinese (a locale dictionary has been registered for future t() integration).
Installation and Enablement¶
Plugin installation and enablement states for the desktop client and Web instance are independent of each other; operate according to your actual runtime environment. Environment requirements: DSH 0.2, Node.js 22+, and a DSH CLI matching the host version; both the npm package and GitHub release include lib/ build artifacts, so no local build is generally needed.
Users still on DSH 0.1 should keep plugin 0.1.2 (specify dsh-agent-instructions-editor@0.1.2 on npm) and should not upgrade directly to the 0.2.x series.
Desktop Client (Recommended)¶
- Open the left-side “Plugins”, click “Add plugin”.
- Enter the npm package name
dsh-agent-instructions-editor@latestand confirm installation. - After installation completes, click “Enable now” (if you close the completion dialog, the plugin remains in the installed list but is not enabled).
- Only when the UI prompts a restart is needed, fully quit via the Quit menu and reopen (on Windows / macOS, closing the window may only hide it to the background).
- Open Settings and confirm that “Personalized Instructions” appears in the sidebar.
Alternative: provided the desktop companion CLI is registered and the client has been Quit:
dsh plugin --profile desktop add dsh-agent-instructions-editor@latest
dsh plugin --profile desktop list
Then restart the desktop client. A regular dsh CLI installed externally via npm cannot manage the desktop profile.
Web Instance¶
Prefer using the same version of the dsh CLI that started the Web instance:
dsh plugin --profile web add dsh-agent-instructions-editor@latest
Stop the current process, re-run dsh web, and refresh the browser page.
If npm is unavailable, install from a pinned GitHub tag per the README:
dsh plugin --profile web add github:MaRi23333/dsh-agent-instructions-editor#v0.2.3
If using npx to run installation, the version should match the Web host (e.g., npx @deepseek-ai/dsh@0.2.0-rc.2 ...). When switching back from GitHub or a local directory to npm, include @latest so that an existing installation is not judged as already satisfied and skips the update.
Typical Usage¶
- Install and enable the plugin, then restart the host (per UI prompts or README requirements).
- Go to Settings → Personalized Instructions.
- Edit
~/.dsh/AGENTS.mdin the Global instructions area, watching whether the budget bar approaches the default 65,536-byte limit. - Expand Project instructions, select a target project from the selector (or paste a project root path and complete registration).
- In each layer of the project chain, click an existing file to edit, or create one of the four whitelisted filenames in an empty slot.
- After saving, if you receive a 409, the file was modified externally: first reload to merge content, or confirm and overwrite.
- Create a new session and then verify whether the agent behaves according to the new instructions; do not assume the current session will hot-update.
Use Cases and Notes¶
Who it’s for: users who need to manage global and multi-project instruction chains uniformly inside DSH and want the UI to match the official loader’s discovery rules; developers accustomed to Codex-style “personalization” centralized editing scenarios can also use it by analogy.
Runtime and trust: the plugin runs with the current DSH process privileges, and can read and write APIs on the local loopback as well as instruction files under allowed paths. Before installing, it is recommended to read the source repository and the MIT license, and understand the Host validations (loopback Host header, JSON on POST, same-origin Origin) and write boundaries.
Known limitations (excerpted from the README):
- No file locking across processes; if an external editor and this plugin save the same file simultaneously, there is theoretically a very small race that could lose one external update, similar to regular editors.
- If the agent-instructions configuration in
dsh-baseis modified (custom markers, candidates, or budgets), the editor’s display may drift from the loader defaults. - When an instruction file is a symlink, reads follow the target; writes replace the symlink itself via rename and do not write through to the target.
Conclusion¶
dsh-agent-instructions-editor brings DSH’s instruction file system into the settings page: the global AGENTS.md, the four-piece project chain, and byte budgets are all visible on one screen, and saving is backed by a path whitelist plus mtime conflict hints. Install the package for the corresponding profile on demand from the catalog page or GitHub, then edit under Personalized Instructions after enabling, and confirm effectiveness by creating a new session.