docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs #182
Notifications
Due Date
No due date set.
Blocks
Depends on
#128 docs: remove the ADR 0004 citations
Mortis/Kamino
#143 docs(adr): record the threat model as ADR 0001
Mortis/Kamino
Reference: Mortis/Kamino#182
Reference in new issue
Block a user
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 intests/scripts/; a line intests/sanity/ignore-common.txtis a last resort and carries its reason..gitea/workflows/AGENTS.md: the "Workflows" section of today'sCLAUDE.md, rewritten as rules. Describemolecule.ymlas it is when you write it: in particular whether pushes tomainare path-filtered or diff-selected (today'sCLAUDE.mdwrongly says every scenario runs for every push tomain). Where the file states the push triggers, Lint and Build no longer run on push tomain; Build keeps itsv*tag trigger (#166). Rules to add:image.ymlthe push credential,renovate.ymlthe Renovate token, andrelease.ymlthe release token once that workflow exists); no other workflow referencessecrets.except the job token. Held by review (CODEOWNERS).main's copy; a content or artefact check runs from the pull request's copy. Give the reason. Held by CODEOWNERS review./opt/ci-pins.sha256in 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 ofCLAUDE.md(a published version is never moved, bumpversion:in the PR that changes an image,job_imagerelease equals the DockerfileFROM, the label block, the 100 MB layer cap, the two-PR loop for an image input) plus these:mainis the backstop. There is no pull-request build, by the maintainer's choice.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:accepted; held by control (CODEOWNERS code-owner approval ondocs/adr/);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.mdintoimages/AGENTS.md(image inputs, version bump, pin PR, layer limit) andscripts/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-authorskill if it is available.Acceptance
Not in scope
Removing
CLAUDE.mdand the rootAGENTS.md(separate issue, lands after this one).renovate.jsondescriptions (Renovate push trigger issue).Input from Enforcement map for each prose-only rule for the nested files:
images/AGENTS.md:mainis the backstop. There is no pull-request build, by the maintainer's choice..gitea/workflows/AGENTS.md: restated secrets rule: each secret is referenced by exactly one workflow (image.ymlthe push credential,renovate.ymlthe Renovate token,release.ymlthe release token); no other workflow referencessecrets.except the job token. Held: review (CODEOWNERS). Also: a script that judges a pull request's own diff runs frommain's copy.Added by Contributor doc set (resolution, section 1):
.gitea/workflows/AGENTS.mdholds the rule "a script that judges a pull request's own diff runs frommain'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 intoimages/AGENTS.md(image inputs, version bump, pin PR, layer limit) andscripts/AGENTS.md(lock-requirements.sh, hook SHA pins), whichever owns each line. If the contributor doc split lands first, it does the move instead.Order: the contributor-doc split (#189) lands first, so move the dependency and image update section out of
docs/contributing/rather thanCONTRIBUTING.md. ADR 0001 (#143) also lands first and createsdocs/adr/. (From Order of the implementation backlog, #198.)Review of the map (2026-11-15): corrections to this issue.
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 ofdocs/contributing/making-a-change.md. Change here: move it fromdocs/contributing/making-a-change.mdintoimages/AGENTS.mdandscripts/AGENTS.md, and delete the interim section.docs/adr/AGENTS.mdbullet 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".agentsmd-authorskill."apm.lock.yamldeploys it from thecoreplugin, 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.
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:accepted". Confirmed by the maintainer; this settles the correction in the review comment of 2026-11-16. Held by: control (CODEOWNERS code-owner approval ondocs/adr/).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:
mainstays the backstop).Scope added by Does the stand-alone rule cover issue text and job logs (2026-11-20):
.gitea/workflows/AGENTS.mdgets 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 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:/opt/ci-pins.sha256in the Molecule job (#225).Where the file states the push triggers, Lint and Build no longer run on push to
main; Build keeps itsv*tag trigger (#166).Final validation round, second pass (2026-11-20): body edited.
accepted", held by control (CODEOWNERS), as the comment of 2026-11-20 says; accepted risks go to theSECURITY.mdregister, not into an ADR..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).docs/contributing/making-a-change.md, the held-by vocabulary, and "useagentsmd-authorif available".From ci: lint workflows with zizmor (#145, PR #279): the zizmor pre-commit hook now runs over
.gitea/workflows. When.gitea/workflows/AGENTS.mdis written, the rules "neverpull_request_target" and "never interpolate${{ github.* }}into arun:block" are held by "control: the zizmor hook" (once #279 has merged), not by review.