# Nighty Blender skill

Rules for AI apps that make 3D models in Blender through the Nighty Blender MCP tools: the local AI makes every new model, after one question to the person; everything is checked before it is called done.

## Save this file as a skill / rules file for your AI app

- Codex: append it to AGENTS.md in your project, or to ~/.codex/AGENTS.md for every project.
- Cursor: save it as .cursor/rules/nighty-blender.mdc (start it with a front matter that has a description).
- Gemini CLI: append it to GEMINI.md in your project, or to ~/.gemini/GEMINI.md.
- Windsurf: save it in .windsurf/rules/ (e.g. .windsurf/rules/nighty-blender.md).
- Claude Code: the Nighty Blender plugin already has these rules; without it, append this to CLAUDE.md.
- Any other app: add it to its rules or system prompt file.

It needs the Nighty Blender MCP server and the Blender addon (set up with https://nightkilleryt.com/tools/blender/ai-setup.txt).

## The first rule

- Never build a model by hand in code on your own. A new model always goes: `asset_options` -> ask the person -> the picture, shown -> `make_asset`.
- Building in code (`search_examples` + `run_python` modelling) only when the person asks for it in their own words ("build it in code", "model it by hand").
- No local AI yet? Offer it: `engine_check`, show its plan (files, sizes, licenses), `engine_setup` only after a yes. Or the person's own 3D-service key (Nighty panel). Never fall back to code by yourself.
- Edits on a generated model (move a part, recolor, a decal, fix a spot): the step tools. `run_python` only for a small fix the person asked for.

## How to make a model

1. `status` (is the engine ready?) and `scene_info`.
2. Ask first, every time: `asset_options` with ask: true and your best guesses in choice (made_for from the request; Roblox gets 15,000 triangles and 1K maps). In AI apps that show forms, the person picks in a list and you get their options back; otherwise send the person its `question` as ONE message, as it is, and wait. It covers mesh, the exact triangle count, textures, size, made for, colors, quality (with times), views and versions.
3. Picture first: the person gave a picture -> use it. Words only -> `generate_image`, show it ("This is what I'll turn into 3D: OK?") and wait; make another if they say no. Views 4, 6 or 8: make_asset first stops with the views sheet; show it, and on the person's OK call make_asset again with the same options and views_ok: true.
4. `make_asset` with the picture and `on_ok` from step 2 (or their changes in options: faces is the exact triangle count, quality, versions), confirmed: true. It answers with a job: `wait_job` until done. Without confirmed it refuses and answers with the question: ask it.
5. Versions 2-4: it stops with one preview per version (also side by side in Blender). Show them, ask which one, then `make_asset` with `pick`: only that one is finished; the others are removed.
6. `look` at the result (mode material, view hero) and tell the person the `mesh` line. Fix single steps with the step tools (`clean_colors`, `bake`, `assign_materials`, `add_decal`, `retopo`, `export_asset`).
7. Every change is one undo step named "AI: ..."; `undo` takes back only your own steps. Slow tools give a job id: `wait_job`.

Quality: Balanced is the default; Max is experimental (more detail, colors can drift, slower). Messy AI colors: make_asset cleans them (colors auto); by hand `clean_colors`, then `bake` again.

## Only when the person asks you to build in code

- Guides, read once then: MCP resources nighty-blender://guide/workflow (its last part), /library, /topology, /hard-surface, /props, /organic, /texturing, /blender-api (or `get_guide { topic }`).
- `search_examples` with the style for something close; adapt its code in `run_python` (`import nighty as n`). Safe level (the default): modelling only (`bpy`, `bmesh`, `mathutils`, `math`, `random`, `nighty`); files, other programs, the internet and settings are off. A refused call says the person can switch to 'full' in the Nighty panel.
- The loop: one part or a few (`n.settings(detail, size)` first; meters, Z up, front -Y), `verify_mesh` (fix every error), `measure`, `look`, fix; done: `verify_mesh` on all parts, the studio look, `finish_asset`.
- The bar: silhouette first, secondary forms that step out of each other, a few strong details, value contrast, bevels on every visible edge (never 8-sided visible cylinders), real proportions, parts touching. Game budget: props 2000-12000 triangles, weapons up to 20000 (one Roblox mesh).
- Library in one breath: shapes (`box`, `rounded_box`, `cylinder`, `tube`, `lathe`, `extrude`, `spline`), finish (`bevel`, `mark_bevel`, `chamfer`, `chunky`, `boolean_cut`, `panel_cut`, `vents`), detail kit (`inset`, `plate`, `grille`, `groove`, `bolts_along`), place (`align`, `snap`, `place_on`), surfaces (`surface`, `paint`), checks (`verify`, `measure`).
