Ao rules

From gabrielmoreira/agent-skills-mirror · View interactive version

Ao rules is an AI agent skill from the GitHub repository gabrielmoreira/agent-skills-mirror. Shared rules and the connection helper for every ao-* skill (run Orchestrator from chat). Read before running any ao-* skill.

How to use this skill

Skill file

AO rules

Every ao-* skill follows these rules. Other skills link here instead of repeating them.

AO hosts

An AO host is one computer that runs the Orchestrator daemon. Each host has its own projects, sessions and orchestrators, and Orchestrator never links them: a repo cloned on two hosts is two separate projects. Orchestrator names a project after its folder, so both can still get the same id, and then the same session id (for example agent-orchestrator-1-12) can exist on both. Always name a session as <host>/<session id>, and act only on the host that owns it.

Memory keeps one note named AO hosts, with one line per host:

| Field | Example | Meaning |

|---|---|---|

| name | Pro | A short name: the user's pick, else the model word of the ListMachines label (Pro, Air, mini). Never the network hostname such as MacBookAir.lan |

| reach | local or remote | How you get to its Orchestrator |

| via | laptop | The ListMachines label of the computer whose shell you use |

| base | http://192.168.1.20:7444 | Remote only. The host's LAN address from Orchestrator's remote access settings |

| header | ~/.ao-grok/studio.header | Remote only. File on via that holds the host's password |

One computer can be via for itself (local) and for other hosts (remote) at the same time.

Every run: call ListMachines, then use every host whose via computer is connected, in parallel, labelled by host name. Say once which hosts you could not reach. Never hard-code machine ids or home paths.

Calling AO

Start every shell command that calls Orchestrator with this helper. It works in zsh and bash:

aoapi(){ # aoapi METHOD PATH [JSON]
  local base hdr=() data=() f="${AO_RUN_FILE:-$HOME/.ao/running.json}"
  if [ -n "$AO_REMOTE_BASE" ]; then base="$AO_REMOTE_BASE"; hdr=(-H @"$AO_REMOTE_HEADER")
  else [ -f "$f" ] || { echo "AO_NOT_RUNNING" >&2; return 3; }
    base="http://127.0.0.1:$(grep -o '"port": *[0-9]*' "$f" | grep -o '[0-9]*$')"; fi
  [ -n "$3" ] && data=(--data "$3")
  curl -sS --fail-with-body --max-time 30 -X "$1" "${hdr[@]}" -H 'Content-Type: application/json' "${data[@]}" "$base/api/v1/$2"
}

Errors

| You see | Meaning and next step |

|---|---|

| AO_NOT_RUNNING, or connection refused on a local host | Orchestrator is not running there. Ask the user to open Orchestrator |

| Connection refused or timeout on a remote host | The host is asleep, off this network, or remote access is off. Ask the user to check Orchestrator's remote access settings on the host |

| HTTP 401 or 403 on a remote host | The host's password changed. Run ao-setup "Remote host" again |

| HTTP 404 on a session path | No such session on that host. Check the host name |

| Any other error | Orchestrator returns JSON with message. Relay it in plain words |

Who does what: orchestrator first

Each project on a host has at most one live orchestrator: an agent that plans the project's work, starts and steers workers, and gets their reports. It has more context than you do. You are the user's phone line to it.

Decisions

A worker asks for two kinds of decision. A question (user_input) asks what to build. An approval asks permission to run a command or change files. Who decides depends on the mode, saved in memory:

  1. Default mode: show each question or approval to the user as a card with the exact options. Answer only with their pick for that request. Never reuse a pick for a new request.
  2. Away mode starts when the user says something like "I'm away", "decide for me" or "keep it moving". Save the scope and the end time in memory. Then:
  1. Standing approvals: the user may list kinds of approvals to always accept. Follow the list exactly.

Orchestrator gives no risk level, so you judge it. Treat these as a floor. If a command looks riskier, call it high.

| Risk | Examples |

|---|---|

| high | Deletes outside the session's worktree, rm -rf, git push --force, push to main or master, git reset --hard, history rewrites, deploy, publish, release, secrets, credentials, tokens, sudo, system installs, payments |

| low | Reading or searching files, git status/diff/log, tests, lint, typecheck, builds |

| normal | Everything else, such as edits and commits in the session's worktree, or pushing the session's own branch |

Never invent the user's preferences. The worker decides how to do the work. The user decides what to build.

Writes

Change nothing on the user's computers unless the user approved that exact change in chat, or away mode or a standing approval covers it. Approval for one change is not approval for the next. Never delete or archive sessions or projects, never change Orchestrator settings, and never merge, publish or deploy without the user's yes for that item.

Secrets

Messages to agents

Output

Memory

Grok Bot only

These steps need tools only Grok Bot has. Any other agent (Claude Code, Codex, Cursor) runs on one computer and does this instead:

| Grok Bot step | Other agents |

|---|---|

| ListMachines, every connected computer | Only the computer you run on, as a local host |

| Routines | Run the check once when asked |

| Cards | Plain text with numbered options |

| Memory | Ask, or use the notes file the user names |

| SendToUser, CopyToBox | Give the file path |

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.