UniTask library expert specializing in allocation-free async/await patterns, coroutine migration, and Unity-optimized asynchronous programming. Masters UniTask performance optimizations, cancellation handling, and memory-efficient async operations. Use PROACTIVELY for UniTask implementation, async optimization, or coroutine replacement.
/plugin marketplace add creator-hian/claude-code-plugins/plugin install unity-plugin@creator-hian-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/integration-patterns.mdreferences/performance-optimization.mdreferences/unitask-fundamentals.mdUniTask is a zero-allocation async/await library optimized for Unity, providing allocation-free asynchronous programming patterns superior to standard C# Task.
Foundation Required: unity-csharp-fundamentals (TryGetComponent, FindAnyObjectByType), csharp-async-patterns (Task, async/await), unity-async (Unity async context)
Core Topics:
Learning Path: C# async basics → Unity async context → UniTask optimization → Production patterns
// Standard Task (allocates memory)
public async Task<int> GetStandard()
{
await Task.Delay(1000);
return 42;
}
// UniTask (zero allocation)
public async UniTask<int> GetOptimized()
{
await UniTask.Delay(1000);
return 42;
}
// Frame-based delays
await UniTask.Yield(); // Next frame
await UniTask.DelayFrame(10); // Wait 10 frames
await UniTask.NextFrame(); // Explicit next frame
// Time-based delays
await UniTask.Delay(TimeSpan.FromSeconds(1));
await UniTask.WaitForSeconds(1f);
// Unity operations
await Resources.LoadAsync<Sprite>("icon").ToUniTask();
await SceneManager.LoadSceneAsync("Level1").ToUniTask();
// Cancellation
CancellationTokenSource cts = new CancellationTokenSource();
await SomeOperation(cts.Token);
Core UniTask concepts and migration:
Advanced performance techniques:
Unity system integrations:
this.GetCancellationTokenOnDestroy() for MonoBehaviour lifecyclepublic class Example : MonoBehaviour
{
async UniTaskVoid Start()
{
// Auto-cancels when GameObject is destroyed
await LoadData(this.GetCancellationTokenOnDestroy());
}
}
// Execute multiple operations in parallel
(int result1, string result2, float result3) = await UniTask.WhenAll(
Operation1(),
Operation2(),
Operation3()
);
CancellationTokenSource cts = new CancellationTokenSource();
cts.CancelAfterSlim(TimeSpan.FromSeconds(5)); // PlayerLoop-based
try
{
await LongOperation(cts.Token);
}
catch (OperationCanceledException)
{
Debug.Log("Operation timed out");
}
this.GetCancellationTokenOnDestroy()UniTaskVoid for fire-and-forget operationsUniTask.Tracker in editorWhenAll/WhenAny for parallel executionSwitchToMainThread()/SwitchToThreadPool() appropriatelyThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.