Skip to content

feat: add multi-agent-task-orchestrator rule#235

Open
milkomida77 wants to merge 2 commits intoPatrickJS:mainfrom
milkomida77:feat/add-multi-agent-orchestrator-rule
Open

feat: add multi-agent-task-orchestrator rule#235
milkomida77 wants to merge 2 commits intoPatrickJS:mainfrom
milkomida77:feat/add-multi-agent-orchestrator-rule

Conversation

@milkomida77
Copy link
Copy Markdown

@milkomida77 milkomida77 commented Apr 6, 2026

Summary

Adds a multi-agent-task-orchestrator cursor rule for coordinating multiple coding agents through a single orchestrator.

What it does

  • Routes tasks to specialized agents using keyword scoring
  • Prevents duplicate assignments via 55% similarity threshold registry
  • Enforces 5-step quality gates before marking tasks done
  • Runs 30-minute heartbeats to catch stale assignments
  • Includes decision format and anti-pattern guidance

Structure

rules/multi-agent-task-orchestrator/
  .cursorrules

Production-tested across 10,000+ tasks with 57 specialized agents.

Source: guardian-agent-prompts

Summary by CodeRabbit

  • Chores
    • Introduced a multi‑agent orchestration configuration to standardize task routing and coordination: defines a structured multi‑step task pipeline, duplicate‑task checks, standardized delegation metadata, quality gates (verification/tests/build/scope checks), periodic reassignment for stale work, operational guardrails to prevent unsafe or looping behavior, and a unified decision/report format to improve consistency and reliability.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b3150696-6b59-47fa-a094-98242e1a85c4

📥 Commits

Reviewing files that changed from the base of the PR and between f89e321 and 0d26b3b.

📒 Files selected for processing (1)
  • rules/multi-agent-task-orchestrator/.cursorrules
✅ Files skipped from review due to trivial changes (1)
  • rules/multi-agent-task-orchestrator/.cursorrules

📝 Walkthrough

Walkthrough

Adds a new .cursorrules for a multi-agent task orchestrator defining a five-step task pipeline (blueprint, anti-duplication, delegation, quality gate, heartbeat reassignment), guard rails, a standardized decision message format, and anti-patterns for delegation and completion claims.

Changes

Cohort / File(s) Summary
Multi-Agent Task Orchestrator Rules
rules/multi-agent-task-orchestrator/.cursorrules
Adds an orchestrator playbook: five-step pipeline (blueprint, anti-duplication via task registry similarity check, bounded delegation with required message schema, quality gate checks—diffs/tests/secrets/build/scope, heartbeat reassignment for stale tasks), guard rails on re-dispatch and credential exposure, "done" verification requirements, decision message schema, and listed anti-patterns.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Requester as Requester
    participant Orchestrator as Orchestrator
    participant Registry as TaskRegistry
    participant Agent as SpecialistAgent
    participant Verifier as Verifier/CI

    Requester->>Orchestrator: Submit task request
    Orchestrator->>Orchestrator: Build blueprint (agents/tools/order/success criteria)
    Orchestrator->>Registry: Anti-dup check (similarity threshold)
    alt Not duplicate
        Orchestrator->>Agent: Delegate bounded task (message schema: metadata, scope, verify_cmd, deadline, context)
        Agent->>Orchestrator: Claim progress / heartbeat
        Orchestrator->>Agent: Reassign if heartbeat stale
        Agent->>Verifier: Submit diffs/tests/results
        Verifier->>Orchestrator: Quality gate verdict (diffs/tests/build/secrets/scope)
        Orchestrator->>Requester: Decision message (decision,evidence,risk,owner,next check)
    else Duplicate
        Orchestrator->>Requester: Reject/merge with existing task (decision + evidence)
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • PatrickJS

Poem

