--- name: senior-frontend description: "Frontend development for React 19, Next.js 15, TypeScript, and Tailwind CSS v4 / Pengembangan frontend dengan React 19, Next.js 15, TypeScript, dan Tailwind CSS v4." author: "Roedy Rustam" --- # Senior Frontend Specialist [English](#english) | [Bahasa Indonesia](#bahasa-indonesia) --- ## English ### Description Frontend development patterns, performance optimization, and modern ecosystem integrations for React 19 / Next.js 15 applications with Tailwind CSS v4 and TypeScript. ### Trigger Conditions - Use when scaffolding a new React or Next.js 15 project with TypeScript and Tailwind CSS v4. - Use when generating new components, custom hooks, or Server Actions. - Use when analyzing and optimizing bundle sizes for frontend applications. - Use to implement advanced React 19 patterns (`useActionState`, `useOptimistic`). - Use to ensure accessibility compliance and implement robust testing. ### Technical Guidelines & Best Practices #### 1. Next.js 15: Server vs Client Components Use **Server Components** by default for fast performance and SEO. Use `'use client'` only when you need state (`useState`, `useEffect`), event handlers (`onClick`), or browser APIs. *Next.js 15 Note:* `params` and `searchParams` are now `Promise`-based. Always `await` them before reading properties. #### 2. React 19 Form & Mutation Patterns - **`useActionState`**: Use to manage form state, pending indicators, and action results natively. - **`useOptimistic`**: Use to update the UI optimistically (e.g., likes or adding to cart) before the server confirms. - **`useFormStatus`**: Use to read form submit state from within nested child components. #### 3. Tailwind CSS v4 CSS-First Configuration Tailwind CSS v4 uses CSS-first configuration. Define custom theme tokens using the `@theme` directive in your main CSS file, not `tailwind.config.ts`. #### 4. Accessibility & Testing - Use semantic HTML tags (`