Uw State Machine
Interface-based state machine patterns for Unity game states, character controllers, and UI flows. Use when implementing game flow (menu -> gameplay -> game over), character states (idle -> run -> jump -> fall), AI behavior states, or UI screen transitions. Triggers on "state machine", "game states", "character states", "screen flow", "game flow", "add states to", "idle/run/jump", "menu flow", "AI states", "boss phases", or any task involving managing discrete states with transitions between them. Reads ProjectConfig.yaml -> architecture_pattern to adapt patterns for SO-first or DI-first.
Install
npx skills add devdavv/unity-ai-workflow --skill uw-state-machinegit clone --depth 1 https://github.com/devdavv/unity-ai-workflow.git /tmp/unity-ai-workflow
mkdir -p ~/.claude/skills
cp -r /tmp/unity-ai-workflow/.claude/skills/uw-state-machine ~/.claude/skills/uw-state-machinePersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# State Machine
Interface-based state machines for game flow, characters, and UI.
## Before You Start
1. Read `docs/ProjectConfig.yaml` for:
- `architecture_pattern` — `"so-first"` or `"di-first"` (affects how states and the StateMachine are created and wired).
- `mcp.unity_mcp` — if `true`, call `refresh_unity` after creating files.
2. Read `docs/CODING_STANDARDS.md` for async patterns (`Awaitable` + `CancellationToken`) — state transitions are async.
3. Ensure the feature has an `.asmdef` — create with `uw-unity-feature-scaffold` if needed.
## Core Interface
```csharp
public interface IState
{
Awaitable Enter(CancellationToken ct);
Awaitable Exit(CancellationToken ct);
}
```
For states that need per-frame updates (character movement, AI ticking), extend with:
```csharp
public interface IUpdatableState : IState
{
void Update();
}
```
## State Machine Service
Only one state is active at a time. Transitions are async to support loading screens, animations, and cleanup between states.
```csharp
public class StateMachine
{
private IState _currentState;
public IState CurrentState => _currentState;
public async Awaitable TransitionTo(IState newState, CancellationToken ct)
{
if (_currentState != null)
await _currentState.Exit(ct);
_currentState = newState;
await _currentState.Enter(ct);
}
}
```Details
- Skill name
uw-state-machine- Repository
- devdavv/unity-ai-workflow
- Path
.claude/skills/uw-state-machine/SKILL.md- License
- MIT
- Repo updated
- 1 April 2026
FAQ
What does the Uw State Machine skill do?
Interface-based state machine patterns for Unity game states, character controllers, and UI flows. Use when implementing game flow (menu -> gameplay -> game over), character states (idle -> run -> jump -> fall), AI behavior states, or UI screen transitions. Triggers on "state machine", "game states", "character states", "screen flow", "game flow", "add states to", "idle/run/jump", "menu flow", "AI states", "boss phases", or any task involving managing discrete states with transitions between them. Reads ProjectConfig.yaml -> architecture_pattern to adapt patterns for SO-first or DI-first.
How do I install the Uw State Machine skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add devdavv/unity-ai-workflow --skill uw-state-machine. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Uw State Machine popular?
It lives in devdavv/unity-ai-workflow, which has 47 GitHub stars and 6 forks.
Related skills
Uw Code Review
47devdavv/unity-ai-workflow
Pre-commit code quality review for Unity C# code. Checks against Rules, CODING_STANDARDS.md, NAMING_CONVENTIONS.md, and GDD Gherkin test coverage. Use when code has been written and tests are passing but before committing. Runs automatically at Step 8.5 of /uw-cmd-implement-feature. Triggers on "review this code", "check my implementation", "pre-commit review", "code review", "check before commit", "is this ready to commit", "review my changes", or any request to validate code quality before committing.
Uw Dependency Injection
47devdavv/unity-ai-workflow
Opt-in DI architecture using Reflex for Unity 6+. Covers container setup, scoping, injection, command pattern, update management, and class taxonomy. Use when ProjectConfig.yaml -> architecture_pattern is "di-first", or when the user asks about dependency injection, inversion of control, service architecture, or testable game code. Triggers on "set up DI", "add dependency injection", "create a service", "wire up dependencies", "make this testable", "decouple these systems", "add a command pattern", "cross-feature communication", or architecture discussions involving testability, decoupling, an
Uw Game Feel Integrator
47devdavv/unity-ai-workflow
Inject juice and game feel into gameplay code using the project's chosen middleware. Use when adding screen shake, tweens, particles, audio feedback, haptics, hitstop, or any form of "juice" to gameplay events. Triggers on requests like "add juice", "make this feel better", "add screen shake", "polish this feature", "add feedback to this action", "make the hit feel impactful", "add particles when", "screen shake on damage", "tween this", "add camera shake", "make this snappy", or any game feel, polish, or feedback work. Always reads ProjectConfig.yaml -> feel_tools and docs/GFD.md Feedback Mat
Uw UI Toolkit Binder
47devdavv/unity-ai-workflow
Generate Unity 6+ UI Toolkit Runtime Data Binding code using MVVM pattern with [CreateProperty], DataBinding, and PropertyPath. Use when creating UI screens, HUDs, menus, inventories, settings panels, or any data-bound UI elements with UI Toolkit. Triggers on requests like "create a health bar", "build the HUD", "make a settings screen", "bind data to UI", "create an inventory UI", "add a pause menu", "show player stats on screen", "build a shop UI", "create a dialogue box", or any task involving runtime UI layout, styling, or data display. Also use when the user mentions UXML, USS, ViewModel,
Vue Best Practices
43vinayakkulkarni/vue-nuxt-best-practices
Vue.js performance optimization guidelines for building fast, maintainable applications. This skill should be used when writing, reviewing, or refactoring Vue.js code to ensure optimal performance patterns. Triggers on tasks involving Vue components, reactivity, Composition API, state management, or performance improvements.
Building Native UI
49robinebers/skills
Complete guide for building beautiful apps with Expo Router. Covers fundamentals, styling, components, navigation, animations, patterns, and native tabs.
Browse the most popular Claude skills, all frontend & design skills, or write your own with the skills generator.