From 0434b9c346acf447445634d5741c5306b7f6978a Mon Sep 17 00:00:00 2001 From: Aron Strandberg Date: Tue, 1 Dec 2026 21:34:10 +0000 Subject: [PATCH 1/3] docs: add the files Claude Code Review reads Claude Code Review now runs on this repository's pull requests. It reads a repository's rules from CLAUDE.md and its review instructions from REVIEW.md, and there was neither: the rules are in AGENTS.md. CLAUDE.md imports AGENTS.md, so the rules stay in one file and every version of Claude Code reads them too. REVIEW.md adds no rule. It says which findings count as Important, lists the three checks a pull request gets from AGENTS.md and CONTRIBUTING.md (a test that asserts, a changelog fragment, the docs page), and keeps a review off what CI already fails on, lockfiles and fixture sources that are wrong on purpose. The review reads REVIEW.md from the default branch, never from a pull request, so it takes effect once merged. --- CLAUDE.md | 1 + REVIEW.md | 36 ++++++++++++++++++++++++++++++ changelog.d/claude-review-files.md | 11 +++++++++ 3 files changed, 48 insertions(+) create mode 100644 CLAUDE.md create mode 100644 REVIEW.md create mode 100644 changelog.d/claude-review-files.md diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 00000000..43c994c2 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/REVIEW.md b/REVIEW.md new file mode 100644 index 00000000..62b17b17 --- /dev/null +++ b/REVIEW.md @@ -0,0 +1,36 @@ +# Review instructions + +`AGENTS.md` holds this repository's rules, and `CLAUDE.md` imports it. This +file says how a review weighs them and what it leaves alone. It adds no rule. + +## What Important means here + +These are build rules. A mistake in them surfaces in a consumer's build, far +from the change. Reserve Important for a finding that makes a build or a test +wrong, or lets a wrong one pass, and for a break of a rule under "Rules" or +"Anti-Patterns" in `AGENTS.md`. Naming, comment wording and suggestions to +restructure are Nit at most. + +## Always check + +- New behaviour has a test that asserts it, and no test is deleted or tagged + `manual` for the change to pass. +- The pull request adds a fragment to `changelog.d/`, unless it only bumps a + dependency. A breaking change's fragment is under `### Breaking — ` + and states the edit a consumer has to make. +- A change to a rule attribute, a provider or a Gazelle directive updates its + page under `docs/` in the same pull request. + +## Do not report + +- What CI already fails on: `buildifier` and `gofmt` formatting, `go vet`, the + docs build, and the checks under `tools/ci/`. +- Lockfiles: `pnpm-lock.yaml`, `package-lock.json`, `go.sum` and `Cargo.lock`. +- The source files of fixtures under `tests/`, `e2e/` and `examples/`. Many + are wrong on purpose, so that a rule fails on them. Review the BUILD files + there and what the tests assert. + +## Evidence + +A finding about behaviour cites the `file:line` it rests on. A name or a +comment is not evidence of what the code does. diff --git a/changelog.d/claude-review-files.md b/changelog.d/claude-review-files.md new file mode 100644 index 00000000..0b7e46c3 --- /dev/null +++ b/changelog.d/claude-review-files.md @@ -0,0 +1,11 @@ +### Added + +- **`CLAUDE.md` and `REVIEW.md`, the two files Claude Code Review reads.** + The review reads a repository's rules from `CLAUDE.md` and its review + instructions from `REVIEW.md`. This repository had neither: its rules are in + `AGENTS.md`. `CLAUDE.md` imports `AGENTS.md`, so the rules stay in one file. + `REVIEW.md` adds no rule. It says which findings count as Important, names + the three things every pull request is checked for (a test that asserts, a + changelog fragment, the page under `docs/`), and keeps a review off what CI + already fails on, lockfiles and the sources of fixtures that are wrong on + purpose. From 63c6d92536e6ba8605b65dc88d237f1d15f270fb Mon Sep 17 00:00:00 2001 From: Aron Strandberg Date: Tue, 1 Dec 2026 21:43:32 +0000 Subject: [PATCH 2/3] docs: lower no severity and skip no file that REVIEW.md did not mean to The first review of this file found four places where it took more away than it meant to. "Reserve Important for" two kinds of finding capped every other kind, security findings among them. The review's own judgement of severity now stands, with one kind raised (a break of a rule in AGENTS.md) and one lowered (naming, comment wording, restructuring of correct code). The exemption from the changelog fragment covered every dependency bump, though a bump that raises a compatibility floor is a breaking change with a fragment of its own. It now covers a bump that changes nothing for a consumer. Lockfiles are out of "Do not report": here they are the default compiler's pin and the fixtures the npm reader is tested against. "The checks under tools/ci/" included check_tools_lock.sh, which runs on a release tag and not on a pull request. The bullet now names what ci.yml fails a pull request on. Fixture sources are skipped only under tests/ and only where the test over them expects the failure. e2e/ and examples/ hold working examples. --- REVIEW.md | 33 ++++++++++++++++-------------- changelog.d/claude-review-files.md | 10 ++++----- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index 62b17b17..d65b01e9 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -3,32 +3,35 @@ `AGENTS.md` holds this repository's rules, and `CLAUDE.md` imports it. This file says how a review weighs them and what it leaves alone. It adds no rule. -## What Important means here +## Severity -These are build rules. A mistake in them surfaces in a consumer's build, far -from the change. Reserve Important for a finding that makes a build or a test -wrong, or lets a wrong one pass, and for a break of a rule under "Rules" or -"Anti-Patterns" in `AGENTS.md`. Naming, comment wording and suggestions to -restructure are Nit at most. +A review's own judgement of severity stands, with two changes: + +- A break of a rule under "Rules" or "Anti-Patterns" in `AGENTS.md` is + Important. These are build rules, and a mistake in them surfaces in a + consumer's build, far from the change. +- A remark on naming or on a comment's wording, and a suggestion to + restructure code that is correct, are Nit at most. ## Always check - New behaviour has a test that asserts it, and no test is deleted or tagged `manual` for the change to pass. -- The pull request adds a fragment to `changelog.d/`, unless it only bumps a - dependency. A breaking change's fragment is under `### Breaking — ` - and states the edit a consumer has to make. +- The pull request adds a fragment to `changelog.d/`. The one exception is a + dependency bump that changes nothing for a consumer. A breaking change's + fragment is under `### Breaking — ` and states the edit a consumer has + to make, and a bump that raises a compatibility floor is a breaking change. - A change to a rule attribute, a provider or a Gazelle directive updates its page under `docs/` in the same pull request. ## Do not report -- What CI already fails on: `buildifier` and `gofmt` formatting, `go vet`, the - docs build, and the checks under `tools/ci/`. -- Lockfiles: `pnpm-lock.yaml`, `package-lock.json`, `go.sum` and `Cargo.lock`. -- The source files of fixtures under `tests/`, `e2e/` and `examples/`. Many - are wrong on purpose, so that a rule fails on them. Review the BUILD files - there and what the tests assert. +- What `.github/workflows/ci.yml` already fails a pull request on: + `buildifier` and `gofmt` formatting, `go vet`, the docs build, and the + checks it runs from `tools/ci/`. +- A fixture source under `tests/` that is wrong on purpose, so that a rule + fails on it. Report one only when the test over it does not expect the + failure. ## Evidence diff --git a/changelog.d/claude-review-files.md b/changelog.d/claude-review-files.md index 0b7e46c3..9bd01db9 100644 --- a/changelog.d/claude-review-files.md +++ b/changelog.d/claude-review-files.md @@ -4,8 +4,8 @@ The review reads a repository's rules from `CLAUDE.md` and its review instructions from `REVIEW.md`. This repository had neither: its rules are in `AGENTS.md`. `CLAUDE.md` imports `AGENTS.md`, so the rules stay in one file. - `REVIEW.md` adds no rule. It says which findings count as Important, names - the three things every pull request is checked for (a test that asserts, a - changelog fragment, the page under `docs/`), and keeps a review off what CI - already fails on, lockfiles and the sources of fixtures that are wrong on - purpose. + `REVIEW.md` adds no rule. It makes a break of a rule in `AGENTS.md` + Important and a remark on naming a Nit at most, names the three things every + pull request is checked for (a test that asserts, a changelog fragment, the + page under `docs/`), and keeps a review off what `ci.yml` already fails on + and off fixture sources that are wrong on purpose. From 48983db4057a7f2a974009467f16a7c66c504998 Mon Sep 17 00:00:00 2001 From: Aron Strandberg Date: Wed, 2 Dec 2026 18:58:56 +0000 Subject: [PATCH 3/3] docs: ask for a changelog fragment by what a pull request changes REVIEW.md asked every pull request for a fragment and listed one exception, a dependency bump. A list of exceptions is never complete: the release workflow's own pull request, which rewrites .bcr/source.json and nothing else, would get a finding it cannot satisfy. The check now names when a fragment is due: when the pull request changes what a rule, a tool, Gazelle or CI does. A bump of a development dependency and the BCR metadata update change none of those. A bump that raises a compatibility floor is still a breaking change with a fragment. --- REVIEW.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/REVIEW.md b/REVIEW.md index d65b01e9..3280648f 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -17,10 +17,10 @@ A review's own judgement of severity stands, with two changes: - New behaviour has a test that asserts it, and no test is deleted or tagged `manual` for the change to pass. -- The pull request adds a fragment to `changelog.d/`. The one exception is a - dependency bump that changes nothing for a consumer. A breaking change's - fragment is under `### Breaking — ` and states the edit a consumer has - to make, and a bump that raises a compatibility floor is a breaking change. +- A pull request that changes what a rule, a tool, Gazelle or CI does adds a + fragment to `changelog.d/`. A breaking change's fragment is under + `### Breaking — ` and states the edit a consumer has to make, and a + dependency bump that raises a compatibility floor is a breaking change. - A change to a rule attribute, a provider or a Gazelle directive updates its page under `docs/` in the same pull request.