Guiding principles for agents and humans #91

Closed
opened 2026-11-11 22:02:56 +00:00 by Claude · 3 comments
Owner

Part of #87

Question

What is the short list of principles that guides every contribution, and what concrete test goes with each so a reviewer or a check can apply it?

Candidates from the maintainer: no long comments or prose in code; avoid long and complex custom scripts; keep things simple and understandable.

Context

  • Decided already: principles bind existing content and humans as well as agents.
  • The maintainer's shared rules already contain usable wording, for example "No comments unless the why is genuinely non-obvious. Names carry meaning; git history carries context." and "No abstractions, features, or cleanup beyond what the task requires."
  • The repository currently breaks the candidates: a 34-line header in image.yml, scripts/check_image_versions.py at roughly 480 lines, renovate.json descriptions over 100 words.
  • A principle without a counter-example and a boundary tends to lose to an agent's defaults.
Part of #87 ## Question What is the short list of principles that guides every contribution, and what concrete test goes with each so a reviewer or a check can apply it? Candidates from the maintainer: no long comments or prose in code; avoid long and complex custom scripts; keep things simple and understandable. ## Context - Decided already: principles bind existing content and humans as well as agents. - The maintainer's shared rules already contain usable wording, for example "No comments unless the why is genuinely non-obvious. Names carry meaning; git history carries context." and "No abstractions, features, or cleanup beyond what the task requires." - The repository currently breaks the candidates: a 34-line header in `image.yml`, `scripts/check_image_versions.py` at roughly 480 lines, `renovate.json` descriptions over 100 words. - A principle without a counter-example and a boundary tends to lose to an agent's defaults.
Claude added the
Wayfinder
Grilling
label 2026-11-11 22:02:56 +00:00
Claude added a new dependency 2026-11-11 22:03:14 +00:00
Claude added a new dependency 2026-11-11 22:03:14 +00:00
Defame1297 was assigned by Claude 2026-11-13 15:34:43 +00:00
Author
Owner

Resolution

The ticket grew during the session: the maintainer meant "principles" broadly, as the spine of a full guidance set for contributors and their agents, not only a code-style list. Most areas already have tickets, so this one decided what nothing else owned: the cross-cutting principles, the form every rule takes, code style outside roles, and the pattern for what an agent gets in context.

1. Scope of the guidance set

