Agent Skills
› Besty0728/Unity-Skills
› unity-script-roles
unity-script-roles
GitHub为Unity脚本提供职责划分建议,指导类应作为MonoBehaviour、ScriptableObject、纯C#服务或Installer。帮助用户在创建脚本前明确角色、拆分职责,避免过度依赖MonoBehaviour,优化架构设计。
Trigger Scenarios
用户询问某个类是否该用MonoBehaviour
需要确定类的职责或拆分职责
在MonoBehaviour与纯C#间抉择
准备创建一批游戏逻辑脚本
Install
npx skills add Besty0728/Unity-Skills --skill unity-script-roles -g -y
SKILL.md
Frontmatter
{
"name": "unity-script-roles",
"description": "Advises on assigning Unity script roles — whether a class should be a MonoBehaviour, ScriptableObject, plain C# service, or installer. Use when deciding a class's role, splitting responsibilities across types, or choosing between MonoBehaviour and plain C#, even if the user just asks \"这个该用MonoBehaviour吗\" or \"职责怎么分\". 为 Unity 脚本职责划分提供建议(某个类应作 MonoBehaviour、ScriptableObject、纯 C# 服务还是 installer);当用户要确定类的职责、在类型间拆分职责、或在 MonoBehaviour 与纯 C# 间抉择时使用。"
}
Unity Script Roles
Use this skill before creating a batch of gameplay scripts.
Goal
Turn a rough script list into explicit roles so AI does not generate everything as MonoBehaviour.
Output Format
- Script name
- Recommended role
- Main responsibility
- Main dependencies
- Why this role fits better than the alternatives
Common Roles
MonoBehaviourbridgeScriptableObjectconfig/data- pure C# domain/service
- presenter / controller
- state / state machine node
- installer / bootstrap helper
Guardrails
Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).
- Do not make every class a
MonoBehaviour. - Do not force
ScriptableObjectonto runtime state that should stay in memory-only objects.
Version History
- ec9f870 Current 2026-07-05 14:41


