From 0b5619079bfb914aee4055cf7ca9a869119b2ed9 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 07:53:38 +0200 Subject: [PATCH] Cite the section bar from the one-line rule instead of restating its list --- CLAUDE.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 1a008f1b..7838453a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -112,15 +112,15 @@ How work proceeds in any repo, unless that repo's `AGENTS.md` says otherwise. ### Comments -These rules govern prose; doc comments a tool consumes — docstrings, godoc, JSDoc types — are outside them. +The rules below govern prose comments; doc comments a tool consumes — docstrings, godoc, JSDoc types — are outside them. Default to NO comment. Delete one that is any of: 1. A **restatement** of the adjacent code. BANNED: `// Sanitized + bounded to 1000 chars` above `mb_substr(json_encode(LogSanitizer::body($x)), 0, 1000)`. 2. A **cross-cutting convention** used elsewhere (sanitization, the 1000-char Loki cap, "log so the source is recoverable"). Project-wide facts live in ONE doc, never repeated at call sites. 3. A **justification of self-evident code** (a log line is self-evidently for observing its value). -4. A **file preamble or arrangement rationale**: what a file holds, why it exists, why two things share it, why a check sits beside what it judges, why an order was chosen. The file name and the declarations are the index; a choice with no effect on the running program belongs in the commit that made it, or in the decision record. +4. A **file preamble or arrangement rationale**: what a file holds, why it exists, why two things share it, why a check sits beside what it judges, why an order was chosen. The file name and the declarations are the index; a choice with no effect on the running program belongs in the commit that made it. -**What stays is one terse line: a footgun, an external constraint, or an invariant, and only where the code cannot show it.** GOOD: `# Pinned to 7.x: hurl 8's jsonpath change breaks the nth-filter asserts.` Background on what a thing is for, however plausible, is deleted. A second line is a signal to stop and ask where the text belongs — nearly always the commit message or the ticket; consecutive comment lines are how a file reaches 40% prose. A paragraph is earned by an invariant a reader must hold before touching the code below, never by a rationale, and it stays with the code it guards. When unsure, delete. +**What stays is one terse line, and only where the code cannot show it.** GOOD: `# Pinned to 7.x: hurl 8's jsonpath change breaks the nth-filter asserts.` A second line belongs in the commit message or the ticket. The one exception is a paragraph for an invariant a reader must hold before touching the code below; it stays with the code it guards. **Density is a review signal.** Prose comment lines much past ~10% of a file's non-blank lines mean something is wrong — narrating comments, or code that fails to carry its own meaning. A defect to investigate, not a style preference.