unity-testability

Advises on separating Unity-facing code from pure C# logic for testability.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-testability-pikachu0310
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-testability
Source: https://github.com/pikachu0310/codex-agent-ops-public/tree/main/.agents/skills/unity-skills/skills/testability
Command: npx skills add https://github.com/pikachu0310/codex-agent-ops-public --skill unity-testability-pikachu0310

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity developers often struggle to decide which logic should stay in MonoBehaviour classes and which should move into plain C# classes so it can be unit tested without a scene or GameObject dependencies. ## Core Features & Use Cases - Testability Review Questions: Evaluates whether logic can run without Transform, GameObject, or scene state, and whether configuration can be injected instead of read from static globals. - Refactoring Guidance: Identifies logic that should move to pure C#, logic that should stay Unity-facing, and suggested seams or interfaces. - Test Planning: Produces candidate EditMode and PlayMode test lists so teams can plan a concrete test strategy. - Use Case: When a MonoBehaviour grows complex, use this Skill to decide which rules and algorithms to extract into plain C# classes called from a thin Unity-facing wrapper, then plan EditMode coverage for the extracted logic. ## Quick Start Ask the assistant to review a Unity script and advise which logic should move to pure C# classes and which EditMode and PlayMode tests to write.

Frequently Asked Questions about unity-testability

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

FAQPage Schema
How do I make Unity code unit testable?

Move rules and algorithms that do not need Transform, GameObject, or scene state into plain C# classes, then call them from a thin MonoBehaviour. Inject configuration instead of reading static globals so EditMode tests can run without a scene.

What logic should stay in a MonoBehaviour versus pure C#?

Keep scene interaction, lifecycle callbacks, and GameObject wiring in the MonoBehaviour. Move decision logic, calculations, and rules into pure C# classes that the MonoBehaviour calls, so they can be tested without Unity runtime dependencies.

When should I use EditMode versus PlayMode tests in Unity?

Use EditMode tests for pure C# logic that has no scene or runtime dependencies, since they run fast in the editor. Reserve PlayMode tests for behavior that genuinely requires a running scene, GameObjects, or frame-based execution.

Should every Unity script get test seams and interfaces?

No. The guidance warns against forcing test seams everywhere. For tiny, scene-bound scripts, prefer a few meaningful seams over abstraction for its own sake, and focus extraction effort on complex or rule-heavy logic.