r3f-scene

r3f-scene is a skill for Claude Code, Codex from frankxai/claude-skills-library. It costs 106 tokens per session (1,958 once invoked), scanned A, original, MIT.

A React Three Fiber recipe for building an interactive 3D scene in a web page. React Three Fiber is a React library for displaying Three.js 3D graphics.

In plain words
What is it for?
Use it for pages with 3D objects, cameras, lighting, models, or interaction where depth and shape are central to the experience.
Why use it?
It limits the cost of 3D by loading the scene only when needed, stopping it when it is off-screen, and providing alternatives when motion or WebGL is unavailable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths.

Good fit Use it for pages with 3D objects, cameras, lighting, models, or interaction where depth and shape are central to the experience.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/frankxai/claude-skills-library/r3f-scene
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 frankxai/claude-skills-library --skill r3f-scene
Clone the repo
git clone --depth 1 https://github.com/frankxai/claude-skills-library

Made for: Claude Code, Codex.

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-scene

README.md
[![agentmods](https://agentmods.dev/badge/skills/frankxai/claude-skills-library/r3f-scene/github.svg)](https://agentmods.dev/skills/frankxai/claude-skills-library/r3f-scene)
Your own site
<a href="https://agentmods.dev/skills/frankxai/claude-skills-library/r3f-scene"><img src="https://agentmods.dev/badge/skills/frankxai/claude-skills-library/r3f-scene/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-scene

Your own site · 80×15
<a href="https://agentmods.dev/skills/frankxai/claude-skills-library/r3f-scene"><img src="https://agentmods.dev/badge/skills/frankxai/claude-skills-library/r3f-scene.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 106 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,958 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.00106 $0.01958
Opus 5.5 $0.00042 $0.00783
Sonnet 5.5 $0.00021 $0.00392
Haiku 4.5 $0.00011 $0.00196

Measured 14d ago against content hash 7dd0cd5d47a8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

r3f-scene 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 14d 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.

packs/web-excellence/skills/r3f-scene/SKILL.md · 190 lines

How it starts

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

R3F scene

A 3D scene is the most expensive surface a page can carry: about 244 kB of JavaScript transferred before the first model, and a render loop that runs until something stops it. This skill builds the scene so the cost is paid late and only while someone is looking.

Run gpu-surface section 1 first. The job sentence must need depth: an object turned in the hand, a space moved through, a structure whose shape is the point. A flat field of colour is a shader-backdrop.

1. Before installing

  • node .claude/skills/web-steward/peer-check.mjs --root . As of 2026-11-12, @react-three/[email protected] declares react >=19 <19.4 and @react-three/[email protected] declares react ^19. A repo on React 18 with R3F 9 installed has an unmet peer: fix that first.
  • three, @react-three/fiber, and @types/three move together. Pin them.
  • Add @react-three/drei only for a helper the scene uses. Add postprocessing only when the job sentence names the effect.

2. Build

use-surface.ts is in gpu-surface section 3.

// components/effects/SceneLayer.tsx
'use client'

import { Canvas, useFrame } from '@react-three/fiber'
import { useRef, type ReactNode } from 'react'
import type { Mesh } from 'three'

type SceneLayerProps = {
  /** Animate only while true: on screen and motion allowed. */
  running: boolean
  children: ReactNode
}

// The only file that imports three or @react-three/*: the whole 3D stack stays in this chunk.
export default function SceneLayer({ running, children }: SceneLayerProps) {
  return (
    <Canvas
      aria-hidden
      dpr={[1, 1.5]}
      frameloop={running ? 'always' : 'demand'}
      camera={{ position: [0, 0, 4.2], fov: 40 }}
      gl={{ antialias: true, alpha: true, powerPreference: 'default' }}
      style={{ position: 'absolute', inset: 0 }}
    >
      {children}
    </Canvas>
  )
}

/** A scene takes time as a value, so the still is a moment someone chose. */
export function Knot({ color, running, stillTime }: { color: string; running: boolean; stillTime: number }) {
  const mesh = useRef<Mesh>(null)
  useFrame(({ clock }) => {
    const t = running ? stillTime + clock.elapsedTime : stillTime
    if (!mesh.current) return
    mesh.current.rotation.x = t * 0.25
    mesh.current.rotation.y = t * 0.4
  })
  return (
    <>
      <ambientLight intensity={0.6} />
      <directionalLight position={[3, 4, 5]} intensity={2.2} />
      <mesh ref={mesh}>
        <torusKnotGeometry args={[0.9, 0.3, 160, 24]} />
        <meshStandardMaterial color={color} metalness={0.85} roughness={0.25} />
      </mesh>
    </>
  )
}

Read the full file on GitHub · 190 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. 14d ago First seen · 190 lines · 106 tokens per session scan A 7dd0cd5d47a8

Subscribe to this mod's changes

r3f-scene is a skill published in the GitHub repository frankxai/claude-skills-library (51 stars, last pushed today), licensed MIT. It adds 106 tokens to every session and 1,958 once invoked, about $0.0004 per session on Opus 5.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-11-16.

Related

r3f-scene compared with skills from other repositories

r3f-scene next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
r3f-scenefrankxai/claude-skills-librarySkill51todayMITA106Claude Code, Codex
prototypevinvcn/mattpocock-skills-zh-CNSkill6.2k5d agoMITA39Claude Code, Codex
shadcn-uichidekina/aria-superpowersSkill21mo agononeA73Claude Code
frontend-designchidekina/aria-superpowersSkill21mo agononeA77Claude Code, Codex
token-saverchidekina/aria-superpowersSkill21mo agononeC85Claude Code, Codex
wayfindervinvcn/mattpocock-skills-zh-CNSkill6.2k5d agoMITA40Claude Code, Codex
migrate-to-shoehornvinvcn/mattpocock-skills-zh-CNSkill6.2k5d agoMITA53Claude Code, Codex