Configure team roles and models in T3 Code, and coordinate worktree delegation, independent review and inbox-style delivery. Use for team configuration or for tasks that explicitly ask for T3 team collaboration.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Multi Agent Workflow?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/nishiki4love-multi-agent-workflow)
---
name: multi-agent-workflow
description: Configure team roles and models in T3 Code, and coordinate worktree delegation, independent review and inbox-style delivery. Use for team configuration or for tasks that explicitly ask for T3 team collaboration.
---
# Multi-Agent Workflow
Handles team configuration, T3 delegation with independent review, and resuming and reporting on existing runs. Solo implementation, ordinary code review and general progress questions proceed as the original task. The current main session takes on the `defaults.coordinatorRoleId` role by default. Only when the user explicitly asks for a new top-level session, use `modelSelection` on `t3_thread_launch` to pick the coordinator model.
The core rules in this file take precedence over older examples, role templates and reference files inside the Skill. User authorization, project constraints and T3 runtime limits apply to every action.
## Configuration and Capabilities
- Configuration is layered. The base layer is the user-global `$MULTI_AGENT_WORKFLOW_HOME/team.json` (default `~/.config/multi-agent-workflow/team.json`), or the [built-in config](config/team.default.json) when there is no global file. A project `.multi-agent-workflow/team.json` is an overlay on that base: it holds only project-specific roles, same-id overrides, `excludeRoles` and any `providers`/`defaults` changes, and is merged at runtime. A project file with `"inherit": false` is standalone and ignores the base. Run `node <skill-dir>/scripts/init.mjs --inspect --json` to check the effective (merged) config, each role's source and capabilities; it is authoritative. For the role catalog with sample `delegate_task` payloads, run `node <skill-dir>/scripts/init.mjs --show-roles`: it renders the effective config at call time and writes no file. Project configs never write `roles.md`; only the global config keeps one next to its `team.json`. The [built-in role catalog](references/roles.md) shows the default roles and sample payloads; the effective config is authoritative for actual models and permissions.
- When the user asks to initialize, change models or manage roles, or the project has no config yet, read [Configuration and Maintenance](references/operations.md#configuration-and-maintenance). `<skill-dir>` is the directory containing this Skill (for example `.agents/skills/multi-agent-workflow` inside a project or `~/.agents/skills/multi-agent-workflow` at user level). All scripts run from the target project root. Choose the config scope from the user's intent.
- Call `orchestrator_capabilities` once per thread before the first delegation. Check again after an error or when the user changes Provider. Run the full orchestration when `delegate_task` and a shell are available. T3 tools such as `delegate_task` and `orchestrator_capabilities` may be lazy-loaded: if they are missing from the tool list, load them the way the runtime expects (for example ToolSearch) and actually call one; only conclude a capability is missing if it still fails. See the [role catalog example](references/roles.md#3-delegate_task-standard-call-examples) for the payload format. Once a required capability is confirmed missing, switch to chat mode and provide an execution plan and code suggestions for the user to run manually.
- Read the `features` flags in the same `orchestrator_capabilities` result and gate optional steps on them: `scheduledTasks` before `schedule_task`, `cancellation` before relying on `task_cancel` in the circuit breakers, `threadManagement` before `t3_thread_organize`. When a flag is false or missing, skip that step and list what was skipped under **Waiting / Needs approval** instead of failing the run.
- Match tasks to roles by `description`, `kind` and `permissions`. For read-write implementation, prefer a matching specialist role, otherwise use the default `executor`. Bind Provider, model and `options` from `targets`, and balance across the model pool when running in parallel. When the preferred target is unavailable, signed out or rate-limited, switch explicitly along `fallbacks` only within the bounds of user authorization and what the runtime allows, and record the reason. Never switch to a Provider listed in `providers.disabled`.
## Permissions and Circuit Breakers
- Modifying `.env*`, running or changing data, database or config migrations, changing CI/CD, installing or upgrading dependencies, `git push`, merging into the main branch, deleting resources, incurring costs or changing paid subscriptions all require explicit approval that covers the specific action and target. Obtain secrets only through `request_secret`.
- Child roles execute only what the brief says and deliver back to the coordinator; they never dispatch work in reverse. Default is `Depth ≤ 1`: child roles must not delegate further. Depth 2 applies only when higher-level rules allow it and the brief explicitly permits it.
- Each task or lane gets at most 3 review rounds and, without human intervention, at most 4 handoffs. Implementation dispatch, review, repair messages, replacements and re-reviews all count as handoffs. When a limit is hit, pause automatic flow, record the results received so far and escalate for a human decision. If round 3 still fails, stop automatic repair and re-review. Tasks the user cancelled or interrupted may be re-dispatched only after confirmation.
- Async tasks follow the `next` returned by T3. Never poll `task_status`, use `sleep` or timers. If there is no other independent work, end the current turn and wait for the system notification.
## Plan, State and Lanes
1. Before splitting work, read project conventions and contracts and extract the mandatory acceptance commands, module boundaries, security and engineering invariants, and how to start a preview. If engineering docs are missing, look at the project manifest. For complex root causes or security architecture questions, do a read-only analysis first.
2. Pick the process tier before anything else, and record it in `STATE.md`:
- **Direct**: a single file, no more than 10 lines. The coordinator implements and verifies it, with no run directory.
- **Light lane**: one read-write lane touching at most 3 files, with no full-flow trigger. Create the run directory and `STATE.md` as a light lane per [Run Directory and STATE.md](references/operations.md#run-directory-and-statemd), fill the **Light Plan** section of `STATE.md` (goal, files, done criteria, verification) instead of drafting `SPEC.md`, and show it to the user. A request that already names the exact change and says to go ahead counts as approval; otherwise wait for a one-line confirmation. The brief inlines the plan. Review, circuit breakers, acceptance and cleanup rules stay the same.
- **Full flow**: everything else. Create the run directory the same way as a full flow and follow step 3.
- Full-flow triggers, any one of which rules out the light lane: more than one lane or parallel work; shared types or API contracts; dependency manifests or lockfiles; build, test or CI config; migrations or `.env*`; authentication, authorization, secrets or other security-sensitive code; public API or data format changes. If a light lane grows past its limits or hits a trigger, stop dispatching, draft `SPEC.md` and get approval for the full flow.
- The default run directory is `~/.config/multi-agent-workflow/runs/<repo-name>/<run-id>/`; `MULTI_AGENT_WORKFLOW_HOME` overrides the config root. Use a new run-id for each new requirement, and maintain `STATE.md` from the [state template](templates/run-state.md); never overwrite an existing one.
3. In the full flow, the coordinator exclusively maintains `SPEC.md` and `STATE.md` in that directory; neither goes into Git. `SPEC.md` states the feature goal, files involved, scope of doc and UI copy updates, risks and the verification plan. After submitting the plan, pause and wait for explicit user approval before writing feature code or dispatching read-write implementation.
4. Once approved, split read-write lanes by non-overlapping file scopes (`Owned Paths`), and use `Forbidden Paths` to list all other paths plus the external `SPEC.md`. Shared types, API contracts, dependencies and build or test config are merged serially into the baseline first, before starting lanes that depend on them. On a same-file conflict, cancel the task that started later, and re-dispatch it on the new baseline after the earlier task merges.
5. `STATE.md` is the single ledger for run state and circuit-breaker counters. Update it immediately after every dispatch, completion pickup, repair message, re-review, merge and cleanup. Record role and model, `taskId`, `childThreadId`, the verbatim `link`, `worktreePath`, branch, latest head, review round and handoff count. The first dispatch counts as 1 handoff. Record actions and targets the user approved. The log is append-only, with timestamps from `date`.
### Recovery and Reconciliation
When continuing an existing run, after context compaction or after switching sessions, reconcile `STATE.md`, child sessions and Git per [Recovery and Reconciliation](references/operations.md#recovery-and-reconciliation) before dispatching. Decide on pickup, review or cleanup only after reconciling; never re-dispatch a lane that is still running.
## Handoff, Review and Repair
- Every handoff uses the [seven-field brief](templates/handoff-brief.md), with the role template chosen per the [contract spec](references/contracts.md). The brief states the goal, path boundaries, the role `checklist`, checkable done criteria and actual verification evidence. When a preview is involved, state the dedicated port and start command.
- In the full flow, the brief passes the absolute path of the external `SPEC.md` and the relevant sections; in a light lane it inlines the Light Plan instead. When the sandbox cannot read it, inline a key summary of those sections in the context field. Executors read it read-only before starting, and must stop and report to the coordinator immediately if they need to deviate. Reviewers check the goal, file scope, risk mitigations and verification plan against the same content.
- Fill `delegate_task.role` from the role's `delegateRole`, freeze Provider, model and dynamic options into `target`, and use a semantic, unique `clientRequestId`. Read-write tasks always use `isolation: "worktree"` and `mode: "async"`. Read-only tasks pick `shared` or `worktree` from the role config, and the brief names the worktree and head to inspect.
- T3 has no read-only child mode: narrower `runtimeMode` values only pause for human approval and do not block writes, so never use them as a read-only control. Enforce `permissions: "read-only"` with the [Read-Only Guard](references/operations.md#read-only-guard) instead: right before dispatching a read-only role, record a git fingerprint of every checkout it can reach (the coordinator checkout for `shared`, plus the lane worktree it inspects) in `STATE.md`; when the delivery arrives, recompute it before accepting anything. Any difference means it wrote something: reject the delivery, log it in `STATE.md`, restore nothing on your own and escalate under **Failed / Blocked**.
- Core, security-sensitive and key deliveries from roles with `requiresReview: true` must get an independent read-only review from `reviewRole` (or `defaults.defaultReviewRoleId` when unset). Other deliveries are checked against the applicable gates to decide whether they need review. Every review or re-review starts a fresh `delegate_task`. A re-review states the previously reviewed head, the blockers and the new head, and its scope is the previous blockers plus the diff between the two heads.
- For well-located fixes of no more than 10 lines, the coordinator fixes, commits and re-runs gates on the original lane's worktree and branch. Substantive fixes follow the [repair brief](templates/repair-followup.md) and, where T3 allows, are sent with `t3_thread_send` to the original executor's `childThreadId`, which returns a new head on the original branch. Update the ledger when the tool returns a new `taskId`. Review is still done by an independent role.
- Dispatch a replacement read-write task only when the original executor cannot continue and continuing the lane is approved, for example when the child session errors or hits a rate limit. The replacement must continue from the reviewed head; see [Replacement Executor](references/operations.md#replacement-executor). Handle timeouts, rate limits and other failures per the [failure circuit breaker and recovery runbook](references/guardrails.md), subject to the permissions and counters above.
## Acceptance, Reporting and Cleanup
- Acceptance is measured against the brief's "Done criteria". Check the actual commands and exit status in the corresponding worktree, the last 20 lines of test output verbatim, applicable preview evidence and any required review `PASS`. For Web, HTTP or UI work, verify on a dedicated port per [Isolation and QA](references/guardrails.md), respect the project's start method and T3 preview permissions, and after verifying close the tabs you opened and stop temporary servers.
- Once the feature passes acceptance, the coordinator compares `SPEC.md` against the implementation and updates the affected `README.md`, `CHANGELOG.md` and UI or CLI copy. Without a `CHANGELOG.md`, follow project conventions. Large copy changes get a separate conflict-free lane with review after the feature lanes merge. Re-run project gates whenever code or UI copy changes.
- Handle delivery within the authorized scope per the [PR and merge flow](references/guardrails.md). Link related PRs per T3 rules, and use `watch_pull_request` when follow-up is needed. Report measured results and the verbatim child session `link`.
- Inbox reports use **Done**, **Waiting / Needs approval** and **Failed / Blocked**. Done lists only tasks that meet all done criteria and the docs or copy already updated. Waiting lists approvals, circuit-breaker trips and pending cleanups. Failed / Blocked lists the actual error, the stage and the next repair step.
- Clean up a lane only after its merge is confirmed. Settle child sessions with no follow-up tasks and no queued messages, then dry-run, request approval and execute per [Post-Merge Cleanup](references/operations.md#post-merge-cleanup). T3 never removes worktrees itself, so the cleanup script reclaims a T3-managed worktree only with `--thread-state` proving its owning session is finished and settled. Merges are recognized as ancestor, rebase or squash; when git cannot prove one (for example a squash that needed conflict resolution), confirm the PR with `pull_request_read` and pass `--merged-pr <branch>=<url>`. Keep skipped items along with the reasons. Handle recurring tasks or cross-machine collaboration through the [corresponding T3 operations](references/guardrails.md).