Skip to content
Development
Skill

/async

Advise on Unity async and lifecycle strategy

From plugin
unity-skills
1.9k83 skills4 commands

Claude Code

$ npx -y skills add Besty0728/Unity-Skills --skill async --agent claude-code

SKILL.md

async.SKILL.md
name: unity-async
description: Advise on Unity async and lifecycle strategy

Unity Async Strategy

Documentation only: no REST skills.

Scope: this module covers async code written into the Unity runtime (`Update`, coroutines, UniTask, cancellation, lifecycle ownership). It does not cover the REST protocol's own async jobs; for `jobId` polling see [batch](../batch/SKILL.md).

When to use

  • Deciding how runtime work should be scheduled or cleaned up

Decision ladder

1. Ask first whether the task needs per-frame work at all. 2. If not, prefer events, callbacks, or explicit method calls. 3. For a short Unity-bound sequence, prefer a coroutine. 4. Recommend `UniTask` only when the project already uses it, or the user explicitly wants it and accepts the dependency. 5. Use `Update` only for true continuous simulation, polling, or input loops that cannot be event-driven.

Specific guidance

  • Avoid many unrelated `Update` methods when an event-driven flow works.
  • Cache references used in hot paths.
  • Always define lifecycle ownership: who starts the work, who cancels or stops it, when it is cleaned up.
  • In `MonoBehaviour`, prefer `OnEnable` / `OnDisable` / `OnDestroy` for subscribe/unsubscribe symmetry.
  • Use `IDisposable` mainly for pure C# lifetimes, temporary subscriptions, or scope-based cleanup, not as a replacement for Unity lifecycle methods.

Output format

  • Recommended scheduling model
  • Why it fits
  • Lifecycle / cancellation owner
  • Hot-path risks
  • Why the heavier alternative is unnecessary, if applicable

Pitfalls

  • Do not recommend `UniTask` just because it looks more advanced than a coroutine.
  • Prefer the simplest scheduling model that fits the use case.
Read more
@besty0728
Ships withunity-skills

REST API-based AI-driven Unity Editor Automation Engine Let AI control Unity scenes directly through Skills 🎉 We are now indexed by DeepWiki! Got questions? Check out the AI-generated docs → The current official maintenance baseline is Unity 2022.3+.

Stars on GitHub

Momentum

stars in total
1.9k
Star history of Besty0728/Unity-Skills on GitHub, a chart by star-history.com

Other skills on unity-skills.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills10d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc12d293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react1d252k
@facebook@facebookInstall Skill

Questions about async.

Which coding agents can use async?
async installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.