All skills
thedivergentai avatar

/godot-state-machine-advanced

@9d6e91e

Expert blueprint for hierarchical finite state machines (HSM) and pushdown automata for complex AI/character behaviors. Covers state stacks, sub-states, transition validation, and state context passing. Use when basic FSMs are insufficient OR implementing layered AI. Keywords state machine, HSM, hierarchical, pushdown automata, state stack, FSM, AI behavior.

Use this Skill: https://skilld.dev/gh/thedivergentai/gd-agentic-skills/godot-state-machine-advanced

This session only. Nothing lands on disk.

referenceshsm-implementation-cookbook.md

≈281 tokens on demand. Your agent reads this file only when SKILL.md points to it.

HSM implementation cookbook

[!CAUTION] Do not paste inline HierarchicalState samples from pre-lattice baselines — they double-exit() on pop. Use MANDATORY scripts.

State base contract

class_name State extends Node
var state_machine: Node

func enter(_msg: Dictionary = {}) -> void: pass
func exit() -> void: pass
func update(_delta: float) -> void: pass
func physics_update(_delta: float) -> void: pass
func handle_input(_event: InputEvent) -> void: pass

Routing

Need Script
Hierarchy hsm_hierarchical_base.gd
Push/pop overlays hsm_pushdown_stack.gd
Guards hsm_transition_guard.gd
Context hsm_state_context.gd

Best practices

  1. One state per file (class_name).
  2. Signal state_changed for audio/VFX syncers.
  3. Every push_state needs a pop_state plan.

Pushdown resume: enter({"is_resume": true}) — hsm_reentry_aware_state.gd.

Source: SKILL.md on GitHub

No alerts17d4 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    The skill provides a standard and professional set of templates for advanced AI state machines in Godot. The analysis found no malicious behavior, exfiltration patterns, or safety bypasses. It correctly implements data-driven patterns expected for game development.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

  • Runlayer7mo

    3 files scanned · No issues

Signed by skilld at 9d6e91e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 3 weeks ago.

Activeupdated 2 months ago

README badge

README badge for thedivergentai/gd-agentic-skills/godot-state-machine-advanced