docs(agents): write roles/AGENTS.md with the role rules #282

Merged
Defame1297 merged 4 commits from docs/181-roles-agents-md into main 2026-11-21 21:57:43 +00:00
Owner

Closes #181

What changes

  • roles/AGENTS.md (new, 125 lines). It holds every role rule in force, each with a one-sentence reason (Why) and how it is held (Held). The rules come from #93, #207, #213, #214, #257 and #258, plus the Roadmap rule.
    • Rules 9 and 10 are left out, as the issue says.
    • Where a control has not landed yet, the file names the future check and its issue: "review until … (#N)". That covers #134, #135, #138, #183, #227 and #246.
    • The controls that exist today are named:
      • select_molecule_scenarios.py for the scenario and for users of a role;
      • var-naming[no-role-prefix];
      • schema[role-arg-spec], which rejects entry-level cross-input keys (entry_point has additionalProperties: false in ansible-lint's schema);
      • the ansible_parent_role_names assert.
  • galaxy.yml: roles/AGENTS.md goes into build_ignore, as the issue asks for when this lands before #244.
  • scripts/select_molecule_scenarios.py: roles/AGENTS.md is added to IGNORED, with a test. This was not asked for in the issue. Without it, the file (two path parts) falls through to "can affect every scenario", and no scenario reads it.
    • The selector runs from the base branch's copy, so this PR still runs every scenario (it also touches galaxy.yml). The saving applies from the next PR on.

Judgement calls for the reviewer

  • Length. 125 lines: under the 200 limit, over the 80 aim. Shortening further meant dropping reasons or held-bys, which the acceptance requires.
  • Reasons I wrote. No decision gives a reason for these, so I wrote them:
    • handlers are internal (handler names are global in a play);
    • role interface;
    • check-mode guard;
    • Roadmap;
    • all-three-releases;
    • internal roles;
    • dropping a platform.
  • Interim states, stated in the file.
    • Platforms: trixie is declared but untested, and jammy/all are still declared, until #226 and #133.
    • role-name is skipped repository-wide until #138.
  • All-three-releases aspiration (#207). I worded it as "aims to target both Ubuntu and Proxmox hosts". This removes a literal clash with "Ubuntu-targeting roles declare exactly noble and resolute".

Verified

  • Every commit hook passes: REUSE, yamllint, gitleaks, ansible-lint, changelog lint, Conventional Commits. The pre-push ansible-test sanity passes.
  • python -m unittest discover -s tests/scripts: 203 tests OK, run in a clean worktree. The new selector test went red, then green.
  • ansible-galaxy collection build plus scripts/check_tarball.py: all entries allowed, and no AGENTS.md in the tarball.
  • Load test (acceptance 2). I used a throwaway clone with CLAUDE.md removed and Claude Code 2.1.326 in -p mode.
    • After a Read of roles/docker/README.md, the session quoted # Role rules and **Layout.** from roles/AGENTS.md.
    • A control session that read no file answered that it did not have it.
  • Review. Two independent review passes (standards and spec against the decision tickets) ran for three rounds, until both reported ready. Every cited backlog issue was checked to be open and to match what the file says about it.

Not verified

  • Molecule and the CI jobs: they run here.
  • Live loading. In this repository the file does not load yet: the root CLAUDE.md stops nested AGENTS.md loading until #185 removes it. The load test used one Claude Code version, with the maintainer's user-level ~/.claude/CLAUDE.md present.
  • There is no pointer to this file from the root AGENTS.md; that is #185's job (#213 decision 3).

Stand-alone search

I searched the new file for other repositories, hosts, addresses and namespaces. It names only public products (Ubuntu and Debian releases, Proxmox, already named in role READMEs) and this repository's own issues.

🤖 Generated with Claude Code

https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG

Closes #181 ## What changes - **`roles/AGENTS.md`** (new, 125 lines). It holds every role rule in force, each with a one-sentence reason (*Why*) and how it is held (*Held*). The rules come from #93, #207, #213, #214, #257 and #258, plus the Roadmap rule. - Rules 9 and 10 are left out, as the issue says. - Where a control has not landed yet, the file names the future check and its issue: "review until … (#N)". That covers #134, #135, #138, #183, #227 and #246. - The controls that exist today are named: - `select_molecule_scenarios.py` for the scenario and for users of a role; - `var-naming[no-role-prefix]`; - `schema[role-arg-spec]`, which rejects entry-level cross-input keys (`entry_point` has `additionalProperties: false` in ansible-lint's schema); - the `ansible_parent_role_names` assert. - **`galaxy.yml`**: `roles/AGENTS.md` goes into `build_ignore`, as the issue asks for when this lands before #244. - **`scripts/select_molecule_scenarios.py`**: `roles/AGENTS.md` is added to `IGNORED`, with a test. This was not asked for in the issue. Without it, the file (two path parts) falls through to "can affect every scenario", and no scenario reads it. - The selector runs from the base branch's copy, so this PR still runs every scenario (it also touches `galaxy.yml`). The saving applies from the next PR on. ## Judgement calls for the reviewer - **Length.** 125 lines: under the 200 limit, over the 80 aim. Shortening further meant dropping reasons or held-bys, which the acceptance requires. - **Reasons I wrote.** No decision gives a reason for these, so I wrote them: - handlers are internal (handler names are global in a play); - role interface; - check-mode guard; - Roadmap; - all-three-releases; - internal roles; - dropping a platform. - **Interim states, stated in the file.** - Platforms: `trixie` is declared but untested, and `jammy`/`all` are still declared, until #226 and #133. - `role-name` is skipped repository-wide until #138. - **All-three-releases aspiration (#207).** I worded it as "aims to target both Ubuntu and Proxmox hosts". This removes a literal clash with "Ubuntu-targeting roles declare exactly `noble` and `resolute`". ## Verified - Every commit hook passes: REUSE, yamllint, gitleaks, ansible-lint, changelog lint, Conventional Commits. The pre-push `ansible-test sanity` passes. - `python -m unittest discover -s tests/scripts`: 203 tests OK, run in a clean worktree. The new selector test went red, then green. - `ansible-galaxy collection build` plus `scripts/check_tarball.py`: all entries allowed, and no `AGENTS.md` in the tarball. - **Load test (acceptance 2).** I used a throwaway clone with `CLAUDE.md` removed and Claude Code 2.1.326 in `-p` mode. - After a Read of `roles/docker/README.md`, the session quoted `# Role rules` and `**Layout.**` from `roles/AGENTS.md`. - A control session that read no file answered that it did not have it. - **Review.** Two independent review passes (standards and spec against the decision tickets) ran for three rounds, until both reported ready. Every cited backlog issue was checked to be open and to match what the file says about it. ## Not verified - Molecule and the CI jobs: they run here. - **Live loading.** In this repository the file does not load yet: the root `CLAUDE.md` stops nested `AGENTS.md` loading until #185 removes it. The load test used one Claude Code version, with the maintainer's user-level `~/.claude/CLAUDE.md` present. - There is no pointer to this file from the root `AGENTS.md`; that is #185's job (#213 decision 3). ## Stand-alone search I searched the new file for other repositories, hosts, addresses and namespaces. It names only public products (Ubuntu and Debian releases, Proxmox, already named in role READMEs) and this repository's own issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
Claude added this to the Open to contributors milestone 2026-11-21 21:40:05 +00:00
Claude added 4 commits 2026-11-21 21:40:05 +00:00
State every role rule in force with its reason and how it is held. Rules
whose control has not landed say "review until #N lands".

Keep the file out of the Collection tarball (build_ignore) until the
tarball check refuses AGENTS.md at any depth, and put it on the Molecule
selector's IGNORED list: no scenario reads it.

Closes #181

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
Review: name the check each pending control will be, not only its issue;
state complexity and the role-name exemption as future controls; name
schema[role-arg-spec] for the validation misuse; merge the duplicated
input rule into the role interface; add entry-point validation and the
negative-test ordering; drop the claim that contributor docs point here.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
Review round 2: the no-alias ban was decided for inputs only; the
fragment check requires a fragment and checks the section only for a
dropped platform; schema[role-arg-spec] holds entry-level misuse; say
why internal roles are listed in .ansible-lint-ignore; scope the
all-three-releases aim to roles that target both kinds of host.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
docs(agents): rewrap the layout rule
Build / build (pull_request) Successful in 13s
Lint / lint (pull_request) Successful in 43s
Molecule / molecule (pull_request) Successful in 15m53s
8f08badfd4
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNmHMc85bomfevwUDG
CODEOWNERS rules requested review from Defame1297 2026-11-21 21:40:05 +00:00
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-21 21:42:27 +00:00
Defame1297 approved these changes 2026-11-21 21:57:43 +00:00
Defame1297 merged commit 500951cd35 into main 2026-11-21 21:57:43 +00:00
Defame1297 deleted branch docs/181-roles-agents-md 2026-11-21 21:57:43 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#282