skills/sync-codex-agents/SKILL.md
Convert this repo's Claude agents (`agents/*.md`) to Codex `.toml` format and stage them for installation to `~/.codex/agents/`. Skips Claude-only MCP wrappers (`codex-*` agents). Use when the user asks to sync, mirror, port, or convert agents for Codex; when Claude agents have been edited and Codex is now stale; or when the user mentions `~/.codex/agents/` is out of date.
npx skillsauth add preetamnath/agent-skills sync-codex-agentsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convert agents/*.md (Claude format) to .toml (Codex format), stage in .tmp/codex-agents/, then offer to install into ~/.codex/agents/ and clean up.
When the user wants to refresh Codex agents from the repo's Claude agents — typically after editing one or more files in agents/. Not for the codex-* MCP-wrapper agents (those are Claude-only and the script skips them).
Run bash with skills/sync-codex-agents/scripts/convert.py (or python3.12 skills/sync-codex-agents/scripts/convert.py if the shebang fails to resolve).
The script requires Python 3.11+ (uses tomllib for post-check validation).
The script:
agents/*.md.tools: line contains mcp__codex__codex (the Claude-only MCP wrappers)..tmp/codex-agents/<name>.toml for each remaining agent..toml files in that directory before writing (keeps the staging area in sync with current source).tomllib, verifies required fields, exact body round-trip, filename/name match, and absence of MCP wrapper leakage. Exits non-zero on any failure.If the script exits non-zero, stop. Show the user the script's stderr output and ask how they want to proceed via the AskUserQuestion tool with options: "Investigate and retry (Recommended)", "Abort". Do not proceed to step 2 until the script exits zero.
For each generated .tmp/codex-agents/<name>.toml, compare against ~/.codex/agents/<name>.toml if it exists:
diff -u ~/.codex/agents/<name>.toml .tmp/codex-agents/<name>.toml
Summarize for the user as a short table: agent name, status (new, unchanged, modified), and lines changed when modified. If any destination file would be overwritten with substantive changes the user did not initiate (e.g., they hand-edited the Codex copy), call this out explicitly.
Use the AskUserQuestion tool with these options:
~/.codex/agents/ and remove .tmp/ (Recommended) — cp .tmp/codex-agents/*.toml ~/.codex/agents/ && rm -rf .tmp/codex-agents~/.codex/agents/ and keep .tmp/ — copy only.tmp/ — user will copy manuallyRun the corresponding shell commands. After install, list what was installed (paths) so the user can verify.
AskUserQuestion tool in step 3 before writing to ~/.codex/agents/ or any destination outside the repo. Auto mode does not override this — installing modifies a directory outside the repo.codex-* wrappers. These agents use mcp__codex__codex and exist only to call Codex from Claude. They make no sense inside Codex itself. The script filters them; if a user asks to include one, refuse and explain why.convert.py exits non-zero, do not proceed. The post-checks catch real bugs (truncated bodies, malformed TOML, MCP leakage) — bypassing them defeats the point of the skill.model and tools are dropped. Codex's agent format has no equivalent. If a user asks where these went, explain.~/.codex/agents/codex.toml). If Codex rejects a generated file, the script is wrong, not the source .md. Update the script.verifier's another agent's findings) require TOML basic-string escaping, not literal-string. The script uses basic strings ("...") for name and description and handles escaping. If you ever switch to literal strings ('...'), apostrophes will break the parse."""...""") with escaping. None of the current agents trip this, but a future agent containing a ''' Python heredoc could.''' (or """). The renderer relies on this and does NOT add an extra \n before the closing delimiter — adding one would inject a phantom newline into the parsed body and break exact round-trip. The post-check enforces exact round-trip via tomllib, so this kind of regression is caught immediately.name field. Codex looks up agents by filename. The post-check enforces this; do not rename outputs..tmp/ is gitignored at repo root via /.tmp/. Outputs never appear in git status.development
Judge whether a candidate fact earns a durable-doc line: keep only what a future agent would get the wrong answer without; cut anything derivable from code, setup, breadcrumb, or a restated default. TRIGGER when: user asks 'does this belong in CLAUDE.md / a rule / the docs', 'is this worth keeping/writing down', 'should this be a comment'; vetting or pruning a fact before it's filed or shaped.
testing
Audit one instruction file by composing the durable-instruction lenses over it — vet-fact (WORTH: does each fact earn a line?), place-fact (PLACE: is it in the right home?), tighten-instruction (SHAPE: tighten the line). Pick the subset the file needs: shape-only, worth+shape, or worth+place+shape. A misplaced fact can be relocated to its right home on your approval, or deferred for a durable-docs-update batch. TRIGGER when: user wants a skill file or durable doc (CLAUDE.md, a rule, ARCHITECTURE.md) audited for what to keep, where it belongs, and how it reads; user says 'refine/audit this file', 'prune and tighten this doc', 'what here is worth keeping'. For shape-only tightening, tighten-file is the leaner sibling.
development
Route a kept fact to its durable home by delivery trigger and most-local-wins — across in-file comment, nested CLAUDE.md, path-scoped rule, root CLAUDE.md, ARCHITECTURE.md, or a skill. TRIGGER when: user asks 'where should this go', 'which file/rule/home does this belong in', 'is this in the right place', 'should this be a pointer'; placing or re-homing a fact already judged worth keeping.
development
Sequence a locked spec into dependency-ordered, wave-grouped tasks. TRIGGER when: user says 'build the plan' or 'sequence this'; a spec needs slicing into parallel-safe waves.