supervisor
supervisor is a facilitator and unblocker for coding agents across GitHub repositories and owners. Work that has an owner goes to that owner; the supervisor picks up only work no one owns (unowned repositories and areas, items between owners) and clears agents blocked outside their lane. Its reports to the user are short, with blockers and decisions first. It provides a CLI for configuration validation and supervision workflows, an MCP server (supervisor mcp), JSON Schemas, and agent skills.
Install
Requires Node.js >=24 and pnpm.
pnpm add -g @jongleberry/supervisor
Run the global install outside any agent sandbox, as its own command: the sandbox's pnpm store is read-only.
Or build from source:
pnpm install
pnpm run build
Validate a configuration file:
supervisor config validate examples/config.example.json
Start the stdio MCP server (exposes policy_check, pr_create, pr_update, and pr_validate):
supervisor mcp
Loop commands
The supervisor loop keeps its state, waits for events, and is stopped through these commands. All read the config from $SUPERVISOR_CONFIG, else .supervisor.json in the current directory, and need stateDir set. They call gh, and wait polls the hook-harness relay in-process.
supervisor state <subcommand> is the only writer of <stateDir>/state.json. Each subcommand holds a lock for the whole read-modify-write, checks each top-level field that the write adds or changes against schemas/state.json (the field names and the exact shape of schedule), and replaces the file atomically; a write that breaks the schema exits 1 and saves nothing, while reads never check the file and an old invalid field that a write leaves alone does not block it. supervisor state --help lists the subcommands. supervisor state merge-record --pr <owner>/<repo>#<N> --head <sha> --review <text> --always-human <text> [--classifiers <file>] records each autonomous merge. It runs supervisor policy check <owner>/<repo> <pr> --json itself, in process, with the policy from the config only (no --dir, --repo-dir, --input, or check file), and refuses unless that check is of the pull request at that head and its next step is a merge. It and supervisor state merge-stack first refuse, with exit 1 and before any GitHub or pr-shepherd call, a repository that no scope covers or that every covering scope runs in report mode, since nothing merges outside an enforce scope; supervisor state merge-records lists the records by repository or rule.
supervisor state sp-plan --entry <owner>/<repo>:<path> [--entry ...] [--budget <n>] prints the scheduled-prompt rotation for a sweep as JSON (next, lap, window with each prompt's target lap and skip, after (the entry after the window and its lap), and select), computed from the config quota and the state's next, lap (the lap next is on, stored by sp-record --next-lap and sp-next --lap) and runs. It writes nothing and takes no lock; the sweep skill calls it instead of working out the lap itself.
supervisor wait [--advance] polls the hook-harness relay in-process over every owner in scopes (an older eventWait.hookHarness key in config is accepted and ignored) and returns only the events that need action: a JSON summary line, then one compact JSON line per event, with its repository as owner/repo. There is one cursor, hookHarness.cursor, and one seen list, hookHarness.seen; the full result goes to <stateDir>/hh-last.json. --owner is gone (exit 2). supervisor wait --help describes what returns. It exits 3 while the stop switch is set, 4 (one line naming supervisor state advance-hh) when hh-last.json still holds events that were not advanced (skipped when the wait advances itself), and 1 on auth, configuration, cursor, or sustained relay errors. It also drops events already in hookHarness.seen. A state written by 0.3.0 kept both per owner: the first wait or advance-hh drops those entries and keeps their seen ids, the first wait starts 10 minutes before now (older events are not returned; the next sweep covers them), and old hh-last.<owner>.json files are ignored and can be deleted.