unity-script-roles

Assigns Unity classes to MonoBehaviour, ScriptableObject, or plain C# roles.

Updated Jun 21, 2026
One-click install
npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-script-roles-du-qwq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-script-roles
Source: https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications/tree/main/.agents/skills/unity-skills/skills/script-roles
Command: npx skills add https://github.com/du-qwq/Shader-Writing-Architecture-and-Specifications --skill unity-script-roles-du-qwq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When generating gameplay code, AI tends to make every class a MonoBehaviour, producing tangled responsibilities and poor architecture. This Skill turns a rough script list into explicit role assignments before any code is written. ## Core Features & Use Cases - Role Assignment: Recommends whether each class should be a MonoBehaviour bridge, ScriptableObject config, pure C# service, presenter, state node, or installer. - Structured Output: For each script it lists the recommended role, main responsibility, main dependencies, and why that role fits better than alternatives. - Use Case: Before creating a batch of gameplay scripts, paste your planned class list and get a role breakdown so runtime state stays in plain C# objects and only scene-attached bridges become MonoBehaviours. ## Quick Start Ask the AI to review your planned Unity script list and assign each class a role such as MonoBehaviour, ScriptableObject, or plain C# service.

Frequently Asked Questions about unity-script-roles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide between MonoBehaviour and plain C# in Unity?

Use MonoBehaviour only for classes that must attach to GameObjects and receive Unity lifecycle callbacks. Keep domain logic, services, and runtime state in plain C# classes so they stay testable and independent of the scene graph.

When should I use ScriptableObject in Unity?

Use ScriptableObject for shared configuration and static data assets that benefit from editor serialization. Avoid it for runtime-only state, which belongs in memory-only plain C# objects.

How to split responsibilities across Unity script types?

List your planned scripts, then assign each one a role: MonoBehaviour bridge, ScriptableObject config, pure C# service, presenter, state node, or installer. Document each class's main responsibility and dependencies before writing code.

Why is making every class a MonoBehaviour a problem?

Making everything a MonoBehaviour couples logic to the scene graph, blocks unit testing, and hides dependencies. Separating roles keeps domain code in plain C# and limits MonoBehaviours to engine-facing bridges.

Can ScriptableObject store runtime game state?

It can, but this skill advises against it. Runtime state should live in memory-only plain C# objects; ScriptableObject is reserved for configuration and data assets, avoiding stale serialized state between sessions.