.claude/skills/three-component/SKILL.md
Create a React Three Fiber 3D component for the Kardashev Network visualization
npx skillsauth add tadams95/kardashev-network three-componentInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a new 3D component: $ARGUMENTS
src/components/three/
├── SunScene.tsx # Main R3F canvas + scene setup
├── Sun.tsx # 3D sun with corona shader
├── EnergyParticles.tsx # Particle system for energy rays
├── CloudLayer.tsx # Animated cloud coverage
├── Ground.tsx # Ground plane receiving energy
├── InteractiveCamera.tsx # Mouse parallax camera controls
└── StatsOverlay.tsx # Click-to-reveal energy stats
// src/components/three/ComponentName.tsx
import React, { useRef } from "react";
import { useFrame } from "@react-three/fiber";
import * as THREE from "three";
interface ComponentNameProps {
// Data-driven props
intensity?: number;
color?: string;
// Position/transform props
position?: [number, number, number];
scale?: number;
}
export function ComponentName({
intensity = 1,
color = "#ffffff",
position = [0, 0, 0],
scale = 1,
}: ComponentNameProps) {
const meshRef = useRef<THREE.Mesh>(null);
// Animation loop
useFrame((state, delta) => {
if (meshRef.current) {
// Example: rotate based on time
meshRef.current.rotation.y += delta * 0.5;
}
});
return (
<mesh ref={meshRef} position={position} scale={scale}>
<sphereGeometry args={[1, 32, 32]} />
<meshStandardMaterial color={color} emissive={color} emissiveIntensity={intensity} />
</mesh>
);
}
// src/components/three/SunScene.tsx
import React, { Suspense } from "react";
import { Canvas } from "@react-three/fiber";
import { OrbitControls, Environment } from "@react-three/drei";
import { EffectComposer, Bloom } from "@react-three/postprocessing";
interface SunSceneProps {
ghi: number; // Solar irradiance W/m²
cloudCover: number; // 0-100%
isDay: boolean;
}
export function SunScene({ ghi, cloudCover, isDay }: SunSceneProps) {
return (
<Canvas camera={{ position: [0, 0, 10], fov: 50 }}>
<Suspense fallback={null}>
<ambientLight intensity={0.2} />
<pointLight position={[0, 0, 0]} intensity={ghi / 500} />
{/* 3D Components */}
<Sun intensity={ghi / 1000} />
<EnergyParticles density={ghi / 100} />
<CloudLayer opacity={cloudCover / 100} />
<Ground />
{/* Post-processing */}
<EffectComposer>
<Bloom luminanceThreshold={0.5} intensity={1.5} />
</EffectComposer>
{/* Controls */}
<OrbitControls enableZoom={false} enablePan={false} />
</Suspense>
</Canvas>
);
}
| Data Point | Animation Effect |
|------------|------------------|
| ghi (irradiance) | Sun glow intensity, particle density |
| cloudCover | Cloud layer opacity, sun dimming |
| isDay | Day/night scene transition |
| currentValue | Energy beam thickness, particle speed |
// Mouse parallax example
import { useThree } from "@react-three/fiber";
function InteractiveCamera() {
const { camera } = useThree();
useFrame(({ mouse }) => {
camera.position.x = THREE.MathUtils.lerp(camera.position.x, mouse.x * 2, 0.05);
camera.position.y = THREE.MathUtils.lerp(camera.position.y, mouse.y * 2, 0.05);
camera.lookAt(0, 0, 0);
});
return null;
}
useInstancedMesh for many similar objectswindow.innerWidth for mobile optimizationssrc/components/three/useFrame for animationsdevelopment
Web3 integration with wagmi and viem - wallet connection, contract interactions, transactions, RainbowKit. Use when implementing wallet features, reading/writing contracts, or handling blockchain transactions.
content-media
Three.js textures - loading, configuration, UV mapping, environment maps. Use when loading images, configuring texture properties, or working with HDR environments.
data-ai
Three.js shaders - GLSL, ShaderMaterial, uniforms, custom effects. Use when creating custom visual effects, modifying vertices, writing fragment shaders, or extending built-in materials.
testing
Three.js post-processing - EffectComposer, bloom, depth of field, custom passes. Use when adding visual effects, screen-space effects, or enhancing rendered output.