docs: add frontend pattern rule contract (FE1-FE10)#27407
Conversation
722f15b to
2f60b6c
Compare
Adds .claude/docs/FRONTEND_PATTERNS.md, a canonical rule contract for site/src changes with stable rule IDs, derived from recurring review findings on frontend PRs over the past 18 months. Adds a compact non-negotiables index to site/AGENTS.md and links the contract from the root AGENTS.md frontend routing line.
2f60b6c to
c4bbbd4
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Adds a canonical frontend rule contract (FE1 to FE10) for site/src/ changes and wires it into existing agent guidance so reviewers and tooling can reference stable rule IDs consistently.
Changes:
- Adds
.claude/docs/FRONTEND_PATTERNS.mddefining FE1 to FE10 with short incorrect/correct examples. - Adds a “Frontend Non-Negotiables” FE1-FE10 index to
site/AGENTS.mdlinking to the contract. - Updates root
AGENTS.mdto route frontend changes undersite/src/to the FE rule contract.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
site/AGENTS.md |
Adds a compact FE1-FE10 “Non-Negotiables” index pointing to the canonical contract. |
AGENTS.md |
Links frontend work under site/src/ to the FE1-FE10 contract. |
.claude/docs/FRONTEND_PATTERNS.md |
Introduces the canonical FE rule contract with examples for each rule. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| import { chatModelConfigsKey } from "api/queries/chats"; | ||
|
|
||
| parameters: { | ||
| queries: [{ key: chatModelConfigsKey, data: [MockChatModelConfig] }], | ||
| }, |
What
Adds
.claude/docs/FRONTEND_PATTERNS.md, a canonical frontend rule contract forsite/src/with ten stable rule IDs (FE1 to FE10), each with short incorrect/correct examples using real repo idioms. Adds a compact non-negotiables index at the top ofsite/AGENTS.mdand links the contract from the rootAGENTS.mdfrontend routing line.Why
Frontend PRs keep drawing the same review findings. Mining the last 18 months of
site/PR review data (330 closed/merged PRs, 1,105 inline comments, 358 actionable pattern findings across 57 PRs) shows the recurring themes, in order of frequency: missing Storybook interaction coverage, loose TypeScript, component duplication and PR scope, redundant comments, unhandled UI states, accessibility, react-query misuse, and effect misuse. The guidance largely existed insite/AGENTS.mdalready, but as unprioritized prose with no shared vocabulary.Stable rule IDs give reviewers, agents, and tooling one shared language ("FE7: re-typed query key"), and the rules are ordered by how often reviewers actually flagged them.
This is the first PR of a stack of two:
frontend-reviewskill that audits diffs against these rules pre-PR (docs: add frontend-review skill for pre-PR FE rule audits #27408).A third PR with a deterministic ratchet script (#27409) was closed; the machine-checkable subset will be enforced through proper linting instead.
Notes for reviewers
The rule content is derived from your own review comments (for example, the re-typed query key example in FE7 mirrors feedback on #27385). If a rule does not match how you want the frontend built, the contract file is the place to change it.