skills/unity-code/SKILL.md
Unified Unity runtime C# coding skill — write, extend, or refactor runtime code using code-standards as the single source of truth for patterns and conventions. Integrates with Unity MCP for mandatory console verification after every code change. Auto-triages: Quick (single-file MonoBehaviour, ScriptableObject, interface, enum, struct, helper), Deep (multi-file features, services, state machines, refactors spanning 2+ classes). MUST use for ANY Unity runtime code request — creating scripts, adding components, implementing features, building systems, refactoring, or cleanup. Triggers: "write a script," "add a component," "build a system," "implement feature," "refactor," "clean up," "simplify." Do not use for performance optimization (unity-optimize), Editor scripts (unity-editor), UI Toolkit (unity-uitoolkit), tests (unity-test-unit), or debugging (unity-debug).
npx skillsauth add cuozg/oh-my-skills unity-codeInstall 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.
Detect scope, load code-standards, discover local patterns, implement complete runtime code, verify via Unity console.
| Signal | Mode |
|--------|------|
| One .cs file, narrow runtime edit, single component/type | Quick |
| 2+ files, new feature/system, cross-class refactor | Deep |
| "Clean up," "simplify," behavior unchanged | Quick or Deep (by file count) |
State triage: "This is [mode] — [reason]."
read_skill_file("unity-code", "references/reference-routing.md") — identifies 1–3 code-standards files for this taskread_skill_file("unity-code", "references/quick-mode.md") or references/deep-mode.mdread_skill_file("unity-standards", "references/code-standards/<file>.md")read_skill_file("unity-standards", "references/other/unity-mcp-routing-matrix.md")Code-standards = single source of truth for all patterns, naming, conventions. Mode reference = procedural workflow only.
Before writing any code, read target file + 1–2 nearby files. Capture:
Company.Project.Feature)_camelCase vs m_camelCase)[SerializeField] vs [field: SerializeField] auto-props)Awake() GetComponent vs lazy properties)[Inject], Inspector drag-drop)Local style wins. Match what neighboring files do.
After every code change:
lsp_diagnostics on all changed filesUnity.ReadConsole via Unity MCPFallbacks: MCP only → note LSP limitation · LSP only → note "Console verification unavailable — verify in Unity Editor" · Both unavailable → manual review, note both limitations.
Never declare complete without console verification or explicit fallback note.
TODO, stubs, or half-wired code| To | When |
|----|------|
| unity-editor | Target is editor domain |
| unity-optimize | User wants performance optimization |
| Quick → Deep | Work requires a second file |
| Deep → Quick | Plan reveals single-file scope |
tools
Generate Unity raster image assets through Unity MCP: game sprites, item art, backgrounds, UI icons, portraits, concept images, transparent cutouts, image edits, upscales, background removal, and Unity scene or Game View screenshots. Use when a Unity project needs image files imported under Assets or screenshots captured from the editor. Do not use for meshes, audio, animation, materials, gameplay code, UI Toolkit layout, or generic non-Unity image generation.
tools
Create Unity technical solution documents from user requirements, feature ideas, bug goals, specs, or codebase problems. Use when the user asks for a technical approach, architecture, implementation strategy, solution options, feasibility analysis, system design, or "how should we build/fix this" for Unity runtime, Editor, tools, assets, data, UI, WebGL, SDKs, or production pipelines.
tools
Orchestrate Unity Editor via MCP (Model Context Protocol) tools and resources. Use when working with Unity projects through MCP for Unity - creating/modifying GameObjects, editing scripts, managing scenes, running tests, or any Unity Editor automation. Provides best practices, tool schemas, and workflow patterns for effective Unity-MCP integration.
development
Convert a spec document into an implementation TODO list in the same spec folder. U se when the user says goal-todo, todo from spec, generate tasks from spec, turn this spec into todos, create implementation checklist, extract tasks, or asks to read a Docs/Specs design doc and produce what must be implemented. Includes UI/UX review and codebase investigation before writing the checklist. Do not use for implementing the tasks, creating new goal files, writing test cases, or verifying completed work.