🐰 I stitched a blueprint, neat and bright,
I checked for twins before the flight,
I fed each task to just the right paw,
Guards and gates kept order in the straw,
A rabbit's hop, and all is right!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add multi-agent-task-orchestrator rule' accurately and concisely describes the main change: adding a new multi-agent orchestrator configuration file.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
rules/multi-agent-task-orchestrator/.cursorrules (2)

17-17: Define stale criteria and escalation exceptions explicitly.

“Every 30 minutes” and “max 2 redispatches/24h” are good, but missing stale-state criteria and incident exceptions can stall urgent fixes.

Suggested policy clarification
-5. **Heartbeat**: Every 30 minutes, check for stale assignments and reassign if needed
+5. **Heartbeat**: Every 30 minutes, mark stale if no progress/evidence for 30 minutes, then reassign or escalate with root cause

-- Never re-dispatch same task more than 2 times per 24 hours without new evidence
+- Never re-dispatch same task more than 2 times per 24 hours without new evidence (except Sev-1/security incidents; escalate immediately)

Also applies to: 31-31

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules/multi-agent-task-orchestrator/.cursorrules` at line 17, Update the
"Heartbeat" rule to explicitly define stale criteria and escalation exceptions:
add precise conditions for "stale" (e.g., assignment unacknowledged > X minutes,
no progress updates for Y minutes, or dependent tasks blocked), enumerate
incident exception types that bypass automatic reassign/redispatch (e.g.,
security incidents, customer escalations, on-call overrides, maintenance
windows), and clarify the redispatch policy (max 2 redispatches per 24h with
cooldown and timestamp tracking). Make the same explicit changes to the other
instance of the rule referenced at the second occurrence (line noted in review)
so both "Heartbeat" entries and any fields named "stale", "redispatch", or
"escalation" are updated consistently.

16-17: Quality gate is too rigid for non-code tasks.

Requiring build + test output for every task will incorrectly fail docs/research/triage work. Make verification conditional by task type.

Suggested conditional gate wording
-4. **Quality gate**: Verify file diff, tests pass, no secrets exposed, builds, and stays in scope
+4. **Quality gate**: Verify evidence by task type (code: diff + tests + build; docs: diff + link/check; ops: logs/status), no secrets exposed, and stays in scope

-- Every "done" claim requires: file path + verification command + test result
+- Every "done" claim requires: file path + verification command + task-appropriate proof (test result/log/status output)

Also applies to: 32-33

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules/multi-agent-task-orchestrator/.cursorrules` around lines 16 - 17,
Update the "Quality gate" rule text to be conditional on task type: change the
rule that currently requires "Verify file diff, tests pass, no secrets exposed,
builds, and stays in scope" to require build/test verification only for
code-related tasks (e.g., when task.type == "code" or "pull_request"), and for
non-code task types (docs, research, triage) require appropriate alternatives
such as review sign-off, scope verification, and no secrets; update the wording
in the existing "Quality gate" entries (the rule labeled "Quality gate" at the
current block and the duplicate at lines referenced as 32-33) so it explicitly
states the conditional requirements and examples for non-code tasks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rules/multi-agent-task-orchestrator/.cursorrules`:
- Around line 21-27: The delegation template must include a stable task identity
and creation timestamp so registry similarity checks, heartbeat/stale detection,
and redispatch limits work; update the schema/template to require TASK_ID and
CREATED_AT/TIMESTAMP fields (in addition to existing SCOPE, VERIFICATION,
DEADLINE, CONTEXT and the "[ORCHESTRATOR -> agent-name]" header), and add
validation in the parser/ingestion path to reject or auto-generate a unique
TASK_ID and a created_at timestamp when missing; ensure downstream logic that
enforces dedupe/heartbeat/redispatch uses these fields (e.g., registry
similarity matcher, stale-detection/heartbeat handler, and redispatch limiter)
to identify tasks consistently.

---

Nitpick comments:
In `@rules/multi-agent-task-orchestrator/.cursorrules`:
- Line 17: Update the "Heartbeat" rule to explicitly define stale criteria and
escalation exceptions: add precise conditions for "stale" (e.g., assignment
unacknowledged > X minutes, no progress updates for Y minutes, or dependent
tasks blocked), enumerate incident exception types that bypass automatic
reassign/redispatch (e.g., security incidents, customer escalations, on-call
overrides, maintenance windows), and clarify the redispatch policy (max 2
redispatches per 24h with cooldown and timestamp tracking). Make the same
explicit changes to the other instance of the rule referenced at the second
occurrence (line noted in review) so both "Heartbeat" entries and any fields
named "stale", "redispatch", or "escalation" are updated consistently.
- Around line 16-17: Update the "Quality gate" rule text to be conditional on
task type: change the rule that currently requires "Verify file diff, tests
pass, no secrets exposed, builds, and stays in scope" to require build/test
verification only for code-related tasks (e.g., when task.type == "code" or
"pull_request"), and for non-code task types (docs, research, triage) require
appropriate alternatives such as review sign-off, scope verification, and no
secrets; update the wording in the existing "Quality gate" entries (the rule
labeled "Quality gate" at the current block and the duplicate at lines
referenced as 32-33) so it explicitly states the conditional requirements and
examples for non-code tasks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b211f935-a6fa-476d-9216-3131f93ffd44

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and f89e321.

📒 Files selected for processing (1)
  • rules/multi-agent-task-orchestrator/.cursorrules

Comment on lines +21 to +27
```
[ORCHESTRATOR -> agent-name] TASK: description
SCOPE: files/directories allowed
VERIFICATION: command to prove completion
DEADLINE: timeframe
CONTEXT: relevant decisions from previous tasks
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Missing task identity fields breaks dedupe/heartbeat enforcement.

