react-dev
jaansokk/cursor_tools/.claude/skills/react-dev/SKILL.md
React frontend conventions for this project. Use when building or modifying React components, hooks, state management, styling, or frontend tests.
Skill1 starsChanged 7 months ago
What's in it
- React Conventions
- Stack choices
- Coding standards
- Styling
- Testing
- Workflow
- Principles
--- name: react-dev description: > React frontend conventions for this project. Use when building or modifying React components, hooks, state management, styling, or frontend tests. --- # React Conventions ## Stack choices - **React 18+** with functional components only — no class components - **TypeScript strict** — type all props, callbacks, state. No `any` - **Tailwind CSS** exclusively — no CSS modules, no inline style objects unless absolutely necessary - **Vite** for dev server and builds - **Zustand** for shared state (not Redux, not Context for state management) - **React Testing Library** + **user-event** + **vitest** for testing ## Coding standards - Small, composable components — one responsibility per component, extract early - Minimal state — derive in render what you can, don't duplicate data across state slices - Lift state up to the closest common parent when components must stay in sync - Use `useReducer` for complex update logic - Accessible by default — semantic HTML first, ARIA only when semantic elements aren't sufficient - Ensure keyboard accessibility and visible focus on all interactive controls ## Styling - Utility-first Tailwind — organize classes: layout, spacing, sizing, typography, colors, effects, states - Use component abstractions (variant objects/props) instead of repeating long class lists - Mobile-first responsive: base styles for mobile, scale up with `md:`, `lg:` - Use `prettier-plugin-tailwindcss` for class sorting ## Testing - Test like a user — prefer queries by role + accessible name (`getByRole`, `findByRole`) - Use `@testing-library/user-event` over `fireEvent` - Don't test implementation details (DOM structure, internal state, private methods) ## Workflow - Orient before coding — read existing components in the area, match existing patterns - Small, focused changes — one component or concern at a time, don't refactor unrelated code - Write tests alongside implementation — new components and hooks should ship with tests - Validate after edits — run `tsc` and the linter, run tests if they exist in the area ## Principles - **Speak up.** If you spot code that contradicts conventions, has a latent bug, unnecessary complexity, or a missed optimization — flag it. Don't silently work around issues. - **Verify against documentation** Use the context7 MCP to check documentation of libraries when needed. - **Ask, don't assume.** If requirements are ambiguous or you face a non-obvious UI/state design choice, ask for clarification before proceeding. - **Stay scoped.** If you discover an issue outside your current task, report it instead of silently fixing it. Exception: trivial fixes (typos, obvious off-by-one) that take seconds. - **Leave code better than you found it** — but only in the files you're already touching.
More agent context in jaansokk/cursor_tools
16 other files this repository gives its agents.
CLAUDE.md
Cursor rule
Skill
- code-review-codex.claude/skills/code-review-codex/SKILL.md
- commit.claude/skills/commit/SKILL.md
- python-dev.claude/skills/python-dev/SKILL.md
- spec-review-codex.claude/skills/spec-review-codex/SKILL.md
- summarizer.claude/skills/summarizer/SKILL.md
- ui-design.claude/skills/ui-design/SKILL.md
- yt-transcript.claude/skills/yt-transcript/SKILL.md
- codex-review.cursor/skills/codex-review/SKILL.md
- python-dev.cursor/skills/python-dev/SKILL.md
- react-dev.cursor/skills/react-dev/SKILL.md
- ui-design.cursor/skills/ui-design/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool public_context_discussion, action report. How to connect one.

