dsh-parent-instructions: Appending Parent-Level AGENTS.md Instructions to Child Workspaces

Introduction

In DeepSeek Harness (DSH), the built-in @deepseek-ai/dsh-agent-instructions walks up from the current working directory to find the nearest .git, then loads the AGENTS.md family of files between that root and the cwd. Once a sub-workspace is itself a Git repository, the project root stops at the subdirectory, and the parent-level AGENTS.md is never loaded. For nested workspaces, developers often want the sub-workspace to retain its own instruction text while also inheriting the rules from the parent chain. This plugin is a complementary solution designed for exactly that purpose.

What It Is

dsh-parent-instructions is a DSH plugin maintained by hluica, categorized under “Workflow.” It does not modify the built-in plugin; instead, it appends parent directories “above the built-in project root” to the runtime context and merges the AGENTS.md / CLAUDE.md / AGENTS.local.md / CLAUDE.local.md files from the parent chain into the session’s runtime context.

Core Features

  • Defines a parent workspace root marker in settings (default: .dsh-parent-root), which can be a file or a directory.
  • When a new session is created in a sub-workspace (one that has its own .git), in addition to the project chain loaded by the built-in plugin, it reads all candidate instruction files from the parent root down to the built-in project root.
  • The marker must be above the built-in project root; placing it inside the sub-workspace has no effect.
  • Injected content is rendered via ctx.systemPrompt.context(); it does not enter the system prompt but instead appears as a persistent user-role snapshot.
  • Text deduplication and budget capping: identical content is kept only at its earliest occurrence; a single file must not exceed 256 KiB, and total text must not exceed 32 KiB; when exceeded, broader files are dropped first, and the most specific file is truncated last.

Installation & Activation

Install this directory via the plugin manager (link: for in-place installation, no copying):

plugin_manager: action=install_bundle, target=<absolute path to local-plugins/dsh-parent-instructions>

After installation:

  1. On the “Plugins” page, confirm that “Parent Workspace Instructions” appears and the entry dsh-parent-instructions is running.
  2. Open Settings → General; a “Parent Workspace Marker” row should appear. If it doesn’t, refresh the web page.
  3. Place a file or directory matching the marker name (default: .dsh-parent-root) at the parent root, and ensure at least one of AGENTS.md / CLAUDE.md / AGENTS.local.md / CLAUDE.local.md exists in the parent directory.
  4. Create a new session in the sub-workspace that has its own .git; the new session’s runtime context should include Parent workspace instructions.

Typical Usage

Assume the following directory structure:

proj/
  AGENTS.md
  local-plugins/
    dsh-foo/
      .git
      AGENTS.md

With proj/.dsh-parent-root present, working in proj/local-plugins/dsh-foo:

  • The built-in plugin loads dsh-foo/AGENTS.md.
  • This plugin loads proj/AGENTS.md and local-plugins/AGENTS.md (if they exist).
  • The two sets do not overlap, because this plugin only reads directories strictly above the built-in project root.

Example of the parent source visible to the model:

Parent workspace instructions (from .dsh-parent-root at /path/to/proj; broader than the current workspace, so closer instructions take precedence):

From: /path/to/proj/AGENTS.md

...parent content...

Use Cases & Notes

  • Ideal for DSH users who need to uniformly inherit parent-level instructions in nested workspaces, such as multi-repo projects or modular development.
  • The plugin runs with the current DSH process’s permissions; review the source code and license before installing.
  • The marker must be above the built-in project root; if the cwd itself or a closer ancestor is a .git, the marker must be placed at the parent of that .git directory or higher.
  • If the current preset is minimal, the built-in plugin itself does not load the project chain; this plugin still only supplements the parent level and will not fill in the sub-workspace’s own instructions.
  • parentRootMarker is a profile-level setting, not per-Workspace.
  • On file read failures, permission errors, or invalid markers, the plugin returns an empty section and will not cause prompt assembly to fail.

In Short

dsh-parent-instructions allows nested workspaces to retain their own instructions while also inheriting the AGENTS.md rules from the parent chain. It suits development scenarios that require unified context and consistent rules across multi-level projects.

  • Plugin directory: https://www.skillhub.cn/plugins/hluica/dsh-parent-instructions
  • GitHub: https://github.com/hluica/dsh-parent-instructions
羽毛球分组比赛记分
小程序二维码

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

Xiaoye