Agent Skills
› Besty0728/Unity-Skills
› unity-testability
unity-testability
GitHub为Unity项目提供可测试性建议,指导如何将业务逻辑从MonoBehaviour中剥离至纯C#类,并规划EditMode与PlayMode测试策略。适用于提升代码可测性、抽取单元测试逻辑或解决“代码不好测”等场景。
Trigger Scenarios
怎么测试
代码不好测
提升可测试性
抽取逻辑
规划测试策略
Install
npx skills add Besty0728/Unity-Skills --skill unity-testability -g -y
SKILL.md
Frontmatter
{
"name": "unity-testability",
"description": "Advises on Unity testability — isolating logic out of MonoBehaviour and planning EditMode\/PlayMode tests. Use when improving testability, extracting logic for unit tests, or planning a test strategy, even if the user just says \"怎么测试\" or \"代码不好测\". 为 Unity 可测试性提供建议(把逻辑从 MonoBehaviour 中剥离、规划 EditMode\/PlayMode 测试);当用户要提升可测试性、为单元测试抽取逻辑、或规划测试策略时使用。"
}
Unity Testability Advisor
Use this skill when deciding what logic should remain in Unity-facing classes and what should move into pure C# code.
Review Questions
- Can the rule/algorithm run without
Transform,GameObject, or scene state? - Can config be injected instead of read through static globals?
- Can runtime decisions be moved to a plain C# class and called from a thin
MonoBehaviour? - Does this need PlayMode coverage, or is EditMode enough?
Output Format
- Logic that should move to pure C#
- Logic that should stay Unity-facing
- Suggested seams/interfaces
- Candidate EditMode tests
- Candidate PlayMode tests
Guardrails
Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).
- Do not force test seams everywhere if the script is tiny and scene-bound.
- Prefer a few meaningful seams over abstraction for its own sake.
Version History
- ec9f870 Current 2026-07-05 14:41


