three-js — скилл для Claude Code: что делает и как установить
Задаёт правила разработки на Three.js и React Three Fiber: код на TypeScript, очистка ресурсов и оптимизация рендера.
npx skills add Mindrally/skills --skill three-js -a claude-codeЧто делает three-js
Скилл настраивает ИИ-ассистента на работу со связкой Three.js, React Three Fiber, Vite и Next UI. Он заставляет модель писать функциональные компоненты на TypeScript без классов и точек с запятой, отдавать предпочтение интерфейсам перед типами, а перечисления заменять мапами.
В коде 3D-сцен скилл требует контролировать память: вызывать dispose для геометрий, текстур и материалов, применять инстансинг и объединение сеток для снижения вызовов отрисовки. Для React Three Fiber вводятся правила использовать хук useFrame для анимаций, useThree для доступа к контексту и утилиты из @react-three/drei. Без правильного вызова dispose в хуках очистки утечки памяти в браузере гарантированы.
Какие задачи решает
- настроить сцену в React Three Fiber с хуками useFrame и useThree
- оптимизировать вызовы отрисовки через инстансинг и объединение геометрий
- организовать очистку текстур и материалов для предотвращения утечек памяти
- структурировать TypeScript-компоненты с ранними возвратами и проверками
Примеры запросов агенту
- Собери сцену с вращающимся кубом на React Three Fiber через useFrame и утилиты drei.
- Оптимизируй отрисовку тысячи одинаковых мешей в Three.js с помощью инстансинга.
- Добавь корректную очистку геометрий и текстур при размонтировании компонента.
Как установить three-js
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill three-js -a claude-code2Вручную: положить файлы
~/.claude/skills/three-js/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/three-js/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill three-js -a codex2Вручную: положить файлы
.agents/skills/three-js/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill three-js -a cursor2Вручную: положить файлы
.cursor/skills/three-js/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills three-js2Вручную: положить файлы
.github/skills/three-js/SKILL.md1Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill three-js -a gemini-cli2Командой платформы
gemini skills install https://github.com/Mindrally/skills --path three-jsВручную: положить файлы
.devin/skills/three-js/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add Mindrally/skills --skill three-js -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о three-js
Как установить three-js в Claude Code?
Выполните команду npx skills add Mindrally/skills --skill three-js -a claude-code. Конфигурация запишется в файл ~/.claude/skills/three-js/SKILL.md.
Что делает скилл three-js?
Он задаёт стандарты написания 3D-графики на Three.js и React Three Fiber. Ассистент будет генерировать типизированный код без классов и настраивать оптимизацию рендера.
Какие требования к стилю кода задаёт скилл?
Скилл ориентирован на TypeScript, Vite, Tailwind CSS и Next UI. Он требует объявлять функции через ключевое слово function, не ставить точки с запятой и заменять enum на мапы.
Исходный текст
SKILL.md · Apache-2.0
--- name: three-js description: Expert guidance for Three.js and React Three Fiber development with modern React, TypeScript, and performance best practices metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # Three.js Development You are an expert in React, Vite, Tailwind CSS, Three.js, React Three Fiber, and Next UI. ## Key Principles - Write concise, technical responses with accurate React examples - Use functional, declarative programming; avoid classes - Prefer iteration and modularization over code duplication - Use descriptive variable names with auxiliary verbs (e.g., isLoading, hasRendered) - Use lowercase with dashes for directories (e.g., components/auth-wizard) - Favor named exports for components ## JavaScript/TypeScript Standards - Use "function" keyword for pure functions; omit semicolons - Use TypeScript for all code; prefer interfaces over types - Avoid enums; use maps instead - File structure: Exported component, subcomponents, helpers, static content, types ## Error Handling and Validation - Handle errors and edge cases at the beginning of functions - Use early returns for error conditions to avoid deeply nested if statements - Place the happy path last in the function for improved readability - Use guard clauses to handle preconditions and invalid states early - Implement proper error logging and user-friendly error messages ## React Best Practices ### Component Guidelines - Use functional components and interfaces - Use declarative JSX - Use function, not const, for components - Use Next UI and Tailwind CSS for components and styling - Implement responsive design with Tailwind CSS ### Performance Optimization - Wrap client components in Suspense with fallback - Use dynamic loading for non-critical components - Optimize images: WebP format, size data, lazy loading ## Three.js Specific Guidelines ### Scene Management - Properly dispose of geometries, materials, and textures when no longer needed - Use object pooling for frequently created/destroyed objects - Implement level of detail (LOD) for complex scenes ### Performance - Minimize draw calls through geometry merging and instancing - Use appropriate texture sizes and formats - Implement frustum culling for large scenes - Profile and optimize render loops ### React Three Fiber - Use the useFrame hook for animations - Leverage useThree for accessing the Three.js context - Use refs for direct Three.js object manipulation - Implement proper cleanup in useEffect hooks - Use drei library helpers for common 3D patterns
© Mindrally · Apache-2.0 · Mindrally/skills