generate --check for codexcli rules fails when another target owns AGENTS.md
Problem
When two targets both emit the root AGENTS.md rule file, rulesync generate --check for one target can fail even when that target's non-root outputs (for example .codex/memories/*.md) are already up to date.
We use target order so one IDE target (last in config) owns AGENTS.md. Codex topic rules live under .codex/memories/. Full rulesync generate works. A split verify for Codex rules alone does not.
Example setup
{
"targets": {
"claudecode": ["rules", "ignore", "mcp", "skills", "subagents", "permissions"],
"cursor": ["rules", "ignore", "mcp", "skills", "subagents"],
"agentsskills": ["skills"],
"codexcli": ["rules", "mcp", "subagents"],
"devin": ["rules", "ignore", "mcp", "skills"],
"antigravity-ide": ["rules", "mcp"]
},
"delete": true,
"gitignoreTargetsOnly": true
}
- Root
overview.mdhasroot: true,targets: ["*"]. antigravity-ideis last so it winsAGENTS.md(per target-order docs).- Codex non-root rules go to
.codex/memories/.
Reproduction
-
Run full generate (succeeds):
rulesync generate -
Confirm
.codex/memories/*.mdexists and looks correct. -
Run check for Codex rules only (fails):
rulesync generate --check -t codexcli -f rules
Actual output (example):
[DRY RUN] Would write: AGENTS.md
[DRY RUN] Would write 1 rule
AGENTS.md
Files are not up to date. Run 'rulesync generate' to update.
Exit code: 1
Expected (one of):
- Check passes when
.codex/memories/is up to date, even if on-diskAGENTS.mdmatches another target's root output, or - A flag to verify non-root outputs only for a target, or
- A built-in verify command that understands shared files and target order.
Why this hurts
We split verify to avoid other target conflicts:
rulesync generate --check -t claudecode,cursor,devin,antigravity-ide \
&& rulesync generate --check -t agentsskills -f skills \
&& rulesync generate --check -t codexcli -f mcp,subagents
We cannot add rules to the codexcli check without it failing on AGENTS.md, so .codex/memories/ drift is not caught by rulesync's built-in check.
Current workaround
A small custom script that:
- Runs
rulesync generate -o <temp-dir> -t codexcli -f rules - Compares only
<temp-dir>/.codex/memories/*.mdto the local.codex/memories/ - Ignores
AGENTS.md
This works but is easy to get wrong and should not be required in every multi-target repo.
Suggested solutions
Any of these would help:
--checkscope — verify only non-root rule outputs for a target.- Shared-file-aware verify — when multiple targets write the same path, respect target order / "owner" and do not fail other targets' checks.
rulesync verify— documented or built-in multi-target verify for repos usingagentsskills,antigravity-ide,codexcli, etc.- Docs — official recipe for "one target owns
AGENTS.md, Codex memories verified separately".
Environment
- rulesync: 8.29.0
- Node: 24.x
- OS: macOS
- Repo: multi-target setup; generated AI tool outputs gitignored (
gitignoreTargetsOnly: true)