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.
scripts/sideby_cli.py
View on GitHub"""Bounded argv-only sideby transport and response validation."""
import contextlib
import json
import os
import signal
import subprocess
def bounded_run(argv, *, timeout, **kwargs):
"""Stop the entire process group on timeout, including stubborn descendants."""
process = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
text=True, start_new_session=True)
try:
stdout, stderr = process.communicate(timeout=timeout)
return subprocess.CompletedProcess(argv, process.returncode, stdout, stderr)
except subprocess.TimeoutExpired:
with contextlib.suppress(ProcessLookupError):
os.killpg(process.pid, signal.SIGTERM)
try:
process.communicate(timeout=0.5)
except subprocess.TimeoutExpired:
pass
finally:
with contextlib.suppress(ProcessLookupError):
os.killpg(process.pid, signal.SIGKILL)
# A descendant that left the group may still hold the pipes: close them instead of reading to EOF.
for pipe in (process.stdout, process.stderr):
with contextlib.suppress(OSError):
pipe.close()
with contextlib.suppress(subprocess.TimeoutExpired):
process.wait(timeout=1)
raise
def valid_response(command, data):
if not isinstance(data, dict):
return False
# Older list responses omit the version; reject explicit unknown versions.
if type(data.get('schemaVersion', 1)) is not int or data.get('schemaVersion', 1) != 1:
return False
if command == ['sessions']:
rows = data.get('sessions')
problems = data.get('problems')
return (data.get('schemaVersion') == 1 and isinstance(rows, list)
and isinstance(problems, list) and all(isinstance(p, str) for p in problems)
and all(isinstance(s, dict) and isinstance(s.get('sessionId'), str)
and isinstance(s.get('account'), str)
and s.get('status') in ('busy', 'idle', 'needs-you', 'unknown')
and all(k not in s or isinstance(s[k], str) for k in ('label', 'accountLabel', 'title', 'resumeCommand'))
for s in rows))
if command == ['list']:
rows = data.get('accounts')
return isinstance(rows, list) and all(
isinstance(s, dict) and isinstance(s.get('family'), str) and isinstance(s.get('ref'), str)
and isinstance(s.get('sameLogin', []), list)
and all(isinstance(ref, str) for ref in s.get('sameLogin', [])) for s in rows)
if command == ['config', 'get', 'aliases']:
return isinstance(data.get('value'), dict)
return False
def read_json(command, *, runner=None, timeout=10):
"""Return a validated success response, or None for every transport/protocol failure."""
try:
result = (runner or bounded_run)(['sideby', *command, '--json'], capture_output=True, text=True, timeout=timeout)
if result.returncode != 0:
return None
data = json.loads(result.stdout)
return data if valid_response(command, data) else None
except (OSError, ValueError, TypeError, subprocess.SubprocessError):
return None
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: 197k | Updated | Claude CodeCodex | Verified | Install |