Guest User

ANTI-load-bearing CLAUDE.md

a guest
Aug 23rd, 2026
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.57 KB | None | 0 0
  1. # Comment & prose style
  2.  
  3. Your default commenting and prose style is a known, catalogued failure mode: verbose, literary, tutorial-voiced, over-certain. It persists even against explicit instructions, so treat compliance as a process, not an intention: write, then re-read only the comments/prose as a separate pass against the rules below. Rules have IDs so they can be cited in review ("violates L2").
  4.  
  5. Scope: code comments, docstrings, commit messages, PR descriptions, README/doc prose written in this repo.
  6.  
  7. ## W — What comments are for
  8.  
  9. - **W1** Comments explain *why*: why this exists, why this way over the obvious way, why it works when it looks wrong, what external constraint (protocol, business rule, upstream bug) forces it. Delete comments that restate adjacent code.
  10. - **W2** Fact first, rationale second. Lead with the mechanical claim in plain declarative prose; the reason follows. Never an aphorism the reader must decode.
  11. - **W3** Standard trade vocabulary only: token bucket, debounce, backpressure, memoize, bypass, invariant. Greppable names, never invented imagery ("on the glass", "down the wire").
  12. - **W4** Falsifiable claims. Every comment must be checkable against the code and visibly break when the code changes. Include units, thresholds, boundaries: bytes vs chars, ms vs s, inclusive vs exclusive, base-0 vs base-1.
  13. - **W5** Behaviour assertions ("this guarantees X") are usually better as a test named for X. Prefer the test; if commenting anyway, cite the test.
  14. - **W6** When comment and code disagree, the comment is wrong. Fix the comment; flag the disagreement in your summary in case the code is the actual bug.
  15. - **W7** Deliberate-but-uncommented decisions (a cap, a reset, an ordering constraint, a magic number) get 1–3 plain lines. Rationale gaps are where comment effort goes.
  16. - **W8** Length: inline 1–3 lines; file/class headers ≤2 paragraphs; anything longer moves to a doc/ADR referenced by path.
  17. - **W9** Register test: readable by someone tired, unfamiliar with the file, debugging at 2 a.m., eighteen months out, with no memory of any metaphor or of this chat.
  18.  
  19. ## L — Banned lexicon
  20.  
  21. Do not use these in comments, docs, commits, or PRs. If one seems genuinely necessary (rare), justify it inline.
  22.  
  23. - **L1 Claude-tell metaphors:** load-bearing; seam(s); the shape of; does work / does real work / heavy lifting / earns its keep / quiet job; the magic happens; under the hood (decorative); journey; tapestry; delve; landscape (abstract); ecosystem (decorative).
  24. - **L2 Certitude/bravado:** honest(ly); exact(ly) as filler; obviously; clearly; simply; just (as minimizer); the whole point; root cause (unless it demonstrably is); the key insight; crucially; importantly; fundamentally (as filler).
  25. - **L3 Empty quality adjectives:** elegant; robust; clean(ly); graceful(ly); seamless; comprehensive; battle-tested; production-ready; performant; powerful; proper(ly) as filler; first-class; best-practice (as adjective).
  26. - **L4 Corporate/SF filler verbs:** leverage; utilize (use "use"); streamline; wire up; land (for completing work); surface (as verb); orthogonal; synthesize (decorative).
  27. - **L5 Decorative architecture-speak:** single source of truth / source of truth (unless naming an actual designated one); canonical (same condition); separation of concerns (as a comment's entire content).
  28. - **L6 Emoji and decorative unicode.** Anywhere: comments, commits, PRs, console output strings.
  29.  
  30. ## S — Banned structures
  31.  
  32. - **S1 Contrastive binary**, all variants: "isn't X — it's Y"; "not just X, but Y"; "not merely X"; "this is less about X than Y". Arrive at the point directly; don't stage a fake wrong answer to knock down.
  33. - **S2 Aphoristic ender:** closing a comment block, commit, or PR with a short quotable maxim. If the final sentence has no identifier and no number and sounds like it wants quoting, delete it.
  34. - **S3 Mirrored-clause symmetry** for rhetorical effect ("a key you press makes a key sound, text the machine sends makes a bleep").
  35. - **S4 ALL-CAPS emphasis** (MUST, WHOLE, ONLY as shouting). Acronyms and language keywords excepted. If a distinction matters, the sentence carries it.
  36. - **S5 Tutorial voice:** "now we...", "let's...", "first we loop over...", narrating readable code step by step.
  37. - **S6 Chat leakage:** "as requested"; "per your instructions"; "I've added/simplified/fixed"; "Fixed!"; "You're right"; any first-person narration; any comment that only makes sense as a message to the person in this conversation.
  38. - **S7 Em-dash chains.** More than one em-dash per comment block is a tell; restructure the sentence.
  39. - **S8 Headers/sections in short docs** where three sentences of prose would do; bullet lists for content that is actually sequential prose.
  40.  
  41. ## H — Self-check heuristics
  42.  
  43. Apply these to your own output in the review pass. They approximate a linter; run them as if they were one.
  44.  
  45. - **H1 Redundancy:** if ≥ roughly half the meaningful tokens in an inline comment appear in the next 1–2 code lines, it restates the code. Delete or convert to a why.
  46. - **H2 Atmospheric:** any comment over ~15 words containing zero code identifiers, zero digits, and zero standard technical terms is prose, not documentation. Rewrite with a checkable claim or delete.
  47. - **H3 Naked numbers:** a digit in a comment needs a unit or a named-constant reference. "wait 500" → "wait 500 ms (POLL_INTERVAL)".
  48. - **H4 Stale numbers:** any number in a comment must match the code it describes. On mismatch, apply W6.
  49. - **H5 Length:** inline block over 5 lines → move content to header; header over 2 paragraphs → move to doc.
  50. - **H6 Read-aloud test** on headers and PR descriptions: if it sounds like it wants to be quoted, rewrite until it merely wants to be understood.
  51.  
  52. ## P — Process
  53.  
  54. - **P1** Two passes, always: write, then re-read only comments/prose against L, S, H. Known self-review blind spots: binaries produced while paraphrasing a binary you were removing; aphoristic enders on headers; "honest"; em-dashes; "robust".
  55. - **P2** Rewriting existing comments: translate, don't strip. Every genuine rationale in the original survives, restated per W. A file scrubbed of all "why" content is as much a failure as the literary original.
  56. - **P3** Never change code to satisfy a comment rule. Comments and prose only, unless the task says otherwise.
  57. - **P4** Commit messages: imperative subject ≤72 chars stating the change; body states why, constraints, and side effects in plain prose. All L/S rules apply. No "This commit introduces...".
  58. - **P5** When a rule and readability genuinely conflict, readability wins — say so in one line where you break the rule.
Advertisement
Add Comment
Please, Sign In to add comment