Skip to content

Move the coding standards into a root CODING_STANDARDS.md - #2498

Open
kmcginnes wants to merge 2 commits into
mainfrom
t3/add-coding-standards-doc
Open

kmcginnes wants to merge 2 commits into
mainfrom
t3/add-coding-standards-doc

Conversation

@kmcginnes

Copy link
Copy Markdown
Collaborator

Summary

Our code standards lived in three sections of AGENTS.md, which is agent context, so human contributors had no path to them. This moves them into a root CODING_STANDARDS.md written for contributors that agents also read, and points every other file at it instead of restating it.

User-facing: none

flowchart LR
  CONTRIB["CONTRIBUTING.md"] --> CS["CODING_STANDARDS.md"]
  PRT["PR template"] --> CS
  AG["AGENTS.md"] --> CS
  REV["REVIEW.md"] --> CS
  CS -->|what blocks a PR| REV
  CS -->|area depth| AREA["docs/agents/*.md"]
  CS --> ADR["docs/adr/"]
Loading
  • CODING_STANDARDS.md (new, 134 lines). Every rule is one Must, Prefer or Avoid line with a one-line reason. A Must blocks a PR only where it hits an Important category in REVIEW.md. It leads with the rules no linter knows: saved and exported data stays readable, query templates, performance on large graphs, and the browser-support baseline. Then come the moved Principles, TypeScript and Comments sections, plus short Errors and untrusted input, Testing, React and Styling sections that link the area guides rather than repeat them. It has no formatting rules and nothing the lint block in vite.config.ts already enforces.
  • AGENTS.md: drops Code Quality Standards, Comments and TypeScript, and the two test rules in Core Rules. Adds one line telling agents to read CODING_STANDARDS.md before writing or reviewing code. typescript.autoClosingTags moves to Core Rules. Reviews names the new file and passes it to reviewer sub-agents next to REVIEW.md.
  • REVIEW.md: the Nit rule now points at CODING_STANDARDS.md for structure and style.
  • CONTRIBUTING.md: one new "Coding standards" section. The rest is unchanged.
  • PR template: a checklist item for CODING_STANDARDS.md.

No rule was dropped. Two got stronger:

  • Single-pass, copy-free processing was a Prefer. It's now a Must for graph- and schema-sized collections, since REVIEW.md already treats copying passes over them as Important.
  • Zod at boundaries was a Prefer. Parsing untrusted input is now a Must, matching REVIEW.md. Other boundaries stay Prefer.

Three rules have no lint rule behind them yet: module-level function declarations, unnecessary any, and the 1000-line signal. They stay as prose. A later change that turns one into a lint rule deletes its line here in the same PR.

Merge Danger

Door: two-way

Impact: docs

Agents lose the standards from AGENTS.md. They now reach them through the pointer line and the Reviews section.

Related


🤖 Written by an AI agent on my behalf.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant