DSH’s core instruction chain is defined by AGENTS.md files. Manually maintaining these files, determining their effective scope, or monitoring instruction budgets is cumbersome. dsh-agent-instructions provides a panel in the DSH sidebar for directly editing each file layer in the instruction chain and visualizing budget usage.
Plugin Information¶
- Name: dsh-agent-instructions
- Maintainer: Bay-Zeddie
- Category: Client
- License: MIT
Installation and Activation¶
This plugin targets the DSH desktop client.
# 方式一:在桌面端应用的「插件」页添加本仓库(本地路径或 GitHub 地址)
# 方式二:在 desktop profile 的 package.json 里添加依赖与 bundles 条目
# 然后重启应用,host 侧代码会在启动时装载
Features¶
Sidebar Entry¶
The plugin registers a top-level panel in the sidebar, located under MCP and at the same level as ‘Plugins / Automation Tasks’. The old bottom-right floating button and the settings page entry available from v0.4.18 onward have been removed per the maintainer’s decision.
Instruction Chain Editing¶
The plugin list serves as the editor, listing each layer in read order. Click a list row to edit the corresponding AGENTS.md file. Reading, modifying, and saving any layer are supported.
Effective Scope and Pausing¶
The instruction chain includes three effective scopes: workspace + global / workspace-only / global-only.
- Pause or enable a layer by adding a .disabled suffix to the file name.
- Content is not deleted and can be restored at any time.
- Pausing leaves a trace on disk. If the directory is a git repository, git status will show the file rename.
Instruction Budget Visualization¶
The plugin reads agent-presets.default from settings.yaml and maxBytes from agent.cordis.yml, and visualizes the hierarchical usage of the instruction chain. The budget is an approximation (only file bytes are counted, excluding official rendering borders).
Technical Implementation¶
- Hand-written React bundle (uses
React.createElement, no JSX). - Uses official
ui-primitivescontrols. - All styles read DSH’s
--dsw-*design tokens, and the UI language follows DSH. - Integrates with the official slot system.
Permissions and Security¶
Access Scope¶
- Read: candidate files in the instruction chain (
AGENTS.md/CLAUDE.md/AGENTS.local.md/CLAUDE.local.mdand their.disabledvariants),settings.yaml(read-onlyagent-presets.default),agent.cordis.yml(read-onlymaxBytes), and.git(only probed as an existence marker). - Write: limited to whitelisted files (
AGENTS.md/AGENTS.local.mdand their variants), with atomic writes to disk. - Rejected: off-chain paths are uniformly rejected, with no formatting or preview.
- Network: zero external requests.
Behavioral Constraints¶
- Does not modify any DSH source code.
- Does not inject system prompts, does not write a second identity file, and does not alter DSH’s native behavior.
- Does not read the session.
Typical Usage¶
- After installation, open the panel from the sidebar → Agent Instructions (under MCP).
- If you want to modify the code: after
git clone, install from a local path on the desktop client’s ‘Plugins’ page, then refresh the page after modifications (client-side changes take effect immediately; host-side changes require restarting the app). - Click a list row to edit the
AGENTS.mdfile for the corresponding layer. - Pause or enable instructions by adding a
.disabledsuffix.
Notes¶
- The case where the workspace directory does not exist is not handled.
pnpm removewill not clean up symlinks innode_modules.- The settings page entry has been removed; only the sidebar entry remains.