Author SHA1 Message Date
clawbot 9f1e9f5253 Rewrite AGENTS.md in short plain sentences (#327)
check / check (push) Waiting to run
Every rule keeps its meaning and emphasis. Sentences are split so each
holds one idea, with the main rule before its exception and every
command, file name and identifier in backticks.

Three statements were false against the repo or the standing rulings
on record and are corrected:

- the format check is `make fmt-check`, not `make check-fmt`
- a feature branch reaches `next` through a PR that passes review, is
  merged only when the feature is completely finished and the code is
  up to standards, and is deleted after the merge; only the user
  merges `next` into `main`
- the naming example uses the code's term: `al` is bad,
  `SourceHostAllowlist` is good

The `Last Updated` line takes today's date.

Model: fable-5-1
2026-10-27 05:06:36 +01:00
2 changed files with 854 additions and 1007 deletions
+52 -51
View File
@@ -1,75 +1,76 @@
# Repository Rules # Repository Rules
Last Updated 2026-01-08 Last Updated 2026-10-27
These rules MUST be followed at all times, it is very important. These rules MUST be followed at all times. This is very important.
- Never use `git add -A` - add specific changes to a deliberate commit. A commit - Never use `git add -A`. Stage specific changes for a deliberate commit. A
should contain one change. After each change, make a commit with a good commit holds one change. After each change, make a commit with a good one-line
one-line summary. summary.
- NEVER modify the linter config without asking first. - NEVER modify the linter config without asking first.
- NEVER modify tests to exclude special cases or otherwise get them to pass - NEVER modify a test to exclude special cases or otherwise make it pass without
without asking first. In almost all cases, the code should be changed, NOT the asking first. In almost all cases, change the code, NOT the test. You need
tests. If you think the test needs to be changed, make your case for that and explicit user approval to modify an existing test. If you think a test needs
ask for permission to proceed, then stop. You need explicit user approval to to change, make your case and ask for permission to proceed. Then stop. A bug
modify existing tests. A bug fix may change an existing test without asking fix may change an existing test without asking only when that test pins
when that test pins exactly the behavior the filed bug calls wrong, and the exactly the behavior the filed bug calls wrong. The change must then move the
change moves it to the fixed behavior and nothing else; any other change to an test to the fixed behavior and nothing else. Any other change to an existing
existing test still needs explicit user approval. (You do not need user test needs explicit user approval. Writing NEW tests needs no approval.
approval for writing NEW tests.)
- When linting, assume the linter config is CORRECT, and that each item output - When linting, assume the linter config is CORRECT. Treat each item the linter
by the linter is something that legitimately needs fixing in the code. reports as something that legitimately needs fixing in the code.
- When running tests, use `make test`. - When running tests, use `make test`.
- Before commits, run `make check`. This runs `make lint` and `make test` and - Before committing, run `make check`. It runs `make test`, `make lint` and
`make check-fmt`. Any issues discovered MUST be resolved before committing `make fmt-check`. Any issue it finds MUST be resolved before committing,
unless explicitly told otherwise. unless you are explicitly told otherwise.
- When fixing a bug, write a failing test for the bug FIRST. Add appropriate - When fixing a bug, write a failing test for the bug FIRST. Add appropriate
logging to the test to ensure it is written correctly. Commit that. Then go logging to the test, to make sure the test is written correctly. Commit that.
about fixing the bug until the test passes (without modifying the test Then work on the fix until the test passes, without changing the test further.
further). Then commit that. Then commit the fix.
- When adding a new feature, do the same - implement a test first (TDD). It - When adding a new feature, do the same: write a test first (test-driven
doesn't have to be super complex. Commit the test, then commit the feature. development, TDD). The test does not need to be very complex. Commit the test,
then commit the feature.
- When adding a new feature, use a feature branch. When the feature is - When adding a new feature, use a feature branch. The feature branch reaches
completely finished and the code is up to standards (passes `make check`) then `next` through a PR that passes review. It is merged only when the feature is
and only then can the feature branch be merged into `main` and the branch completely finished and the code is up to standards. The code is up to
deleted. standards when it passes `make check`. The branch is deleted after the merge.
Only the user merges `next` into `main`.
- Write godoc documentation comments for all exported types and functions as you - Write `godoc` comments for all exported types and functions as you go along.
go along.
- ALWAYS be consistent in naming. If you name something one thing in one place, - ALWAYS be consistent in naming. If you name something one way in one place,
name it the EXACT SAME THING in another place. use the EXACT SAME name in every other place.
- Be descriptive and specific in naming. `wl` is bad; `SourceHostWhitelist` is - Be descriptive and specific in naming. `al` is bad; `SourceHostAllowlist` is
good. `ConnsPerHost` is bad; `MaxConnectionsPerHost` is good. good. `ConnsPerHost` is bad; `MaxConnectionsPerHost` is good.
- This is not prototype or teaching code - this is designed for production. Any - This is not prototype or teaching code. It is designed for production. Any
security issues (such as denial of service) or other web vulnerabilities are security issue (such as denial of service) or other web vulnerability is a P1
P1 bugs and must be added to TODO.md at the top. bug. It must be added at the top of `TODO.md`.
- As this is production code, no stubbing of implementations unless specifically - Do not stub an implementation unless you are specifically instructed to. This
instructed. We need working implementations. is production code, and we need working implementations.
- NEVER silently fall back to a different setting when a user's parameter - NEVER silently fall back to a different setting when a user's parameter
explicitly specifies a value. If a user requests format=webp and WebP encoding explicitly specifies a value. For example, if a user requests `format=webp`
is not supported, return an error - do NOT silently output PNG instead. If a and WebP encoding is not supported, return an error. Do NOT silently output
user specifies fit=invalid and that fit mode doesn't exist, return an error - PNG instead. If a user specifies `fit=invalid` and that fit mode does not
do NOT silently default to "cover". Silent fallbacks violate the principle of exist, return an error. Do NOT silently default to `cover`. A silent fallback
least surprise and mask bugs. The only acceptable defaults are for OMITTED violates the principle of least surprise and masks bugs. Defaults are
parameters, never for INVALID explicit values. acceptable only for OMITTED parameters, never for INVALID explicit values.
- Avoid vendoring deps unless specifically instructed to. NEVER commit the - Avoid vendoring dependencies unless specifically instructed to. NEVER commit
vendor directory, NEVER commit compiled binaries. If these directories or the `vendor/` directory. NEVER commit compiled binaries. If such a directory
files exist, add them to .gitignore (and commit the .gitignore) if they are or file exists and `.gitignore` does not list it, add it to `.gitignore`.
not already in there. Keep the entire git repository (with history) small - Commit that `.gitignore` change. Keep the entire git repository, history
under 20MiB, unless you specifically must commit larger files (e.g. test included, under 20 MiB. Go over 20 MiB only when you specifically must commit
fixture example media files). Only OUR source code and immediately supporting a large file, such as a media file used as a test fixture. Only OUR source
files (such as test examples) goes into the repo/history. code and its immediately supporting files, such as test examples, go into the
repository and its history.
+802 -956
View File
File diff suppressed because it is too large Load Diff