unity-testability

Identify pure C# logic to extract from Unity MonoBehaviour code for testability.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It helps you make Unity code easier to test by separating pure game logic from scene-dependent MonoBehaviour behavior.

Core Features & Use Cases

  • Identifies logic that can move into plain C# classes for unit testing.
  • Highlights Unity-facing code that should remain in MonoBehaviour, Transform, or GameObject contexts.
  • Suggests practical seams, interfaces, and test coverage choices for EditMode and PlayMode.
  • Use it when refactoring hard-to-test gameplay code, planning a test strategy, or deciding whether a rule belongs inside or outside Unity-specific scripts.

Quick Start

Ask the skill to review your Unity script and recommend what should be extracted into pure C# plus which EditMode and PlayMode tests to add.

Frequently Asked Questions about unity-testability

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

FAQPage Schema
How do I separate pure C# logic from MonoBehaviour for unit testing in Unity?▼

To identify logic to extract from Unity scripts, look for pure gameplay rules that do not depend on Transform, GameObject, or scene context. Move this pure C# logic into plain classes and keep Unity-facing code as thin MonoBehaviour wrappers.

What is the difference between EditMode and PlayMode tests for Unity gameplay code?▼

EditMode tests run without the Unity engine lifecycle, making them ideal for testing extracted pure C# logic. PlayMode tests execute within the runtime environment to verify scene-bound MonoBehaviour behavior and integration.

How do I create seams and interfaces to improve Unity testability?▼

Create seams by defining interfaces for scene-bound dependencies, allowing MonoBehaviour-heavy systems to interact with pure C# classes through abstractions. This enables minimal but meaningful test isolation and easier mocking.

When should logic stay inside a MonoBehaviour versus moving to a plain C# class?▼

Logic should stay inside a MonoBehaviour when it directly manipulates Transform, GameObject, or scene-bound dependencies. Move rules and runtime decisions to plain C# classes when they represent pure gameplay logic independent of Unity-specific contexts.

How do I refactor hard-to-test gameplay systems in Unity?▼

Refactor hard-to-test Unity gameplay systems by evaluating scene-bound dependencies, extracting pure logic into plain C# classes, and wrapping Unity-facing code with seams or interfaces to establish meaningful test isolation.