r3f-component-patterns

r3f-component-patterns is a skill for Claude Code from bullish0x/GameStudio. It costs 24 tokens per session (3,507 once invoked), scanned A, original, MIT.

A guide to structuring reusable React Three Fiber components, hooks, and compositions for 3D applications. React Three Fiber lets React components describe Three.js scenes.

In plain words
What is it for?
Use it to build reusable 3D objects, combine simple components into scenes, create custom hooks, and tune component performance.
Why use it?
It helps prevent large 3D scenes from becoming difficult to reuse or maintain. It also explains how to organize components and reduce avoidable updates.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents).

Good fit Use it to build reusable 3D objects, combine simple components into scenes, create custom hooks, and tune component performance.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bullish0x/gamestudio/r3f-component-patterns
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bullish0x/GameStudio --skill r3f-component-patterns
Clone the repo
git clone --depth 1 https://github.com/bullish0x/GameStudio

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for r3f-component-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/bullish0x/gamestudio/r3f-component-patterns/github.svg)](https://agentmods.dev/skills/bullish0x/gamestudio/r3f-component-patterns)
Your own site
<a href="https://agentmods.dev/skills/bullish0x/gamestudio/r3f-component-patterns"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/r3f-component-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for r3f-component-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/bullish0x/gamestudio/r3f-component-patterns"><img src="https://agentmods.dev/badge/skills/bullish0x/gamestudio/r3f-component-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00024 $0.03507
Opus 5 $0.00012 $0.01754
Sonnet 5 $0.00005 $0.00701
Haiku 4.5 $0.00002 $0.00351

Measured 8d ago against content hash 1638f06f5242, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

r3f-component-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/r3f-component-patterns/SKILL.md · 564 lines

How it starts

The opening of the file, as written. The whole thing — 564 lines — stays where its author put it; the contents beside it link to each section on GitHub.

React Three Fiber Component Patterns

When to Use

Use this skill when:

  • Building reusable 3D components with R3F
  • Structuring React Three.js applications
  • Implementing component composition
  • Creating custom R3F hooks
  • Optimizing React component performance

Core Principles

  1. Declarative: Define 3D scenes with JSX
  2. Reusable: Create component libraries
  3. Composable: Build complex scenes from simple parts
  4. Type-Safe: Full TypeScript support
  5. Performance: Use React.memo and useMemo
  6. Props-Driven: Configure via props, not imperative code

Implementation

1. Basic Component Patterns

// components/Box.tsx
import { useRef } from 'react';
import { useFrame } from '@react-three/fiber';
import { Mesh } from 'three';

interface BoxProps {
  position?: [number, number, number];
  color?: string;
  scale?: number;
  rotationSpeed?: number;
  onClick?: () => void;
}

export function Box({
  position = [0, 0, 0],
  color = 'hotpink',
  scale = 1,
  rotationSpeed = 1,
  onClick,
}: BoxProps) {
  const meshRef = useRef<Mesh>(null);

  useFrame((state, delta) => {
    if (meshRef.current) {
      meshRef.current.rotation.y += delta * rotationSpeed;
    }
  });

  return (
    <mesh ref={meshRef} position={position} scale={scale} onClick={onClick}>
      <boxGeometry args={[1, 1, 1]} />
      <meshStandardMaterial color={color} />
    </mesh>
  );
}

2. Compound Components

// components/Player.tsx
import { useRef } from 'react';
import { Group } from 'three';

interface PlayerProps {
  position?: [number, number, number];
  color?: string;
}

export function Player({ position = [0, 0, 0], color = 'blue' }: PlayerProps) {
  const groupRef = useRef<Group>(null);

  return (
    <group ref={groupRef} position={position}>
      {/* Body */}
      <mesh position={[0, 1, 0]} castShadow>
        <boxGeometry args={[1, 2, 1]} />
        <meshStandardMaterial color={color} />
      </mesh>

      {/* Head */}
      <mesh position={[0, 2.5, 0]} castShadow>
        <sphereGeometry args={[0.5, 16, 16]} />
        <meshStandardMaterial color={color} />
      </mesh>

      {/* Arms */}
      <mesh position={[-0.75, 1, 0]} castShadow>
        <boxGeometry args={[0.3, 1.5, 0.3]} />
        <meshStandardMaterial color={color} />
      </mesh>
      <mesh position={[0.75, 1, 0]} castShadow>
        <boxGeometry args={[0.3, 1.5, 0.3]} />
        <meshStandardMaterial color={color} />
      </mesh>
    </group>
  );
}

Read the full file on GitHub · 564 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 564 lines · 24 tokens per session scan A 1638f06f5242

Subscribe to this mod's changes

r3f-component-patterns is a skill published in the GitHub repository bullish0x/GameStudio (12 stars, last pushed 3mo ago), licensed MIT. It adds 24 tokens to every session and 3,507 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

generic-react-feature-developer

Guide feature development for React applications with architecture focus. Covers Zustand/Redux patterns, IndexedDB usage, component systems, lazy loading strategies, and seamless integration. Use when adding new features, refactoring existing code, or planning major changes.

travisjneuman/.claude · 53 tokens

generic-react-ux-designer

Professional UI/UX design expertise for React applications. Covers design thinking, user psychology (Hick's/Fitts's/Jakob's Law), visual hierarchy, interaction patterns, accessibility, performance-driven design, and design critique. Use when designing features, improving UX, solving user problems, or conducting design…

travisjneuman/.claude · 69 tokens

generic-react-code-reviewer

Review React/TypeScript code for bugs, security vulnerabilities, performance issues, accessibility gaps, and CLAUDE.md workflow compliance. Enforces TypeScript strict mode, GPU-accelerated animations, WCAG AA accessibility, bundle size limits, and surgical simplicity. Use when completing features, before commits, or…

travisjneuman/.claude · 71 tokens

generic-react-design-system

Complete design system reference for React applications. Covers colors, typography, spacing, component patterns, glassmorphism effects, GPU-accelerated animations, and WCAG AA accessibility. Use when implementing UI, choosing colors, applying spacing, creating components, or ensuring brand consistency.

travisjneuman/.claude · 59 tokens

nextjs-developer

Use when building Next.js applications with App Router, server components, or server actions. Invoke to configure route handlers, implement middleware, set up API routes, add streaming SSR, write generateMetadata for SEO, scaffold loading.tsx/error.tsx boundaries, or deploy. Triggers on: Next.js, App Router, RSC, use…

ivklgn/ai-kit · 103 tokens

pn-threejs-core

Guides Three.js scenes, cameras, lighting, asset loading, animation, physics, and performance. Use when working on Three.js; covers scene structure, R3F/Drei patterns, WebGPU migration (r171+), TSL shaders, and compute shaders.

perniemann/pnCore · 59 tokens