react-native-r3f — скилл для Claude Code: что делает и как установить
Задаёт правила разработки 3D-сцен на React Three Fiber и three.js. Помогает генерировать чистые компоненты с TypeScript без точек с запятой.
npx skills add Mindrally/skills --skill react-native-r3f -a claude-codeЧто делает react-native-r3f
Скилл настраивает ассистента на строгие стандарты кода для React Three Fiber в проектах на Vite и Tailwind CSS. Все функции объявляются через ключевое слово function, точки с запятой опускаются, а вместо enum используются структуры map. Для типов обязателен TypeScript с интерфейсами вместо type.
В трёхмерной графике скилл требует декларативной композиции сцен и очистки ресурсов в useEffect. Повторяющиеся меши оптимизируются через инстансинг, а типовые элементы берутся из библиотеки @react-three/drei. Обработка ошибок строится через guard clauses на входе в функцию с ранними возвратами, оставляя основной сценарий в конце.
Ассистент всегда оформляет компоненты как именованные экспорты и изолирует трёхмерный холст внутри Suspense с резервной заглушкой. Если в проекте приняты классы или точки с запятой, эти правила будут конфликтовать с принятым стилем.
Какие задачи решает
- Собрать интерактивную 3D-сцену на React Three Fiber с камерой OrbitControls
- Настроить очистку буферов и ресурсов three.js при размонтировании компонента
- Оптимизировать рендеринг однотипных 3D-объектов через инстансинг
- Оформить интерфейс поверх 3D-холста с помощью Tailwind CSS и Next UI
Примеры запросов агенту
- Создай компонент сцены с кубом и студийным освещением через
@react-three/drei - Добавь анимацию вращения меша через хук
useFrameс ранним возвратом при ошибке - Сделай карточку предпросмотра 3D-модели в
Suspenseс резервным отображением
Как установить react-native-r3f
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a claude-code2Вручную: положить файлы
~/.claude/skills/react-native-r3f/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/react-native-r3f/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a codex2Вручную: положить файлы
.agents/skills/react-native-r3f/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a cursor2Вручную: положить файлы
.cursor/skills/react-native-r3f/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills react-native-r3f2Вручную: положить файлы
.github/skills/react-native-r3f/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path react-native-r3fВручную: положить файлы
.devin/skills/react-native-r3f/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о react-native-r3f
Как установить react-native-r3f в Claude Code?
Выполните команду npx skills add Mindrally/skills --skill react-native-r3f -a claude-code. Конфигурация запишется в ~/.claude/skills/react-native-r3f/SKILL.md.
Какие правила оформления кода задаёт скилл?
Код пишется исключительно на TypeScript без точек с запятой и без конструкций enum. Компоненты оформляются ключевым словом function и только как именованные экспорты.
Как скилл оптимизирует 3D-сцены?
Ассистент использует инстансинг для повторяющейся геометрии, готовые хелперы из библиотеки drei и обязательную очистку выделенных ресурсов three.js в хуке useEffect.
Исходный текст
SKILL.md · Apache-2.0
---
name: react-native-r3f
description: Expert guidance for React Three Fiber development with React, Vite, Tailwind CSS, and three.js
metadata:
maintainer: Mindrally
source: https://github.com/Mindrally/skills
---
# React Native R3F (React Three Fiber)
You are an expert in React, Vite, Tailwind CSS, three.js, React Three Fiber, and Next UI.
## Core Principles
- Write concise, technical responses with accurate React examples
- Employ functional, declarative programming paradigms; avoid class-based approaches
- Prioritize iteration and modularity over code duplication
- Use descriptive variable names incorporating auxiliary verbs (e.g., `isLoading`, `hasError`)
- Directory naming: lowercase with dashes (e.g., `components/auth-wizard`)
- Favor named exports for all components
## JavaScript/TypeScript Standards
- Use `function` keyword for pure functions; omit semicolons
- TypeScript mandatory for all code; prefer interfaces over type aliases
- Avoid enums; use maps instead
- File organization: exported component -> subcomponents -> helpers -> static content -> types
- Omit unnecessary braces in single-line conditionals
## Error Handling
- Address errors and edge cases at function entry points
- Employ early returns for error conditions
- Position happy path logic last for enhanced readability
- Use guard clauses for preconditions and invalid states
## React-Specific Practices
- Functional components exclusively
- Use `function` syntax, not `const`, for component declarations
- Leverage Next UI and Tailwind CSS for styling
- Implement responsive design throughout
- Wrap client components in Suspense with fallbacks
- Use dynamic loading for non-critical components
- Return expected errors as values; avoid try/catch for anticipated errors
- Implement error boundaries using `error.tsx` and `global-error.tsx`
## React Three Fiber Best Practices
- Use declarative 3D scene composition with React components
- Leverage hooks like `useFrame`, `useThree`, `useLoader` for animations and scene access
- Implement proper cleanup in useEffect for 3D resources
- Use drei library helpers for common 3D patterns
- Optimize performance with instancing for repeated geometries
- Handle window resize and device pixel ratio appropriately
## Example Component Structure
```tsx
import { Canvas } from '@react-three/fiber'
import { OrbitControls, Environment } from '@react-three/drei'
import { Suspense } from 'react'
interface SceneProps {
isAnimating: boolean
}
function Scene({ isAnimating }: SceneProps) {
return (
<Canvas>
<Suspense fallback={null}>
<ambientLight intensity={0.5} />
<directionalLight position={[10, 10, 5]} />
<mesh>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial color="orange" />
</mesh>
<OrbitControls />
<Environment preset="studio" />
</Suspense>
</Canvas>
)
}
export { Scene }
```
© Mindrally · Apache-2.0 · Mindrally/skills