sync-agent-assets: skills generated by ai-rulez are reported as unresolvable local-skill drift
What happens
sync-agent-assets.mjs --check exits 1 immediately after a clean ai-rulez generate whenever the repo has an ai-rulez skill and the claude and cursor presets are enabled (cursor writes .agents/skills). --write also exits 1 and changes nothing, so the Stop hook's check-then-write pass can never converge.
This is the same shape as #187 (the CLAUDE.md/AGENTS.md pair) and #189, but for skills.
Pilot Shell v11.0.6, ai-rulez 4.15.0, macOS.
Reproduce
mkdir demo && cd demo && git init -q
mkdir -p .ai-rulez/rules .ai-rulez/skills/demo
cat > .ai-rulez/config.toml <<'EOF'
version = '4.0'
name = 'demo'
presets = ['claude', 'cursor', 'opencode', 'codex']
[header]
style = "compact"
EOF
printf -- '---\npriority: high\n---\n\nBe brief.\n' > .ai-rulez/rules/brief.md
printf -- '---\ndescription: Demo skill\n---\n\nDo the demo.\n' > .ai-rulez/skills/demo/SKILL.md
ai-rulez generate
node ~/.pilot/skills/setup-rules/scripts/sync-agent-assets.mjs --check --repo .
node ~/.pilot/skills/setup-rules/scripts/sync-agent-assets.mjs --write --repo .
--check:
Agent asset drift detected:
- local skill demo: both sides differ without a trusted baseline; preserved both versions
exit 1. --write: Error: local skill demo: both sides differ without a trusted baseline; preserved both versions, exit 1, no file changed. Running ai-rulez generate again and re-checking gives the same result.
Why the two sides differ
ai-rulez renders .claude/skills/demo/SKILL.md and .agents/skills/demo/SKILL.md differently on purpose. The claude preset adds a constant user_invocable: false; the other presets do not, and they quote the description:
< description: Demo skill > description: "Demo skill"
< user_invocable: false
So the two trees cannot be made identical by either tool, and the mirror rule (".agents/skills canonical, .claude/skills its managed mirror") does not apply to files ai-rulez owns.
Expected
Skill files that ai-rulez generated should not be treated as local skills to reconcile. ai-rulez already records them: .ai-rulez/.generated-manifest.json lists every generated output, including .claude/skills/demo/SKILL.md, .agents/skills/demo/SKILL.md, .codex/skills/demo/SKILL.md and .opencode/skills/demo/SKILL.md. A skill path present in that manifest could be skipped by --check and --write.
Impact
Noise only in my setup: the Stop hook is fail-open and left no files behind. It does mean --check cannot be used as a CI or make check gate in a repo that generates skills with ai-rulez.
Thanks for the detailed reproduction. I reproduced it with ai-rulez 4.15.0 and fixed the ownership handling for the upcoming Pilot Shell 11.0.7 release.
The sync script now reads .ai-rulez/.generated-manifest.json and preserves skills listed there, including their different Claude and Codex variants. This applies to check, write, and install modes, including tracked and ignored generated skills. Ordinary skill drift is still checked.
Your reproduction now passes every mode without changing any generated file. Running ai-rulez generate again also leaves the check passing. The regression suite covers this behavior and is now required before release publication.
I'll add the release link once publication and verification finish.
Released in Pilot Shell 11.0.7.
I verified your reproduction with ai-rulez 4.15.0: check, write, and install modes preserve all generated files, and another ai-rulez generate still leaves the check passing. The published release includes the corrected sync script.
Closing this as fixed. Thanks for identifying the generated-manifest ownership boundary.