Five areas: governance, contribution, code style, repository structure, architecture. The set stands alone (it depends on nothing outside this repository, the maintainer's own agent configuration included) and is written once, for humans and agents alike. Recorded in the map's Destination and Notes.

2. Terms and form

  • Principle: a commitment that holds across the repository, with its reason. Rule: what a principle requires of a contributor in one area. Control: a hook or CI job that holds a rule mechanically. (GLOSSARY.md, drafted, not yet committed.)
  • Every rule is written as: the rule, a one-sentence reason, and how it is held: control (naming the hook or check), review, or aspirational.

3. The seven principles

  1. Accountability: every change has a human author who understands it and answers for it; an agent is a tool.
  2. A human decides what is irreversible or shared: settings, protection, tags, releases, credentials, merges to main.
  3. Secrets and supply chain: no secret in the repository, a prompt or a log; dependencies and images are pinned and change through review.
  4. Enforced, not trusted: a rule that matters gets a control; one without is labelled as such.
  5. Honest reporting: a pull request says what was verified and what was not.
  6. Simple enough to review: see the code-style rules below.
  7. Openness and licence: AI assistance is disclosed; contributions are GPL-compatible and REUSE-clean.

The area tickets elaborate these; they do not re-decide them.

4. Code style outside roles (principle 6)

  1. Existing tool first. An Ansible module, a lint rule or a tool's own setting before a script; a pull request that adds or grows a script says what was ruled out.
  2. One job per file, readable in one sitting.
  3. A comment gives the reason, in a line or two.
  4. Write for the next reader, not the record. No incident history, change narration or session notes in code, comments or agent context; that goes in the commit message or an ADR.
  5. Change only what the task needs. Unrelated cleanup is a separate pull request; fixing a line you had to touch anyway is fine.

Each is to be written with a counter-example from this repository and a boundary saying what it does not forbid.

How they are held:

  • Control: add ruff (lint and format, complexity and function-size rules at their defaults) and shellcheck as hooks that also run in CI. Neither Python nor shell is linted today. Enable ansible-lint's complexity rule; its max_tasks number is set by the Role standard ticket, which must first confirm with ansible-lint -L that the rule is active under the production profile.
  • Review, with soft numbers: a comment block over 5 lines, a script or workflow over 200 lines, a guidance document over 200 lines. Above a number the pull request says why; there is no failing tier.
  • No custom checker for comment or file length. No standard tool does it for YAML or shell, and writing one would break rule 1.
  • One home per number: a tool-held number lives in that tool's committed config file, a review-held number in the code-style document only. No environment variables: a contributor's shell and CI must judge a file the same way.
  • Exceptions are explicit and local: an inline suppression with its reason, or one sentence in the pull request. Never a global exclude.
  • Existing content: the rules bind new and changed lines from the day they land. Existing violators become backlog issues after the CI image pipeline decision, which may delete the largest of them.

5. What an agent gets in context

  • The test for always-loaded: a line goes into always-loaded context only if it applies to nearly every task, an agent would get it wrong without it, and no control already holds it.
  • Root AGENTS.md: the seven principles and five code-style rules at one line each, the commands to verify a change, and pointers.
  • Nested AGENTS.md in each directory with its own way of working (candidates: roles/, scripts/, .gitea/workflows/, images/), so an agent editing there gets those rules without being told to look.
  • docs/ for guidance tied to a task rather than a directory, and for the reasons and examples behind the rules.
  • Pointers carry a trigger: "before writing or changing X, read <file>", never a bare link.
  • Skills never carry a rule. They may add workflow; every rule is readable without installing anything.
  • No CLAUDE.md, no .claude/rules, no hook injection for guidance. This reverses the map's earlier note that CLAUDE.md becomes a thin adapter; see the test below.

6. No ADR

The principles are easy to change and unsurprising, so they miss the ADR bar. The guidance documents are the record.

Evidence

Test: how Claude Code loads nested AGENTS.md (version 2.1.323, a throwaway directory, one run per case; each asked a fresh session to read one file in sub/ and report which planted codewords it could see):

Setup Root AGENTS.md sub/AGENTS.md
Root CLAUDE.md importing AGENTS.md loaded not loaded
Root and sub/ each with a one-line CLAUDE.md importing its AGENTS.md loaded loaded
No CLAUDE.md anywhere loaded loaded

A root adapter switches off on-demand loading of nested AGENTS.md; with no CLAUDE.md both load natively. Not established: the oldest Claude Code version that reads AGENTS.md natively. Codex, Cursor and Copilot document reading root and nested AGENTS.md (not tested here).

What the maintainer's other repositories show (read-only survey): the same principles are stated there and hold only where a control exists. Content measured by a hook complies; comments and prose, held by instruction alone, run to a quarter or more of many files, with comment blocks of 90 to 160 lines that are mostly incident history. A custom size checker there grew to over 500 lines. This is why rule 4 exists and why no custom checker is written here.

Public sources

Passed to other tickets

  • AGENTS.md structure and what leaves CLAUDE.md: apply the always-loaded test to today's CLAUDE.md content; decide which directories get a nested AGENTS.md; establish the minimum Claude Code version and state it in the contributor setup; repository structure.
  • Role standard: the complexity number, and confirming the rule is active.
  • Enforcement map for each prose-only rule: shell and Python lint are decided here (ruff, shellcheck); the label vocabulary is control, review, aspirational.
## Resolution The ticket grew during the session: the maintainer meant "principles" broadly, as the spine of a full guidance set for contributors and their agents, not only a code-style list. Most areas already have tickets, so this one decided what nothing else owned: the cross-cutting principles, the form every rule takes, code style outside roles, and the pattern for what an agent gets in context. ### 1. Scope of the guidance set Five areas: governance, contribution, code style, repository structure, architecture. The set stands alone (it depends on nothing outside this repository, the maintainer's own agent configuration included) and is written once, for humans and agents alike. Recorded in the map's Destination and Notes. ### 2. Terms and form - **Principle**: a commitment that holds across the repository, with its reason. **Rule**: what a principle requires of a contributor in one area. **Control**: a hook or CI job that holds a rule mechanically. (`GLOSSARY.md`, drafted, not yet committed.) - Every rule is written as: the rule, a one-sentence reason, and how it is held: **control** (naming the hook or check), **review**, or **aspirational**. ### 3. The seven principles 1. **Accountability**: every change has a human author who understands it and answers for it; an agent is a tool. 2. **A human decides what is irreversible or shared**: settings, protection, tags, releases, credentials, merges to `main`. 3. **Secrets and supply chain**: no secret in the repository, a prompt or a log; dependencies and images are pinned and change through review. 4. **Enforced, not trusted**: a rule that matters gets a control; one without is labelled as such. 5. **Honest reporting**: a pull request says what was verified and what was not. 6. **Simple enough to review**: see the code-style rules below. 7. **Openness and licence**: AI assistance is disclosed; contributions are GPL-compatible and REUSE-clean. The area tickets elaborate these; they do not re-decide them. ### 4. Code style outside roles (principle 6) 1. **Existing tool first.** An Ansible module, a lint rule or a tool's own setting before a script; a pull request that adds or grows a script says what was ruled out. 2. **One job per file, readable in one sitting.** 3. **A comment gives the reason, in a line or two.** 4. **Write for the next reader, not the record.** No incident history, change narration or session notes in code, comments or agent context; that goes in the commit message or an ADR. 5. **Change only what the task needs.** Unrelated cleanup is a separate pull request; fixing a line you had to touch anyway is fine. Each is to be written with a counter-example from this repository and a boundary saying what it does not forbid. How they are held: - **Control**: add `ruff` (lint and format, complexity and function-size rules at their defaults) and `shellcheck` as hooks that also run in CI. Neither Python nor shell is linted today. Enable ansible-lint's `complexity` rule; its `max_tasks` number is set by the Role standard ticket, which must first confirm with `ansible-lint -L` that the rule is active under the production profile. - **Review, with soft numbers**: a comment block over 5 lines, a script or workflow over 200 lines, a guidance document over 200 lines. Above a number the pull request says why; there is no failing tier. - **No custom checker** for comment or file length. No standard tool does it for YAML or shell, and writing one would break rule 1. - **One home per number**: a tool-held number lives in that tool's committed config file, a review-held number in the code-style document only. No environment variables: a contributor's shell and CI must judge a file the same way. - **Exceptions** are explicit and local: an inline suppression with its reason, or one sentence in the pull request. Never a global exclude. - **Existing content**: the rules bind new and changed lines from the day they land. Existing violators become backlog issues after the CI image pipeline decision, which may delete the largest of them. ### 5. What an agent gets in context - **The test for always-loaded**: a line goes into always-loaded context only if it applies to nearly every task, an agent would get it wrong without it, and no control already holds it. - **Root `AGENTS.md`**: the seven principles and five code-style rules at one line each, the commands to verify a change, and pointers. - **Nested `AGENTS.md`** in each directory with its own way of working (candidates: `roles/`, `scripts/`, `.gitea/workflows/`, `images/`), so an agent editing there gets those rules without being told to look. - **`docs/`** for guidance tied to a task rather than a directory, and for the reasons and examples behind the rules. - **Pointers carry a trigger**: "before writing or changing X, read `<file>`", never a bare link. - **Skills never carry a rule.** They may add workflow; every rule is readable without installing anything. - **No `CLAUDE.md`**, no `.claude/rules`, no hook injection for guidance. This reverses the map's earlier note that `CLAUDE.md` becomes a thin adapter; see the test below. ### 6. No ADR The principles are easy to change and unsurprising, so they miss the ADR bar. The guidance documents are the record. ## Evidence **Test: how Claude Code loads nested `AGENTS.md`** (version 2.1.323, a throwaway directory, one run per case; each asked a fresh session to read one file in `sub/` and report which planted codewords it could see): | Setup | Root `AGENTS.md` | `sub/AGENTS.md` | |---|---|---| | Root `CLAUDE.md` importing `AGENTS.md` | loaded | **not loaded** | | Root and `sub/` each with a one-line `CLAUDE.md` importing its `AGENTS.md` | loaded | loaded | | No `CLAUDE.md` anywhere | loaded | loaded | A root adapter switches off on-demand loading of nested `AGENTS.md`; with no `CLAUDE.md` both load natively. Not established: the oldest Claude Code version that reads `AGENTS.md` natively. Codex, Cursor and Copilot document reading root and nested `AGENTS.md` (not tested here). **What the maintainer's other repositories show** (read-only survey): the same principles are stated there and hold only where a control exists. Content measured by a hook complies; comments and prose, held by instruction alone, run to a quarter or more of many files, with comment blocks of 90 to 160 lines that are mostly incident history. A custom size checker there grew to over 500 lines. This is why rule 4 exists and why no custom checker is written here. **Public sources** - Soft wording of limits: Google ([small changes](https://google.github.io/eng-practices/review/developer/small-cls.html), [shell guide](https://google.github.io/styleguide/shellguide.html), [Python guide](https://google.github.io/styleguide/pyguide.html)), [Linux kernel coding style](https://www.kernel.org/doc/html/latest/process/coding-style.html), [Zen of Ansible and good practices](https://redhat-cop.github.io/automation-good-practices/). - No change history in comments: [Zulip](https://github.com/zulip/zulip/blob/main/AGENTS.md), [uv](https://github.com/astral-sh/uv/blob/main/AGENTS.md), [ruff](https://github.com/astral-sh/ruff/blob/main/AGENTS.md) (which also warns against splitting something solely for its length). - Agent context: [Claude Code memory](https://code.claude.com/docs/en/memory) (under 200 lines per file; imports load eagerly; nested files load on demand), [best practices](https://code.claude.com/docs/en/best-practices) (a hook for a rule with zero exceptions), [Codex AGENTS.md](https://developers.openai.com/codex/guides/agents-md) (32 KiB cap, files concatenated root-down), [agents.md](https://agents.md/). - Standard controls: ansible-lint [`complexity`](https://docs.ansible.com/projects/lint/rules/complexity/) (`max_tasks` default 100), yamllint `line-length`, ruff `C901` and `PLR0915`, shellcheck. No standard tool limits consecutive comment lines or file length in YAML or shell. ## Passed to other tickets - **AGENTS.md structure and what leaves CLAUDE.md**: apply the always-loaded test to today's `CLAUDE.md` content; decide which directories get a nested `AGENTS.md`; establish the minimum Claude Code version and state it in the contributor setup; repository structure. - **Role standard**: the `complexity` number, and confirming the rule is active. - **Enforcement map for each prose-only rule**: shell and Python lint are decided here (`ruff`, `shellcheck`); the label vocabulary is control, review, aspirational.
Author
Owner

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

  • Partly superseded by Agent guard hook and permission allowlist. Section 5 says "No CLAUDE.md, no .claude/rules, no hook injection for guidance" and "Skills never carry a rule". Point 5 of the later resolution adopts instructions through apm: they "may carry rules shared across the maintainer's repositories" and "for now they land in .claude/rules/". "No .claude/rules" no longer holds as written; "No CLAUDE.md" and "every rule is readable without installing anything" for this repository's own rules still stand.
  • How those apm rules rank against AGENTS.md, and whether they may land before the managed-section issue, is open in Making sure an agent actually loads the guidance.
Review of the map (2026-11-15): corrections to this issue. - **Partly superseded by [Agent guard hook and permission allowlist](https://git.rkdr.net/Mortis/Kamino/issues/195).** Section 5 says "No `CLAUDE.md`, no `.claude/rules`, no hook injection for guidance" and "Skills never carry a rule". Point 5 of the later resolution adopts instructions through apm: they "may carry rules shared across the maintainer's repositories" and "for now they land in `.claude/rules/`". "No `.claude/rules`" no longer holds as written; "No `CLAUDE.md`" and "every rule is readable without installing anything" for this repository's own rules still stand. - How those apm rules rank against `AGENTS.md`, and whether they may land before the managed-section issue, is open in [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213).
Author
Owner

Partly superseded by Making sure an agent actually loads the guidance: Codex does not read nested AGENTS.md files from a session started at the root (it walks from the root down to the working directory), so the root carries a triggered pointer per nested file. "No .claude/rules" holds again until apm instructions move into a managed section of the root AGENTS.md.

Partly superseded by [Making sure an agent actually loads the guidance](https://git.rkdr.net/Mortis/Kamino/issues/213): Codex does not read nested `AGENTS.md` files from a session started at the root (it walks from the root down to the working directory), so the root carries a triggered pointer per nested file. "No `.claude/rules`" holds again until apm instructions move into a managed section of the root `AGENTS.md`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Kamino#91