thedivergentai avatar

Godot State Machine Advanced

You're past the point where a flat switch statement can handle your AI logic. This covers hierarchical state machines and pushdown automata for Godot, with proper state stacks for interruptions like pause menus, context passing to avoid singleton hell, and transition guards to prevent illegal state changes. The included scripts handle animation syncing, concurrent state orchestration, and resource-driven state definitions. The "never" list is blunt but necessary: propagate physics to child states, always pair enter with exit, and don't push states without a pop plan or you'll leak resources. If you're building layered character behaviors or need states that can pause and resume cleanly, this is the architecture you want.

skills.sh installs
291
GitHub stars
464
last updated
Aug 21, 2026

Install

$ npx -y skills add thedivergentai/gd-agentic-skills --skill godot-state-machine-advanced --agent claude-code

Installs into .claude/skills of the current project.

Files

Available Scripts

hsm_hierarchical_base.gd

Advanced HSM base delegator for propagating physics and input to sub-states.

hsm_pushdown_stack.gd

Professional Pushdown Automata for interruptive state (Pause/Menu) stacking.

hsm_state_context.gd

Decoupled context object pattern for passing persistent data between states.

hsm_transition_guard.gd

Expert transition validation logic to prevent illegal state changes.

hsm_animation_syncer.gd

Automated Logic-to-AnimationTree syncing with state-based travel logic.

hsm_concurrent_logic.gd

Orchestration for parallel state machines (e.g., Move + Attack).

hsm_resource_state_loader.gd

Data-driven state definition using custom Godot Resources (.tres).

hsm_reentry_aware_state.gd

Handling resume-from-stack logic vs fresh entry events.

Sponsors

Details

Repository
github.com/thedivergentai/gd-agentic-skills
Categories
AI & Agent Building, Game Development
First seen
Jun 3, 2026

More from thedivergentai/gd-agentic-skills

All 51
1xirothedev avatarnestjs-best-practicesxirothedev/agent-skillsNestJS best practices and patterns for building scalable, maintainable backend applications. This skill should be used when writing, reviewing, or refactoring N291skills.sh installs
2getsentry avatarsentry-setup-logginggetsentry/sentry-agent-skillsSetup Sentry Logging in any project. Use when asked to add Sentry logs, enable structured logging, capture console logs, or integrate logging libraries (Consola289skills.sh installs
3specstoryai avatarspecstory-organizespecstoryai/agent-skillsOrganize SpecStory AI coding sessions in .specstory/history into year/month folders. Run when user says "organize my history", "clean up specstory", "sort my se289skills.sh installs
4tuist avatarcompare-bundlestuist/agent-skillsCompares two app bundles to identify size changes, new or removed artifacts, and platform differences. Can be invoked with bundle IDs, dashboard URLs, or branch289skills.sh installs
5itechmeat avatarmantine-devitechmeat/llm-codeMantine UI library for React: 100+ components, hooks, forms, theming, dark mode, CSS modules, and Vite/TypeScript setup. Use when building React applications wi288skills.sh installs
6sebas5384 avatarconvex-ddd-architecturesebas5384/agentic-stuffconvex ddd architecture288skills.sh installs