| name | ais-orchestrator |
| description | PRIMARY execution skill. Run, monitor, and orchestrate all agent sessions in tmux via ais CLI. Use ais for ALL task execution — spawning sub-agents, inspecting output, rotating accounts on rate limits, and collecting results. Everything runs in tmux. |
| metadata | {"openclaw":{"emoji":"🕸️","os":["linux","darwin"],"requires":{"bins":["ais","tmux"]}}} |
| parameters | {"action":{"type":"string","description":"Action: create, ls, inspect, inject, watch, kill, accounts, status, patrol","required":true},"name":{"type":"string","description":"Session name for create/inspect/inject/kill","required":false},"agent":{"type":"string","description":"Agent type: claude or kimi (default: kimi)","required":false},"account":{"type":"string","description":"Account ID: cc1-cc3/hataricc/nicxxx for claude, 1-N for kimi","required":false},"cmd":{"type":"string","description":"Command to inject after agent loads","required":false}} |
AIS Orchestrator — Primary Execution Skill
ais is the primary way to run everything. All tasks, agents, and processes are managed through tmux sessions via ais. Never run long-lived processes outside tmux.
Source: https://github.com/gastown-publish/ais
Core Principle
Everything runs in tmux. Everything is inspected in tmux. Use ais for all execution.
Quick Reference
ais create <name> -a claude|kimi -A <account> [--yolo] [-c "cmd"] [-d dir]
ais ls
ais kill <name>
ais kill --all
ais inspect <name> -n 100
ais inspect <name> --rate-limit
ais watch <name> -i 5
ais watch <name> --until "DONE"
ais logs <name> -o file.log
ais status <name>
ais inject <name> "do the thing"
ais inject <name> "y"
ais accounts
Spawning Agents
Claude Code Agent
ais create worker1 -a claude -A cc1 --yolo -c "fix the auth bug in src/auth.py"
Kimi Code Agent (free)
ais create worker2 -a kimi -A 1 --yolo -c "write tests for src/utils.py"
With working directory
ais create task1 -a claude -A cc2 --yolo -d ~/project/services/auth -c "fix all failing tests"
Account Inventory
Check before spawning:
ais accounts
Claude Code Accounts (~/.claude-accounts/)
| Account | Model | Best For |
|---|
cc1 | Sonnet | Fast tasks, workers |
cc2 | Sonnet | Parallel workers |
cc3 | Opus | Complex reasoning |
Env: CLAUDE_CONFIG_DIR=~/.claude-accounts/<id>
Kimi Code Accounts (~/.kimi-accounts/)
Free, no credit cost, has rate limits. Add more with kimi-account add <key>.
Env: KIMI_SHARE_DIR=~/.kimi-accounts/<id>
The 7 Rules of Sub-Agent Prompts
- One task, one agent. Never give an agent two unrelated goals.
- Be specific about what, not how. Say "fix the failing test in
test_auth.py" not "look at the tests."
- Name the files. "Edit
src/auth/handler.py" not "find the auth code."
- Set boundaries. "Only modify files in
services/order/."
- Define done. "When done, print
TASK COMPLETE: <summary>."
- Give context, not instructions to find context. Paste the error, not "run the tests to see."
- Match agent to task. Opus for architecture. Sonnet for fixes. Kimi for free boilerplate.
Prompt Template
[WHAT] One sentence stating the task.
[CONTEXT] The error, test output, function signature.
[SCOPE] Which files to touch. Which to leave alone.
[DONE] How to signal completion.
[CONSTRAINTS] Things to avoid.
Monitoring All Agents
Quick patrol
bash ~/.openclaw/skills/ais-orchestrator/scripts/patrol.sh
Manual check
for name in $(ais ls 2>/dev/null | tail -n +3 | awk '{print $1}'); do
echo "=== $name ==="
output=$(ais inspect "$name" -n 10 --rate-limit 2>/dev/null)
if echo "$output" | grep -q "TASK COMPLETE"; then
echo "[DONE] $(echo "$output" | grep 'TASK COMPLETE')"
elif echo "$output" | grep -qiE 'rate.?limit|429'; then
echo "[RATE LIMITED] — rotate account"
else
echo "$output" | tail -3
fi
done
Rate Limit Recovery
When ais inspect --rate-limit detects a limit:
- Kill the session:
ais kill <name>
- Pick a different account
- Respawn:
ais create <name> -a <agent> -A <new-account> ...
Rotation order:
- Claude: cc1 → cc2 → cc3 → cc1
- Kimi: 1 → 2 → 3 → 1
Multi-Agent Patterns
Fan-Out: Same task across directories
for svc in order product payment; do
ais create "fix-${svc}" -a kimi -A $((RANDOM % 3 + 1)) --yolo \
-d ~/project/services/${svc}-service \
-c "Fix all failing tests. Print TASK COMPLETE when done."
done
Pipeline: Sequential dependencies
ais create phase1 -a claude -A cc3 --yolo -c "Design the interface. Print TASK COMPLETE."
while ! ais inspect phase1 -n 20 | grep -q "TASK COMPLETE"; do sleep 30; done
ais create impl1 -a claude -A cc1 --yolo -c "Implement using the interface."
ais create impl2 -a kimi -A 1 --yolo -c "Implement the other part."
Specialist Agents
ais create architect -a claude -A cc3 --yolo -c "Review and design. Write PLAN.md."
ais create implement -a claude -A cc1 --yolo -c "Implement plan from PLAN.md."
ais create tester -a kimi -A 1 --yolo -c "Write tests. Free credits."
Log Trail
Every session creates logs at ~/.ais/logs/<name>/:
~/.ais/logs/worker1/
├── events.log # Timestamped events
├── snapshots.log # TUI captures
├── status.json # Machine-readable (for other agents)
└── prompt.txt # Original task
Other agents can resume work:
ais status worker1
cat ~/.ais/logs/worker1/prompt.txt
ais create worker1 -a claude -A cc2 -c "$(cat ~/.ais/logs/worker1/prompt.txt)"
Rules
- Always run
ais accounts first — know what's available
- Spread across accounts — don't overload one account
- Monitor every 2-5 minutes — catch problems early
- Rotate immediately on rate limit — don't wait
- Use Kimi for simple tasks — it's free
- Save logs before killing —
ais kill --save
- Never send Ctrl-C — always
ais kill for graceful shutdown
- Include TASK COMPLETE signals in every prompt
- Report to user — what's running, done, failed
- Everything in tmux — never run agents outside
ais