Adonis0123/adonis-skills / skills/agent-dispatch
agent-dispatch
FlaggedChoose the lightest agent setup for a coding, review, drafting or design-research task: do it yourself, fan out to 2-3 workers with independent parts across the Claude Code, Codex, Grok Build, Cursor or other CLIs and accounts on this machine, run a scoped architecture loop, or send one brief to independent researchers; pick a cross-model reviewer, test budget and cleanup; track dispatched work, external waits and user decisions on a Run Board. Use when work may need delegation, or the user asks to dispatch, fan out, parallelize, run several agents or accounts, get another AI's review or independent design opinions, or asks how dispatched work is going. Chinese triggers: 派活、并行、要不要多开几个 agent、分给多个 Claude 账号 / codex / grok、找另一个 AI 审、对比优秀设计、多方意见、进度看板、派出的任务进行到哪了。Not for unrelated read-only questions, trivial edits, research with no delegation, a single review of an existing diff (agentic-review-handoff), or the machine-wide session list (sideby sessions). Inside another named workflow, only size its workers.
references/accounts.md
View on GitHub# Accounts, pools and the probe
Read this before choosing a tier above L0, and whenever the user restricts accounts ("只用 cc001 cc002 cc003 cc008"), asks for 多开, or names a product you have not seen the probe report.
## Run the probe once per session
```bash
python3 <this skill>/scripts/probe_agents.py
```
It discovers accounts in order: accounts file (`~/.config/agent-dispatch/accounts.json` or `$AGENT_DISPATCH_ACCOUNTS`) → optional multi-account manager (sideby) → PATH lookup, and prints:
| Field | Meaning |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `products` | available products with distinct `quota_pools` and the per-account `<command>` to launch each |
| `code_products` | coding CLIs with usable subscriptions (API-key accounts excluded from managers unless listed in the accounts file) |
| `drafting_agents` | CLIs preferred for article drafting (e.g. Antigravity `agy`); used only when the user asks for a drafting agent or the Coordinator's context is already crowded, since the Coordinator holds the implementation context |
| `sessions_per_pool` | concurrent headless sessions allowed per pool (default 3) |
| `busy_sessions` / `available_slots` | per-pool occupied user sessions and remaining slots; a busy pool with slots left is not full; never select a full pool silently. The protocol cannot identify interactive sessions, so all busy sessions are reserved unless listed in `AGENT_DISPATCH_OWNED_SESSIONS`; the Coordinator id (`AGENT_DISPATCH_COORDINATOR_SESSION`, else `CLAUDE_CODE_SESSION_ID`, else `CODEX_THREAD_ID`) is excluded before the separate Coordinator reservation. That reservation is taken from `max_parallel_workers` only, so the Coordinator's own pool still shows its slot here: read it as "one more session fits beside the Coordinator", not as an idle pool |
| `max_parallel_workers` | pool slots left after reservations (pools × `sessions_per_pool`), minus the one session the Coordinator keeps; capped at 3 unless the user set `sessions_per_pool` above 1 |
| `allow` / `allow_unmatched` | the user's allow-list and entries that matched nothing (typos) |
| `fallback` | degradations that apply on this machine |
Do not assume Codex, Grok, Antigravity or extra accounts exist because a plan, a prior session or this skill mentions them. If the probe cannot run, treat the machine as single-product with one pool.
Also confirm the review skills you plan to use are installed and callable; `open-code-review-*` additionally needs the `ocr` CLI on PATH.
## Pools bound quota, not concurrency
One subscription account can run several headless sessions at once, and the Coordinator's own pool may host workers too. Up to 3 sessions per pool run by default; quota, not a free slot, is what runs out. So an account that is busy is not full: when a Lane is ready and its account is below the quota stop line (`SKILL.md` § Spend), start it as another headless session on that account instead of queueing it until the account goes idle, and do not ask the user first. Only when the account is at the quota stop line or at `sessions_per_pool` move the Lane to another account, picked from the probe and never around it, also without asking, and name the account in the next state line. When the probe's `allow` is non-empty, take the listed account of that product whose fullest quota window is lowest (`sideby quota <ref> --json`, `usedPercent`) and start the Lane with that account's own `<command>` (`sideby run <ref> --`); when no allowed account is below the quota stop line, wait for the reset instead of leaving the allow-list. Only when `allow` is empty may sideby choose: `sideby next <family> --dry-run --json` names the account with the most quota left. Raise the limit with `AGENT_DISPATCH_SESSIONS_PER_POOL` or the file field when the user asks for more; set it to 1 to get the old one-session-per-pool behavior. Sessions on one pool share its rate limit, so extra sessions there trade wall time for earlier limit hits; say so when you use them.
Read pools from the probe, never from account names: one login can sit behind two names (sideby reported `claude:main` and `claude:001` as one pool).
## Restricting accounts
Pass the names via `AGENT_DISPATCH_ALLOW` or the file's `allow`; it overrides discovery. Entries may be probe ids (`claude:001`), short commands (`cc001`, resolved from `sideby config get aliases` or the file's `aliases`) or a product name for all its accounts; check `allow_unmatched` for typos.
## Accounts file
`pool` groups accounts sharing quota; a missing `pool` gets its own pool; `id` defaults to `command`; optional `aliases` maps short names to ids; env vars override `allow` and `sessions_per_pool`.
```json
{
"allow": ["personal", "work"],
"sessions_per_pool": 3,
"accounts": [
{
"id": "personal",
"product": "claude",
"command": "claude",
"pool": "personal"
},
{
"id": "work",
"product": "claude",
"command": "CLAUDE_CONFIG_DIR=~/.claude-work claude",
"pool": "work"
}
]
}
```
## sideby as the session layer
When `sideby` is on PATH, `sideby sessions --json` lists every live session across accounts (status `needs-you` / `busy` / `idle`), `sideby send <session> "<text>" --json` delivers a message to a running Claude session (others get a paste line), and `sideby sessions copy <id> --as reference --json` hands a session to another AI. Detect each at runtime (`--help` exits 0) and keep the per-product fallbacks in `launch.md`. Listing every session on the machine belongs to sideby, not to a Run.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |