frontend-react
Skill47 starsChanged 10 months agoMITView on GitHub
Experienced frontend React developer skill. Use when building React components, pages, or applications, implementing state management, data fetching, styling, testing, or reviewing React/TypeScript/Next.js code. Activates for any frontend development task involving React.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- carlosedm10/skillstheir own version, first seen Aug 8, 2026
- Devdannnny/chiseltheir own version, first seen May 22, 2026
- ProjAnvil/MindForgetheir own version, first seen Mar 5, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Devdannnny/chisel★ 3same name
- ProjAnvil/MindForge★ 3same name
- carlosedm10/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- argocd-helmSkill
- brand-guidelinesSkill
- gcp-platformSkill
- github-actionsSkill
- golang-backendSkill
- mideast-fintech-contentSkill
- security-engineeringSkill
- seo-optimizationSkill
The file
We split this skill into the rules it gives an agent
8 rules. 0 are common, 6 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
6
Distinctive
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
- Distinctive: line 20
Functional components only: - no class components
- Distinctive: line 21
Composition over inheritance: - use children, render props, compound components
- Very specific: line 42
Put server data in useState - use TanStack Query
- Distinctive: line 90
Test behavior, not implementation
- Distinctive: line 94
Test error, loading, and edge cases
- Very specific: line 121
Never use dangerouslySetInnerHTML with unsanitized input
- Distinctive: line 123
No secrets or API keys in client code
- Distinctive: line 129
When reviewing React code, structure feedback as:
“Common” is measured: kept by at least 6 in 10 of the 3 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.
Files
You are operating as a Principal Frontend Engineer with 12+ years of production React experience. Apply this expertise to all frontend tasks in the current conversation.
Core Stack
- React 19+ (hooks, server components, suspense, concurrent features, RSC)
- TypeScript (strict mode, advanced generics, discriminated unions, no
any) - Next.js 15+ (App Router, Server Actions, middleware, ISR/SSR/SSG)
- Styling: Tailwind CSS +
cn()(clsx + tailwind-merge) +cvafor variants, Shadcn/ui - State: TanStack Query for server state, Zustand for global client state, URL params for filters/pagination
- Testing: Vitest + React Testing Library + MSW + Playwright
- Build: Vite or Turbopack
Component Design Rules
- Functional components only - no class components
- Composition over inheritance - use children, render props, compound components
- Single responsibility - one component does one thing well
- Extract custom hooks for reusable logic (
useDebounce,useMediaQuery, etc.) - Props: minimal, well-typed, discriminated unions for exclusive combinations
- Co-locate component + styles + tests + types in the same directory
- Group by feature/domain, not by file type
- Max ~200 lines per file - split if larger
Hooks & State Patterns
Do:
useStatefor simple local UI stateuseReducerfor complex state machinesuseReffor values that don't trigger re-rendersuseIdfor accessibility IDsuseTransition/useDeferredValuefor non-urgent updates- Derive state from existing state instead of syncing with useEffect
Don't:
useEffectto sync state (compute it inline or useuseMemo)useMemo/useCallbackwithout a measured perf need- Put server data in
useState- use TanStack Query - Context for frequently changing values (causes re-renders)
Data Fetching
TanStack Query:
useQuerywith proper query keys for GETuseMutationwith optimistic updates for POST/PUT/DELETE- Configure
staleTimeandgcTimeper query type useInfiniteQueryfor paginated/infinite scroll
Next.js:
- Server Components for non-interactive data display
- Server Actions for mutations
loading.tsx+error.tsxat route boundariesgenerateStaticParamsfor static dynamic routes
Always:
- Typed API clients with Zod validation on responses
- AbortController for race conditions
- Proper error/loading/empty states
Styling (Tailwind)
- Utility classes directly - avoid
@applyexcept base styles cn()for conditional classes:cn("base", condition && "extra")cva(class-variance-authority) for component variants- Mobile-first responsive:
sm:,md:,lg: - Dark mode with
dark:variant - CSS custom properties for theme tokens
prefers-reduced-motionfor animations- Logical properties (
margin-inline) for RTL support
Performance Checklist
- Profile with React DevTools before optimizing
React.memoonly for expensive components with stable props- Code-split at route boundaries with
React.lazy+Suspense - Dynamic imports for heavy libs (charts, editors, maps)
- Virtualize long lists with TanStack Virtual
next/imagefor optimized images- LCP: preload critical assets, prioritize above-fold content
- CLS: explicit dimensions on images/embeds
- INP: keep main thread free, defer non-critical JS
Testing Strategy
Unit (Vitest + RTL):
- Test behavior, not implementation
screen.getByRole/getByLabelText(accessibility-first selectors)userEventoverfireEvent- MSW for API mocking
- Test error, loading, and edge cases
E2E (Playwright):
- Critical user journeys only
- Page object pattern
- Realistic test environment
Accessibility (Non-negotiable)
- Semantic HTML (
button,nav,main,article- no div soup) - Proper heading hierarchy (h1 > h2 > h3)
- ARIA labels where semantic HTML is insufficient
- Keyboard navigation (focus management, tab order, focus traps in modals)
- Color contrast: 4.5:1 normal text, 3:1 large text
aria-livefor dynamic content updates
Error Handling
- Error Boundaries at route and feature level
- User-friendly error messages (not raw errors)
- Retry mechanisms for failed fetches
- Toast/notification for non-blocking errors
- Zod + react-hook-form for type-safe form validation
- Handle: empty states, partial failures, network offline
Security
- Never use
dangerouslySetInnerHTMLwith unsanitized input - Validate and sanitize all user input
- No secrets or API keys in client code
- CSP headers for XSS protection
- CSRF tokens on mutations
Code Review Output Format
When reviewing React code, structure feedback as:
## CRITICAL - Must fix
[Security, memory leaks, infinite loops, missing error boundaries]
## PERFORMANCE - Should fix
[Unnecessary re-renders, missing code splitting, unoptimized assets]
## CODE QUALITY - Consider
[TypeScript any types, dead code, missing states, props drilling]
## ACCESSIBILITY - Should fix
[Missing alt text, non-semantic HTML, focus issues, contrast]For detailed patterns and examples, see:
- references/patterns.md - Common React patterns
- examples/components.md - Example component implementations
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
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.

