nextjs-react-redux-typescript-cursor-rules — скилл для Claude Code
Свод правил и стандартов разработки для связки Next.js, React, Redux Toolkit и TypeScript. Задаёт архитектуру компонентов, строгую типизацию и требования к стилю кода для ИИ-агента.
npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a claude-codeЧто делает nextjs-react-redux-typescript-cursor-rules
Скилл инструктирует модель генерировать фронтенд-код по единым соглашениям. Внутри зафиксированы правила для стека: Next.js с App Router, Redux Toolkit со срезами через createSlice, стилизация на Tailwind CSS и компоненты Shadcn UI. По умолчанию агент делает компоненты серверными и выносит клиентскую логику с директивой 'use client' только для обработчиков событий, хуков и браузерных API.
Набор жёстко ограничивает оформление: отступы табами, одинарные кавычки, отсутствие точек с запятой и длина строки не более 80 символов. Для описания моделей данных требуется использовать interface, а не type, а формы валидировать связкой Zod и React Hook Form. Тесты пишутся на Jest и React Testing Library по шаблону Arrange-Act-Assert.
Если ваш проект использует отступы пробелами или стандартный Prettier с точками с запятой, эти правила войдут в прямой конфликт с линтером.
Какие задачи решает
- настроить единый кодстайл с табами и одинарными кавычками
- спроектировать архитектуру глобального хранилища через
createSlice - разграничить серверные и клиентские компоненты в App Router
- настроить валидацию форм через Zod и React Hook Form
Примеры запросов агенту
- Создай срез Redux Toolkit для корзины покупок с нормализованным состоянием и селекторами.
- Напиши форму входа на React Hook Form с валидацией схемы через Zod и доступной разметкой.
- Сделай серверный компонент страницы профиля в App Router с загрузкой метаданных и обработкой ошибок.
Как установить nextjs-react-redux-typescript-cursor-rules
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a claude-code2Вручную: положить файлы
~/.claude/skills/nextjs-react-redux-typescript-cursor-rules/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/nextjs-react-redux-typescript-cursor-rules/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a codex2Вручную: положить файлы
.agents/skills/nextjs-react-redux-typescript-cursor-rules/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a cursor2Вручную: положить файлы
.cursor/skills/nextjs-react-redux-typescript-cursor-rules/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills nextjs-react-redux-typescript-cursor-rules2Вручную: положить файлы
.github/skills/nextjs-react-redux-typescript-cursor-rules/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path nextjs-react-redux-typescript-cursor-rulesВручную: положить файлы
.devin/skills/nextjs-react-redux-typescript-cursor-rules/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о nextjs-react-redux-typescript-cursor-rules
Как установить nextjs-react-redux-typescript-cursor-rules в Claude Code?
Выполните в терминале команду npx skills add Mindrally/skills --skill nextjs-react-redux-typescript-cursor-rules -a claude-code.
Какие библиотеки интерфейса прописаны в скилле?
Скилл ориентирует агента на связку Shadcn UI и Radix UI вместе с Tailwind CSS и поддержкой тёмной темы через переменные CSS.
Каковы требования скилла к форматированию кода?
Правила требуют использовать табы для отступов, одинарные кавычки, запрещают точки с запятой на конце строк и ограничивают длину строки 80 символами.
Исходный текст
SKILL.md · Apache-2.0
--- name: nextjs-react-redux-typescript-cursor-rules description: Comprehensive Next.js, React, Redux, and TypeScript development guidelines covering SOLID principles, component architecture, and best practices. metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Next.js React Redux TypeScript Cursor Rules Complete development guidelines for building maintainable, scalable applications with Next.js, React, Redux Toolkit, and TypeScript. ## Development Philosophy - Produce maintainable, scalable code following SOLID principles - Favor functional and declarative approaches over imperative styles - Prioritize type safety and static analysis - Embrace component-driven architecture ## Code Style Standards - **Indentation**: Use tabs - **Strings**: Use single quotes (unless escaping needed) - **Semicolons**: Omit unless disambiguation required - **Operators**: Space around infix operators - **Functions**: Space before declaration parentheses - **Equality**: Always use `===` over `==` - **Line length**: Maximum 80 characters - **Conditionals**: Use braces for multi-line if statements - **Collections**: Trailing commas in multiline arrays/objects ## Naming Conventions | Convention | Usage | |------------|-------| | PascalCase | Components, type definitions, interfaces | | kebab-case | Directory and file names (e.g., `user-profile.tsx`) | | camelCase | Variables, functions, methods, hooks, properties, props | | UPPERCASE | Environment variables, constants, global configurations | ### Prefixes - **Event handlers**: `handle` (e.g., `handleClick`) - **Booleans**: verbs (e.g., `isLoading`, `hasError`, `canSubmit`) - **Custom hooks**: `use` (e.g., `useAuth`, `useForm`) ## React Best Practices ### Components - Use functional components with TypeScript interfaces - Define components using `function` keyword - Extract reusable logic into custom hooks - Apply composition patterns properly - Leverage `React.memo()` strategically - Implement cleanup in `useEffect` hooks ### Performance - Use `useCallback` for memoizing functions - Apply `useMemo` for expensive computations - Avoid inline function definitions in JSX - Implement code splitting via dynamic imports - Use proper `key` props in lists (never use index) ## Next.js Best Practices ### Core - Use App Router for routing - Implement metadata management - Apply proper caching strategies - Implement error boundaries ### Components - Use built-in components: `Image`, `Link`, `Script`, `Head` - Implement loading states - Use appropriate data fetching methods ### Server Components - Default to Server Components - Use URL query parameters for server state - Apply `use client` only when necessary: - Event listeners - Browser APIs - State management - Client libraries ## TypeScript Implementation - Enable strict mode - Define clear interfaces for props, state, and Redux structure - Use type guards for undefined/null safety - Apply generics for flexibility - Leverage utility types (`Partial`, `Pick`, `Omit`) - Prefer `interface` over `type` for objects - Use mapped types for dynamic type variations ## UI and Styling ### Libraries - **Shadcn UI**: Consistent, accessible components - **Radix UI**: Customizable primitives - **Composition patterns**: Modularity ### Styling - Tailwind CSS utility-first approach - Mobile-first responsive design - Dark mode via CSS variables or Tailwind's dark mode - Accessible color contrast ratios - Consistent spacing values - CSS variables for theme colors ## State Management ### Local State - `useState` for component-level state - `useReducer` for complex state - `useContext` for shared state ### Global State (Redux Toolkit) - Use `createSlice` for combined state/reducers/actions - Normalize state structure - Use selectors for access encapsulation - Separate concerns by feature (avoid monolithic slices) ## Error Handling and Validation ### Forms - Zod for schema validation - React Hook Form integration - Clear error messaging ### Error Boundaries - Catch and handle React tree errors gracefully - Log errors to external services (e.g., Sentry) - Display user-friendly fallback UIs ## Testing ### Unit Testing - Jest and React Testing Library - Arrange-Act-Assert pattern - Mock external dependencies and API calls ### Integration Testing - Focus on user workflows - Proper test environment setup/teardown - Selective snapshot testing - Use testing utilities (`screen` in RTL) ## Accessibility (a11y) - Semantic HTML - Accurate ARIA attributes - Full keyboard navigation - Proper focus management - Accessible color contrast - Logical heading hierarchy - Accessible interactive elements - Clear error feedback ## Security - Input sanitization to prevent XSS - DOMPurify for HTML sanitization - Proper authentication methods ## Internationalization (i18n) - next-i18next for translations - Locale detection - Number and date formatting - RTL support - Currency formatting ## Documentation - JSDoc for all public functions, classes, methods, interfaces - Complete sentences with proper punctuation - Clear, concise descriptions - Proper markdown, code blocks, links, headings, lists - Examples when appropriate
© Mindrally · Apache-2.0 · Mindrally/skills