unity-architecture

Advise on Unity gameplay and system architecture for code organization and refactoring.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/Rayzerrek/dotfiles --skill unity-architecture-rayzerrek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-architecture
Source: https://github.com/Rayzerrek/dotfiles/tree/main/.pi/agent/skills/unity-skills/skills/architecture
Command: npx skills add https://github.com/Rayzerrek/dotfiles --skill unity-architecture-rayzerrek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you decide how to structure Unity gameplay and system code before you build, so responsibilities stay clear and the project does not become tightly coupled.

Core Features & Use Cases

  • Module Planning: Splits gameplay into small, understandable modules with clear boundaries.
  • Initialization & Update Rules: Calls out explicit startup order and guard clauses to prevent hidden timing bugs.
  • Data and Communication Guidance: Helps choose whether data belongs in scene objects, ScriptableObjects, interfaces, events, commands, or plain C# classes.
  • Use Case: Use it when you are refactoring a prototype into a maintainable game architecture or deciding how to compose a scene bootstrap flow.

Quick Start

Ask for a Unity architecture recommendation for your project scope, and include the gameplay loop, current pain points, and any constraints around scenes, data, and performance.

Frequently Asked Questions about unity-architecture

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

FAQPage Schema
How do I structure Unity gameplay code to prevent tight coupling?

The best Unity architecture for small games uses the smallest structure that fits the project scope, relying on plain C# classes, ScriptableObjects for data, and simple communication patterns rather than over-engineering with heavy frameworks.

How do I fix hidden timing bugs during Unity scene initialization?

Fix Unity scene initialization bugs by establishing an explicit startup order and using update guard clauses. This prevents hidden timing issues by ensuring clear data ownership and controlled execution flow during bootstrap.

When should I use ScriptableObjects versus plain C# classes for data in Unity?

Use ScriptableObjects in Unity for shared data assets, and plain C# classes for localized logic or state. Architecture decisions depend on module boundaries, ensuring clear data ownership across scene objects, interfaces, and events.

How do I refactor a Unity prototype into a maintainable game architecture?

Refactor a Unity prototype by defining module boundaries, applying SOLID structure, and choosing decoupling strategies. Establish clear data ownership and simple communication patterns to transition from prototype to maintainable project.

Does this Unity architecture guidance apply to long-lived projects?

Yes, this Unity architecture guidance applies to long-lived projects by recommending SOLID structure, clear data ownership, and explicit update guards. It scales from prototypes to long-lived projects by choosing the smallest architecture that fits.