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

Closed
opened 2026-11-15 19:24:01 +00:00 by Claude · 9 comments
Owner

Spec: AGENTS.md structure and what happens to CLAUDE.md's content (resolution, section 1), as changed by Enforcement map for each prose-only rule, Contributor doc set, Where the maintainer's own procedures live, and what "held by review" means for them, Does the stand-alone rule cover issue text and job logs and What Molecule proves before a merge, and who acts on the nightly run.

What to build

Four files, each holding that directory's rules in full (rule, one-sentence reason, how it is held), under 200 lines each. Held-by values are: control (naming the check), review, aspirational. "Agent instruction" is a place a rule lives, not a way it is held.

  • scripts/AGENTS.md: the script rules; a script change comes with its test in tests/scripts/; a line in tests/sanity/ignore-common.txt is a last resort and carries its reason.
  • .gitea/workflows/AGENTS.md: the "Workflows" section of today's CLAUDE.md, rewritten as rules. Describe molecule.yml as it is when you write it: in particular whether pushes to main are path-filtered or diff-selected (today's CLAUDE.md wrongly says every scenario runs for every push to main). Where the file states the push triggers, Lint and Build no longer run on push to main; Build keeps its v* tag trigger (#166). Rules to add:
    • Secrets: each secret is referenced by exactly one workflow (image.yml the push credential, renovate.yml the Renovate token, and release.yml the release token once that workflow exists); no other workflow references secrets. except the job token. Held by review (CODEOWNERS).
    • Judge scripts: a script that judges a pull request's own diff runs from main's copy; a content or artefact check runs from the pull request's copy. Give the reason. Held by CODEOWNERS review.
    • No host detail in job output: a step prints no host sizing, address or network detail. Reason: job output is readable without an account. Held by review.
    • Molecule tests the pull request's pins, as Lint and Build do. Reason: the pull request that raises the ansible-core floor must be behaviour-tested on the new core before it automerges. Held by control: the pin comparison against /opt/ci-pins.sha256 in the Molecule job (#225). If the Molecule toolchain issue #225 has not landed, write the rule without the held-by line and note in the pull request that #225 adds it.
  • images/AGENTS.md: the rules from the "Images" section of CLAUDE.md (a published version is never moved, bump version: in the PR that changes an image, job_image release equals the Dockerfile FROM, the label block, the 100 MB layer cap, the two-PR loop for an image input) plus these:
    • Bake in (from CI image pipeline: keep, simplify or replace): every tool, collection, hook environment and package a CI job uses is in its image; runtime downloads only on the slow path. Held by review, plus the network-off control if it has landed.
    • Recorded speed (from the same issue): a speed optimisation that adds machinery states its measured saving where it lives. Held by review.
    • Layer size: when you change an image, estimate each layer's size and state the estimate in the pull request; every layer must stay below 100 MB (Cloudflare rejects larger request bodies with HTTP 413). Held by aspirational; the push failing on main is the backstop. There is no pull-request build, by the maintainer's choice.
    • kaniko: pinned by layer digests that Renovate cannot compute, so it is bumped by hand. Write down the trigger (for example, a release of the osscontainertools fork). Held by aspirational.
    • Retiring an image: retire it when no host runs its release. Held by aspirational.
      This file also covers extensions/molecule/ (the image-smoke scenarios). Where the CI image pipeline backlog has changed the pipeline, describe what is there, not the old text.
  • docs/adr/AGENTS.md: the ADR rules from Public design contract replacing the ADR 0004 references:
    • three-part bar, accepted or superseded only, one screen, no infrastructure detail;
    • an ADR is accepted on the maintainer's approval of its pull request, which sets status accepted; held by control (CODEOWNERS code-owner approval on docs/adr/);
    • an accepted risk is an entry in the "Accepted risks" section of SECURITY.md (risk, why accepted, trigger, planned reduction), not an amendment to an ADR; later decisions add entries there.
      Create docs/adr/ if it does not exist yet (ADR 0001, #143, lands first and creates it).

The contributor-doc split (#189) lands first. Move the dependency and image update section from docs/contributing/making-a-change.md into images/AGENTS.md (image inputs, version bump, pin PR, layer limit) and scripts/AGENTS.md (lock-requirements.sh, hook SHA pins), whichever owns each line, and delete the interim section.

Drop history (code-style rule 4): incident accounts and "open item" notes do not move. Use the agentsmd-author skill if it is available.

Acceptance

  • Every rule has its reason and its held-by; a control is named only if it exists.
  • No private-environment references.
  • The PR says what was verified and what was not.

Not in scope

Removing CLAUDE.md and the root AGENTS.md (separate issue, lands after this one). renovate.json descriptions (Renovate push trigger issue).

Spec: [AGENTS.md structure and what happens to CLAUDE.md's content](https://git.rkdr.net/Mortis/Kamino/issues/101) (resolution, section 1), as changed by [Enforcement map for each prose-only rule](https://git.rkdr.net/Mortis/Kamino/issues/102), [Contributor doc set](https://git.rkdr.net/Mortis/Kamino/issues/103), [Where the maintainer's own procedures live, and what "held by review" means for them](https://git.rkdr.net/Mortis/Kamino/issues/250), [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253) and [What Molecule proves before a merge, and who acts on the nightly run](https://git.rkdr.net/Mortis/Kamino/issues/256). ## What to build Four files, each holding that directory's rules **in full** (rule, one-sentence reason, how it is held), under 200 lines each. Held-by values are: control (naming the check), review, aspirational. "Agent instruction" is a place a rule lives, not a way it is held. - `scripts/AGENTS.md`: the script rules; a script change comes with its test in `tests/scripts/`; a line in `tests/sanity/ignore-common.txt` is a last resort and carries its reason. - `.gitea/workflows/AGENTS.md`: the "Workflows" section of today's `CLAUDE.md`, rewritten as rules. Describe `molecule.yml` as it is when you write it: in particular whether pushes to `main` are path-filtered or diff-selected (today's `CLAUDE.md` wrongly says every scenario runs for every push to `main`). Where the file states the push triggers, Lint and Build no longer run on push to `main`; Build keeps its `v*` tag trigger ([#166](https://git.rkdr.net/Mortis/Kamino/issues/166)). Rules to add: - **Secrets:** each secret is referenced by exactly one workflow (`image.yml` the push credential, `renovate.yml` the Renovate token, and `release.yml` the release token once that workflow exists); no other workflow references `secrets.` except the job token. Held by review (CODEOWNERS). - **Judge scripts:** a script that judges a pull request's own diff runs from `main`'s copy; a content or artefact check runs from the pull request's copy. Give the reason. Held by CODEOWNERS review. - **No host detail in job output:** a step prints no host sizing, address or network detail. Reason: job output is readable without an account. Held by review. - **Molecule tests the pull request's pins, as Lint and Build do.** Reason: the pull request that raises the ansible-core floor must be behaviour-tested on the new core before it automerges. Held by control: the pin comparison against `/opt/ci-pins.sha256` in the Molecule job ([#225](https://git.rkdr.net/Mortis/Kamino/issues/225)). If the Molecule toolchain issue #225 has not landed, write the rule without the held-by line and note in the pull request that #225 adds it. - `images/AGENTS.md`: the rules from the "Images" section of `CLAUDE.md` (a published version is never moved, bump `version:` in the PR that changes an image, `job_image` release equals the Dockerfile `FROM`, the label block, the 100 MB layer cap, the two-PR loop for an image input) plus these: - **Bake in** (from [CI image pipeline: keep, simplify or replace](https://git.rkdr.net/Mortis/Kamino/issues/96)): every tool, collection, hook environment and package a CI job uses is in its image; runtime downloads only on the slow path. Held by review, plus the network-off control if it has landed. - **Recorded speed** (from the same issue): a speed optimisation that adds machinery states its measured saving where it lives. Held by review. - **Layer size:** when you change an image, estimate each layer's size and state the estimate in the pull request; every layer must stay below 100 MB (Cloudflare rejects larger request bodies with HTTP 413). Held by aspirational; the push failing on `main` is the backstop. There is no pull-request build, by the maintainer's choice. - **kaniko:** pinned by layer digests that Renovate cannot compute, so it is bumped by hand. Write down the trigger (for example, a release of the osscontainertools fork). Held by aspirational. - **Retiring an image:** retire it when no host runs its release. Held by aspirational. This file also covers `extensions/molecule/` (the image-smoke scenarios). Where the CI image pipeline backlog has changed the pipeline, describe what is there, not the old text. - `docs/adr/AGENTS.md`: the ADR rules from [Public design contract replacing the ADR 0004 references](https://git.rkdr.net/Mortis/Kamino/issues/92): - three-part bar, accepted or superseded only, one screen, no infrastructure detail; - an ADR is accepted on the maintainer's approval of its pull request, which sets status `accepted`; held by control (CODEOWNERS code-owner approval on `docs/adr/`); - an accepted risk is an entry in the "Accepted risks" section of `SECURITY.md` (risk, why accepted, trigger, planned reduction), not an amendment to an ADR; later decisions add entries there. Create `docs/adr/` if it does not exist yet (ADR 0001, [#143](https://git.rkdr.net/Mortis/Kamino/issues/143), lands first and creates it). The contributor-doc split ([#189](https://git.rkdr.net/Mortis/Kamino/issues/189)) lands first. Move the dependency and image update section from `docs/contributing/making-a-change.md` into `images/AGENTS.md` (image inputs, version bump, pin PR, layer limit) and `scripts/AGENTS.md` (`lock-requirements.sh`, hook SHA pins), whichever owns each line, and delete the interim section. Drop history (code-style rule 4): incident accounts and "open item" notes do not move. Use the `agentsmd-author` skill if it is available. ## Acceptance - [ ] Every rule has its reason and its held-by; a control is named only if it exists. - [ ] No private-environment references. - [ ] The PR says what was verified and what was not. ## Not in scope Removing `CLAUDE.md` and the root `AGENTS.md` (separate issue, lands after this one). `renovate.json` descriptions ([Renovate push trigger issue](https://git.rkdr.net/Mortis/Kamino/issues/172)).
Claude added the
Status
Ready for Agent
label 2026-11-15 19:24:01 +00:00
Claude added a new dependency 2026-11-15 19:24:26 +00:00
Author
Owner

Input from Enforcement map for each prose-only rule for the nested files:

images/AGENTS.md:

  • Layer size: when you change an image, estimate each layer's size and state the estimate in the pull request; every layer must stay below 100 MB (Cloudflare rejects larger request bodies with HTTP 413). Held: agent instruction; the push failing on main is the backstop. There is no pull-request build, by the maintainer's choice.
  • kaniko: pinned by layer digests that Renovate cannot compute, so it is bumped by hand. Write down the trigger (for example, a release of the osscontainertools fork). Held: aspirational.
  • Retiring an image: retire it when no host runs its release. Held: aspirational.

.gitea/workflows/AGENTS.md: restated secrets rule: each secret is referenced by exactly one workflow (image.yml the push credential, renovate.yml the Renovate token, release.yml the release token); no other workflow references secrets. except the job token. Held: review (CODEOWNERS). Also: a script that judges a pull request's own diff runs from main's copy.

Input from [Enforcement map for each prose-only rule](https://git.rkdr.net/Mortis/Kamino/issues/102) for the nested files: `images/AGENTS.md`: - **Layer size:** when you change an image, estimate each layer's size and state the estimate in the pull request; every layer must stay below 100 MB (Cloudflare rejects larger request bodies with HTTP 413). *Held:* agent instruction; the push failing on `main` is the backstop. There is no pull-request build, by the maintainer's choice. - **kaniko:** pinned by layer digests that Renovate cannot compute, so it is bumped by hand. Write down the trigger (for example, a release of the osscontainertools fork). *Held:* aspirational. - **Retiring an image:** retire it when no host runs its release. *Held:* aspirational. `.gitea/workflows/AGENTS.md`: restated secrets rule: each secret is referenced by exactly one workflow (`image.yml` the push credential, `renovate.yml` the Renovate token, `release.yml` the release token); no other workflow references `secrets.` except the job token. *Held:* review (CODEOWNERS). Also: a script that judges a pull request's own diff runs from `main`'s copy.
Author
Owner

Added by Contributor doc set (resolution, section 1):

  • .gitea/workflows/AGENTS.md holds the rule "a script that judges a pull request's own diff runs from main's copy; a content or artefact check runs from the pull request's", with its reason and "held by CODEOWNERS review".
  • CONTRIBUTING.md's "Dependency and image updates" section moves into images/AGENTS.md (image inputs, version bump, pin PR, layer limit) and scripts/AGENTS.md (lock-requirements.sh, hook SHA pins), whichever owns each line. If the contributor doc split lands first, it does the move instead.
Added by [Contributor doc set](https://git.rkdr.net/Mortis/Kamino/issues/103) (resolution, section 1): - `.gitea/workflows/AGENTS.md` holds the rule "a script that judges a pull request's own diff runs from `main`'s copy; a content or artefact check runs from the pull request's", with its reason and "held by CODEOWNERS review". - `CONTRIBUTING.md`'s "Dependency and image updates" section moves into `images/AGENTS.md` (image inputs, version bump, pin PR, layer limit) and `scripts/AGENTS.md` (`lock-requirements.sh`, hook SHA pins), whichever owns each line. If [the contributor doc split](https://git.rkdr.net/Mortis/Kamino/issues/189) lands first, it does the move instead.
Claude added a new dependency 2026-11-15 22:20:38 +00:00
Claude added a new dependency 2026-11-15 22:20:38 +00:00
Claude added a new dependency 2026-11-15 22:20:53 +00:00
Claude added this to the Open to contributors milestone 2026-11-15 22:21:19 +00:00
Author
Owner

Order: the contributor-doc split (#189) lands first, so move the dependency and image update section out of docs/contributing/ rather than CONTRIBUTING.md. ADR 0001 (#143) also lands first and creates docs/adr/. (From Order of the implementation backlog, #198.)

Order: the contributor-doc split (#189) lands first, so move the dependency and image update section out of `docs/contributing/` rather than `CONTRIBUTING.md`. ADR 0001 (#143) also lands first and creates `docs/adr/`. (From Order of the implementation backlog, #198.)
Author
Owner

Review of the map (2026-11-15): corrections to this issue.

  • The ordering comment names a folder the section never reaches. The last comment says to "move the dependency and image update section out of docs/contributing/". But docs(contributing): split the contributor docs into CONTRIBUTING.md and docs/contributing/ never put it there: its body only says to move it into this issue's files "if that has merged first", which the order rules out. That issue now gets a note to keep the section as an interim part of docs/contributing/making-a-change.md. Change here: move it from docs/contributing/making-a-change.md into images/AGENTS.md and scripts/AGENTS.md, and delete the interim section.
  • "Accepted on maintainer merge" is not what the settings enforce. The docs/adr/AGENTS.md bullet lists "accepted on maintainer merge". The planned branch protection (chore: apply the recommended repository settings, account permissions and branch protection, step 3) lets each trusted contributor merge, and the maintainer's part is the code-owner approval. Change the rule to "accepted on the maintainer's approval of its pull request".
  • The named skill will not exist. "Use the agentsmd-author skill." apm.lock.yaml deploys it from the core plugin, which chore: commit the deployed agent skills, trim the apm plugins and pin apm-cli removes, and .claude/skills/ is gitignored today (.gitignore:19). Change: "if available", or drop the line.

Waiting on another decision: how the root file points to these nested files waits on Making sure an agent actually loads the guidance.

Review of the map (2026-11-15): corrections to this issue. - **The ordering comment names a folder the section never reaches.** The last comment says to "move the dependency and image update section out of `docs/contributing/`". But [docs(contributing): split the contributor docs into CONTRIBUTING.md and docs/contributing/](https://git.rkdr.net/Mortis/Kamino/issues/189) never put it there: its body only says to move it into this issue's files "if that has merged first", which the order rules out. That issue now gets a note to keep the section as an interim part of `docs/contributing/making-a-change.md`. Change here: move it from `docs/contributing/making-a-change.md` into `images/AGENTS.md` and `scripts/AGENTS.md`, and delete the interim section. - **"Accepted on maintainer merge" is not what the settings enforce.** The `docs/adr/AGENTS.md` bullet lists "accepted on maintainer merge". The planned branch protection ([chore: apply the recommended repository settings, account permissions and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/192), step 3) lets each trusted contributor merge, and the maintainer's part is the code-owner approval. Change the rule to "accepted on the maintainer's approval of its pull request". - **The named skill will not exist.** "Use the `agentsmd-author` skill." `apm.lock.yaml` deploys it from the `core` plugin, which [chore: commit the deployed agent skills, trim the apm plugins and pin apm-cli](https://git.rkdr.net/Mortis/Kamino/issues/193) removes, and `.claude/skills/` is gitignored today (`.gitignore:19`). Change: "if available", or drop the line. Waiting on another decision: how the root file points to these nested files waits on [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213).
Author
Owner

Scope change from Where the maintainer's own procedures live, and what "held by review" means for them (2026-11-20)

docs/adr/AGENTS.md:

  • Acceptance: "an ADR is accepted on the maintainer's approval of its pull request, which sets status accepted". Confirmed by the maintainer; this settles the correction in the review comment of 2026-11-16. Held by: control (CODEOWNERS code-owner approval on docs/adr/).
  • Accepted risks: an accepted risk is an entry in the "Accepted risks" section of SECURITY.md (risk, why accepted, trigger, planned reduction), not an amendment to an ADR. Later decisions add entries there. Adjust the body's "residual risk when a risk is accepted" bullet accordingly.

All four files:

  • Held-by values are: control (naming the check), review, aspirational. "Agent instruction" is a place a rule lives, not a way it is held. In the first comment, the layer-size rule's "Held: agent instruction" becomes "Held by: aspirational" (the push failing on main stays the backstop).
## Scope change from [Where the maintainer's own procedures live, and what "held by review" means for them](https://git.rkdr.net/Mortis/Kamino/issues/250) (2026-11-20) `docs/adr/AGENTS.md`: - **Acceptance:** "an ADR is accepted on the maintainer's approval of its pull request, which sets status `accepted`". Confirmed by the maintainer; this settles the correction in the review comment of 2026-11-16. Held by: control (CODEOWNERS code-owner approval on `docs/adr/`). - **Accepted risks:** an accepted risk is an entry in the "Accepted risks" section of `SECURITY.md` (risk, why accepted, trigger, planned reduction), not an amendment to an ADR. Later decisions add entries there. Adjust the body's "residual risk when a risk is accepted" bullet accordingly. All four files: - **Held-by values are:** control (naming the check), review, aspirational. "Agent instruction" is a place a rule lives, not a way it is held. In the first comment, the layer-size rule's "*Held:* agent instruction" becomes "*Held by:* aspirational" (the push failing on `main` stays the backstop).
Author
Owner

Scope added by Does the stand-alone rule cover issue text and job logs (2026-11-20): .gitea/workflows/AGENTS.md gets one rule: a step prints no host sizing, address or network detail (reason: job output is readable without an account; held by review).

Scope added by [Does the stand-alone rule cover issue text and job logs](https://git.rkdr.net/Mortis/Kamino/issues/253) (2026-11-20): `.gitea/workflows/AGENTS.md` gets one rule: a step prints no host sizing, address or network detail (reason: job output is readable without an account; held by review).
Author
Owner

Scope added from What Molecule proves before a merge, and who acts on the nightly run (2026-11-20)

One rule for .gitea/workflows/AGENTS.md, in the rule form:

  • Molecule tests the pull request's pins, as Lint and Build do. Reason: the pull request that raises the ansible-core floor must be behaviour-tested on the new core before it automerges. Held by control: the pin comparison against /opt/ci-pins.sha256 in the Molecule job (#225).

Where the file states the push triggers, Lint and Build no longer run on push to main; Build keeps its v* tag trigger (#166).

## Scope added from [What Molecule proves before a merge, and who acts on the nightly run](https://git.rkdr.net/Mortis/Kamino/issues/256) (2026-11-20) One rule for `.gitea/workflows/AGENTS.md`, in the rule form: - **Molecule tests the pull request's pins, as Lint and Build do.** Reason: the pull request that raises the ansible-core floor must be behaviour-tested on the new core before it automerges. Held by control: the pin comparison against `/opt/ci-pins.sha256` in the Molecule job (#225). Where the file states the push triggers, Lint and Build no longer run on push to `main`; Build keeps its `v*` tag trigger (#166).
Author
Owner

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

  • ADR rules: "accepted on maintainer merge" is now "accepted on the maintainer's approval of its pull request, which sets status accepted", held by control (CODEOWNERS), as the comment of 2026-11-20 says; accepted risks go to the SECURITY.md register, not into an ADR.
  • Added the Molecule pins rule for .gitea/workflows/AGENTS.md, with its held-by control (#225) only if #225 has landed; otherwise write the rule without the held-by line and note in the pull request that #225 adds it. Added the push-trigger sentence (#166).
  • Folded in the other later comments: the secrets and judge-script rules, the no-host-detail rule for job output, the images rules (bake in, recorded speed, layer size, kaniko, retiring) with "held by: aspirational" instead of "agent instruction", the move of the dependency and image update section out of docs/contributing/making-a-change.md, the held-by vocabulary, and "use agentsmd-author if available".
  • The comments above stay as history.
Final validation round, second pass (2026-11-20): body edited. - ADR rules: "accepted on maintainer merge" is now "accepted on the maintainer's approval of its pull request, which sets status `accepted`", held by control (CODEOWNERS), as the comment of 2026-11-20 says; accepted risks go to the `SECURITY.md` register, not into an ADR. - Added the Molecule pins rule for `.gitea/workflows/AGENTS.md`, with its held-by control (#225) only if #225 has landed; otherwise write the rule without the held-by line and note in the pull request that #225 adds it. Added the push-trigger sentence (#166). - Folded in the other later comments: the secrets and judge-script rules, the no-host-detail rule for job output, the images rules (bake in, recorded speed, layer size, kaniko, retiring) with "held by: aspirational" instead of "agent instruction", the move of the dependency and image update section out of `docs/contributing/making-a-change.md`, the held-by vocabulary, and "use `agentsmd-author` if available". - The comments above stay as history.
Author
Owner

From ci: lint workflows with zizmor (#145, PR #279): the zizmor pre-commit hook now runs over .gitea/workflows. When .gitea/workflows/AGENTS.md is written, the rules "never pull_request_target" and "never interpolate ${{ github.* }} into a run: block" are held by "control: the zizmor hook" (once #279 has merged), not by review.

From ci: lint workflows with zizmor (#145, PR #279): the zizmor pre-commit hook now runs over `.gitea/workflows`. When `.gitea/workflows/AGENTS.md` is written, the rules "never `pull_request_target`" and "never interpolate `${{ github.* }}` into a `run:` block" are held by "control: the zizmor hook" (once #279 has merged), not by review.
Defame1297 was assigned by Claude 2026-11-22 09:04:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#182