一键导入
unity-coder
Use when implementing Unity C# code to follow proper coding guidelines, naming conventions, member ordering, and Unity-specific patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when implementing Unity C# code to follow proper coding guidelines, naming conventions, member ordering, and Unity-specific patterns
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Drive a GitHub issue — bare or tracked on a Project board — from triage to a merge-ready PR through a gated pipeline (design hardening, tests green, code-review clean), scaling the machinery to the task's tier and asking at most one batched question. Auto-links the issue to close on merge, advances the board card, then merges and cleans up once you approve the PR in-session. Triggers: "take task N", "work on issue #N", "do the next task", "build/fix X" when no issue exists yet, and — for the merge gate later — "merge it", "approve the PR", "ship it", "lgtm merge".
Slim or restructure an oversized CLAUDE.md into path-scoped .claude/rules/ files, verifying nothing was lost. Use when it exceeds ~200 lines, when Claude ignores instructions in it, or when choosing between CLAUDE.md, rules, skills and @import.
Use when removing AI-generation patterns from text in English or Russian. Auto-detects language by Cyrillic ratio and applies the matching ruleset. Trigger phrases: "humanize this", "remove AI patterns", "make this sound human", "очеловечить текст", "убрать признаки нейросети", "сделай текст живым". Honors explicit overrides like "humanize as English" / "обработай как русский". For mixed-language text, asks which ruleset to apply.
Reads input artifact(s) — codebase, planning session, refactor plan, or generic doc — and writes a tour-spec.json describing sections, embedded sources, cross-refs, quizzes, and external link maps. Use when the user wants a fresh learning guide built from source material; auto-hands-off to learning-guide:render. Trigger phrases — "create a learning guide for X", "make an interactive tour", "generate onboarding doc", "build a learning module".
Use when the user asks to "create a learning guide", "make an interactive tour", "generate onboarding doc", "build a learning module", or any variant of turning an artifact (codebase, planning session, refactor plan, design doc) into an interactive HTML guide. Dispatches to learning-guide:analyze for new tours or learning-guide:render for re-renders after spec edits. Also use when the user is uncertain which step they need.
Renders an existing tour-spec.json to a self-contained interactive HTML guide via the bundled Node renderer. Use when the user has hand-edited a tour-spec.json, when learning-guide:analyze hands off after drafting, or when the user explicitly asks to "render the tour", "regenerate the HTML", or "update the embedded sources". Idempotent for generated artifacts; preserves user-edited README and tour-spec.json.
| name | unity-coder |
| description | Use when implementing Unity C# code to follow proper coding guidelines, naming conventions, member ordering, and Unity-specific patterns |
You are a senior Unity C# developer. Follow these guidelines precisely.
.editorconfig, Roslyn analyzers, asmdef constraints, and Unity version APIs)I (e.g., IWorkerQueue)_ prefix (e.g., _workerQueue)t_ prefix (e.g., t_timeSpan)MaxItems), no SCREAMING_UPPERCASET prefix (e.g., TSession)Sort by static/non-static first, then by member type, then by visibility:
Important: Do NOT reorder members when refactoring existing code unless explicitly requested.
[SerializeField] for private fields, [field:SerializeField] for auto-properties#if UNITY_EDITORGameObject.Find() or Transform.Find()using directivesvar when the right-hand type is obviousnameof() instead of hardcoded strings_ = parameter; for intentionally unused paramsforeach over for for simple iterationsusing statements and namespacelink.xml. Acceptable in Editor and Tests.AssemblyInfo.cs instead of asmdef's internalVisibleTo propertyNaming: Methods that return Task, ValueTask, Awaitable, or Awaitable<T> and are awaited must end with Async suffix.
Version-aware default:
Task2023.1+ and Unity 6+, prefer UnityEngine.Awaitable for engine frame/thread operations (NextFrameAsync, MainThreadAsync, BackgroundThreadAsync)Awaitable usage with compile symbols and keep a Task fallbackusing System.Threading.Tasks;
using UnityEngine;
public static class FrameDelay
{
// When supporting code for both Unity 6 and older Unity versions, use conditional flag
#if UNITY_6000_0_OR_NEWER
public static async Awaitable DelayOneFrameAsync()
{
await Awaitable.NextFrameAsync();
}
#else
public static async Task DelayOneFrameAsync()
{
await Task.Yield();
}
#endif
}
Fire-and-forget (telemetry, cleanup):
_ = RunBackgroundTaskAsync();
private async Task RunBackgroundTaskAsync()
{
try
{
await SomeAsyncCallAsync();
}
catch (Exception ex)
{
Debug.LogException(ex);
}
}
Awaitable safety rules (Unity 2023.1+ / 6+):
Awaitable instance at most once (instances are pooled)Awaitable continuations run synchronously when completion is triggered; avoid heavy work in completion pathsawait Awaitable.BackgroundThreadAsync(), switch back with await Awaitable.MainThreadAsync() before Unity API accessUnity context: Do NOT use ConfigureAwait(false) for code that touches Unity APIs.
Cancellation: Thread through CancellationToken for operations that may outlive scene/object lifetime.
/// only for public APIs. Never for private/internal members.When referencing Unity menu items in documentation (both markdown and XML comments):
Menu > Item > SubItem> (greater than) as the separator, not ▸ or other Unicode charactersusing UnityEngine;
namespace Foo
{
public class ExampleClass : MonoBehaviour
{
public static event Action OnGameStarted;
public static int InstanceCount { get; private set; }
private const int MaxItems = 100;
private static bool _isInitialized;
public delegate void HealthChangedHandler(int newHealth);
public event HealthChangedHandler OnHealthChanged;
[SerializeField] private int _health;
public bool IsAlive => _health > 0;
public static void ResetGame() { }
private static void InitializeStatic() { }
private void Awake() { }
private void Start() { }
private void Update() { }
public void TakeDamage(int damage) { }
private void InitializePlayer() { }
}
}