aissue
Pick up an open issue from the amux issue tracker, mark it doing, work it, and mark it done.
Scaffold a closed orchestrator loop — creates the mission note, state/constraints notes, and a scheduler entry from the v2 template.
How it fires
How this command gets triggered: by you, by Claude, or both.
/orchestrateContext preview
What this command does when you run it.
Scaffold a closed orchestrator loop — creates the mission note, state/constraints notes, and a scheduler entry from the v2 template.
description: Scaffold a closed orchestrator loop — creates the mission note, state/constraints notes, and a scheduler entry from the v2 template. allowed-tools: Bash, Read, Write argument-hint: -g "goal description" -s "session-a, session-b, ..."
Parse the arguments, generate a filled-in orchestrator loop note from the v2 template, create companion notes, and wire up a scheduler entry.
Extract `-g`, `-s`, `--schedule`, `--slug`, `--no-schedule` from the skill arguments. If `-g` or `-s` is missing, stop and ask the user before proceeding.
Derive a slug if not provided: lowercase the goal, strip punctuation, replace spaces with `-`, truncate to 30 chars. Example: "Make MVS robust end to end" → `mvs-robust-end-to-end`.
For each session in `-s`, derive its likely lane and issue prefix using this mapping. If a session isn't listed, use its name as the lane description and leave the prefix blank.
| Session name contains | Issue prefix | Lane | |---|---|---| | `mvs-infra` | `MI-` | shard, partition, scroll, scale | | `mvs-build` | `MB-` | topology, image builds, cutover | | `backend` | `BACKE-` | write pipeline, celery, analytics | | `ts-gke` | `TG-` | TubeScience, GKE experiments | | `observability` | `MO-` | metrics, alerts, dashboards | | `studio` | `MS-` | UI, golden path, E2E | | `orchestrator` | `AMUX-` | cross-cutting, escalations | | `general` | `MG-` | diagnosis, root cause, unowned |
Fetch the v2 template:
curl -sk $AMUX_URL/api/notes/orchestrator-loop-v2 | python3 -c "import json,sys; print(json.load(sys.stdin).get('content',''))"Do the substitution in Python — fetch the template text, replace every placeholder with real values, write to a temp file, POST it. Do NOT write the note content from scratch.
python3 << 'PYEOF'
import json, os, urllib.request, ssl, re
url = os.environ['AMUX_URL']
slug = '<slug>'
goal = '<goal text>'
schedule = '<schedule>'
prefixes = '<BACKE- MO- AMUX->' # space-separated prefixes from step 2
# One row per session from -s plus orchestrator row always last
session_rows = [
'| `<session-a>` | ✓ | ✓ | ✓ | <inferred lane> |',
'| `<session-b>` | ✓ | ✓ | ✓ | <inferred lane> |',
'| `mixpeek-orchestrator` | — | — | ✓ | AMUX- escalations to Ethan |',
]
ctx = ssl.create_default_context(); ctx.check_hostname = False; ctx.verify_mode = ssl.CERT_NONE
req = urllib.request.Request(f'{url}/api/notes/orchestrator-loop-v2')
tmpl = json.loads(urllib.request.urlopen(req, context=ctx).read())['content']
filled = tmpl
filled = filled.replace('[Loop Name]', slug)
filled = re.sub(r'> Fill in.*?---\n\n', '', filled, flags=re.DOTALL)
filled = filled.replace('`[e.g. mvs-robustness]`', f'`{slug}`')
filled = re.sub(r'\[loop-slug\]', slug, filled)
filled = filled.replace('`[e.g. MI- MB- BACKE- TG-]`', f'`{prefixes}`')
filled = filled.replace('[e.g. every 2h | daily at 09:00 | every weekday at 08:00]', schedule)
filled = filled.replace('[One sentence. The outcome, not the activity.]', goal)
table_ph = '| `[session-a]` | ✓ | ✓ | ✓ | [what it owns] |\n| `[session-b]` | ✓ | ✓ | ✓ | [what it owns] |\n| `[session-c]` | ✓ | read-only | ✗ | [observe only] |'
filled = filled.replace(table_ph, '\n'.join(session_rows))
with open('/tmp/orch-note.json', 'w') as f:
json.dump({'content': filled}, f)
print('template filled')
PYEOF
curl -sk -X POST -H 'Content-Type: application/json' -d @/tmp/orch-note.json $AMUX_URL/api/notes/<slug>**State note** (blank initial state):
curl -sk -X POST -H 'Content-Type: application/json' \
-d '{"content": "## Status\n\nNot yet run. Orchestrator will populate on first tick."}' \
$AMUX_URL/api/notes/<slug>-state**Constraints note** (seed with one standing rule):
curl -sk -X POST -H 'Content-Type: application/json' \
-d '{"content": "# Constraints — <slug>\n\nAppend-only. Never edit existing lines.\n\n```\n[YYYY-MM-DD] — stage explicit git paths only, never git add -A. Reason: 5407ac1473 swept another session'\''s deletions into wrong commit (AMUX-1315).\n```\n"}' \
$AMUX_URL/api/notes/<slug>-constraintsThe scheduler fires at an arbitrary time and the orchestrator wakes up with **no prior context**. The prompt is the only thing it has. It must be entirely self-contained — do not say "load the note and run the loop." The full brief goes in the prompt.
The scheduler prompt = the filled mission note content + the current constraints note content + the current state note content, concatenated, wrapped in a brief header and a closing action line.
Fetch each note and build the prompt in Python:
python3 << 'PYEOF'
import json, os, urllib.request, ssl
url = os.environ['AMUX_URL']
slug = '<slug>'
ctx = ssl.create_default_context(); ctx.check_hostname = False; ctx.verify_mode = ssl.CERT_NONE
def fetch_note(s):
try:
req = urllib.request.Request(f'{url}/api/notes/{s}')
return json.loads(urllib.request.urlopen(req, context=ctx).read()).get('content', '')
except:
return ''
mission = fetch_note(slug)
constraints = fetch_note(f'{slug}-constraints')
state = fetch_note(f'{slug}-state')
prompt = f"""You are running the {slug} orchestration loop. This prompt is your complete brief — read it fully before acting.
--- MISSION ---
{mission}
--- CONSTRAINTS (appendOpen-source control plane for AI coding agents. Run an AI engineering team: parallel Claude Code, Codex, and Gemini workers with a shared board, atomic tasks, schedules, loops, origin-stamped messaging, model switching, and self-healing recovery. One dashboard, or your phone. MIT, single Rust binary.
Pick up an open issue from the amux issue tracker, mark it doing, work it, and mark it done.
Use when the user says "add to board", "create a task", or wants to track a todo on the amux kanban board
Use when you need to interact with the amux system — manage board tasks, check sessions/workers, send emails, message via Telegram, automate browsers, work…
Use when the user asks to interact with a web page, take a screenshot of a site, click or type in Chrome, scrape content, or debug a web UI. Connects to real…
Repo/branch/file hygiene sweep — stray artifacts, doc drift, stale branches, worktrees, upstream sync, backup sprawl, duplicate build caches. Verifies before…
Use when the user needs to log into a website for browser automation, save auth cookies, or sync browser profiles to cloud