unity-script-roles

Plan Unity script roles to classify classes as MonoBehaviour, ScriptableObject, service, or installer.

1|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/muddyrain/valley-mas --skill unity-script-roles-muddyrain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-script-roles
Source: https://github.com/muddyrain/valley-mas/tree/main/.codex/skills/unity-skills/skills/script-roles
Command: npx skills add https://github.com/muddyrain/valley-mas --skill unity-script-roles-muddyrain

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Unity codebases often suffer from misclassified responsibilities where most scripts become bloated MonoBehaviours. This skill helps you allocate clear roles to MonoBehaviour, ScriptableObject, pure C# services, and installers to improve maintainability and testability.

Core Features & Use Cases

  • Role assignment guidance for common Unity script types (MonoBehaviour, ScriptableObject, service, presenter, installer).
  • Output oriented: a per-script mapping including recommended role, main responsibility, main dependencies, and justification.
  • Use Case: when you have many gameplay scripts and you want to reduce boilerplate and promote clean architecture.

Quick Start

Use the unity-script-roles skill to convert a rough list of scripts into explicit roles for immediate development planning.

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 prevent bloated MonoBehaviours?

To organize Unity scripts and prevent bloated MonoBehaviours, you allocate clear responsibilities to MonoBehaviour, ScriptableObject, pure C# services, and installers. This separation clarifies class duties and improves maintainability.

When should I use a ScriptableObject instead of a MonoBehaviour for gameplay data?

Use a ScriptableObject instead of a MonoBehaviour when a script primarily holds shared data or configuration. Assigning the ScriptableObject role centralizes data management and reduces boilerplate compared to attaching data directly to GameObjects.

What is the best way to plan clean architecture for a Unity project with many gameplay scripts?

The best way to plan clean architecture for Unity projects with many gameplay scripts is to map each script to a specific role. Explicitly defining roles like service or installer reduces dependencies and promotes testability across the codebase.

How do I assign roles to C# scripts in Unity to improve testability?

You assign roles to C# scripts in Unity by generating a per-script mapping that includes the recommended role, main responsibility, and dependencies. Defining pure C# services separate from MonoBehaviours directly improves project testability.

Can I use this approach to separate game logic from Unity's MonoBehaviour lifecycle?

Yes, you can use this approach to separate game logic from Unity's MonoBehaviour lifecycle by designating pure C# services for logic. This role planning ensures MonoBehaviours handle framework interactions while services manage testable gameplay code.

Why does my Unity codebase suffer from misclassified script responsibilities?

Your Unity codebase suffers from misclassified script responsibilities when most gameplay scripts become bloated MonoBehaviours. Planning explicit script roles for installers and services corrects this by clarifying class responsibilities and dependencies.