用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Besty0728/Unity-Skills --skill unity-scriptdesign命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | unity-scriptdesign |
| description | Advise on Unity gameplay script quality |
Before calling any skill in this module: if you are about to call a skill with parameters guessed from its name or description, STOP — read this file (or fetch its schema via
GET /skills/recommend?includeSchema=true) first. If you already have the parameter definitions from recommend/schema, you may proceed straight to dryRun.
Use this skill before creating gameplay scripts, or after scripts are generated and need a design pass.
MonoBehaviour, ScriptableObject, or plain C# class?Update, repeated Find, avoidable allocation, or reflection in hot paths?The Review Checklist above asks "where does this class live". Ask the same question for every field. Every piece of state has one of three lifecycles, and putting a field on the wrong one is the most common cause of "why did this break when the designer tweaked a value" and "why are my unit tests flaky".
| Lifecycle | When the value is decided | Where it belongs | Typical idiom |
|---|---|---|---|
| Authoring-time | By a designer in the Editor, before Play | ScriptableObject asset, or [SerializeField] private on a prefab | Immutable at runtime; read via _config.Speed |
| Composition-time | Once per scene/instance, at Awake/Start | private field, assigned from GetComponent / GetComponentInChildren / ctor arg | Cached reference, no per-frame lookup |
| Runtime-mutable | Every frame or on gameplay events | private backing field + public read-only property + event | Exposed via public float Health { get; private set; } + OnHealthChanged |
Transform → Composition-time if set once at spawn, Runtime-mutable if re-targeted each frame.public float hp;.Rigidbody/Animator on the same GameObject → Composition-time, cached in Awake.Mixing the three lifecycles is what turns a clean class into a god object. A MonoBehaviour whose public float speed is edited by both the Inspector and a power-up script has two owners and no invariant; a bug in either path corrupts the other. The ECS baking pipeline makes this distinction a hard architectural boundary (Authoring → Baker → System), and the discipline transfers directly: if you would not mix an Authoring component with runtime write-back in ECS, do not mix them in a MonoBehaviour either. Source: EntitiesSamples/Docs/baking.md:5-16.
Mode: Documentation only — no REST skills to gate; load freely under any operating mode (Approval / Auto / Bypass).