Skip to content

docs: add frontend pattern rule contract (FE1-FE10)#27407

Open
ibetitsmike wants to merge 1 commit into
mainfrom
mike/frontend-patterns-contract
Open

docs: add frontend pattern rule contract (FE1-FE10)#27407
ibetitsmike wants to merge 1 commit into
mainfrom
mike/frontend-patterns-contract

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

What

Adds .claude/docs/FRONTEND_PATTERNS.md, a canonical frontend rule contract for site/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 of site/AGENTS.md and links the contract from the root AGENTS.md frontend 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 in site/AGENTS.md already, 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:

  1. This PR: the rule contract.
  2. A frontend-review skill 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.

This PR was written by Mux, an AI coding agent, on behalf of Mike.

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.
@ibetitsmike
ibetitsmike force-pushed the mike/frontend-patterns-contract branch from 2f60b6c to c4bbbd4 Compare July 22, 2026 11:11
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: c4bbbd46a2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.md defining FE1 to FE10 with short incorrect/correct examples.
  • Adds a “Frontend Non-Negotiables” FE1-FE10 index to site/AGENTS.md linking to the contract.
  • Updates root AGENTS.md to route frontend changes under site/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.

Comment on lines +166 to +170
import { chatModelConfigsKey } from "api/queries/chats";

parameters: {
queries: [{ key: chatModelConfigsKey, data: [MockChatModelConfig] }],
},
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.

3 participants