Conventions that hold across every repo. A project's own AGENTS.md or CLAUDE.md wins where it differs.
The best documentation is the code itself. Good code carries the what and the how, so a comment carries only the why — and since it breaks the flow of reading and shrinks the logic visible at once, it has to earn that cost back. Three shapes do:
- A block comment for why something must be done this particular way: the constraint that forced it, the browser quirk it avoids, the approach that was tried and does not work, the external contract being satisfied.
- A one-line docblock saying what a function does and why. No argument or return annotations.