ci: refuse CLAUDE.md files by hook and keep every AGENTS.md out of the Collection tarball #244

Closed
opened 2026-11-17 11:36:52 +00:00 by Claude · 2 comments
Owner

Spec: Making sure an agent actually loads the guidance, decisions 1 and 7 of its resolution comment.

Blocked by docs(agents): replace CLAUDE.md with a root AGENTS.md: when this starts, CLAUDE.md is gone and the root AGENTS.md is already in galaxy.yml build_ignore.

What to build

  1. Refuse CLAUDE.md. Add a local hook to .pre-commit-config.yaml: language: fail, files: (^|/)(\.claude/)?CLAUDE(\.local)?\.md$, stage pre-commit, with a one-line entry message explaining that any such file makes Claude Code ignore every AGENTS.md. Lint runs it like every other hook. No script.
    • Reason (for the hook comment): apm compile (target claude), a tool's project init or a skill can create one, and the failure is silent: the agent gets no guidance and no error.
  2. Check build_ignore. Check that AGENTS.md and roles/AGENTS.md are in galaxy.yml build_ignore (#185 and the roles/AGENTS.md issue #181 add them) and add whichever is missing. CLAUDE.md is no longer listed.
  3. Keep AGENTS.md out of the tarball. Add a FORBIDDEN pattern in scripts/check_tarball.py that refuses AGENTS.md at any depth (so a future roles/<role>/AGENTS.md fails the Build). Add a test case for it in the script's tests.
    • Reason: a consumer's agent reading an installed role would load contributor rules.

Acceptance

  • A commit adding CLAUDE.md, .claude/CLAUDE.md, CLAUDE.local.md or roles/x/CLAUDE.md fails the hook; docs/CLAUDE-notes.md does not.
  • ansible-galaxy collection build with a roles/AGENTS.md present produces a tarball without it, and check_tarball.py fails on a tarball that contains one.
  • Changelog: none (no consumer-visible change beyond tarball contents that were never shipped).

Notes

  • .pre-commit-config.yaml is an image input: the two-PR loop applies.
Spec: [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213), decisions 1 and 7 of its resolution comment. Blocked by [docs(agents): replace CLAUDE.md with a root AGENTS.md](https://git.rkdr.net/Mortis/Kamino/issues/185): when this starts, `CLAUDE.md` is gone and the root `AGENTS.md` is already in `galaxy.yml` `build_ignore`. ## What to build 1. **Refuse `CLAUDE.md`.** Add a local hook to `.pre-commit-config.yaml`: `language: fail`, `files: (^|/)(\.claude/)?CLAUDE(\.local)?\.md$`, stage `pre-commit`, with a one-line entry message explaining that any such file makes Claude Code ignore every `AGENTS.md`. Lint runs it like every other hook. No script. - Reason (for the hook comment): `apm compile` (target `claude`), a tool's project init or a skill can create one, and the failure is silent: the agent gets no guidance and no error. 2. **Check `build_ignore`.** Check that `AGENTS.md` and `roles/AGENTS.md` are in `galaxy.yml` `build_ignore` ([#185](https://git.rkdr.net/Mortis/Kamino/issues/185) and the roles/AGENTS.md issue [#181](https://git.rkdr.net/Mortis/Kamino/issues/181) add them) and add whichever is missing. `CLAUDE.md` is no longer listed. 3. **Keep `AGENTS.md` out of the tarball.** Add a `FORBIDDEN` pattern in `scripts/check_tarball.py` that refuses `AGENTS.md` at any depth (so a future `roles/<role>/AGENTS.md` fails the Build). Add a test case for it in the script's tests. - Reason: a consumer's agent reading an installed role would load contributor rules. ## Acceptance - A commit adding `CLAUDE.md`, `.claude/CLAUDE.md`, `CLAUDE.local.md` or `roles/x/CLAUDE.md` fails the hook; `docs/CLAUDE-notes.md` does not. - `ansible-galaxy collection build` with a `roles/AGENTS.md` present produces a tarball without it, and `check_tarball.py` fails on a tarball that contains one. - Changelog: none (no consumer-visible change beyond tarball contents that were never shipped). ## Notes - `.pre-commit-config.yaml` is an image input: the two-PR loop applies.
Claude added this to the Open to contributors milestone 2026-11-17 11:36:52 +00:00
Claude added the
Status
Ready for Agent
label 2026-11-17 11:36:52 +00:00
Claude added a new dependency 2026-11-17 11:37:34 +00:00
Author
Owner

Body edited on 2026-11-20 (final validation round of the map, #87 (comment)): removed the note that this issue waits for #165; that edge was removed, and it is blocked only by #185.

Body edited on 2026-11-20 (final validation round of the map, https://git.rkdr.net/Mortis/Kamino/issues/87#issuecomment-12281): removed the note that this issue waits for #165; that edge was removed, and it is blocked only by #185.
Author
Owner

Final validation round, second pass (2026-11-20): body edited.

  • Dropped the conditional "If CLAUDE.md still exists at the root when this lands, coordinate with #185": #244 is blocked by #185, so CLAUDE.md is gone and root AGENTS.md is in build_ignore when this starts.
  • The build_ignore item is now "check that AGENTS.md and roles/AGENTS.md are in build_ignore and add whichever is missing"; CLAUDE.md is no longer listed. Hook and FORBIDDEN pattern work unchanged.
Final validation round, second pass (2026-11-20): body edited. - Dropped the conditional "If `CLAUDE.md` still exists at the root when this lands, coordinate with #185": #244 is blocked by #185, so `CLAUDE.md` is gone and root `AGENTS.md` is in `build_ignore` when this starts. - The `build_ignore` item is now "check that `AGENTS.md` and `roles/AGENTS.md` are in `build_ignore` and add whichever is missing"; `CLAUDE.md` is no longer listed. Hook and `FORBIDDEN` pattern work unchanged.
Defame1297 was assigned by Claude 2026-11-23 19:11:15 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#244