| name | mai-orchestrate |
| description | Use when coordinating work across multiple agents via teams. Create tickets, delegate, track deps, monitor progress, run reviews — all through mai. |
Mai Orchestrate — Teams Coordination
Creating work
Tickets
mai ticket "Fix auth race condition" -p 1 -l auth --target src/auth.ts \
-d "Token refresh has a race condition. Add single-flight mutex."
With dependencies
mai ticket "Write auth tests" -p 2 -l test
mai ticket "Implement auth fix" -p 1 -l fix
mai dep tre-2222 tre-1111
mai dep tree tre-2222
Review tickets
mai ticket "Review auth changes" -p 1 -l review \
--target src/auth.ts --target src/http.ts
Delegating
Implementation worker
teams delegate [{
"text": "Execute tre-5c4a. Run: mai show tre-5c4a to read the ticket. Run mai context on target files before working. Comment progress with mai add-note. Close with mai close when done.",
"assignee": "fix-auth",
"model": "openai-codex/gpt-5.4"
}]
Review worker
teams delegate [{
"text": "Review rev-1234. Use mai-review skill. Leave findings on files with mai add-note --file. Include AC and REJECT in every finding.",
"assignee": "reviewer",
"template": "review"
}]
Fix worker (after review)
teams delegate [{
"text": "Fix the review findings on rev-1234. Run mai context on each target file to see findings. Fix each one. Comment your fixes with mai add-note --file.",
"assignee": "fixer",
"template": "fix"
}]
Research / oracle
mai create "Investigate token refresh options" -k ticket -l research \
-d "Research mutex vs single-flight vs channel-based approaches."
teams delegate [{
"text": "Execute res-4567. Research and post findings with mai add-note.",
"assignee": "oracle",
"template": "oracle"
}]
What workers do
Every worker follows the same pattern:
mai show <ticket-id>
mai context <target-file>
mai add-note <ticket-id> "progress update"
mai add-note <ticket-id> --file src/auth.ts "added mutex here"
mai close <ticket-id> -m "summary of what was done"
Monitoring
mai ls
mai ls -k ticket
mai ls -l review
mai search "auth"
mai search "auth" -k ticket
mai ready
mai blocked
mai dep tree <epic-id>
mai closed
mai doctor
Review cycle
The full review-fix-approve cycle:
mai ticket "Review: feature X" -l review --target src/foo.ts --target src/bar.ts
teams delegate [{"text": "Review ...", "template": "review"}]
teams delegate [{"text": "Fix review findings on ...", "template": "fix"}]
teams delegate [{"text": "Re-review ...", "template": "review"}]
Linking related work
mai link tre-5c4a rev-1234
mai dep tre-impl tre-design
mai show tre-5c4a
Rules
- Create the ticket before delegating. Workers read
mai show, not the task text.
- Tell workers to check
mai context on target files. This is how they see warnings, constraints, and findings.
- Use deps to sequence work. Don't delegate work that depends on unfinished work.
- Review workers use
--file on all findings. Fix agents see findings in-place.
- Link related tickets. Reviews ↔ implementations, epics ↔ children.