state-machine-architect

Generate modular Unity C# state machine code with a Python scaffold script.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/Criezzz/Gametopia2026 --skill state-machine-architect
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-machine-architect
Source: https://github.com/Criezzz/Gametopia2026/tree/main/.agent/skills/state-machine-architect
Command: npx skills add https://github.com/Criezzz/Gametopia2026 --skill state-machine-architect

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill eliminates the repetitive and error-prone work of hand-writing state management and transition logic by providing a reusable, type-safe state machine architecture and scaffolding for game controllers, AI, and UI flows.

Core Features & Use Cases

  • Modular generic StateMachine, IState, and StateBase templates designed for Unity C# projects and similar environments.
  • A Python generator script to scaffold context controllers and individual state classes with namespace support and multiple states.
  • Supports hierarchical and history-aware transitions, event hooks for OnStateChanged, and clear separation of state responsibilities.
  • Common use cases include player movement controllers (Idle, Walk, Run, Jump), enemy AI (Patrol, Chase, Attack), and game flow management (MainMenu, Playing, Paused, GameOver).

Quick Start

Run the included state_gen.py to scaffold a PlayerController with states Idle,Walk,Run,Jump in the Game.Player namespace by supplying the context, states, and namespace arguments to the generator.

Frequently Asked Questions about state-machine-architect

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

FAQPage Schema
How do I generate a state machine for Unity C# player controllers and AI?

You can generate a state machine for Unity C# by running the included Python generator script to scaffold context controllers and individual state classes with namespace support for player movement and AI behavior systems.

What is a finite state machine used for in game development?

A finite state machine in game development manages context-driven states like Idle, Walk, Patrol, and Chase for player controllers, enemy AI, and UI flow control, ensuring clear separation of state responsibilities and modular transitions.

Can I scaffold multiple states like Idle, Walk, and Run for a Unity game namespace?

Yes, you can scaffold multiple states like Idle, Walk, and Run by supplying the context, desired states, and namespace arguments to the Python generator script to produce individual state files with type-safe templates.

Does the generated state machine code support event hooks and history-aware transitions?

The generated state machine code supports hierarchical and history-aware transitions, includes event hooks for OnStateChanged, and provides generic StateMachine, IState, and StateBase templates for Unity C# projects.

What's the best way to structure enemy AI behavior logic without repetitive hand-written transitions?

The best way to structure enemy AI behavior logic is using a reusable state machine architecture that provides type-safe scaffolding for states like Patrol, Chase, and Attack, eliminating repetitive and error-prone hand-written transition code.

Do I need Python to scaffold state machine code for Unity C# projects?

Yes, you need Python to run the state_gen.py generator script which scaffolds context classes and individual state files with namespace support for your Unity C# project's state-based systems.