Senior Frontend (React/Next.js)
Frontend patterns, performance, and decision discipline for React/Next.js.
Surface 4 Assumptions Before Recommending
- Primary device + network — mobile-4G / desktop-fiber / low-end-Android / corporate.
- LCP target in ms — a number, not "fast."
- SEO-dependent vs auth-walled — drives SSR/SSG/RSC vs SPA.
- WCAG target + named a11y owner.
Every recommendation must include: Core Web Vitals targets (LCP, INP, CLS) at p75 on primary device; per-route JS bundle budget (KB-gzip); Lighthouse a11y + perf floor. Missing any → incomplete.
Profiles
| Profile |
When |
LCP (mobile-4G p75) |
Bundle |
| next-app-router |
SaaS, SEO + dynamic, RSC-first |
2000ms |
150 KB/route |
| remix-or-sveltekit |
mobile-4G primary, low-JS, progressive enhancement |
1500ms |
80 KB/route |
| vite-spa |
auth-walled, desktop/corporate |
2500ms |
200 KB init + 80/route |
| astro-or-static |
marketing/docs/blog, SEO-critical |
1200ms |
30 KB JS/page |
React Patterns
- Compound components: share state via Context,
Tabs.List/Tabs.Panel.
- Custom hooks: extract reusable logic (
useDebounce, useLocalStorage).
- Render props: share rendering logic (
DataFetcher with render).
Next.js Optimization
- Server Components by default; add
'use client' only for event handlers, state, effects, browser APIs.
next/image: priority above-fold; fill + sizes responsive.
- Parallel fetch via
Promise.all; stream with <Suspense>.
- Config:
images.formats: ['image/avif','image/webp'], experimental.optimizePackageImports.
Bundle Health
Replace heavy deps: moment(290KB)→date-fns/dayjs · lodash(71KB)→lodash-es tree-shaking · axios(14KB)→fetch/ky · jquery→DOM · @mui→shadcn/Radix. Grade A 90+, C 70-79 (replace heavy deps), F <60.
Accessibility Checklist
Semantic HTML (<button>,<nav>,<main>) · keyboard-focusable interactives · ARIA labels on icons · 4.5:1 contrast · visible focus (focus-visible:ring) · skip link. Test with Testing Library: assert roles, aria-labelledby on dialogs.
TypeScript
Props with children: React.ReactNode; generic components ListProps<T> with typed renderItem. Conditional classes via cn().
1---2name: senior-frontend-react-next-js3description: Use when building React/Next.js components, optimizing performance, analyzing bundle size, scaffolding frontend projects, or reviewing frontend code quality — with eval-gated profile decisions.4tags: [react, nextjs, typescript, tailwind, frontend, performance, bundle-size, accessibility, core-web-vitals, server-components]5source: alirezarezvani/claude-skills6derived_from: engineering-team/skills/senior-frontend7metadata:8 source: https://skillmd.com/skills/aashutosh396/senior-frontend-react-next-js9---1011# Senior Frontend (React/Next.js)1213Frontend patterns, performance, and decision discipline for React/Next.js.1415## Surface 4 Assumptions Before Recommending161. **Primary device + network** — mobile-4G / desktop-fiber / low-end-Android / corporate.172. **LCP target in ms** — a number, not "fast."183. **SEO-dependent vs auth-walled** — drives SSR/SSG/RSC vs SPA.194. **WCAG target + named a11y owner.**2021Every recommendation must include: Core Web Vitals targets (LCP, INP, CLS) at p75 on primary device; per-route JS bundle budget (KB-gzip); Lighthouse a11y + perf floor. Missing any → incomplete.2223## Profiles24| Profile | When | LCP (mobile-4G p75) | Bundle |25|---|---|---|---|26| next-app-router | SaaS, SEO + dynamic, RSC-first | 2000ms | 150 KB/route |27| remix-or-sveltekit | mobile-4G primary, low-JS, progressive enhancement | 1500ms | 80 KB/route |28| vite-spa | auth-walled, desktop/corporate | 2500ms | 200 KB init + 80/route |29| astro-or-static | marketing/docs/blog, SEO-critical | 1200ms | 30 KB JS/page |3031## React Patterns32- **Compound components**: share state via Context, `Tabs.List`/`Tabs.Panel`.33- **Custom hooks**: extract reusable logic (`useDebounce`, `useLocalStorage`).34- **Render props**: share rendering logic (`DataFetcher` with `render`).3536## Next.js Optimization37- Server Components by default; add `'use client'` only for event handlers, state, effects, browser APIs.38- `next/image`: `priority` above-fold; `fill` + `sizes` responsive.39- Parallel fetch via `Promise.all`; stream with `<Suspense>`.40- Config: `images.formats: ['image/avif','image/webp']`, `experimental.optimizePackageImports`.4142## Bundle Health43Replace heavy deps: moment(290KB)→date-fns/dayjs · lodash(71KB)→lodash-es tree-shaking · axios(14KB)→fetch/ky · jquery→DOM · @mui→shadcn/Radix. Grade A 90+, C 70-79 (replace heavy deps), F <60.4445## Accessibility Checklist46Semantic HTML (`<button>`,`<nav>`,`<main>`) · keyboard-focusable interactives · ARIA labels on icons · 4.5:1 contrast · visible focus (`focus-visible:ring`) · skip link. Test with Testing Library: assert roles, `aria-labelledby` on dialogs.4748## TypeScript49Props with `children: React.ReactNode`; generic components `ListProps<T>` with typed `renderItem`. Conditional classes via `cn()`.