Add the Morning Star multi-agent collaboration framework to DeepSeek
- Language
- TypeScript
- License
- MIT
- Branch
- main
Install
$ dsh plugin --profile web add github:btspoony/mstar-harnessRun the command above in your terminal to install this plugin via the dsh CLI. You can switch Profile in the top-right corner. New to dsh? Read the beginner tutorial
Install via your agent
Install the DeepSeek Harness plugin btspoony/mstar-harness for me: review the repository at https://github.com/btspoony/mstar-harness.git first, then run the install command and verify the plugin loads successfully.
Paste this instruction to the DSH Web GUI assistant — it will install and verify for you.
At a Glance
This is the dsh (DeepSeek Harness) host plugin for Morning Star (启明星) multi-agent collaboration framework. It hooks a state-machine-based workflow engine into dsh: automatically validates at key nodes such as writing harness state files, dispatching sub-agents, and modifying skill documents, while rendering a visualized workflow panel on the right side of the dsh conversation window.
Core Features
- Guard harness state file writes: Intercepts write requests to
{HARNESS_DIR}/status.json, performs completeness validation and residual cleanup checks based on the current document, and returns decisions through dsh's rejection channel when violations are detected - Validate sub-agent dispatching: Intercepts subagent / subagent_fork tool calls, determines if the dispatch is legal according to workflow constraints; in "hard constraint" mode, can reject non-compliant dispatches (including anti-self-recursion checks)
- Auto-inject role personas: Listens to dsh sub-agent startup events, injecting the corresponding role's description as a system prompt fragment into the sub-agent context
- Mount skills directory: Mounts mstar's
skills/as an independent skill provider to dsh, enabling dsh to recognize and invoke mstar-* series skills - Output engine status directory: Before each model inference, appends a line of
mstar-engine-statussummary to the conversation context (including iteration phase, current plan, remaining items, compliance policy, etc.) - Expose four workflow slash commands: Registers
/iteration-start,/iteration-drive,/iteration-loop,/codebase-audit, allowing multi-plan iteration start/resume without leaving dsh - Render "MStar Workflow" panel on the right side of conversation window: Displays current iteration phase, plan kanban, and agent flow status in canvas form
Technical Implementation
- Language: TypeScript
- Key Dependencies: @deepseek-ai/cordis (plugin container), @mstar-harness/engine (shared workflow engine), @deepseek-ai/dsh-skill-filesystem (skill mounting channel), schemastery (configuration validation)
- Architecture Pattern: dsh cordis extension plugin (named export + apply hooks), working through four dsh official extension surfaces: fs write interception, tool pre-execution interception, sub-agent startup events, and agent pre-inference directory injection, with zero dsh core modifications
- Entry Point: packages/dsh/src/index.ts (DSH sub-package); root package.json main points to packages/opencode/src/mstar.ts (OpenCode host entry, not involved in this plugin)
Use Cases
Multi-agent projects using dsh (DeepSeek Harness), requiring multiple agents (PM, QC, QA, Developer roles) to collaborate according to a consistent state machine and phase gates. Current pain point: dsh's built-in dispatch tool only handles "dispatch an agent to work", with no guarantee that each dispatch conforms to the overall plan's workflow constraints; after installing this plugin, all dispatches and state writes are pre-audited by the engine, with current progress visualized.
Prerequisites and Compatibility
| Dependency | Min Version | Description |
|---|---|---|
| DSH | 0.1.0-rc.7+ | Plugin strongly depends on dsh-agent / dsh-client-runtime / dsh-client-ui-conversation / dsh-client-ui-slots / dsh-client-locale / dsh-commands / dsh-fs / dsh-invariants / dsh-jobs / dsh-llm / dsh-skill / dsh-skill-filesystem / dsh-tools and other host packages, with dsh-base + dsh-web-app layer required in profile |
| @deepseek-ai/cordis | ^4.0.1 | dsh's plugin container, provided by the host |
| Bun (build time only) | >=1.2.17 | Used by plugin developers when building from source; users installing pre-built artifacts from npm do not need it |
| Runtime Node | Determined by dsh host | Plugin does not independently declare Node version |
| dsh-llm-fallbacks | Optional ^0.2.0 | Only needed when using mstar role seeding with fallbacks model routing linkage, install separately |
| Platform | Cross-platform | Server runs in dsh Node process; browser side loads via dsh web profile |
Installation
dsh plugin --profile web add github:btspoony/mstar-harness
Installation command format is defined by dsh official plugin specification; the above command adds
@mstar-harness/dshto web profile's bundle list and automatically rebuilds mounts. One-liner CLI installation also available:npx @mstar-harness/cli init --target dsh, which automatically installsdsh-llm-fallbacksas well.
Configuration Options
All fields are optional; omitted fields work with "hardcoded defaults" or "runtime detection".
| Config | Type | Description | Default |
|---|---|---|---|
harnessDir | string | Explicitly specify harness root directory. Not needed if your project uses auto-recognized directory names like .mstar/; must specify manually if using unconventional names (e.g., .harness/) | Runtime detection from session workspace (tries .mstar/, .agents/, .plans/, plans/ in order) |
enforcement | hard / soft | Global enforcement override. hard makes dispatch gate truly reject; soft forces warnings only (even if iteration guide declares hard constraints). Generally no need to change | Follows iteration compass metadata; all warnings if no compass |
dispatchTools | string array | List of tool names to intercept at dispatch gate | ["subagent", "subagent_fork"] |
dispatchBinding | string | The mstar role corresponding to current dsh session (e.g., fullstack-dev), used for anti-self-recursion pre-check: prevents agent from dispatching "itself" | Skips self-recursion check if not configured |
skillRoots | string array | Extra skill root directories, recognized as "project-level" by dsh skill filesystem | None (only mounts plugin's built-in skills) |
bundledSkillDir | string | Custom "built-in" skill root directory. Absolute paths take priority; relative paths resolved from dsh startup directory | Plugin package's built-in harness-skills/ mirror (relative path within package, not affected by startup directory) |
catalogTtlMs | number | Refresh interval for engine status directory (milliseconds) | 60000 |
roleMap | object | mstar role name → dsh-llm-fallbacks role name mapping table, currently only used for logging | None |
rolePersonas | object | mstar role name → custom persona text. Injected as system prompt fragment when sub-agent starts. Note: content must not contain paired {{ and }}, otherwise validation fails at startup | Uses plugin package's built-in harness-agents/ defaults |
workflowGate | off / warn / ask / hard | Workflow/ralph tool compliance gate mode. warn only warns; ask routes first-time new workflows through dsh approval; hard directly intercepts non-compliant calls | warn |
workflowNames | string array | Allowlist of workflow names considered "known". Empty/unconfigured ⇒ all treated as unknown (defaults to not allow) | Unconfigured |
maxGoalRounds | number | Maximum round limit for goal service (hard boundary for autonomous iteration phase) | 256 |
FAQ
Q: Did installation slow down dsh startup?
A: Minimal impact. Engine status directory refreshes every 60 seconds by default; hot path only does timestamp comparison and Map lookup; harness files are only re-read on first access or cache expiration.
Q: Will the dispatch gate "kill" my legitimate dispatches?
A: Default is warn mode, only warns without blocking; real rejection only happens when you explicitly enable Enforcement: hard in the iteration compass, or write enforcement: hard in config. Interceptions in hard mode include specific reasons; just modify according to the feedback.
Q: How do I configure anti-self-recursion pre-check to take effect?
A: Add dispatchBinding: '<mstar role name that initiates dispatch>' to the plugin's mstar line in your dsh config, for example dispatchBinding: fullstack-dev. Skips pre-check if not configured, won't report false positives.
Q: I see a new "MStar Workflow" tab in dsh, how do I turn it off?
A: It comes from the plugin package's browser-side client bundle (packages/dsh/src/client/), auto-loaded by dsh web profile. If you don't need it, just remove @mstar-harness/dsh from the profile and restart dsh.
Q: Can I modify the plugin's role personas or skills directory?
A: Yes. Two ways: edit the cordis.patch.yml at dsh profile level, adding rolePersonas / bundledSkillDir overrides to the mstar line's config; or modify the skills/ / agents/ in the repository root and run bun run bundle-assets to repackage.
Q: Error "persona contains {{...}}" - what do I do?
A: dsh's system prompt renderer does strict variable interpolation on {{ and }}; paired curly braces in your rolePersonas text will be rejected. Change double braces to single braces, or rewrite differently; isolated {{ (without matching }}) is safe.
Q: Conflicts with dsh upgrades?
A: No. Plugin does not modify dsh core; after dsh upgrade, just bun run build && dsh plugin --profile web add . to remount (or re-add the remote version). If upgrading from dsh versions before 0.1.0-rc.7, may need to upgrade dsh first.
Learning Curve
Advanced — Requires understanding of mstar's state machine concepts ({HARNESS_DIR}/status.json, iteration compass, QC/QA gate); most users can install and use immediately, but enabling "hard constraints" to actually work requires reading and understanding compass metadata.
Known Issues and Limitations
- State file write interception is "content-blind": fs write events only carry target path and agent, not new content, so "writing a good document to bad" cannot be intercepted on that write; fix by manually reverting to correct format, or deleting status.json to let harness rebuild
- Anti-self-recursion pre-check depends on
dispatchBindingconfig: skipped if unconfigured, multi-role dispatchers need separate config deployment for each role - Built-in skills mirror is synced at build time: if installing from source without running
bun run bundle-assets, no built-in skills or commands exist, but no error will be shown {{and}}content cannot be written inrolePersonas, otherwise plugin mount phase will be rejected by schemastery validation- When gating
workflow/ralphtool calls, unconfiguredworkflowNamesis equivalent to "all unknown", so first run of new workflows will be flagged - Content-blind skill lint has the same blind spot: fs write events don't carry content, so "first creation of non-compliant content" or "good document overwritten" cannot be intercepted
lintSkillWritehard-intercept error class is implemented but current dsh lacks "content-carrying" skill write hooks, so can only give warnings in "repair escape" form- Role→model automatic routing feature not delivered: current plugin only injects personas, does not modify sub-agent model selection; that capability depends on upstream interfaces
- design-md name matching is global basename matching (any
DESIGN.mdin any directory triggers design system validation), which may produce noisy warnings for unrelated projects
Morning Star is an Agent Plugin for harness engineering workflows: a TypeScript Harness Workflow Engine (@mstar-harness/engine) enforces deterministic workflow gates, while mstar-* judgment skills drive multi-agent code delivery.
- Deterministic gates, enforced by a TS engine — path/status/lease/dispatch/sdd/iteration/lint gates run in
@mstar-harness/engine, not as prompt suggestions - Judgment stays in
mstar-*skills — skills remain the single source of truth (SSOT) for roles, gates, and workflow judgment - One engine across hosts — the same engine + skills power dsh (DeepSeek Harness), omp, OpenCode, Cursor, Kimi Code, ZCode, and Codex
- Agent Plugin packaging — one-command install; portable across any Agent Plugins v1.0.0 client
- Recommended host (best → usable): dsh = omp ≥ OpenCode ≥ Cursor > Kimi = ZCode > Codex
What ships
| Component | What it is |
|---|---|
| Harness Workflow Engine | @mstar-harness/engine — TS enforcement of deterministic workflow gates |
| mstar CLI | @mstar-harness/cli — installer bootstrap + mstar workflow verbs |
mstar-* skills | Role, gate, and workflow judgment (single source of truth) |
| Host adapters | dsh, omp, OpenCode, Cursor, Kimi Code, ZCode, Codex |
Release notes: CHANGELOG.md / CHANGELOG_CN.md.
Install
| Host | Command |
|---|---|
| dsh (DeepSeek Harness) | npx @mstar-harness/cli init --target dsh(one CLI command that runs two independent dsh plugin --profile web add installs:@mstar-harness/dsh + dsh-llm-fallbacks; --no-fallbacks skips the latter)or dsh plugin --profile web add @mstar-harness/dsh+ dsh plugin --profile web add dsh-llm-fallbacks |
| omp | npx @mstar-harness/cli init --target omp(links ~/.mstar/harness)or omp plugin install github:btspoony/mstar-harness |
| OpenCode | npx @mstar-harness/cli init --target opencode |
| Cursor | npx @mstar-harness/cli init --target cursor |
| Kimi | Kimi TUI: /plugins install https://github.com/btspoony/mstar-harness→ /plugins reload |
| ZCode | npx @mstar-harness/cli init --target zcodethen install morning-star-harness in ZCode → Settings → Plugin Management |
| Codex | npx @mstar-harness/cli init --target codexthen codex plugin add morning-star-harness --marketplace personal |
| Generic (Agent Plugins v1) | point any Agent Plugins v1.0.0 conformant client at this repo root ( plugin.json + skills/ are the portable package) |
Engine gate checks (optional)
npm i -g @mstar-harness/cli
Puts the mstar-harness binary (short alias mstar) on PATH, so the engine-check commands the skills cite (mstar status validate, mstar dispatch validate, mstar iteration gate, …) actually run.
Without a global install the harness still works and those checks stay advisory. Set enforcement: hard in an iteration compass to make dispatch preflights fail-fast.
Caution:
mstaris a short alias and a shared bin namespace — an unrelated third-party npm package namedmstarclaims the same command name. The alias exists only where@mstar-harness/cliis installed: barenpx mstar …without the package resolves via the registry to that other tool, and globally co-installing both packages silently overwrites themstarshim (last install wins). The canonical invocation name staysmstar-harness— use the long name on any conflict.
Verify
npx @mstar-harness/cli doctor --target <opencode\|cursor\|codex\|zcode\|omp\|dsh>.
The repo ships a portable Agent Plugins v1.0.0 manifest (plugin.json) at its root; skills/ is the Agent Skills component — verify it with npx @mstar-harness/cli plugin validate.
Manual install / path layout: INSTALL.md. CLI flags: docs/cli.md.
Use
Three entry shapes: without iteration (single plan / hotfix), with iteration (multi-plan Phase 1–5), or codebase audit (discover what to do).
General (without iteration)
Enter PM, then run the per-plan cycle: Prepare → Execute → QC → QA gate → Done.
| Host | Enter PM |
|---|---|
| dsh (DeepSeek Harness) | pm skill (via the mstar skill provider; no auto-load) |
| omp | /skill:pm each session (no auto-load) |
| OpenCode | agent.project-manager (agents/project-manager.md) |
| Cursor | /pm |
| Kimi | session auto-loads pm; or /skill:pm |
| ZCode | /morning-star-harness:pm each session (no auto-load) |
| Codex | /pm |
Iteration
| Command | When |
|---|---|
/iteration-start [direction] [pause] | Start a new iteration: Phase 1 (interactive grill-me), then auto-continue Phase 2→5.direction — optional hint (still interactive).pause — stop after Phase 1; resume with /iteration-drive. |
/iteration-drive | Resume Phase 2→5 on an already-locked iteration. |
/iteration-loop [direction] [scale] | Full Phase 1→5 autonomous (no grill-me).direction — optional free text.scale — S / M / L / XL (default M). |
Codebase audit
| Command | When |
|---|---|
/codebase-audit [keywords] | Read-only survey → prioritized, self-contained plans in {PLAN_DIR}/audit-<date>/.Never edits source. Output feeds /iteration-start Research or normal Prepare → Execute.Effort: quick / deep (default standard).Scope: category focus ( security, perf, tests, …); branch (current-branch changes only); next / roadmap (direction candidates only); simplify (DEBT-focused deep pass).SSOT → mstar-audit. |
Command loading
| Host | How commands load |
|---|---|
| dsh (DeepSeek Harness) | /iteration-start · /iteration-drive · /iteration-loop · /codebase-audit (bundled harness-commands/ via ctx.commands) |
| omp | /iteration-start · /iteration-drive · /iteration-loop · /codebase-audit (filename commands from plugin commands/) |
| OpenCode / Cursor | Bundled from commands/ (OpenCode: plugin harness-commands/) |
| Kimi / ZCode | /morning-star-harness:iteration-start · :codebase-audit (etc.) via plugin manifest |
| Codex project | .agents/skills/<name>/SKILL.md (CLI symlinks from commands/) |
| Codex global | Project-scoped commands not installed — use --scope project |
Phase 2 defaults: per-plan worktree + lease, Findings cleanup: zero-residual. Override only with explicit Worktree mode: waived / Findings cleanup: allow-residual. SSOT → mstar-iteration, mstar-branch-worktree, mstar-plan-artifacts.
Project knowledge bootstrap: mstar-compound-refresh → references/project-knowledge-bootstrap.md.
Harness Workflow
flowchart TD
A["PM: entry and intent clarification"] --> B{"PM: spec and context ready"}
B -->|No| C["PM: clarify and refine requirements"]
C --> B
B -->|Yes| D["PM: initialize/load HARNESS_DIR and PLAN_DIR"]
D --> E{"Iteration scope needed"}
E -->|Deep / first iteration| F["iteration-start: grill-me → compass → review → lock"]
E -->|Fast autonomous loop| F2["iteration-loop: Phase 1→5 continuous"]
F --> G["PM: lock compass and create integration branch"]
F2 --> G
G --> H["Phase 2→5: execute → close → PR → merge-ready"]
E -->|No| I["PM: select active plan from status.json"]
H --> I
I --> J{"Any plan not Done"}
J -->|Yes| K["PM: dispatch one plan on a feature branch"]
K --> L["Dev roles: implement and report"]
L --> M["PM: update plan and status.json"]
M --> N["QC trio: review gate"]
N --> O{"QC decision"}
O -->|Request Changes| K
O -->|Approve| P{"QA gate"}
P -->|mandatory| P1["qa-engineer: acceptance verification"]
P -->|pm-acceptance| P2["PM: acceptance checklist"]
P1 --> Q{"Residual findings remain"}
P2 --> Q
Q -->|Yes| R["PM/QA: register or accept residuals in status.json"]
R --> S["PM: mark plan Done and merge to integration branch"]
Q -->|No| S
S --> T["PM: sync compass plan status"]
T --> J
J -->|No| U["iteration-close: close entry checklist"]
U --> V["PM: compound round and knowledge index"]
V --> W["PM: update roadmap and compass completed frontmatter"]
W --> X["PM: close exit checklist and commit"]
X --> Y["Phase 4: create PR"]
Y --> Z["Phase 5: merge-ready loop until CI green and reviews resolved"]
Without iteration: same per-plan gates, no iteration-start / iteration-close wrapper.
Roles and skills
| Agent ID | Responsibility |
|---|---|
project-manager | Routing, assignment, phase progression |
product-manager | Requirements, product planning, research |
architect | Architecture and technical contracts |
fullstack-dev / fullstack-dev-2 | Backend-led implement / second parallel track |
frontend-dev | UI, interaction, frontend performance |
qa-engineer | Acceptance when QA gate: mandatory |
code-reviewer | SDD per-task review; codebase audit (audit category) |
qc-specialist / -2 / -3 | QC trio |
ops-engineer | Deploy, monitoring, infrastructure |
writing-specialist | Docs, fiction, copy, scripts |
prompt-engineer | Prompt / skill / rule work |
Load mstar-harness-core first, then topic skills on demand (mstar-roles).
| Skill | Purpose |
|---|---|
mstar-harness-core | Entry, state machine, Task category, skill index |
mstar-phase-gates | Prepare/Execute, clarify, hotfix |
mstar-iteration | Phase 1–5 iteration lifecycle |
mstar-dispatch-gates | Dispatch, Delegation, anti-recursion |
mstar-sdd | Subagent-driven development |
mstar-branch-worktree | Branches, worktrees, QC/QA checkout |
mstar-plan-conventions | {HARNESS_DIR} discovery / init |
mstar-plan-artifacts | Plans, status.json, residuals, Findings cleanup |
mstar-design-md | DESIGN.md gate for UI plans |
mstar-review-qc | PM QC tri orchestration |
mstar-coding-behavior | RCA, test-first, review feedback, evidence |
mstar-compound / mstar-compound-refresh | Knowledge crystallize / maintain |
mstar-strategy | STRATEGY.md alignment |
mstar-skill-authoring | General skill authoring (SkillsBench gate) |
mstar-audit | Read-only codebase audit → prioritized improvement plans |
mstar-roles | Role prompts + load lists |
mstar-host | Host adapters (dsh / omp / OpenCode / Cursor / Kimi / ZCode / Codex) |
pm | /pm / /skill:pm / host PM entry |
Consumer plans default to .mstar/. Process artifacts (plans/, iterations/, status.json, sdd/, …) are gitignored; tracked results: {HARNESS_DIR}/AGENTS.md, knowledge/, specs/. Specs resolve .mstar/specs/ → docs/specs/ → repo-root specs/. Details → mstar-plan-conventions.
Maintainers: AGENTS.md.
License
MIT. See LICENSE.
Listing badge
[](https://deepseek-plugin.org/plugins/btspoony/mstar-harness)Paste this markdown into your GitHub README to link back to this listing. The badge only states the listing — not a security endorsement.