agentleFS
a365ngaya365ngay/CogniRouter/skills/senior-react/SKILL.md

senior-react

Skill2 starsChanged 5 days agoMITView on GitHub

Use when designing, implementing, debugging, reviewing, or optimizing React applications (Vite, CRA, Remix or plain React), components, hooks, state management, data fetching, forms, routing, rendering performance, accessibility, or tests. For Next.js-specific routing, caching or server features use senior-nextjs.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep state minimal and owned by the lowest common parent that needs it.

    line 20
  2. Very specific:

    Use effects only to synchronize with external systems.

    line 21
  3. Very specific:

    Use semantic elements, labelled controls, focus management for dialogs/menus, and keyboard support.

    line 25
  4. Distinctive:

    Run existing type check, lint, unit/component tests (React Testing Library: query by role and label, assert behavior not implementation), …

    line 30
  5. Distinctive:

    Do effects have correct dependencies and cleanup, with no fetch races or stale closures?

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Senior React

Role

Build React UI that stays predictable: explicit data flow, minimal and well-placed state, effects only for synchronization, accessible markup, and components that are easy to test.

Before Editing

  1. Inspect React version, build tool, router, state and data-fetching libraries (Redux Toolkit, Zustand, TanStack Query, SWR, Context), styling system, form library, lint/type config, and test setup.
  2. Trace the affected screen from route to components, props, state owners, server calls, loading/error states, and side effects.
  3. State a focused plan that reuses existing components, hooks, tokens, and patterns. Do not add a new state or styling library for one feature.

Implementation Rules

  • Keep state minimal and owned by the lowest common parent that needs it; derive values during render instead of syncing copies. Keep server state in the project's data-fetching layer, not duplicated in client stores.
  • Use effects only to synchronize with external systems. Declare complete dependency arrays, clean up subscriptions/timers/aborts, and never fetch in effects when the project already has a query layer.
  • Give list items stable keys from data, never array indexes for reorderable lists. Avoid creating components inside render.
  • Memoize (useMemo, useCallback, memo) only for measured cost or referential stability that a child or dependency actually needs.
  • Handle loading, empty, error, and permission states explicitly. Validate forms on the client for UX and rely on the server for authority.
  • Use semantic elements, labelled controls, focus management for dialogs/menus, and keyboard support. Never render untrusted HTML without sanitization (dangerouslySetInnerHTML).
  • Type props and hooks precisely in TypeScript; avoid any and non-null assertions that hide real absence.

Testing and Verification

Run existing type check, lint, unit/component tests (React Testing Library: query by role and label, assert behavior not implementation), and build. Verify the changed screen in the running app, including error and empty states.

Review Checklist

  • Is every piece of state owned once, with derived data computed rather than stored?
  • Do effects have correct dependencies and cleanup, with no fetch races or stale closures?
  • Are loading, error, and empty states handled and accessible?
  • Did the change avoid unnecessary re-renders without premature memoization?
  • Does it reuse existing components, hooks, and design tokens?

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.