Introduction¶
DeepSeek Harness (DSH) emphasizes “everything is a plugin.” When building coding Agents, consistency and traceability of behavior often depend on manually maintained specification documents. agent-discipline is a DeepSeek Harness bundle that translates the Harness Engineering Methodology (HARNESS-METHODOLOGY-SPEC v1.0) into executable engineering constraints. By injecting methodology prompt sections, providing scaffolding tools, and enforcing compliance auditing, this plugin aims to establish an automated discipline constraint system for AI Agent repository development.
Core Features¶
Prompt Section Injection
After installation, the plugin automatically injects the agent-discipline section into the Harness system-prompt (order -90). The model works according to §1.3 Conversation Lifecycle and Core Invariants in that section, ensuring the Agent follows the predefined development paradigm.
Toolset
The plugin provides three core tools for state management, initialization, and auditing:
- agent_discipline_init: Generates §8 artifact templates in the target repository (including entry instructions, feature lists, progress tracking, validation gates, naming registry, etc.).
- agent_discipline_audit: Performs a read-only heuristic check on the repository against the §10 audit specification (covering 6 CRITICAL items and recommended sampling, five-subsystem scoring, etc.).
- get_feature / update_feature / verify_feature: Used for state machine service operations, replacing manual modification of JSON files.
State Machine Servitization (Form C)
The current version (Form C) has been implemented. The state machine is exposed as a Harness capability seam and managed through ctx.features.
- Strict State Folding: Implements the strict folding mechanism of Form C. Illegal state transitions or missing evidence (such as WIP=1 without evidence) are marked as corrupt.
- Event Log as Source of Truth: The session log is the source of truth, while feature_list.json is only an exported projection. Manual modification of the projection file will be overwritten by the source of truth.
- Self-Validation: The plugin itself is developed using Dogfooding and can be self-audited via node scripts/acceptance.mjs self.
Installation and Enablement¶
In the DeepSeek Harness environment, install the plugin using the official CLI:
dsh plugin --profile web add agent-discipline
After installation, no additional configuration is required; prompt section injection and tool registration take effect automatically.
Typical Usage¶
Initialize Repository Artifacts
Run the initialization tool in the target repository directory to generate the required §8 artifact templates. If the files already exist, the tool automatically skips them.
agent_discipline_init
Run Compliance Audit
Use the audit tool to check the current repository state against the §10 specification. This tool is read-only and mainly performs text and structure heuristic checks; it does not execute the target repository’s specific validation commands.
agent_discipline_audit
Self-Validate Plugin State
To ensure the plugin itself complies with its defined discipline, run the self-validation script:
node scripts/acceptance.mjs self
Applicable Scenarios and Notes¶
Applicable Scenarios
Applicable to Agent scenarios that strictly follow an engineering methodology for code generation, especially for teams with high requirements for repository state machines, feature list management, and audit compliance.
Notes
- Audit Scope: agent_discipline_audit is a heuristic check. It does not execute the target repository’s validation commands itself, and only performs text and structure analysis.
- Source of Truth for State: feature_list.json is an exported projection and must not be edited manually. Changes should be made through tools such as get_feature / update_feature; otherwise, they will be overwritten by the source of truth.
- Dependency Version: The dependency version is declared as >=0.1.0-0, a loose pre-release declaration; formal environments may need to tighten it.
- Optional Companion: The invariant companion module is optional and requires separately importing @deepseek-ai/dsh-invariants to enable internal interception.
Conclusion¶
By translating methodology from documentation into code constraints, agent-discipline provides disciplinary guarantees for DSH plugin development. It combines Form C strict state folding with event sourcing mechanisms, making the AI Agent development process more controllable and auditable.
- Project Home: https://github.com/FranklinZaneDurant/agent-discipline
- Directory Page: https://www.skillhub.cn/plugins/FranklinZaneDurant/agent-discipline