Repository navigation
Coding standards doc, and CLAUDE.md rules to follow it: one area per file, one task per function, main.js's budget a guideline (part of #1107) - #1108
Merged
Conversation
…s budget is a guideline Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, duplication, dead code, comments, tests, PRs); CLAUDE.md points to them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tin, Rust API Guidelines, Google small CLs, defect research); function splits need a contract, comments carry the contract at interfaces, errors defined away, lint candidates by name Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release note: none
Part of #1107: the coding standards future work follows, ahead of the audit that checks the existing code against them.
What changes
docs/coding_standards.md, listed indocs/README.md. Ten sections, each rule with its reason:utilsmodules, logic in the layer that owns it.unwrapoutside tests.Plus which of these tools check today, and lint candidates (Clippy
too_many_linesetc., ESLint) not turned on: lint rules change only with the owner's OK.For review
The standards are a first draft for the owner to keep, change or drop rule by rule. The numbers (50-line functions, 4 parameters, 1,000 / 600-line files) are prompts to look, not limits; say if they should be different. More rules get added as the #1107 audit decides them.
No code changes.
🤖 Generated with Claude Code
Checked against current guidance (second commit)
The draft was reviewed against the Rust API Guidelines, Google's small-CL and TypeScript guides, Ousterhout's A Philosophy of Software Design and his 2024-25 written exchange with Robert Martin over Clean Code, the defect-density research, and the 2026 study of agent instruction files (sources listed at the end of the doc). What changed:
get_,as_/to_/into_; JS casing per Google); long names are not a substitute for a doc comment.pedantichas false positives);max-lines-per-functiondropped as a candidate. The instruction-file study is why the standards live indocs/and CLAUDE.md only points here.