Agent orchestration
Skill UnleashedServices/unleashed-mail-plugin/skills/agent-orchestration
Orchestration patterns for running UnleashedMail agents in parallel. Activates when coordinating multi-agent workflows, determining which agents to run, or deciding execution order. Defines dependency rules and parallelization strategies for all agent combinations.From its SKILL.md
npx -y skills add UnleashedServices/unleashed-mail-plugin --skill agent-orchestrationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
11.8 KB, as published. Nobody here has run it
Agent Orchestration — Flexible Parallel Execution
Agent Registry
Coding Agents (produce code)
| Agent | Layer | Depends On | Can Parallel With |
|---|---|---|---|
db-engineer | Database | Nothing (runs first) | jira-manager |
logic-engineer | Services/ViewModels | db-engineer output | jira-manager, ui-engineer (if protocol is defined first) |
ui-engineer | Views | logic-engineer ViewModel interface | jira-manager, db-engineer (next feature) |
ai-engineer | GARI AI pipeline (providers, tools, prompts) | db-engineer/logic-engineer for persistence + service wiring | jira-manager |
tester | XCTest units + regression tests | The agent whose code it covers (interface defined first) | jira-manager; the implementer of the next unit |
code-simplifier | Simplification / judgment-based style pre-pass | Implementation complete | jira-manager (runs solo as a clean-up pass before the 5 reviewers — AGENT_CONTRACTS §5) |
Review Agents (evaluate code)
| Agent | Focus | Depends On | Can Parallel With |
|---|---|---|---|
security-reviewer | Credentials, OAuth, injection, CI | Changeset (+ whole pipeline on structural changes) | All other reviewers |
concurrency-reviewer | Correctness/logic, races, actors, deprecated APIs | Changeset (+ whole pipeline on structural changes) | All other reviewers |
ux-perf-reviewer | Responsiveness, rendering, query perf | Changeset (+ whole pipeline on structural changes) | All other reviewers |
accessibility-auditor | VoiceOver, keyboard nav, a11y labels | Changeset (+ whole pipeline on structural changes) | All other reviewers |
prompt-review | AI prompt/call-site safety: injection, refusal, ingress, tool scoping, PII-in-logs | Changeset (+ whole pipeline on structural changes) | All other reviewers |
swift-reviewer | Orchestrator + parity & test-coverage audit | Reviewer outputs | Runs after reviewers complete |
Ownership notes.
concurrency-revieweris the correctness owner — general logic/error-handling bugs that the other three reviewers explicitly punt land here. Judgment-based code style beyond SwiftLint is owned bycode-simplifier(runs first, per AGENT_CONTRACTS §5) + the SwiftLint merge gate (swiftlint --strict <changed files>+ whole-repo--baseline), not the reviewers.swift-reviewerowns provider-parity, test-coverage, and build/lint/test (verification) findings and emits them as structured rows (categoriesparity/test-coverage/verification) so they are first-class in dedup and the verdict.One orchestrator, one entry point. Invoking
swift-reviewerruns the whole pipeline: it spawns the five reviewers itself (Step 2), runs its own parity / test / verification audits, then synthesizes (Step 5). The "Stage 4 → Stage 5" split in the diagrams below is swift-reviewer's internal sequence — you may also run the five reviewers yourself and hand their JSON to swift-reviewer for synthesis. Either way there is exactly one orchestrator and one verdict.
Planning & Support Agents
| Agent | Role | Depends On | Can Parallel With |
|---|---|---|---|
modern-standards-planner | Research current best practices | Feature description | jira-manager |
jira-manager | Ticket lifecycle | Nothing | Everything — always parallel |
docs-engineer | Docs / READMEs / planning-doc upkeep | Change landed or planned | jira-manager, reviewers |
ci-engineer | CI workflows, SHA pins, gates | CI / workflow changes | jira-manager |
release-manager | Versioning, CHANGELOG, release cut | Work merged / ready to tag | jira-manager |
xcode-build-fixer | Build failure diagnosis | Build error output | Nothing (reactive) |
graph-api-debugger | Graph/MSAL debugging | Error context | Nothing (reactive) |
Planning Personas (requirements discovery — produce no code)
Run these during brainstorming / planning only, never execution. They surface
requirements and edge cases from a stakeholder's point of view and hand off to the
planner + jira-manager.
| Agent | Perspective | Depends On | Can Parallel With |
|---|---|---|---|
smb-entrepreneur | SMB founder / inbox power-user: productivity, cost, real-world workflow | Feature idea | enterprise-stakeholder, modern-standards-planner, jira-manager |
enterprise-stakeholder | IT director / CTO: compliance, security, scale, admin control | Feature idea | smb-entrepreneur, modern-standards-planner, jira-manager |
Registry is complete + CI-enforced. These tables list all 21 agents.
scripts/validate-plugin-assembly.pyparses the first column of every registry table and fails if it is not exactly equal toagents/*.md— so a new agent (or a renamed/removed one) cannot land without updating this registry, and a phantom row cannot reference an agent that does not exist.
Parallel Execution Rules
Rule 1: Independent agents ALWAYS run in parallel
When spawning agents via the Agent tool, launch all independent agents in a single message.
Do NOT wait for one to finish before starting another if they don't depend on each other.
✅ Good: Launch security-reviewer + concurrency-reviewer + ux-perf-reviewer + accessibility-auditor + prompt-review simultaneously
❌ Bad: Run security-reviewer, wait, then run concurrency-reviewer, wait, then...
Rule 2: Dependent agents chain, but parallelize within each stage
Stage 1 (parallel): db-engineer + jira-manager + modern-standards-planner
Stage 2 (parallel): logic-engineer (Gmail) + logic-engineer (Graph) + jira-manager update
Stage 3 (parallel): ui-engineer + tester (writes/updates XCTest) + jira-manager update
Stage 4a (pre-pass): code-simplifier cleans the changeset BEFORE review (AGENT_CONTRACTS §5)
Stage 4b (parallel): security-reviewer + concurrency-reviewer + ux-perf-reviewer + accessibility-auditor + prompt-review
Stage 5 (serial): swift-reviewer orchestrator synthesizes
Rule 3: Jira manager is always parallel
The jira-manager agent runs alongside everything. It never blocks and never waits.
Invoke it at natural breakpoints (stage transitions) to log progress.
Rule 4: Any subset of agents can be invoked
The user can request any combination:
"Run the security and accessibility reviewers on this PR"
→ Launch security-reviewer + accessibility-auditor in parallel
"Just have the db-engineer and logic-engineer implement this migration"
→ Launch db-engineer, then chain logic-engineer
"Do a full review"
→ Launch all 5 reviewers in parallel → swift-reviewer synthesizes
"Implement and review, but skip the planner"
→ db → logic → ui → all reviewers in parallel
Execution Patterns
Pattern A: Full Feature Lifecycle
1. modern-standards-planner + jira-manager (parallel)
(optionally preceded by smb-entrepreneur + enterprise-stakeholder for requirements discovery)
↓
2. db-engineer + jira-manager milestone (parallel)
↓
3. logic-engineer (+ ai-engineer if the change touches GARI) + jira-manager milestone (parallel)
↓
4. ui-engineer + tester (units/regression) + jira-manager milestone (parallel)
↓
5. code-simplifier pre-pass (clean the changeset before review)
↓
6. security-reviewer + concurrency-reviewer + ux-perf-reviewer + accessibility-auditor + prompt-review (parallel)
↓
7. swift-reviewer (synthesizes) + docs-engineer + jira-manager final update (parallel)
Pattern B: Review Only
0. code-simplifier pre-pass (clean the changeset first, AGENT_CONTRACTS §5)
↓
1. security-reviewer + concurrency-reviewer + ux-perf-reviewer + accessibility-auditor + prompt-review (all parallel)
↓
2. swift-reviewer synthesizes + jira-manager logs review results
Pattern C: Targeted Implementation
User: "Just fix the database layer for this feature"
→ db-engineer only + jira-manager
↓
→ Optional: concurrency-reviewer + security-reviewer (targeted to db changes)
Pattern D: Debug & Fix
1. xcode-build-fixer OR graph-api-debugger (diagnostic)
↓
2. Appropriate coding agent for the fix
↓
3. Targeted review (security if auth-related, concurrency if threading-related)
↓
4. jira-manager logs the fix
Handoff Protocol
When one agent's output feeds into the next, the handoff must include:
db-engineer → logic-engineer
Handoff: Database layer complete
- Migration: v{N}_{description}
- Record types: [list of structs]
- Query extensions: [list of static methods]
- Available observations: [ValueObservation setups]
logic-engineer → ui-engineer
Handoff: Logic layer complete
- ViewModel: [class name]
- Published state: [list of properties with types]
- Actions: [list of async methods]
- Error type: [EmailServiceError cases relevant]
- Observation: [how the VM starts/stops observation]
- Service protocol: [protocol name and key methods]
All reviewers → swift-reviewer
Each reviewer returns its prose report plus a fenced json findings array (the
machine-readable handoff defined in each reviewer's "Structured Findings" section).
The orchestrator parses the JSON — not the prose — and deduplicates on file +
overlapping line…lineEnd + same root cause (same category-family is necessary
but not sufficient), per swift-reviewer Step 5. A malformed or prose-only block is
recovered per Step 5 (lenient self-repair first → re-run a fresh reviewer → fail
closed → flag the missing reviewer as an uncertainty and route to NEEDS DISCUSSION —
not a verification blocker, which is reserved for checks that actually ran and is
treated as confirmed-by-construction), never synthesized from prose alone. The orchestrator folds in its own parity / test-coverage / verification
rows (same schema) and runs a verify gate on every blocker before the verdict. Each reviewer
also returns an Output Contract status (COMPLETE | BLOCKED | PARTIAL), which the
orchestrator reads before the findings: a BLOCKED reviewer is the explicit form of that
missing-reviewer uncertainty (→ NEEDS DISCUSSION, not a verification blocker), and a
PARTIAL reviewer keeps the findings for its completed scope plus a non-gating verification
warning naming the files it didn't reach (per swift-reviewer Step 5).
Handoff: Review complete
- Status: COMPLETE | BLOCKED | PARTIAL (the Output Contract — read BEFORE the findings; a BLOCKED reviewer returning [] means "could not review," not "clean")
- Severity: [highest severity found]
- Findings: [count by severity, with confidence]
- Structured Findings: a fenced json array of objects, each
{ severity, confidence, sourceAgent, category, file, line, lineEnd, scope, finding, evidence, fix }
(`scope` is optional, default `"changeset"`; set `"structural-pipeline"` for a finding a
structural-pipeline trace surfaced OUTSIDE the diff — omitting it makes `schema.parse_finding`
default to `changeset`, which the scope filter demotes such a finding to non-gating, the one
demotion Step-1b forbids)
- Report: [prose review + the JSON array]
Context Sharing
Agents operating in parallel on the same feature should reference:
- The planning document (
docs/planning/FEATURE_NAME_PLAN.md) for shared context - The Jira ticket (managed by
jira-manager) for status and decisions - The CLAUDE.md (this plugin's global context) for conventions and constraints
When spawning agents, always include:
- Which feature/ticket they're working on
- Which stage of the pipeline they're in
- What other agents have already produced (if any)