react-native-r3f — Claude Code skill: what it does, how to install
Guides AI agents in building React Three Fiber scenes with three.js. Enforces semi-colon-free TypeScript and clean modular code.
npx skills add Mindrally/skills --skill react-native-r3f -a claude-codeWhat react-native-r3f does
This skill instructs the agent to write clean code for React Three Fiber projects running on Vite and Tailwind CSS. It enforces strict TypeScript standards: interfaces instead of type aliases, map objects instead of enums, and no semicolons. Pure functions and components must use the function keyword with named exports.
For 3D development, the instructions require declarative scene composition and instancing for duplicate geometries. Helpers from @react-three/drei handle standard environment controls and lighting setups. Functions handle edge cases first via guard clauses, pushing happy-path logic to the bottom.
Every 3D canvas component requires a Suspense boundary with a fallback. Because the rules forbid class components and enforce a semicolon-free style, they directly conflict with codebases relying on classic OOP React patterns.
What it helps with
- Build a declarative 3D canvas with OrbitControls and studio lighting
- Clean up three.js textures and geometries inside useEffect hooks
- Optimize performance by instancing repeated 3D meshes
- Structure TypeScript components with guard clauses and no semicolons
Example prompts for the agent
- Create a 3D scene component with an interactive box mesh and environment lighting
- Implement a rotation loop using the
useFramehook with early return guards - Wrap this Canvas in a Suspense boundary with a fallback component
How to install react-native-r3f
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a claude-code2Manually: put the files in place
~/.claude/skills/react-native-r3f/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/react-native-r3f/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a codex2Manually: put the files in place
.agents/skills/react-native-r3f/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a cursor2Manually: put the files in place
.cursor/skills/react-native-r3f/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills react-native-r3f2Manually: put the files in place
.github/skills/react-native-r3f/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path react-native-r3fManually: put the files in place
.devin/skills/react-native-r3f/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill react-native-r3f -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about react-native-r3f
How to install react-native-r3f in Claude Code?
Run npx skills add Mindrally/skills --skill react-native-r3f -a claude-code. The skill file installs to ~/.claude/skills/react-native-r3f/SKILL.md.
What coding standards does react-native-r3f enforce?
It requires TypeScript without semicolons, interface definitions over type aliases, maps instead of enums, and function declarations for components with named exports.
How does the skill handle three.js performance?
It directs the assistant to use instanced meshes for repeated geometry, leverage drei utilities, and dispose of 3D resources properly inside useEffect.
Source text
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