Make every coding-agent harness on the machine (Claude Code, Codex, opencode, Cursor's IDE and CLI) match three sources: the
rule table,
, which holds each global rule once as what it covers; the
shared global instructions file,
~/.config/agents/AGENTS.md
, which every harness reads; and the user's
workstation repo, named by the
pointer ~/.config/agents/source.md
, from which the shared file's personal parts are generated (which tool fills each role, and the personal workflow lines) and the
personal permissions, permission rows each harness carries alongside the rule table's. Codex also takes explicitly declared CLI defaults from that repository's
, and every machine gets the skills and commands its
lists. Each harness also runs the
pre-tool hook,
, before every tool call, and keeps its memory off. Never remove or loosen an entry the table didn't produce: it's the user's. Harness formats change, so check the docs a harness reference links before writing; where they differ, follow the docs and name the difference in your report. Running the skill again is the
audit: the same steps, ending with a diff that changes nothing.
-
Inspect. Find each harness on the machine, read its reference, then the non-secret configuration fields that reference needs. Leave credentials, authentication stores and runtime state unread. Read the shared file and the pointer too, and when the pointer names a workstation repo, read
references/workstation-repo.md
and the repository's
,
and
in its clone. For Codex, inspect the optional
as its reference directs; use one resolved config home throughout setup and verification.
- When the pointer is missing: read
references/workstation-repo.md
, then ask the user once which repository holds their personal setup and where it is cloned, or whether they have none. The diff writes the pointer, recording "none" too, so the next run doesn't ask.
- When the machine is remote or headless, such as a VPS: read
references/remote-machine.md
first.
- When trying a change without touching the real machine: run the steps against a copy of the home folder in the project's , and check it with . Start no harness there, since it would read the real login.
-
Propose one diff that brings each harness in line with the rule table, the shared file's shape and personal parts, the pointer, memory off, the hook wired, declared supported Codex defaults, and the installs: every skill and command
lists for this machine, each skill up to date. Give every harness found its own section, listing each gap its reference names and the hook's blind spots. Read
references/global-instructions.md
whenever a global instructions file is in the diff.
Work out what each harness should hold, from
, the personal permissions, the shared file's shape and the harness's reference, and compare it with what the machine holds. Write the whole diff: per harness and file, the exact entries or a unified diff, each line marked:
- , (a stricter entry added where it wins), , (an installed skill behind its source);
- , (the hook), (the MCP tools a row matched);
- (the machine is stricter than the table: kept), (neither the table's nor a personal permission's: kept), (an installed skill leaves out on purpose: kept, never installed or removed), (what the harness can't express), (no such feature);
- beside the mark of every entry a personal permission produced (; ), so the user can tell those entries from the table's and never reads them as ;
- (not applicable) for a personal permission whose tool this harness lacks, with why: nothing is written for it there.
Use
only for memory files, a harness's own global file whose every line is already in the shared file (it becomes a link), and this skill's own wiring that points at an old script. An entry a dropped row, the table's or a personal one, left behind is
, for the user to remove.
- When the workstation repo has : the diff holds a line per entry that applies to this machine, and an line, with why, per entry that doesn't. The file is the whole list: install nothing it leaves out.
references/workstation-repo.md
gives the format, the checks and the commands.
- Without the file, with a value: the diff installs that repo's skills globally:
npx --yes skills add <owner>/<repo> -g -a codex -a claude-code -y
, leaving out when is a link to . It's once ~/.agents/.skill-lock.json
records a skill from that source. With no value, it's a line.
-
Ask once for one approval of the whole diff. A change after that needs a new approval.
- When the diff holds only and installs from : write it without asking, since the user approved that list by writing it.
-
Back up every file the diff changes or removes. Before writing any file, copy each one into
~/.config/agents/backups/<UTC time as YYYYmmddTHHMMSSZ>/
, at its path relative to the home folder (
). Copy a symlink as a link.
-
Write exactly the approved diff. Run any install command first, such as a skill the diff installs. If one fails, write nothing and report it. In JSON and TOML files, change only the keys the diff names and keep the rest. Write through a symlink to its target.
-
Verify with
, then inspect again until the diff changes nothing: no
,
or
line. Report the backup folder, what's wired, the gaps, and the stricter and extra entries. For Codex, distinguish persisted defaults from effective overrides and state how subsequent sessions pick up changes.
Run
python3 <this skill>/scripts/verify.py
(Python 3.9+, standard library only; it writes nothing). It passes when it prints
, a
line for every harness found, a
or
line and no
line, every
line is a row codex.md says gets no rule, and declared Codex defaults match without a
line, or a
line says Codex isn't installed. Report
and
lines separately; they limit what the audit proves.
holds each global rule once, by meaning, not in any harness's form. Each harness reference turns a row into that harness's entries; the hook and
read it through
scripts/setupmachine/rules.py
, which refuses a malformed row. A workstation repo's
holds personal permissions in the same format, which every harness, the hook and
take alongside the table's (
references/workstation-repo.md
).
A
object's keys say which kind it is:
A harness that matches a command's text catches only the spellings it lists, so give it one entry per way of writing a command row:
(Python 3.9+, standard library only) is the hook every harness runs before each tool call. It reads
, and the personal permissions through the pointer, and checks the call:
A malformed personal file leaves the table's rows in force: the hook skips the personal permissions and
reports the file.
Each harness reference shows its wiring with
in place of the script's path. Replace it with the absolute path of
in the installed skill (under
or
), never in a checkout or worktree, which can be deleted. If there is no installed copy, name the gap.
The wiring fails open (
[ -f <script> ] && … || true
, or the form a harness reference gives): if the script is gone, each call goes on under the native entries. Without it,
would exit 2 on the missing script, which blocks every call.