Ao operator discipline

From jleechanorg/claude-commands · View interactive version

Ao operator discipline is an AI agent skill from the GitHub repository jleechanorg/claude-commands. Use when spawning, steering, or auditing Agent Orchestrator workers, especially when the user specifies exact AO parameters such as codex, runtime, project, claim-pr, or PR targets.

How to use this skill

Skill file

AO Operator Discipline

Overview

AO parameters are commitments. If the user asks for Codex workers, PR-specific workers, a certain runtime, or a specific project, you must pass those parameters explicitly and then verify that AO actually honored them.

The failure pattern this skill prevents is simple: a worker exists, but it is the wrong worker.

When to Use

Use this skill when:

Do not use this skill for tiny read-only checks like a one-off ao status.

Agent Name Resolution — Read Config First

Before evaluating any --agent value, read the active AO config:

AO_CONFIG_PATH="${AO_CONFIG_PATH:-${HERMES_HOME:-$HOME/.hermes}/agent-orchestrator.yaml}"
if [ -f "$AO_CONFIG_PATH" ]; then
  head -20 "$AO_CONFIG_PATH"   # check defaults.agent and installed plugins
else
  echo "AO_CONFIG_PATH not configured: AO config file to read agent defaults. Example: export AO_CONFIG_PATH=\$HOME/.hermes/agent-orchestrator.yaml"
fi

--agent values are resolved against the config, not against AO package plugin directories. If <X> in --agent <X> is not a well-known CLI name (codex, claude, claude-code, gemini), look it up in the config before concluding it's unsupported.

Resolve shorthands from the config's agents: entries and defaults.agent, not

from memory of another machine. A custom name often wraps another CLI (for

example an alias that runs the claude CLI against a different API provider);

command -v <name> shows whether it is installed on this host.

Never scan packages/agent-*/ as a substitute for reading the config.

Required Rules

  1. Treat user-specified AO parameters as hard requirements:
  1. Never rely on AO defaults when the user asked for something specific.
  1. After every ao spawn, verify the spawned session before trusting it.
  1. If the verified session does not match the request, kill or replace it. Do not proceed with the wrong worker.

Spawn Pattern

For Codex workers, use an explicit agent override:

unset GITHUB_TOKEN
ao spawn --project <project> --agent codex --claim-pr <pr> "<task>"

If the user specified another runtime too, pass it explicitly:

unset GITHUB_TOKEN
ao spawn --project <project> --agent codex --runtime tmux --claim-pr <pr> "<task>"

Verification Checklist

Immediately after spawn, inspect the session file under ~/.agent-orchestrator/.../sessions/<session> and confirm:

Example verification:

python3 - <<'PY'
from pathlib import Path
p = Path("~/.agent-orchestrator/<hash>-<project>/sessions/<session>").expanduser()
print(p.read_text())
PY

For Codex requests, expected launch shape:

agent=codex
launchCommand=...'codex' ... --model 'gpt-6.1-sol' ...

If you see gemini, claude, MiniMax, or another unexpected launcher, the spawn is wrong.

Tmux Monitoring

After verification, check the tmux pane with at least 20 lines:

tmux capture-pane -pt <tmux-session>:0.0 -S -40

Look for:

Do not accept a welcome screen, generic prompt, or stale queued message as evidence the worker is on task.

Recovery

If a worker was launched with the wrong agent or runtime:

ao session kill <session>
ao spawn --project <project> --agent codex --claim-pr <pr> "<task>"

Then re-run the verification checklist.

Common Mistakes

Minimum Completion Bar

Do not report success on AO setup until you have all of:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.