/task-management:dispatch <TM-id> [--backend topology|tmux|orchestration|manual] [--steal]from task-management
Hand one ready-for-agent task to a worker end to end — claim, start, worktree, handoff, spawn (topology → tmux → orchestration → manual). Use when the user says "dispatch this", "run this on an agent", "spawn a worker for TM-N", "/dispatch", or a labelled card should execute without this session doing the work.
Ships in task-management. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
One verb for the whole hand-off. Dispatch is a start: the WIP gate applies
exactly as it does to tm start. On any failure after the claim, the claim is
released and the status put back.
The task is labelled ready-for-agent, unblocked, and this session should not
implement it. The store applies that label itself once the task has a body,
criteria and an epic — you rarely set it by hand, and a card a person kept back
with ready-for-human is not yours to dispatch. For a loop over many cards,
[[pool]] (which is already running by default). To do it yourself, [[implement]].
.bytedesk/task-management/bin/tm label TM-014 ready-for-agent
.bytedesk/task-management/bin/tm caps --json
.bytedesk/task-management/bin/tm dispatch TM-014
.bytedesk/task-management/bin/tm dispatch TM-014 --backend tmux
.bytedesk/task-management/bin/tm dispatch TM-014 --steal
MCP: tm_dispatch { "id": "TM-014", "backend": "tmux", "steal": false }.
HTTP: POST /api/task/TM-014/dispatch { "backend": "tmux" } — 409 carries the
CLI's wording.
--backend pins one name and skips the fallback walk. Default order:
topology → tmux → orchestration → manual (dispatch.backends). Every spawn is
argv-only, shell: false. Tmux also writes <worktree>/.tm-dispatch-prompt.md.
Worker env: TM_SESSION_ID, TM_ACTOR (dispatcher), TM_ROOT (repo). Do not override.
Secrets a worker needs (an API key, say) are declared by NAME, never by value, in YOUR user config
only: {"dispatch":{"passEnv":["TYPESAFE_API_KEY"]}} in ~/.config/task-management/config.json, or
workers.passEnv in agent-orchestration's global ~/.config/agent-orchestration/config.json
($XDG_CONFIG_HOME if set). The repository's .bytedesk/*/config.json files are git-tracked, so
a name set there (including by tm config dispatch.passEnv) is ignored with a passEnvWarnings
warning. Reserved names (TM_*, AO_*, CLAUDE_*, LD_*, DYLD_*, GIT_*, PATH, HOME,
NODE_OPTIONS) are refused. The value is copied from the dispatching session's environment into
the worker. Tmux stages it in a 0600 temp file the pane sources and deletes, then re-applies the
worker's TM_* variables so the file cannot override them. Topology does not read tm's
dispatch.passEnv: ao-topology passes only the names in agent-orchestration's own global
workers.passEnv, and the dispatch event warns about any tm name it did not pass. A name the
dispatching environment lacks is reported as passEnvMissing and the dispatch continues. Never
run tmux set-environment -g for a secret.
not found; done/deleted (reopen first); no backend (tried lists why);
already dispatched with a live claim (confirm the worker ended, then collect; --steal
cannot start a second writer); another
session holds the claim (needs --steal); WIP (gateStart).
For a governed task, first require persistent-lead admission. The handoff records its lead and
workflow. The worker commits, pushes its branch, opens a PR, attaches evidence, then submits
the handoff's finish JSON with ao-topology manage report --consumer <repository> --task <id> --file <finish-report.json>.
The producer records the finish, calls tm review-ready, and queues independent review.
Keep its claim and report any review_blocked reason to the lead;
independent review and a separate integration decision precede done. dispatch.governed: true
holds unadmitted tasks without pausing unrelated work.
Recorded checkouts and branches are validated and reused. New checkouts use
dispatch.integrationBranch. A failed launch retains its checkout and evidence for a later
validated retry. Topology records are durable outside the task checkout; cleanup calls the
producer's preservation check first. Claude then Codex is the supported candidate order;
candidates without enforced worker guards hold visibly.
For an ungoverned task, the legacy completion contract applies:
The worker ticks AC, commits, pushes its own branch and opens a PR
(gh pr create --title "<TM-id>: <title>"), attaches evidence, then tm done —
or tm block with the error if the push or the PR failed. It then merges its own PR once
review is clean and checks pass. A PreToolUse guard enforces the scope: the worker's own branch,
gh pr create and gh pr merge <own branch> are allowed, while force pushes, other branches, deletions,
history rewrites, merging other PRs, releases, secrets and deploys are refused.
This session runs [[collect]] — which records the PR url on the task when gh
finds one — reaps with [[agent]], and watches [[events]]. Probe first with [[caps]].
Full table: docs/agent-first.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub bytedeskai/bytedesk-marketplace --plugin task-management27 skills in this plugin
/adrWrite an architecture decision record into .bytedesk/task-management/adrs/, or finish one of the stubs the AskUserQuestion hook drafted automatically. Use when a real decision gets made — a tradeoff, a rejected alternative, a constraint the team must not relitigate — or when the user says "record this decision", "write an ADR", "/adr"./agentDispatched-worker registry — list with derived liveness, heartbeat a name, reap the dead (parks their claimed tasks). Use when the user says "who is running", "reap dead workers", "agent heartbeat", "/agent", or a dispatched claim looks abandoned./boardShow the task board for this repo — epics, in-progress, blocked, next unblocked, and stale work — from .bytedesk/task-management/. Use when the user asks "what's on the board", "where are we", "what's next", "/board", or when resuming work and you need the real state rather than session memory.Other plugins' skills for the same job