Preface¶
When using the main agent in DeepSeek Harness (DSH) to dispatch sub-agents, the common problem is that agreements rely entirely on verbal communication: the documents submitted come in inconsistent formats, only one of the three required document tiers is delivered, and you have to repeatedly ask who is doing what and which step is stuck. The main agent’s context also gets crowded out by long dispatch instructions. dsh-agent-contract turns collaboration conventions into a checkable contract: conventions are injected at dispatch time, deliverables follow a fixed format with an audit ledger, auditing only reminds without blocking, and a “Contract” panel is provided in the sidebar. The plugin does not modify your code or write content for you; it only handles convention passing and compliance hints.
What Is This¶
In one sentence: Let dispatched sub-agents hand in work in a unified format, with progress traceable, completed work reviewable, and documents maintained by someone.
| Item | Description |
|---|---|
| Plugin ID | t2094308-star/dsh-agent-contract |
| Maintainer | t2094308-star |
| Category | Workflow |
| Current version | 0.35.0 (see package.json in the repo) |
| Directory page | https://www.skillhub.cn/plugins/t2094308-star/dsh-agent-contract |
| Source code | https://github.com/t2094308-star/dsh-agent-contract |
The DSH ecosystem is “everything is a plugin”; community directories such as SkillHub are independent sites with no official affiliation with DeepSeek / High-Flyer. For installation and usage instructions, refer to the repository README.
Core Features¶
Contract Injection and Role-Based Delegation¶
When the main agent dispatches work via each role’s contract_delegate_<role>, the plugin assembles a complete prompt on the spot and hands it to the sub-agent; the main agent only receives a short receipt (who was dispatched, contract word count, model and warnings). The assembly order is fixed in five sections: the master framework body (slot substitution, never trimmed), role card, task slice (task path and verbatim superior supplementary instructions; the task file body is not carried over), document slice (retrieval path and reading instructions; the body is not provided by default), and capability configuration (tool whitelist, model routing, deliverable contract, and prohibitions). The total soft limit is 6000 / hard limit 9000 characters, adjustable in the configuration; for continued dispatch within the same session, only the task slice is sent, without repeating the master framework and role card.
Built-in roles include: researcher, implementer, reviewer, adversarial reviewer, and librarian. Sub-agents can dispatch further downward, with depth up to 4 levels and a total of no more than 20 agents; reviewer and adversarial reviewer form two parallel checks, and adversarial review can use a model from a different source (the “Alternate Source” badge in the panel distinguishes this).
Three Deliverable Actions and Document Headers¶
Sub-agents deliver through fixed actions: write the deliverable document (automatically completing the header with task number, role, tier level, keywords, related files, etc.), update the progress file (one sentence; a reminder is triggered if it exceeds 400 characters), and record a fix summary. For tasks like building indexes or verifying references, the read-only tool doc_census can be used first to get machine-readable information, avoiding unnecessary full-text reads.
Ledger and Audit¶
The plugin records who is doing what, which document was submitted by whom, and whether tasks are finished. Health checks (audit) scan the project for: missing required deliverables, un-updated progress, body changes without keyword updates, wrong document directories, etc., producing red and yellow lists. It only reminds, does not modify files, and does not block operations. Dispatching work without going through the contract requires calling contract_request_escalation first to explain the reason; unauthorized bypass will be reported as uncontracted_dispatch in the health check.
Document Governance and the Librarian¶
The fixed role “librarian” is responsible for organizing documents, completing headers, archiving old files, and maintaining a catalog of “what each document covers”; backups are kept before writing. The configuration item audit.archiveAfterDays can set how many days old files should be suggested for archiving (the example default is 90 days).
Panel¶
The “Contract” page in the desktop app’s right sidebar includes: big-picture to-dos (reads the configurable to-do file and allows checking off), agent to-dos (execution queue), project-level audit red/yellow counts and lists, personnel tree (dispatch relationships and status), etc. The client depends on dsh-better-sidebar for injection.
Project Directory Auto-Adaptation¶
By default it follows the current workspace: it first probes existing directories against a candidate list (e.g., 任务/tasks, [Agent进度], docs/{研究,坑,修改,核心数据库}, etc.), and if none are found, creates a default structure under the project root (create-only, never overwriting). The derived result is written to <project root>/.agent-contract/project.json. The explicit initialization entry is project_init (default is preview-only).
Installation and Activation¶
This plugin is a local development form, linked into the DSH desktop app via link; the installation commands must be executed step by step per the README, and dependency steps cannot be omitted.
# Step 1: First install dependencies in the plugin directory (this step cannot be skipped)
cd "D:\DSH插件\dsh-agent-contract"
npm install --omit=dev --legacy-peer-deps # Install dependencies (libraries the plugin needs at runtime)
# Step 2: Link it into the application
dsh plugin --profile desktop add link:D:\DSH插件\dsh-agent-contract
After installation, fully quit and reopen the desktop app (tray icon → Quit, not just closing the window) for it to take effect.
If step 1 is missed, the app may show “Component activation failed … failed to import”. You can use the following command to self-check whether dependencies are complete (modify the path to your actual plugin directory):
node --input-type=module -e "await import('file:///D:/DSH插件/dsh-agent-contract/index.js')"
A schemastery error usually means missing dependencies; a dsh-tools error is normal (it is provided by the application).
Runtime dependencies include @deepseek-ai/schemastery, zod; peer dependency @deepseek-ai/dsh-tools (provided by DSH).
Typical Usage¶
- Dispatch work: Just speak naturally to the main agent, e.g., “Dispatch a researcher to look into X”. The main agent should use the contract delegation tool, and the sub-agent will receive the working conventions upon startup.
- Hand in work: The sub-agent writes the deliverable document, updates progress, and writes a fix summary if necessary; the document/progress badges on the panel reflect the status.
- Review: After code changes, dispatch a reviewer; when a second perspective is needed, dispatch an adversarial reviewer (the adversarial review model routing can be configured on the settings page; the example uses
adversary: glm-5.3-flash). - Health check and organization: Ask the main agent to “run an audit once” to view the red/yellow lists; dispatch a librarian for an organization round if needed.
- New repository: Just open a new folder as the workspace; to preview the directory structure to be created, ask the main agent to call
project_init(default is preview-only).
To lock the project root or customize paths, edit cordis.patch.yml inside the plugin package (default is not configured). Common items: project.root, paths.*, roles, budgets, audit.checks, git.autoCommit (off by default, and does not push), etc. See the configuration table in the README for details.
Use Cases and Notes¶
Who it suits: Teams or individual DSH users who use multi-sub-agent collaboration, emphasize document tiers and traceable progress, and want the main agent’s context not to be polluted by thousands of characters of contract body text.
Permissions and security: The plugin reads and writes the workspace and ledger with the current DSH process’s permissions; before installing, you should read the source code and license yourself (when the material does not separately list a license name, refer to the repository), and confirm it meets your security policy.
What it does not do: It does not modify business code or block tool calls; compliance issues are only reminded. When contract tools report errors, the README instructions provide the reason and alternative paths (retry, initialization, restart for version drift, bypass after escalation, etc.).
Closing¶
dsh-agent-contract turns the verbal agreements of multi-agent collaboration into contracts automatically issued at dispatch, fixed formats and a ledger at delivery, plus optional auditing and librarian governance; you are mainly responsible for conversation-level decisions and watching the panel, while the conventions and bookkeeping are handled by the plugin’s horizontal service layer.
- Directory page: https://www.skillhub.cn/plugins/t2094308-star/dsh-agent-contract
- GitHub: https://github.com/t2094308-star/dsh-agent-contract