DSH adopts the “Everything is a Plugin” philosophy. When developing complex agent workflows, the main control agent often needs to autonomously orchestrate sub-agents. hu568/dsh-plugin-cluster-preset is a DSH “Cluster Mode” agent preset that enables the main control agent to autonomously delegate work to a group of named experts, performing parallel fan-out and coalescing verification, while introducing the “Agent Mortality Theory” stage prompter.
Core Capabilities¶
This preset includes the following core components:
- 5 Named Expert Tools:
explore(codebase retrieval),librarian(external reference retrieval),oracle(read-only high-intellect advisor),metis(pre-planning advisor),momus(plan reviewer). - 2 General Delegation Tools:
subagent(fresh context),subagent_fork(inherits current session). - Default Proactive Use of Agent Teams: By modifying policies, the upstream behavior of “only build teams when explicitly requested by the user” is changed to “proactively build by default,” unless it is a minor single-file change, a pure Q&A, or the user explicitly says “do it yourself.”
- Agent Mortality Theory Stage Prompter: Calculates age based on theoretical context usage, providing prompts at four prime life stages: 20, 30, 40, and 60 years old, helping the agent perceive context pressure.
Installation and Activation¶
This repository is a distributable DSH bundle. It is recommended to install it using the official plugin manager:
plugin_manager action=install_bundle target="github:hu568/dsh-plugin-cluster-preset"
Desktop users can add this spec via “Settings → Plugins” or the plugin manager UI.
Note: Code changes require a full restart of DSH to take effect (
dsh-hmrignoresnode_modulesby default, and Node ESM caches imported modules). Theversionmust be bumped during updates; otherwise, DSH will report anambiguous-installerror.
Mechanism Details¶
1. Default Proactive Use of Agent Teams¶
DSH’s default policy for Agent Teams requires the user to explicitly say “enable agent teams” to build teammates. This preset changes this to “proactive by default” via cluster-preset/team-policy.js, while retaining other upstream runtime constraints (such as shared working directory, non-overlapping writing domains, task board usage, etc.).
Implementation Principle: In DSH, the preset scope is the parent of the agent scope, and section merging follows the “closer wins” principle. Therefore, the policy at the agent layer is overridden via the system-prompt/assemble waterfall at the preset layer, rather than using a same-name section override. This overrides the policy while isolating the influence of other presets.
2. Agent Mortality Theory Stage Prompter¶
The prompter treats the session’s theoretical context usage as age, with a scale of 1% usage = 1 year.
- 20 Years Old (Prime 1/4): Lightweight tasks can be completed. Prompts to solidify key conclusions.
- 30 Years Old (Prime 2/4): Most tasks can be completed. Prompts to re-read details and split into smaller units for delegation.
- 40 Years Old (Prime 3/4): Cognitive degradation is noticeable. Prompts to stop doubling down on the same line of thought and perform independent review of key conclusions.
- 60 Years Old (Prime 4/4): Only a few complex tasks require such a long context. Prompts to wrap up as soon as possible and avoid starting new fronts.
This prompter reports both “Theoretical Lifespan” (determining intellect) and “Actual Lifespan” (determining survival). If these are misaligned—for example, if the actual lifespan is exhausted but the theoretical age is still young—the prompter will explicitly point this out.
3. Leaf Constraints (Preventing Infinite Delegation)¶
Every expert is a leaf and cannot delegate further. This is guaranteed by two lines of defense:
maxDepth: 1: The sub-agent runtime validates depth. The orchestrator has depth 0, and created sub-agents have depth 1. Experts have depth 1; if they delegate again, the sub-agent would have depth 2, which is rejected.toolFilter: All delegation tools and write tools are removed viadeny. Experts only retain regular tools likeread,grep, etc.
Note: General delegation lines cannot set
modelSelectionSettings: true. This is because thesubagenttool has a special registration mechanism (it is not in the ancestor layer when mounted). If this flag is set, names in thedenylist (likesubagent) will cause an error before the sub-agent is created, and the expert will still hold the tool, invalidating the “leaf” promise.
Notes¶
- Relative Path Dependencies: The plugin uses relative paths (e.g.,
./cluster-preset/lifecycle-reminder.js). During installation, ensure these files exist in the corresponding subdirectories; otherwise, the import will fail. - package.json Requirements: The directory containing relative path plugins must include a
package.jsonwith non-emptynameandversionfields. Otherwise, DSH will trace back to the profile’s manifest, which typically only hasnamebut noversion, resulting in a mount failure. - Illegal Value Handling: Illegal values in the configuration will cause a mount failure and error (fail-loud); they will not be silently ignored.
Summary¶
hu568/dsh-plugin-cluster-preset provides a complete orchestration solution for main control agents. Through named experts, default enabled Agent Teams, and Mortality Theory prompts, it helps agents handle complex tasks more efficiently and controllably. During deployment, attention must be paid to the restart process after code modifications and the integrity of relative path files.