Preface¶
DeepSeek Harness (DSH) achieves high extensibility through a plugin-based architecture. However, when handling development tasks that require multi-person collaboration, clear accountability, or strict auditing, prompts alone often cannot guarantee process compliance. The dsh-tang-governance plugin introduces a governance model based on the administrative logic of the “Three Departments and Six Ministries,” using runtime-enforced boundaries, explicit approval points, and observable execution tracing to transform loose conversations into structured workflows.
Plugin Positioning¶
This is a standalone npm package that adds the “Three Departments and Six Ministries” governance model to DeepSeek Harness. It does not modify the Harness source code but runs as a plugin. Its core concept draws on the Tang dynasty administrative structure, breaking the development process into stages such as requirement clarification, independent review, user approval, execution by responsible departments, and final acceptance, ensuring tasks operate within controlled boundaries.
Core Features¶
The plugin divides the development process into explicit roles and stages:
* Scale-aware intake: Zhongshu (Central Secretariat) routes tasks based on scale (small/medium/large), avoiding lengthy processes for small tasks.
* Pre-draft clarification: When requirements are ambiguous, it pauses with blocking questions before drafting solutions.
* Independent review and countersigning: Menxia (Chancellery) independently reviews specification documents and rejects them if issues are found.
* Explicit user gates: User approval is required before implementation, and acceptance confirmation is required before closure.
* Unified ministry routing: Shangshu (Department of State Affairs) scans six responsible domains and dispatches only substantively involved ministries.
* Runtime-enforced boundaries: Validates hierarchy, roles, and dependencies through code rather than prompts alone.
* Observable execution: Provides an organizational chart, collapsible timeline, Token usage, and department records.
* Stable model inheritance: Ministries can be routed independently, and the Six Ministries inherit the model and provider from Shangshu.
* Persistent case files: Each task generates a structured archive under .tang/cases/<case-id>/.
* Workspace knowledge: Automatically generates a shared index and deduplicates reusable findings.
* Recoverable stop: Users can stop work at any time without discarding completed artifacts.
Installation and Enablement¶
Before installation, ensure the environment meets the requirements: Node.js ^22.19.0 || >=24, and DeepSeek Harness 0.1.1-rc.2 or a compatible 0.1.x version.
- Clone the repository and install dependencies.
- Run type checking and tests.
- Add the local plugin to DSH configuration.
- Start the web interface.
git clone https://github.com/Ruszero01/dsh-tang-governance.git
cd dsh-tang-governance
pnpm install
pnpm run check
dsh plugin --profile web add link:.
dsh web --no-open
Open http://127.0.0.1:3080, select the governance mode from the preset menu to begin.
Typical Usage¶
- Mode selection: Directly choose the “Three Departments and Six Ministries” governance mode from DSH’s preset menu.
- Requirement clarification: When a request is ambiguous, Zhongshu pauses and asks specific questions, then begins drafting only after confirmation.
- Solution review: Review the Markdown solution signed by Menxia in the approval workspace.
- Execution tracing: View the organizational chart and real-time execution tracing on the dashboard to monitor department status and Token consumption.
- Record viewing: Inspect each department’s execution records to understand evidence and status at every stage.
- Closure confirmation: Before closing, review the final case report and manually close after confirming acceptance evidence and risks.
Applicable Scenarios and Notes¶
- Environment requirements: Node.js
^22.19.0 || >=24and DeepSeek Harness0.1.1-rc.2or a compatible0.1.xversion are required. - Mode inheritance: On first launch, the plugin uses the API to copy the currently installed Harness Standard mode and appends governance tools, so dependencies and behavior are determined by the current Harness version.
- Scale signal: “Task scale” is a soft planning signal rather than a hard Token limit. Complex work may expand due to evidence or implementation needs, and only explicit user or deployment configuration sets
maxTokens. - Permissions and compliance: The plugin runs with the permissions of the current DSH process. Before installing, review the source code and license (MIT).
Conclusion¶
For DSH developers who need strict auditing, clear accountability, and standardized workflows, Tang Governance provides a complete closed loop from requirements to delivery. Its observability and runtime-enforced mechanisms can effectively reduce communication costs and rework rates in collaboration.
- GitHub repository: https://github.com/Ruszero01/dsh-tang-governance
- Directory page: https://www.skillhub.cn/plugins/Ruszero01/dsh-tang-governance