Introduction¶
When building multi-agent collaboration in DeepSeek Harness (DSH), a common practice is to write workflow rules into each agent’s instructions: one for the executor, one for the reviewer, and one for the lead. As the number of rules grows, maintaining consistency becomes difficult, as changes in one place require synchronization in multiple places. Even more troublesome is the issue of runaway loops—agents repeatedly retry the same error, no one determines when to stop, and handoff information is lost when passed between roles.
The agent-loop-workflow plugin introduced below is a workflow skeleton designed to address these issues: it abstracts the collaboration protocol so that any agent team only needs to load it once, without the need to duplicate it across different places.
What is it¶
agent-loop-workflow is a project-independent multi-agent collaboration workflow skeleton maintained by LeslieWylie under the MIT license, current version 0.1.1. It provides a collaboration protocol for DSH featuring loop protection, six-field handoffs, risk-tiered review routing, and a fixed delivery order.
It only defines the workflow skeleton itself with zero dependencies—it requires no external services, relying only on DSH’s skill loading mechanism. The runtime environment requires Node >= 18.
Core Features¶
Role Topology¶
It defines four types of roles and their responsibility boundaries: DRI (executor), reviewer, lead (decision-making/routing), and operations (automation). Team members perform their respective duties, with boundaries clearly defined by the protocol.
Loop Guard Six Invariants¶
This is the core of loop protection, consisting of six invariants: maximum round limit, no-progress detection, circuit breaker for identical errors, time warnings, explicit exit mechanism, and single-authority writes. The first four are used to detect and interrupt runaway loops, the explicit exit mechanism guarantees a clear termination path for the loop, and single-authority writes prevent multiple parties from modifying the same state simultaneously.
Six-Field Handoff¶
Handoffs between roles use a fixed template containing six fields: owner, goal, input, write operation, acceptance criteria, and evidence of failure. The information structure is consistent with every handoff, ensuring the receiving party does not miss any critical items.
Risk-Tiered Routing¶
Reviews are categorized into fast / standard / high based on the scope of changes, automatically routing them to different reviewers. Small changes take the fast track, while large changes undergo strict review.
Fixed Delivery Order¶
The delivery process is fixed as: verification → commit → push → Draft MR/PR → ready signal → in_review. Every step has clear prerequisites, and no steps are skipped.
review→Closure Protocol and Anti-Loop¶
After entering in_review, reviews are automatically dispatched. Reviewer conclusions are recorded in metadata, supporting rejection, retry, and escalation mechanisms. Regarding anti-loop protection, three measures are taken: idempotent order creation, preventing duplicate dispatches due to status changes, and identifying manual sources.
General Red Lines¶
The protocol includes three built-in general constraints: key confidentiality, separation of token permissions, and confirmation for destructive operations.
Installation and Enablement¶
First, install the plugin. The official installation command is as follows, where --profile web indicates installation into the web profile:
dsh plugin --profile web add "github:LeslieWylie/agent-loop-workflow"
After restarting, load the skill in any session:
load agent-loop-workflow
After the steps above, the agents within the team will have access to unified workflow rules.
Design Principles¶
Three principles deserve separate explanation:
-
Project-independent: It only defines the collaboration workflow skeleton. Specific project code issues, review checklists, and repository paths should be placed in the project’s own
*-conventions/*-engineering/*-review-rulesskills, not mixed into this protocol. -
Zero dependencies: No external services are required; install and use.
-
Platform-agnostic: The skill does not specify any issue tracker or code hosting platform. “Issue” and “MR” in the protocol are abstract descriptions; you simply map them to your own platform during use.
Use Cases and Notes¶
Suitable scenarios: Building a multi-agent team consisting of DRI, reviewer, lead, and operations in DSH, and wishing to have a ready-made, reusable collaboration protocol instead of writing instructions from scratch every time.
Two points to note before use:
-
The plugin runs with the permissions of the current DSH process. It is recommended to check the source code and license before installation to ensure it meets your security requirements. The repository address is at the end of the article.
-
It does not solve project-level issues. How to review a specific repository or which directories contain pitfalls should be placed in the project’s own conventions / review-rules skill, working in layers with this plugin.
Conclusion¶
agent-loop-workflow addresses repetitive work and the risk of runaway loops in multi-agent collaboration: a single protocol defines roles, handoffs, review routing, and delivery order, complemented by Loop Guard to safeguard against control loss. For DSH developers whose team size is still evolving and collaboration rules are frequently adjusted, this serves as a ready-to-use starting point that can be customized.
- Community Directory Page: https://www.skillhub.cn/plugins/LeslieWylie/agent-loop-workflow
- GitHub Repository: https://github.com/LeslieWylie/agent-loop-workflow