dsh-agent-prompt: Edit AGENTS.md in the DSH GUI

Introduction

DeepSeek Harness (DSH) injects AGENTS.md-compatible instruction files into the agent at the start of each session: a user-global file plus a project chain resolved by workspace. Normally, editing these files requires opening an external editor or dropping into a terminal, working on one path at a time, and it’s easy to miss changes when switching workspaces.

Agent Prompt (icrefin/dsh-agent-prompt) collects the same set of “files Harness actually reads” into a panel on the left sidebar of the GUI: a file tree for global and per-workspace files on the left, and a plain-text editor on the right. The bytes written on save are exactly what the agent will read in the next session. Maintained by icrefin, categorized as a client plugin in the SkillHub directory; the current released version is v0.1.0, targeting the dsh 0.2.0-rc.2 ecosystem.

What This Is

In one sentence: a centralized editor for user-global and per-workspace AGENTS.md files inside the DeepSeek Harness GUI, with path resolution rules consistent with the official package @deepseek-ai/dsh-agent-instructions.

The plugin provides no Loader configuration options and has no separate settings page—the files on disk are the state themselves.

Core Features

UI and Entry Point

  1. A new Agent Prompt row is added to the sidebar icon bar, positioned directly below Schedules (sidebar.panellist, id: 'agentPrompt', order: 11).
  2. Clicking it opens the Agent Prompt main page: the left tree lists GLOBAL (User-global) and each registered WORKSPACES node, with workspace filtering; the right side is a monospace plain-text editing area (no Markdown preview, no syntax highlighting).
  3. Each node displays the resolved absolute path; files that don’t yet exist are marked as not created, and saving will create the file and any missing parent directories.

Which Files Are Edited

Scope Resolution Rule
User global $DSH_HOME/AGENTS.md, falling back to ~/.dsh/AGENTS.md if unset (an empty-string $DSH_HOME is treated as unset)
A workspace Search upward from the registered workspace directory until the first ancestor directory containing .git; the target file is <that directory>/AGENTS.md. If no marker is found along the way, it stops at the workspace directory itself

In a monorepo, if the workspace directory doesn’t coincide with the Git repository root, the tree node shows the repository root rather than the package directory.

Scope note: the panel only handles AGENTS.md. The loader also supports CLAUDE.md, AGENTS.local.md, and CLAUDE.local.md at each layer of the project chain, but this plugin deliberately does not edit those files.

Editor Operations

Action Shortcut / Notes
Save Ctrl+S (⌘S on macOS), effective globally in the page; the button is disabled until the draft matches disk
Reload Discard the draft and re-read from disk; confirms if there are unsaved changes
Undo / Redo Native system undo; local history, consecutive keystrokes are folded into one step
Wrap Soft-wrap toggle, preference saved in localStorage

Before switching files or closing the page, you’ll be prompted if there are unsaved changes. Clipboard operations rely on system shortcuts (Ctrl+C / Ctrl+V, etc.); the panel does not provide duplicate buttons.

Host HTTP API (for integration or debugging)

Routes are registered under ctx.webServer with a loopback-only access restriction; write operations modify the instruction files that the agent reads, so they should not be exposed in a LAN-accessible dsh web deployment. The request body limit is 4 MiB.

GET  /api/agent-prompt/tree
GET  /api/agent-prompt/file?key=global|ws:<workspaceId>
POST /api/agent-prompt/file   { key, content }

key is global or ws:<workspaceId>; the workspace id must already be registered in DSH; unknown ids return 404.

Installation and Activation

Desktop profiles are managed by the Electron application and cannot be installed via dsh plugin add (that command will reject this profile). Add a local packaged artifact via Settings → Plugins (or the plugin manager).

Build and package from source:

pnpm install
pnpm build                              # tsc -> lib/, tsdown -> lib/client.js
npm pack --pack-destination dist        # dist/dsh-agent-prompt-0.1.0.tgz

Add dist/dsh-agent-prompt-0.1.0.tgz on the Plugins page. The bundle is written into the profile’s dsh.profile.bundles; cordis.patch.yml mounts the host side, and the dsh.client manifest loads the browser side.

Two operational notes:

  1. Reinstalling the same version number will not replace already-extracted content. If you rebuild the tarball under the same version, remove the bundle from the profile before installing, or bump the version in package.json.
  2. A restart is usually not needed on first install; afterwards, if changes touch host-side routes etc., the DSH process must be restarted. The browser bundle hot-updates with the revision, while host ESM is loaded at process startup, as described in the @deepseek-ai/dsh-hmr documentation. If entries report failed to import, try restarting.

Build environment requires Node >= 22.17.0 (see engines in the repository’s package.json).

Typical Usage

  1. Launch the DSH desktop app with the plugin installed, and select Agent Prompt in the left icon bar.
  2. Select User-global (e.g., ~/.dsh/AGENTS.md) or a workspace node in the tree, and edit common or project-level agent instructions on the right.
  3. Press Save or Ctrl+S to write; the status bar reflects line count, character count, and whether it has been saved.
  4. When starting a new agent session, Harness loads the just-written content according to the @deepseek-ai/dsh-agent-instructions rules.

To discard local changes, use Reload; if the same file has been changed in an external editor, you should Reload before editing, otherwise Save will overwrite directly (the panel does not do mtime merging).

Use Cases and Cautions

Who it’s for: developers who frequently switch between multiple DSH workspaces and need to maintain global and per-repo AGENTS.md files; users who want to verify “the paths and content the agent will actually read in the next session” without leaving the Harness window.

Permissions and security: the plugin runs with the current dsh process permissions. Write routes can create or overwrite AGENTS.md on the local machine; the README notes that these APIs are reachable from loopback addresses and are not protected by the SPA ?token= launch token (named routes are matched before the authenticated SPA fallback). Before installing, review the GitHub repository source and the MIT LICENSE.

Other limitations:

  • While the page is open, external modifications to the same file are not automatically detected; saving overwrites them.
  • If workspaceRegistry is not registered, the global file is still available, but workspace-targeted operations may return 503.
  • If agent-instructions config pins a dshHome different from $DSH_HOME || ~/.dsh, the path shown by the panel may differ from what the loader uses (the default combination only sets maxBytes, so this is generally not an issue).

The DSH community embraces “everything is a plugin”; the SkillHub directory is an independent community site with no official affiliation with DeepSeek / High-Flyer.

Reference Links

If you’re already using AGENTS.md in Harness to constrain agent behavior, bringing the editing entry point into the sidebar can reduce the number of switches between external editors and terminal paths.

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

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

Xiaoye