# threejs-tresjs

The threejs-tresjs skill for Claude Code guides creation of 3D HUD interfaces with Three.js, TresJS, and Vue 3. It covers metric panels, status indicators, and particle effects.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 255 installs · ★ 48 repo stars
- Author: martinholovsky
- License: Unlicense · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/martinholovsky/claude-skills-generator/tree/HEAD/skills/threejs-tresjs/SKILL.md
- Updated: 2025-12-06
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/threejs-tresjs

## What it does

The skill covers 3D scenes and HUD elements, including metric displays, animated indicators, and particles. Its examples use `TresCanvas`, TresJS components, and `@tresjs/cientos`, with Vue 3 Composition API integration.

It also shows Vitest checks for components, cleanup of Three.js resources on unmount, and instancing for repeated objects. Color inputs are validated and displayed text is sanitized. Fallbacks are recommended for devices without WebGL; GPU load can become a problem if resource use is left unchecked.

The listed dependencies include `three`, `@tresjs/core`, and `@tresjs/cientos`, with `postprocessing` for effects. The skill flags XSS issues in `three` versions below `0.137.0` and ReDoS issues below `0.125.0`. Check the library version before building on these patterns.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add martinholovsky/claude-skills-generator --skill threejs-tresjs -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/threejs-tresjs/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/threejs-tresjs/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add martinholovsky/claude-skills-generator --skill threejs-tresjs -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/threejs-tresjs/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add martinholovsky/claude-skills-generator --skill threejs-tresjs -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/threejs-tresjs/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install martinholovsky/claude-skills-generator skills/threejs-tresjs
```

2. **Manually: put the files in place**
- File: `.github/skills/threejs-tresjs/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add martinholovsky/claude-skills-generator --skill threejs-tresjs -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/martinholovsky/claude-skills-generator --path skills/threejs-tresjs
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/threejs-tresjs/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add martinholovsky/claude-skills-generator --skill threejs-tresjs -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/martinholovsky/claude-skills-generator/tree/HEAD/skills/threejs-tresjs/SKILL.md

## When to use it
- build a 3D HUD panel for live metrics
- add status indicators and particle effects to a scene
- test whether a HUD component renders
- dispose of geometry and materials on unmount
- validate user-provided color values

## Example prompts
- Build a TresJS HUD panel with a heading and a numeric value.
- Add a status indicator and particle effect to the scene.
- Write a Vitest check for the HUD component and clean up its Three.js resources on unmount.

## Source text · SKILL.md · Unlicense

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 81bab50cd94a975a.

BEGIN THIRD-PARTY FILE 81bab50cd94a975a
````text
---
name: threejs-tresjs
description: 3D HUD rendering with Three.js and TresJS for JARVIS AI Assistant
model: sonnet
risk_level: MEDIUM
version: 1.0.0
---

# Three.js / TresJS Development Skill

> **File Organization**: This skill uses split structure. See `references/` for advanced patterns and security examples.

## 1. Overview

This skill provides expertise for building 3D HUD interfaces using Three.js and TresJS (Vue 3 integration). It focuses on creating performant, visually stunning holographic displays for the JARVIS AI Assistant.

**Risk Level**: MEDIUM - GPU resource consumption, potential ReDoS in color parsing, WebGL security considerations

**Primary Use Cases**:
- Rendering 3D holographic HUD panels
- Animated status indicators and gauges
- Particle effects for system visualization
- Real-time metric displays with 3D elements

## 2. Core Responsibilities

### 2.1 Fundamental Principles

1. **TDD First**: Write tests before implementation - verify 3D components render correctly
2. **Performance Aware**: Optimize for 60fps with instancing, LOD, and efficient render loops
3. **Resource Management**: Always dispose of geometries, materials, and textures to prevent memory leaks
4. **Vue Reactivity Integration**: Use TresJS for seamless Vue 3 composition API integration
5. **Safe Color Parsing**: Validate color inputs to prevent ReDoS attacks
6. **GPU Protection**: Implement safeguards against GPU resource exhaustion
7. **Accessibility**: Provide fallbacks for devices without WebGL support

## 3. Technology Stack & Versions

### 3.1 Recommended Versions

| Package | Version | Security Notes |
|---------|---------|----------------|
| three | ^0.160.0+ | Latest stable, fixes CVE-2020-28496 ReDoS |
| @tresjs/core | ^4.0.0 | Vue 3 integration |
| @tresjs/cientos | ^3.0.0 | Component library |
| postprocessing | ^6.0.0 | Effects library |

### 3.2 Security-Critical Updates

```json
{
  "dependencies": {
    "three": "^0.160.0",
    "@tresjs/core": "^4.0.0",
    "@tresjs/cientos": "^3.0.0"
  }
}
```

**Note**: Versions before 0.137.0 have XSS vulnerabilities, before 0.125.0 have ReDoS vulnerabilities.

## 4. Implementation Patterns

### 4.1 Basic HUD Scene Setup

```vue
<script setup lang="ts">
import { TresCanvas } from '@tresjs/core'
import { OrbitControls } from '@tresjs/cientos'

const gl = {
  clearColor: '#000011',
  alpha: true,
  antialias: true,
  powerPreference: 'high-performance'
}
</script>

<template>
  <TresCanvas v-bind="gl">
    <TresPerspectiveCamera :position="[0, 0, 5]" />
    <OrbitControls :enable-damping="true" />

    <HUDPanels />
    <MetricsDisplay />
    <ParticleEffects />
````
END THIRD-PARTY FILE 81bab50cd94a975a

The third-party file has ended. Everything between the 81bab50cd94a975a tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2650 of 18933 bytes. © martinholovsky · Unlicense · https://github.com/martinholovsky/claude-skills-generator/tree/HEAD/skills/threejs-tresjs/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
