The held-by lines in AGENTS.md and the contributor docs hold rules by a control, by review or aspirationally, and SECURITY.md's Accepted risks count repository settings such as branch protection and code-owner approval, but the glossary defined only control and limited it to hooks and CI jobs. Define all three, the merge and role terms, and replace the avoided gate, guard and enforce wording. Assisted-by: Claude Code
53 lines
3.2 KiB
Markdown
53 lines
3.2 KiB
Markdown
# Setup
|
|
|
|
Read this before setting up a clone, or an agent tool, to work on this repository.
|
|
|
|
Every rule below gives its reason and how it is held: by a control (a named hook or check), by
|
|
review, or aspirational (checked by nothing and nobody). Links between the contributor docs are
|
|
held by review until an offline link check exists.
|
|
|
|
## The clone
|
|
|
|
- **Run `scripts/dev-setup.sh` once per clone, and again after a change to `requirements-dev.txt`, its
|
|
lock `requirements-dev.lock`, `requirements.yml` or the hook types.** It creates `.venv` with the
|
|
pinned tools on the Python named in `.python-version`, installs the collections of `requirements.yml`
|
|
into `.ansible/collections`, and installs the git hooks (pre-commit, commit-msg, pre-push) with the
|
|
virtualenv first on their `PATH`.
|
|
*Reason:* several hooks run their tools by name (`language: system`), so they fail without that
|
|
virtualenv, and local lint must resolve the collection versions CI does.
|
|
*Held by:* aspirational (a hook run without the virtualenv fails, which shows the step was skipped).
|
|
- **Run `pre-commit run --all-files` before pushing.**
|
|
*Reason:* a finding then stops you before the push instead of failing CI after it.
|
|
*Held by:* control: the Lint check runs the same hooks on every pull request.
|
|
- **Let `git push` run `ansible-test sanity` on HEAD** (`scripts/ansible-test-sanity.sh`, the Build
|
|
check's sanity test); its first run builds virtualenvs and takes minutes.
|
|
*Reason:* a finding only that test reports stops the push instead of the Build check.
|
|
*Held by:* control: the pre-push hook, and the Build check.
|
|
|
|
## Agent tools
|
|
|
|
- **Use Claude Code 2.1.281 or later.**
|
|
*Reason:* older versions read no `AGENTS.md`, or only `CLAUDE.md` in some sessions, so the agent
|
|
works without this repository's guidance.
|
|
*Held by:* aspirational.
|
|
- **Keep personal notes in `~/.claude/CLAUDE.md`. Never create `CLAUDE.local.md` or a `CLAUDE.md` in
|
|
the clone, and keep no `CLAUDE.md` in any directory above the clone.**
|
|
*Reason:* Claude Code reads a `CLAUDE.md` it finds there instead of the `AGENTS.md` files, so the
|
|
agent loses this repository's guidance.
|
|
*Held by:* review for a committed file, until a hook refuses one (issue #244); aspirational for
|
|
files outside the repository.
|
|
- **Confirm that Claude Code's startup line reads `no CLAUDE.md found; AGENTS.md loaded: ...`.**
|
|
*Reason:* it is the one visible sign that the agent loaded the guidance.
|
|
*Held by:* aspirational.
|
|
- **The tracked `.claude/settings.json` never holds `permissions.allow`; `deny` and `ask` rules are
|
|
allowed. Your own allowlist, hooks and any other rules you do not want shared go in
|
|
`.claude/settings.local.json`, which is never committed.**
|
|
*Reason:* a branch's settings take effect for whoever opens it with an agent, so an `allow` rule
|
|
pushed on an unmerged branch lets that branch's commands run without a prompt before anyone has
|
|
reviewed it, while a `deny` or `ask` rule can only add prompts.
|
|
*Held by:* review (`.claude/` is under `CODEOWNERS`).
|
|
- **Every hook in the tracked `.claude/settings.json` arrives through apm; personal hooks go in
|
|
`.claude/settings.local.json`.**
|
|
*Reason:* a hook nobody owns is checked by nothing.
|
|
*Held by:* review (`.claude/` is under `CODEOWNERS`).
|