frontend-react — Claude Code rule: what it does, how to install
frontend-react — a React frontend rule for Claude and Claude that keeps UI edits small: explicit prop types, existing state patterns, routes left alone.
MIT ★ 1,198 updated 2026-10-23
.claude/rules/frontend-react.mdWhat frontend-react does
This rule file pins down how an agent should touch a React UI. Its header limits the scope to client/src/**/*.{ts,tsx,css} and client/public/**/*.tsx, so outside those globs it stays dormant — a different folder layout means editing the paths first.
Six instructions sit in the file. Don't rearrange the information hierarchy unless a redesign was asked for. Component props and API types stay explicit, never any. Loading, empty and error states follow whatever pattern nearby pages already use. Any new behaviour has to survive a delayed websocket push. Routes follow the current navigation model, and diffs stay narrow instead of restyling the whole screen.
The websocket clause only earns its place in an app that streams live updates. On a static page it adds nothing.
What it helps with
- add a typed prop to a component without falling back to
any - reuse the existing loading and error state pattern on a new page
- keep the current information hierarchy through a small UI fix
- wire a new route into the existing navigation model
- hold a UI change to a narrow diff instead of a restyle
Example prompts for the agent
- Add an
onSelectprop toUserCardwith an explicit type, noany. - Build the loading and error states for the reports page the way nearby components do it.
- Fix the UI behaviour when websocket updates arrive late, leave the layout alone.
How to install frontend-react
Manually: put the files in place
.claude/rules/frontend-react.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/frontend-react.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/frontend-react.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/frontend-react.mdManually: put the files in place
.clinerules/frontend-react.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about frontend-react
How to install frontend-react in Claude Code?
Create .claude/rules/frontend-react.md in your project and paste the rule text into it.
What does frontend-react do?
It sets the boundaries for React UI work: typed props and API calls, state handled like the pages around it, small diffs rather than a broad rewrite.
Which files does the rule cover?
client/src/**/*.{ts,tsx,css} and client/public/**/*.tsx — the header of the rule file carries that list.
Source text
frontend-react.md · MIT
---
paths:
- "client/src/**/*.{ts,tsx,css}"
- "client/public/**/*.tsx"
---
# Frontend Rules
- Preserve existing UI information hierarchy unless redesign is requested.
- Keep component props and API typing explicit; avoid implicit `any`.
- Match existing page/component patterns for loading, empty, and error states.
- When adding UI behavior, ensure it degrades safely if websocket updates are delayed.
- Keep routes consistent with current navigation model.
- Prefer focused UI diffs over broad stylistic rewrites.
© hoangsonww · MIT · hoangsonww/Claude-Code-Agent-Monitor