# Transform Glb To Jsx

> Use this skill whenever the user asks to convert, transform, or generate a React component/JSX file from a 3D GLTF or GLB model asset.

- **Type:** Skill
- **Install:** `agentstack add skill-dor-rondel-agent-skills-transform-glb-to-jsx`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dor-rondel](https://agentstack.voostack.com/s/dor-rondel)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dor-rondel](https://github.com/dor-rondel)
- **Source:** https://github.com/dor-rondel/agent-skills-mcp/tree/main/resources/frontend/transform-glb-to-jsx

## Install

```sh
agentstack add skill-dor-rondel-agent-skills-transform-glb-to-jsx
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 3D Model Transformation Workflow (GLB to JSX)

This skill utilizes `gltfjsx` via `pnpm dlx` to convert 3D `.glb` or `.gltf` assets into optimized React Three Fiber / Drei components matching our React 19 and Three.js stack.

## 🛠️ Prerequisites & Context

- **Source Directory:** Look for input assets typically in `public/` or an asset folder.
- **Target Directory:** Output components should generally go into the application components directory (e.g., `components/` or `app/components/`).
- **Stack Rules:** Ensure generated code uses TypeScript and matches React 19 / Three r170 conventions.

## 🏃‍♂️ Execution Blueprint

### 1. Basic Transformation

To generate a standard TypeScript component from a GLB asset, run:

    pnpm dlx gltfjsx public/models/avatar.glb --types --output components/Avatar.tsx

### 2. Advanced / Optimized Transformation

If the model requires optimization (like Draco compression or texture resizing), append the necessary flags:

    pnpm dlx gltfjsx public/models/avatar.glb --types --transform --output components/Avatar.tsx

---

## 📐 Common Flags Reference

- `--types` or `-t`: Generates TypeScript types (Mandatory for this codebase).
- `--transform` or `-T`: Optimizes the model (isolates meshes, resizes textures, compresses with Draco).
- `--output` or `-o`: Specifies the output filename.
- `--shadows` or `-s`: Injects shadow properties directly onto the generated meshes.

## ⚙️ Post-Transformation Rules

1. **Verify Imports:** Check that the generated file correctly imports hooks from `@react-three/drei` (e.g., `useGLTF`) and `@react-three/fiber`.
2. **Prettier Check:** Immediately run `pnpm format` on the newly generated `.tsx` file to align it with project style guidelines.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dor-rondel](https://github.com/dor-rondel)
- **Source:** [dor-rondel/agent-skills-mcp](https://github.com/dor-rondel/agent-skills-mcp)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dor-rondel-agent-skills-transform-glb-to-jsx
- Seller: https://agentstack.voostack.com/s/dor-rondel
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
