docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs #292

Merged
Defame1297 merged 1 commits from docs/182-nested-agents-md into main 2026-11-22 16:04:45 +00:00
Owner

What and why

Closes #182

Four nested AGENTS.md files, each holding its directory's rules in full (rule, Why, Held), in the format of roles/AGENTS.md:

  • scripts/AGENTS.md: tests in tests/scripts/, the sanity ignore list as a last resort, the pin and lock rule, hook SHA pins.
  • .gitea/workflows/AGENTS.md: the "Workflows" section of CLAUDE.md as rules, plus the secrets, judge-script, no-host-detail and Molecule-pins rules, the bot-diff gate and the denied image namespace.
  • images/AGENTS.md: the "Images" rules plus bake in, recorded speed, layer size, kaniko, retiring an image, and the image-smoke scenarios.
  • docs/adr/AGENTS.md: the ADR bar, status values, acceptance on the maintainer's approval, one screen, no infrastructure detail, and accepted risks in the SECURITY.md register.

The interim "Dependency and image updates" section of docs/contributing/making-a-change.md is replaced by pointers. CONTRIBUTING.md and code-style.md point to the new files.

Decisions made on this issue where it no longer matched the repository:

  1. #166 has not landed, so triggers are written as they are today: Lint and Build still run on push to main; Molecule's push trigger is path-filtered and runs every scenario. Each is marked "until #166".
  2. #225 has not landed: "Molecule tests the pull request's pins" is held aspirational until #225. #225 adds the control.
  3. The judge-script rule carries a stated exception: check_image_versions.py bump judges the diff but runs from the pull request's copy, until #165 removes it.
  4. The renovate --platform=local test line stays in making-a-change.md until the root AGENTS.md (#185) can carry it. The "open item" (no live run has yet shown that bot pull requests get Lint and Build) is dropped as history, as the issue says. It now survives only in CLAUDE.md.

Known inconsistencies left for other issues:

  • CLAUDE.md still says "nothing but image.yml may reference" the secrets. That is stale: renovate.yml uses the Renovate token, and the new file says so. CLAUDE.md goes in #185.
  • The concurrency: comment in molecule.yml still says raising capacity "needs a lock or a shared group". The new rule follows #166 (per-run container names, no shared group), and #166 rewrites that comment.
  • ADR 0001's link to docs/contributing/maintaining.md was already broken before this PR (#262).
  • The new scripts/, images/ and .gitea/workflows/ AGENTS.md files are not on the selector's IGNORED list, so this pull request runs every Molecule scenario.

Verified

  • pre-commit run --all-files: every hook passed (gitleaks, REUSE, zizmor, actionlint, ansible-lint and the rest). The pre-push ansible-test sanity also passed.
  • ansible-galaxy collection build followed by scripts/check_tarball.py: 225 entries, all allowed, and no AGENTS.md in the archive. No changelog fragment is needed: these are tooling docs in build_ignore.
  • Each file is under 200 lines (41, 103, 88, 28).
  • A script check of every relative Markdown link in the changed files: all resolve, apart from the existing maintaining.md link above.
  • I checked every named control, step and hook against the files: "Check the baked tooling against the pins", "Check image pins", "Check image versions were bumped", "Check a bot pull request only moves pins", "Test the repository scripts", "Prepare kaniko and check the registry credential", zizmor, actionlint, check_tarball.py, CODEOWNERS entries.
  • Searched the new files for references outside this repository (other repositories, hostnames, addresses, host sizing): none. net.rkdr.mortis.* is the label namespace the tracked Dockerfiles already use.
  • agentsmd-audit: passes for the four new files (secrets, structure, drift), with info notes only. Its 8 drift FAILs are on the existing roles/AGENTS.md, where the validator resolves roles/<role>/ paths against the root.
  • Independent code-review (standards and spec) by a subagent: no high findings. The medium and low findings are fixed, apart from those listed above.

Not verified

  • That branch protection requires code-owner approval. The ADR acceptance rule and several Held lines name CODEOWNERS as the control, and the CODEOWNERS header says it binds only once that setting is on. I can't read that setting.
  • That Claude Code loads these nested files. It won't while the root CLAUDE.md exists (#185).
  • CI on this pull request: not yet run.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code:claude-opus-5-5

## What and why Closes #182 Four nested `AGENTS.md` files, each holding its directory's rules in full (rule, *Why*, *Held*), in the format of `roles/AGENTS.md`: - `scripts/AGENTS.md`: tests in `tests/scripts/`, the sanity ignore list as a last resort, the pin and lock rule, hook SHA pins. - `.gitea/workflows/AGENTS.md`: the "Workflows" section of `CLAUDE.md` as rules, plus the secrets, judge-script, no-host-detail and Molecule-pins rules, the bot-diff gate and the denied image namespace. - `images/AGENTS.md`: the "Images" rules plus bake in, recorded speed, layer size, kaniko, retiring an image, and the image-smoke scenarios. - `docs/adr/AGENTS.md`: the ADR bar, status values, acceptance on the maintainer's approval, one screen, no infrastructure detail, and accepted risks in the `SECURITY.md` register. The interim "Dependency and image updates" section of `docs/contributing/making-a-change.md` is replaced by pointers. `CONTRIBUTING.md` and `code-style.md` point to the new files. Decisions made on this issue where it no longer matched the repository: 1. #166 has not landed, so triggers are written as they are today: Lint and Build still run on push to `main`; Molecule's push trigger is path-filtered and runs every scenario. Each is marked "until #166". 2. #225 has not landed: "Molecule tests the pull request's pins" is held *aspirational until #225*. #225 adds the control. 3. The judge-script rule carries a stated exception: `check_image_versions.py bump` judges the diff but runs from the pull request's copy, until #165 removes it. 4. The `renovate --platform=local` test line stays in `making-a-change.md` until the root `AGENTS.md` (#185) can carry it. The "open item" (no live run has yet shown that bot pull requests get Lint and Build) is dropped as history, as the issue says. It now survives only in `CLAUDE.md`. Known inconsistencies left for other issues: - `CLAUDE.md` still says "nothing but `image.yml` may reference" the secrets. That is stale: `renovate.yml` uses the Renovate token, and the new file says so. `CLAUDE.md` goes in #185. - The `concurrency:` comment in `molecule.yml` still says raising capacity "needs a lock or a shared group". The new rule follows #166 (per-run container names, no shared group), and #166 rewrites that comment. - ADR 0001's link to `docs/contributing/maintaining.md` was already broken before this PR (#262). - The new `scripts/`, `images/` and `.gitea/workflows/` `AGENTS.md` files are not on the selector's IGNORED list, so this pull request runs every Molecule scenario. ## Verified - `pre-commit run --all-files`: every hook passed (gitleaks, REUSE, zizmor, actionlint, ansible-lint and the rest). The pre-push `ansible-test sanity` also passed. - `ansible-galaxy collection build` followed by `scripts/check_tarball.py`: 225 entries, all allowed, and no `AGENTS.md` in the archive. No changelog fragment is needed: these are tooling docs in `build_ignore`. - Each file is under 200 lines (41, 103, 88, 28). - A script check of every relative Markdown link in the changed files: all resolve, apart from the existing `maintaining.md` link above. - I checked every named control, step and hook against the files: "Check the baked tooling against the pins", "Check image pins", "Check image versions were bumped", "Check a bot pull request only moves pins", "Test the repository scripts", "Prepare kaniko and check the registry credential", `zizmor`, `actionlint`, `check_tarball.py`, `CODEOWNERS` entries. - Searched the new files for references outside this repository (other repositories, hostnames, addresses, host sizing): none. `net.rkdr.mortis.*` is the label namespace the tracked Dockerfiles already use. - `agentsmd-audit`: passes for the four new files (secrets, structure, drift), with info notes only. Its 8 drift FAILs are on the existing `roles/AGENTS.md`, where the validator resolves `roles/<role>/` paths against the root. - Independent `code-review` (standards and spec) by a subagent: no high findings. The medium and low findings are fixed, apart from those listed above. ## Not verified - That branch protection requires code-owner approval. The ADR acceptance rule and several *Held* lines name `CODEOWNERS` as the control, and the `CODEOWNERS` header says it binds only once that setting is on. I can't read that setting. - That Claude Code loads these nested files. It won't while the root `CLAUDE.md` exists (#185). - CI on this pull request: not yet run. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code:claude-opus-5-5
Claude added this to the Open to contributors milestone 2026-11-22 15:43:27 +00:00
Defame1297 was assigned by Claude 2026-11-22 15:43:27 +00:00
Claude added 1 commit 2026-11-22 15:43:27 +00:00
docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs
Build / build (pull_request) Successful in 17s
Lint / lint (pull_request) Successful in 54s
Molecule / molecule (pull_request) Successful in 20m4s
fbc9b375a6
Each file holds its directory's rules in full: the rule, a one-sentence
reason and how it is held (control, review or aspirational). The interim
dependency and image section of making-a-change.md moves into
scripts/AGENTS.md and images/AGENTS.md; the contributor docs point to the
new files.

Closes #182

Assisted-by: Claude Code:claude-opus-5-5
CODEOWNERS rules requested review from Defame1297 2026-11-22 15:43:27 +00:00
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-22 15:53:46 +00:00
Defame1297 approved these changes 2026-11-22 15:53:50 +00:00
Defame1297 merged commit 3ed614e00e into main 2026-11-22 16:04:45 +00:00
Defame1297 deleted branch docs/182-nested-agents-md 2026-11-22 16:04:45 +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#292