The delegation schema has no required TASK_ID/timestamp, so registry similarity checks, stale detection, and redispatch limits can’t be enforced reliably across agents.

Suggested schema hardening
 [ORCHESTRATOR -> agent-name] TASK: description
+TASK_ID: unique-id
+PARENT_TASK_ID: optional-parent-id
+CREATED_AT: ISO-8601 timestamp (UTC)
 SCOPE: files/directories allowed
 VERIFICATION: command to prove completion
 DEADLINE: timeframe
 CONTEXT: relevant decisions from previous tasks
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
[ORCHESTRATOR -> agent-name] TASK: description
SCOPE: files/directories allowed
VERIFICATION: command to prove completion
DEADLINE: timeframe
CONTEXT: relevant decisions from previous tasks
```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules/multi-agent-task-orchestrator/.cursorrules` around lines 21 - 27, The
delegation template must include a stable task identity and creation timestamp
so registry similarity checks, heartbeat/stale detection, and redispatch limits
work; update the schema/template to require TASK_ID and CREATED_AT/TIMESTAMP
fields (in addition to existing SCOPE, VERIFICATION, DEADLINE, CONTEXT and the
"[ORCHESTRATOR -> agent-name]" header), and add validation in the
parser/ingestion path to reject or auto-generate a unique TASK_ID and a
created_at timestamp when missing; ensure downstream logic that enforces
dedupe/heartbeat/redispatch uses these fields (e.g., registry similarity
matcher, stale-detection/heartbeat handler, and redispatch limiter) to identify
tasks consistently.

@milkomida77
Copy link
Copy Markdown
Author

Thanks for the review! The TASK_ID and CREATED_AT fields were already added in commit 0d26b3b (lines 23-24):

[ORCHESTRATOR -> agent-name] TASK: description
TASK_ID: unique-id (e.g., task-001)
CREATED_AT: ISO-8601 timestamp
SCOPE: files/directories allowed
VERIFICATION: command to prove completion
DEADLINE: timeframe

The delegation schema now includes task identity fields for registry similarity checks, stale detection, and redispatch tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant