---
name: game-prop-generator
description: >-
  Generate a game-ready 3D prop (treasure chest, barrel, crate, furniture, signage, any
  world decoration) from reference images, end to end inside a connected Roblox Studio
  using Cube 3D mesh generation through the Studio MCP. No Blender, no FBX, no scripts.
  Trigger when the user drops reference images and says things like "build this treasure
  chest", "make this prop for my game", "generate this 3D model in Studio", "create these
  world props", "turn these refs into a Roblox model", or "use our prop generator".
  This skill covers non-avatar props, things that sit in the game world, not on avatars.
  For avatar accessories (hair, hats, wings) use roblox-accessory-generator. For layered
  clothing (shirts, pants) use layered-clothing-creator.
  Generates with Cube 3D, judges by screen capture and iterates to match the refs, places
  the prop at game scale, adds lighting effects for glowing elements, optionally builds
  multi-piece assemblies (e.g. lid + body for animated chests), gates the result, and
  hands off a workspace-ready prop. Never auto-publishes.
---

# Game prop generator (Cube 3D + Studio MCP only)

Turn dropped-in reference images into a **game-ready 3D prop** placed at correct scale
in the connected Studio. Generate with Cube 3D (`generate_mesh`), judge by `screen_capture`
and iterate to match refs, place at game scale, add `PointLight` for any glowing elements,
optionally assemble multi-piece models (separate lid + body for animatable containers),
and deliver a workspace-ready prop with a clean gate.

**This skill is for world props, not avatar items.** No avatar validator constraints,
no WrapLayer cages, no AccessoryType. Higher triangle budgets and free placement.

`reference/prop-spec.md` has the deep reference: scale table, lighting values, multi-piece
patterns, Cube 3D prop prompt craft, emissive material tricks, and PBR upgrade notes.

## Inputs (from the user's message + dropped files)
- **Reference images** (required): the prop from as many angles as available. Read every
  image and lock: prop category, key silhouette, surface materials, color palette, any
  glowing or emissive elements, approximate real-world size.
- **Prop category** (optional): infer from images if unstated. Sets the stud-scale target
  and generation size (table below).
- **Multi-piece?** (optional): if the prop needs an animated part (chest lid that opens,
  door that swings), say so or infer from context. Generates body + animated part as
  separate meshes and assembles them named for TweenService animation.
- **Scale note** (optional): "small loot chest", "boss room chest", "waist height", etc.

## Preflight
1. `list_roblox_studios` → confirm a Studio is connected. If none, ask human to open
   Roblox Studio with the MCP plugin.
2. `get_studio_state` → confirm **Edit mode**. Never generate while play mode is running.

## Hard constraints (game props: no avatar validator, but Roblox engine limits apply)
- **Triangle budget:** up to **8,000** for a detailed hero prop; pass `maxTriangles = 6000`
  for most props (leaves headroom for complexity). Simple/background props: 2000–3000.
- **Texture:** ≤ 2048 × 2048. Cube bakes automatically.
- **Bounding box:** no hard Roblox limit for world props, size to what looks right in the
  game world at avatar scale (see table below).
- **Anchored:** static props should be `Anchored = true`. Physics props: `false`.
- **Collision:** for visual-only props or complex shapes, set `UsePartCollision = false`
  and add a simple invisible `Part` box as the collision volume (snippet D).
- **Emissive glow:** Cube 3D bakes the APPEARANCE of glow into the texture, but doesn't
  make it emit real light. For props with actual glowing elements (neon strips, magical
  eyes, lantern flames), add a `PointLight` inside or adjacent to the glowing surface
  (snippet C). This makes the prop illuminate nearby geometry at runtime.
- **No Scripts** in delivered props, remove any that come from inserted assets.

## Prop scale reference (at R15 avatar scale: ~5 studs tall)
| Prop | Stud size (W × H × D) | Cube 3D `size` | `maxTriangles` |
|---|---|---|---|
| Small loot chest (ankle height) | 2.5 × 2 × 2 | `{x=2.5, y=2, z=2}` | 4000 |
| Standard chest (waist height) | 4 × 3 × 3.5 | `{x=4, y=3, z=3.5}` | 6000 |
| Boss chest / large (chest height) | 6 × 4.5 × 5 | `{x=6, y=4.5, z=5}` | 8000 |
| Barrel / crate (waist) | 2.5 × 3 × 2.5 | `{x=2.5, y=3, z=2.5}` | 3000 |
| Door / gate (full height) | 3.5 × 8 × 0.5 | `{x=3.5, y=8, z=0.5}` | 4000 |
| Sign / plaque | 3 × 2 × 0.3 | `{x=3, y=2, z=0.3}` | 2000 |
| Furniture (chair, table) | 3 × 4 × 3 | `{x=3, y=4, z=3}` | 5000 |

## Procedure
1. **Ingest references.** Read every dropped image. State the locked style target in one
   line: prop name, key visual elements (materials, colors, defining features), any
   glowing parts, and the chosen scale tier.
2. **Generate (Cube 3D).** Craft a tight one-paragraph `textPrompt` (template below).
   Set `size` and `maxTriangles` from the table. Call `generate_mesh`. **Do NOT call
   `wait_job_finished`**, poll the workspace instead.
3. **Locate + measure** (snippet A). Read bounding box + triangle count, frame camera.
4. **Review by looking.** `screen_capture` from front, side, and three-quarter. Compare
   to refs: silhouette match, material read, key detail placement, scale feel.
5. **Iterate.** Refine prompt and regenerate if it misses. Produce **2–4 candidates**
   for hero props; 1–2 for background fillers. Keep the best, delete rejects.
   For multi-piece props (e.g. chest body + lid), generate each piece separately with
   matching prompt aesthetic.
6. **Place at game scale** (snippet B). Move the prop to a clear area of the workspace
   at the correct stud size. Frame the camera at avatar comparison distance.
7. **Add lighting for glowing elements** (snippet C, only if the ref has glow/emission).
   Add a `PointLight` with the correct color and brightness inside or near the glowing
   feature. For neon strips: cyan color, Brightness 2–4, Range 8–12. For magical effects:
   tune to the ref's glow color.
8. **Multi-piece assembly** (snippet D, only if animated prop requested). Name the body
   `PropName_Body` and the lid/door `PropName_Lid`. Position lid on top. Build a `Model`
   parent. Add a `Hinge` or `Motor6D` only if the human explicitly wants animation, 
   otherwise just deliver named parts ready for TweenService.
9. **Collision setup** (snippet E, only for complex shapes). Add an invisible box Part
   matching the prop's footprint as the collision volume.
10. **Gate.** Run the gate check (format below), report PASS/FAIL.
11. **Hand off.** Report full results. Provide publishing steps if the human wants to
    upload as a Roblox model asset. **Never auto-publish.**

## Cube 3D prompt structure for props

Props are different from avatar clothing or hair, you're describing a standalone object,
not something worn on a body.

**Template:**
```
A stylized [prop name] for a [game genre/aesthetic] game.
[Primary shape: overall silhouette, proportions, lid/body/base breakdown].
[Materials: describe each surface — "dark purple-black wooden planks", "gunmetal metal bands",
"polished gold trim", etc. One phrase per distinct material zone].
[Key details: the 2–4 most identifying features — skull face, crystal gem, keyhole, etc.].
[Color palette: dominant colors + any accent/glow colors].
[Glow note if applicable: "glowing cyan eye sockets", "warm golden light seam"].
Solid closed prop, no interior geometry visible. Game-ready low-poly stylized 3D model,
clean readable silhouette, strong thumbnail read.
```

**Verified prompts (these refs):**

*Monster chest (dark fantasy):*
```
A stylized demonic treasure chest for a dark fantasy game.
Dark purple-black weathered wooden plank body with a slightly domed lid. Gunmetal dark metal
reinforcement bands running horizontally and vertical corner brackets. Center front features a
large stylized skull face emblem: angular glowing cyan eye sockets, three bottom tusk fangs,
a keyhole nose mouth. Diamond-shaped cyan crystal gem set above the skull. A thin horizontal
neon cyan light strip wrapping around the chest at the lid seam. Curved demon horns emerging
from the top corners. Spiked claws at the bottom front corners.
Dark purple-black base, gunmetal accents, glowing cyan details.
Solid closed chest, no interior. Stylized game-ready low-poly 3D prop, strong silhouette.
```
size = `{x=4, y=3, z=3.5}`  maxTriangles = 6000

*Standard loot chest (classic fantasy):*
```
A stylized classic treasure chest for a fantasy RPG game.
Warm medium-brown horizontal wooden planks with a curved dome-top lid. Bright polished gold
metal trim bands arching over the dome, gold corner L-bracket reinforcements and small bolt-
foot bases. Center front has a large ornate octagonal gold lock plate with a small faceted
blue diamond gem at center and a traditional keyhole below. A subtle warm golden light glow
along the horizontal lid seam. A round ring handle on the right side.
Warm brown wood, bright gold metal, blue gem accent.
Solid closed chest, no interior. Stylized game-ready low-poly 3D prop, strong silhouette.
```
size = `{x=4, y=3, z=3.5}`  maxTriangles = 6000

## Luau snippets (run via `execute_luau`)

**A, locate + measure the latest generation, frame the camera:**
```lua
local target
for _, c in ipairs(workspace:GetChildren()) do
	if c:IsA("Model") and c:FindFirstChildWhichIsA("MeshPart", true) then target = c
	elseif c:IsA("MeshPart") then target = c end
end
local mp = target:IsA("MeshPart") and target or target:FindFirstChildWhichIsA("MeshPart", true)
local cf, size
if target:IsA("Model") then cf, size = target:GetBoundingBox() else cf, size = CFrame.new(mp.Position), mp.Size end
local tris = "?"
local ok, em = pcall(function() return game:GetService("AssetService"):CreateEditableMeshAsync(mp.MeshContent) end)
if ok and em then local f = em:GetFaces(); if f then tris = tostring(#f) end end
local cam = workspace.CurrentCamera
cam.CFrame = CFrame.lookAt(cf.Position + Vector3.new(0, size.Y * 0.5, math.max(size.X, size.Z) * 3), cf.Position)
return string.format("name=%s size=%.2f,%.2f,%.2f tris=%s meshId=%s",
	mp.Name, size.X, size.Y, size.Z, tris, mp.MeshId)
```

**B, place prop at game scale and rename for clarity:**
```lua
-- Swap propName and targetSize to match the generation
local propName = "MonsterChest"       -- swap per prop
local targetSize = Vector3.new(4, 3, 3.5)  -- swap per table

local target
for _, c in ipairs(workspace:GetChildren()) do
	if c:IsA("Model") and c:FindFirstChildWhichIsA("MeshPart", true) then target = c end
end
local mp = target:FindFirstChildWhichIsA("MeshPart", true)

-- Scale to target size
local cf, currentSize = target:GetBoundingBox()
local scaleFactor = math.min(targetSize.X/currentSize.X, targetSize.Y/currentSize.Y, targetSize.Z/currentSize.Z)
mp.Size = mp.Size * scaleFactor

-- Anchor and place
mp.Anchored = true
mp.CanCollide = true
mp.CastShadow = true
mp.Name = "Handle"
target.Name = propName
target:PivotTo(CFrame.new(0, targetSize.Y / 2, 0))  -- place at ground level

local cam = workspace.CurrentCamera
cam.CFrame = CFrame.lookAt(Vector3.new(8, targetSize.Y, 8), target:GetPivot().Position)
return string.format("placed %s size=%.2fx%.2fx%.2f anchored=true", propName, targetSize.X, targetSize.Y, targetSize.Z)
```

**C, add PointLight for glowing elements (use only when ref has real glow/emission):**
```lua
-- Tune color, brightness, and range to match the ref's glow
-- Cyan neon (monster chest eyes/strip): Color=0,255,255  Brightness=3  Range=10
-- Warm gold (standard chest seam): Color=255,200,80  Brightness=1.5  Range=6
-- Purple magic: Color=180,80,255  Brightness=2  Range=8

local glowColor = Color3.fromRGB(0, 255, 255)  -- swap to match ref
local brightness  = 3                            -- 1=dim, 5=blinding
local range       = 10                           -- studs of light reach

local propModel = workspace:FindFirstChild("MonsterChest")  -- swap name
local mp = propModel and propModel:FindFirstChildWhichIsA("MeshPart", true)
if not mp then return "prop not found" end

local pt = mp:FindFirstChild("GlowLight") or Instance.new("PointLight")
pt.Name = "GlowLight"
pt.Color = glowColor
pt.Brightness = brightness
pt.Range = range
pt.Shadows = true
pt.Parent = mp
return string.format("PointLight added color=(%d,%d,%d) brightness=%.1f range=%d",
	math.floor(glowColor.R*255), math.floor(glowColor.G*255), math.floor(glowColor.B*255),
	brightness, range)
```

**D, multi-piece assembly (body + lid, named for TweenService animation):**
```lua
-- Run AFTER generating body and lid as separate meshes.
-- The body should already be placed via snippet B (named PropName_Body).
-- The lid is the most recent Cube 3D generation in workspace.
local bodyModel = workspace:FindFirstChild("MonsterChest_Body")  -- swap name
local body = bodyModel and bodyModel:FindFirstChildWhichIsA("MeshPart", true)

local lidTarget
for _, c in ipairs(workspace:GetChildren()) do
	if c:IsA("Model") and c:FindFirstChildWhichIsA("MeshPart", true) and c ~= bodyModel then lidTarget = c end
end
local lid = lidTarget and lidTarget:FindFirstChildWhichIsA("MeshPart", true)
if not (body and lid) then return "body or lid not found" end

-- Scale lid to match body width/depth
local _, bodySize = bodyModel:GetBoundingBox()
lid.Size = Vector3.new(bodySize.X * 0.95, lid.Size.Y, bodySize.Z * 0.95)
lid.Anchored = true
lid.Name = "Lid"
lidTarget.Name = "MonsterChest_Lid"  -- swap name

-- Position lid flush on top of body
local bodyTop = bodyModel:GetPivot().Position + Vector3.new(0, bodySize.Y/2, 0)
lidTarget:PivotTo(CFrame.new(bodyTop.X, bodyTop.Y + lid.Size.Y/2, bodyTop.Z))

-- Build parent model
local prop = Instance.new("Model")
prop.Name = "MonsterChest"  -- swap name
bodyModel.Parent = prop; lidTarget.Parent = prop
prop.Parent = workspace

return string.format("assembled %s: body=%.2fx%.2fx%.2f lid=%.2fx%.2fx%.2f",
	prop.Name, bodySize.X, bodySize.Y, bodySize.Z, lid.Size.X, lid.Size.Y, lid.Size.Z)
```

**E, add invisible box collision for complex mesh shapes:**
```lua
-- Only needed when MeshPart.UsePartCollision gives bad physics collisions
local propModel = workspace:FindFirstChild("MonsterChest")  -- swap name
local _, size = propModel:GetBoundingBox()
local pivot = propModel:GetPivot()

local col = Instance.new("Part")
col.Name = "CollisionBox"
col.Size = size
col.CFrame = pivot
col.Transparency = 1
col.Anchored = true
col.CanCollide = true
col.CanTouch = true
col.CastShadow = false
col.Parent = propModel

-- Disable mesh collision on the visual MeshPart
local mp = propModel:FindFirstChildWhichIsA("MeshPart", true)
if mp then mp.CanCollide = false end

return string.format("collision box added size=%.2fx%.2fx%.2f", size.X, size.Y, size.Z)
```

## Pre-publish GATE (report PASS/FAIL per line)
```
[GATE:PROP] PASS mesh_found name=MonsterChest parts=1 scripts=0
[GATE:PROP] PASS triangles tris=5840 limit=6000
[GATE:PROP] PASS scale size=4.0x3.0x3.5 target=4x3x3.5
[GATE:PROP] PASS anchored anchored=true (static prop)
[GATE:PROP] PASS lighting pointLight=GlowLight color=cyan brightness=3 range=10
[GATE:PROP] PASS collision canCollide=true (or collisionBox present)
[GATE:PROP] PASS texture textureId=rbxassetid://... present=true
```

## Report (what you hand back)
- Studio readiness + Edit mode confirmation + reference angles ingested.
- Locked style target: prop name, scale tier, glowing elements detected.
- The Cube 3D `textPrompt`(s), `size`, `maxTriangles` used; candidates with reference-match
  verdict and which was kept.
- Final mesh facts: triangle count, stud size, anchored state, lighting added.
- `screen_capture`s, bare mesh at ref angles, placed in scene at avatar comparison scale,
  and (if glow added) with PointLight active.
- For multi-piece: parts list with names and relative positions.
- The GATE block, verbatim.
- Reference-match self-critique + top 1–2 things human might redirect.
- Publishing steps if requested (Save to Roblox as a Model asset).

## Publishing as a Roblox model asset (optional human step)
1. The prop Model is in the place workspace with the correct name.
2. Right-click the Model in Explorer → Save to Roblox → Model → fill in name/description.
3. For game use: just leave it in the place, no upload required.
4. For the Creator Store (free or paid): Roblox will review it for policy compliance.
   (No submission fee for free models; paid models have a listing fee.)

## What this skill does NOT do
- **Avatar items:** use `roblox-accessory-generator` (rigid) or `layered-clothing-creator` (LC).
- **Animated props:** delivers named parts + positioning for TweenService; does NOT wire
  the actual TweenService animation, that's a gameplay script task, not a prop task.
- **PBR surface detail:** Cube 3D bakes one texture. For SurfaceAppearance + roughness/normal
  maps, use the `asset-pack-importer` skill after generating the base mesh.
- **No auto-publish.** Always stops at the human gate.

## Cross-surface install
Self-contained, works in **Claude Code** (auto-discovered) and **Claude Desktop** (add
this `game-prop-generator` folder as a Skill in Settings → Capabilities → Skills).
