unity-unitask-design

Identify and correct UniTask async code issues in Unity projects.

Updated Jan 30, 2026
One-click install
npx skills add https://github.com/Rayzerrek/dotfiles --skill unity-unitask-design-rayzerrek
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-unitask-design
Source: https://github.com/Rayzerrek/dotfiles/tree/main/.pi/agent/skills/unity-skills/skills/unitask-design
Command: npx skills add https://github.com/Rayzerrek/dotfiles --skill unity-unitask-design-rayzerrek

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write and review Unity asynchronous code with UniTask so you can avoid common mistakes like double-awaiting, leaking subscriptions, misusing cancellation, and choosing the wrong player loop timing.

Core Features & Use Cases

  • Struct and Awaitable Semantics: Understand how UniTask differs from Task, including single-use awaits, Preserve usage, and fire-and-forget patterns.
  • Timing and Cancellation: Choose the right PlayerLoopTiming, DelayType, and CancellationToken flow for frame-accurate and lifetime-safe async behavior.
  • Composition and Interop: Combine tasks with WhenAll or WhenAny, bridge to coroutines, UnityWebRequest, AsyncOperation, and Task, and manage async streams, reactive properties, channels, and triggers.
  • Use Case: Review a Unity gameplay system that mixes loading, UI events, scene lifecycle, and network requests, then point out the safest UniTask patterns and likely runtime pitfalls.

Quick Start

Ask me to audit your UniTask code for cancellation, timing, composition, and leak risks in your Unity project.

Frequently Asked Questions about unity-unitask-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix UniTask cancellation and leak issues in Unity async code?

To fix UniTask cancellation and leak issues in Unity, you must ensure safe CancellationToken handling and avoid double-awaiting struct awaitables. Properly managing cancellation flow prevents leak-resistant async operations.

What is the difference between UniTask and Task for Unity async code?

UniTask differs from Task by providing zero-allocation awaitables and single-use await semantics in Unity. It requires specific Preserve usage for fire-and-forget patterns to avoid struct and awaitable lifecycle issues.

How do I choose the right PlayerLoop timing for UniTask async operations?

Choosing the right PlayerLoop timing for UniTask requires matching PlayerLoopTiming and DelayType to your frame-accurate async behavior. This ensures frame-accurate execution and lifetime-safe cancellation flow.

How do I bridge UniTask with coroutines and UnityWebRequest in Unity?

To bridge UniTask with coroutines and UnityWebRequest in Unity, you use composition and interop patterns. This allows you to combine tasks with WhenAll or WhenAny while managing AsyncOperation conversions safely.

Can I use async enumerables and triggers with UniTask in Unity gameplay systems?

You can use async enumerables and triggers with UniTask in Unity gameplay systems to manage async streams and reactive properties. This approach handles scene lifecycle and UI events while pointing out likely runtime pitfalls.

What are the limitations of using UniTask for Unity async programming?

A key limitation of UniTask in Unity async programming is its single-use await constraint; double-awaiting causes runtime faults. You must also carefully manage subscription leaks and choose correct player loop timing to avoid edge case failures.