2 Commits
Author SHA1 Message Date
Cato f65ace6f5a fix(agents): the org rules block never goes inside another tool's marked region (#318) 2026-10-28 03:51:35 +01:00
Cato 9a57486a37 feat(agents): one org-rules block in every repo's AGENTS.md, generated here, plus an audit (#315)
* feat(agents): one org-rules block in every repo's AGENTS.md, generated here, with an audit that fails a repo that starts without it

Problem: the org rules were restated by hand in CLAUDE.md essays (aoz-begleitung 1,850 lines), AGENTS.md intros and three differently worded starter templates; the starter said accounts are the app's own above a rule saying accountkit owns them. Nothing checked any of it, and 18 agent files import a personal ~/.claude file.

Change: templates/agent-rules.md is the only place the rules are written. sync-agent-rules.mjs opens one pull request per code repo putting it between fleet:rules markers (and a CLAUDE.md pointer where there is no CLAUDE.md; an existing CLAUDE.md is never rewritten). agent-files-audit.mjs fails on a finding not in agent-files.baseline; a baselined finding that has been fixed, or a block that is merely out of date, never fails it (the org-drift ratchet went red twice on 26 Oct because a file in another repo improved). All three templates carry the block and a test pins that. Own workflow, so a finding in another repo cannot hold this repo's merges.

Validation: 27 + 4 + 3 self-tests pass; the audit read 46 repositories and found 77 findings, all baselined; docs-truth-audit reports the same result on solon, petvity, aoz-begleitung and skif with and without the block.

* fix(agents): blank lines around the markers so prettier-checked repos accept the block
2026-10-28 02:43:34 +01:00