agentleFS
jaansokkjaansokk/cursor_tools/.claude/skills/react-dev/SKILL.md

react-dev

Skill1 starsChanged 9 months agoMITView on GitHub

React frontend conventions for this project. Use when building or modifying React components, hooks, state management, styling, or frontend tests.

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 8 are distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use useReducer for complex update logic

    line 24
  2. Distinctive:

    Ensure keyboard accessibility and visible focus on all interactive controls

    line 26
  3. Distinctive:

    Use component abstractions (variant objects/props) instead of repeating long class lists

    line 31
  4. Very specific:

    Use prettier-plugin-tailwindcss for class sorting

    line 33
  5. Very specific:

    Test like a user — prefer queries by role + accessible name (getByRole, findByRole)

    line 37
  6. Very specific:

    Use @testing-library/user-event over fireEvent

    line 38
  7. Distinctive:

    Don't test implementation details (DOM structure, internal state, private methods)

    line 39
  8. Distinctive:

    Write tests alongside implementation — new components and hooks should ship with tests

    line 45
  9. Distinctive:

    Speak up: If you spot code that contradicts conventions, has a latent bug, unnecessary complexity, or a missed optimization — flag it.

    line 50
  10. Distinctive:

    Verify against documentation: Use the context7 MCP to check documentation of libraries when needed.

    line 51
  11. Distinctive:

    Ask, don't assume: If requirements are ambiguous or you face a non-obvious UI/state design choice, ask for clarification before proceeding.

    line 52
  12. Distinctive:

    Stay scoped: If you discover an issue outside your current task, report it instead of silently fixing it.

    line 53

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.