unity-script-roles

Assign Unity script roles like MonoBehaviour, ScriptableObject, or pure C# service.

Updated Mar 30, 2026
One-click install
npx skills add https://github.com/krl76/MP-Study-Projects --skill unity-script-roles-krl76
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-script-roles
Source: https://github.com/krl76/MP-Study-Projects/tree/main/Practice1/.codex/skills/unity-skills/skills/script-roles
Command: npx skills add https://github.com/krl76/MP-Study-Projects --skill unity-script-roles-krl76

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unity projects often drift into monolithic script classes due to default usage of MonoBehaviour. This Skill helps plan and assign explicit script roles to improve architecture and maintainability.

Core Features & Use Cases

  • Determine whether a script should be MonoBehaviour, ScriptableObject, a pure C# service, a presenter, an installer, or a state object.
  • Use during architecture planning, feature previews, and refactoring to prevent role ambiguity and sprawl.
  • Output actionable role recommendations including primary responsibility and core dependencies.

Quick Start

Create a role map for each script to assign the appropriate Unity ownership (MonoBehaviour, ScriptableObject, service, presenter, installer).

Frequently Asked Questions about unity-script-roles

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

FAQPage Schema
How do I organize Unity scripts to avoid making every class a MonoBehaviour?

To organize Unity scripts and avoid overusing MonoBehaviour, you can assign explicit class roles such as pure C# services, presenters, or installers during architecture planning. This prevents monolithic scripts and clarifies class responsibilities.

When should I use ScriptableObject instead of MonoBehaviour in Unity architecture?

You should use ScriptableObject instead of MonoBehaviour when planning script roles for data containers or shared configurations. Evaluating script ownership during design time helps distinguish data-centric ScriptableObjects from scene-bound MonoBehaviours.

What is the best way to plan Unity script responsibilities during refactoring?

The best way to plan Unity script responsibilities during refactoring is to generate a structured role map. This map specifies each script's recommended role, main responsibility, dependencies, and justification to guide the implementation.

How do I determine if a Unity script should be a pure C# service or a presenter?

To determine if a Unity script should be a pure C# service or a presenter, analyze its dependencies and main responsibility. Architecture planning clarifies whether a script requires Unity lifecycle hooks or functions better as framework-agnostic logic.

Can I use pure C# classes for game logic instead of MonoBehaviour in Unity?

Yes, you can use pure C# service classes for game logic instead of MonoBehaviour. By assigning explicit script roles during architecture planning, you can separate framework-agnostic logic from Unity's lifecycle components to improve maintainability.

Does Unity require MonoBehaviour for all gameplay scripts?

No, Unity does not require MonoBehaviour for all gameplay scripts. You can assign roles like pure C# services, presenters, or installers to reduce role ambiguity and prevent monolithic class sprawl in your project architecture.