react-best-practices
React & Next.js engineering standards.
от Dokhacgiakhoa★ 513 звёзд на GitHub
Установить react-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
React & Next.js Best Practices
Goal: Build high-performance, maintainable, and accessible React applications using modern patterns (React 19+, Next.js App Router).
1. Architecture & Rendering
- App Router First: Use Next.js App Router (
app/) for all new projects. - Server Components (RSC): Default to Server Components. Only add
'use client'when interactivity (state, hooks, event listeners) is strictly needed. - Suspense & Streaming: Use
<Suspense>boundaries to stream UI parts that depend on slow data. - Data Fetching: Fetch data in Server Components directly (async/await components). Avoid
useEffectfor data fetching.
2. Component Patterns
- Composition: Use
childrenprop to tackle prop drilling. - Atomic Design: Organize components by atomicity (though feature-based folder structure is preferred for scale).
- Custom Hooks: Extract complex logic into
useHookName. - Props: Use strict TypeScript interfaces for props. Avoid
any.
3. State Management
- URL as State: Store shareable state (filters, pagination) in URL Search Params.
- Server State: Use React Query (TanStack Query) or SWR for client-side data fetching/caching if RSC is not applicable.
- Global State: Minimal use of Zustand/Context. Prefer local state + composition.
4. Performance Optimization
- Images: Always use
next/imagewith properwidth,height, andsizes. - Fonts: Use
next/fontto eliminate layout shift (CLS). - Lazy Loading: Use
next/dynamicorReact.lazyfor heavy client components below the fold. - Bundle Analysis: Regularly check bundle size with
@next/bundle-analyzer.
5. Styling
- Tailwind CSS: Use utility-first styling.
- CN Utility: Use
clsx+tailwind-merge(typicallycn()helper) for conditional class merging. - Mobile First: Write styles for mobile first, then add
md:,lg:prefixes.
6. Directory Structure (Feature-First)
app/
├── (marketing)/ # Route group
├── dashboard/
│ ├── page.tsx
│ ├── layout.tsx
│ ├── _components/ # Private feature components
│ └── loading.tsx
components/ # Shared components (UI Kit)
lib/ # Utilities and helpers
hooks/ # Shared hooks
types/ # Global types
7. Security
- XSS: React escapes by default, but be careful with
dangerouslySetInnerHTML. - Auth: Use
NextAuth.js(Auth.js) or Clerk. Protect routes via Middleware.
Checklist before PR:
- Is
'use client'used only where necessary? - Are lists using stable
keyprops? - Is data fetched on the server where possible?
- Are images optimized?
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл react-best-practices?
React & Next.js engineering standards.
Как установить скилл react-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл react-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…