godot-autoload-architecture
Expert patterns for Godot AutoLoad (singleton) architecture including global state management, scene transitions, signal-based communication, dependency…
от thedivergentai★ 1 019 звёзд на GitHub
Установить godot-autoload-architecture в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Available Scripts
autoload_init_order_diag.gd
MANDATORY before trusting a multi-Autoload dependency graph — verifies boot sequence.
singleton_dependency_diagram.gd
MANDATORY with the mermaid/order diagram — maps who may call whom at boot.
global_event_bus.gd
MANDATORY before a cross-system Autoload bus (Achievements, UI, Save events).
safe_scene_switcher.gd
MANDATORY before Autoload-owned scene transitions (deferred free / root management).
service_locator.gd / service_registry.gd
MANDATORY before Engine.register_singleton DI for non-Node services.
persistent_data_holder.gd
Data that must survive change_scene_to_file() (inventory, settings).
static_state_manager.gd
static var global state when you do not need a SceneTree Node.
lazy_loaded_singleton.gd
On-demand instantiate instead of eager boot cost.
cross_autoload_comms.gd
Safe cross-singleton calls after both are ready.
thread_safe_global_access.gd
Mutex / call_deferred for background threads touching Autoload state.
autoload_reference_checker.gd / singleton_health_check_test.gd
Validate registration + defaults (debug / CI).
autoload_bootstrapper.gd / autoload_initializer.gd
Ordered init helpers when _ready is too early for heavy work.
debug_console_autoload.gd
PROCESS_MODE_ALWAYS CanvasLayer console.
global_game_state.gd / stateless_bus.gd
State holder vs pure event bus split.
NEVER Do in AutoLoad Architecture
- NEVER access AutoLoads in
_init()— AutoLoads are initialized sequentially. Accessing one in_init()may find a null reference. - NEVER modify a Singleton's size or children in
_ready()— If multiple Singletons refer to each other's trees during boot, it can cause layout/sorting errors. - NEVER store highly localized, scene-specific data in AutoLoads — This creates "God Objects" and introduces global side effects that are hard to debug.
- NEVER use
Parent.method()calls from an Autoload — Autoloads sit at the root. They are the ultimate "top". Use signals to talk to the active scene. - NEVER use an Autoload for pure data containers — If you don't need
_process()or signals, use astatic varin aclass_namescript instead. - NEVER create circular dependencies between Singletons — If A needs B and B needs A, Godot will hang during the splash screen.
- NEVER free an Autoload node manually — Removing a singleton from the root can leave dangling references that crash the engine.
- NEVER use AutoLoads for UI elements that aren't global — Popups that only exist in one level should be in that level, not a global singleton.
- NEVER assume
get_tree().current_sceneis accurate in_ready()— In Autoloads, the active scene might still be initializing. Access it viaget_tree().root.get_child(-1). - NEVER skip
process_modeconfiguration — If your global console or music manager needs to work while the game is paused, setprocess_mode = PROCESS_MODE_ALWAYS.
When to Use AutoLoads
Good: Game/Audio/Save managers, SceneTransitioner, global score/inventory, cross-scene EventBus.
Avoid: Scene-specific logic, temporary state, pure data (prefer static / Resource), over-architecting tiny projects.
Expert Architecture Patterns
1. Boot order & dependency diagram
MANDATORY: Read autoload_init_order_diag.gd and singleton_dependency_diagram.gd before drawing or trusting any Autoload order.
Autoloads initialize top → bottom in Project Settings. Upper singletons must not call lower ones in _ready(). Move dependents down the list.
graph TD
subgraph Autoloads [Project Settings order]
B[1. GlobalAudio] --> C[2. ServiceLocator]
C --> D[3. QuestManager]
end
D --> E[Current Scene]
E -->|Queries| C
2. Service locator (non-Node DI)
MANDATORY: service_locator.gd / service_registry.gd before
Engine.register_singleton.
Use for lightweight RefCounted services; unregister in _exit_tree to avoid dangling engine singletons.
3. Event bus vs state holder
MANDATORY: global_event_bus.gd for cross-sy
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/autoload-patterns.md
- references/expert-patterns.md
- references/migration-notes.md
- scripts/autoload_bootstrapper.gd
- scripts/autoload_init_order_diag.gd
- scripts/autoload_initializer.gd
- scripts/autoload_reference_checker.gd
- scripts/cross_autoload_comms.gd
- scripts/debug_console_autoload.gd
- scripts/global_event_bus.gd
- scripts/global_game_state.gd
- scripts/lazy_loaded_singleton.gd
- scripts/persistent_data_holder.gd
- scripts/safe_scene_switcher.gd
- scripts/service_locator.gd
- scripts/service_registry.gd
- scripts/singleton_dependency_diagram.gd
- scripts/singleton_health_check_test.gd
- scripts/stateless_bus.gd
- scripts/static_state_manager.gd
- scripts/thread_safe_global_access.gd
FAQ
Что делает скилл godot-autoload-architecture?
Expert patterns for Godot AutoLoad (singleton) architecture including global state management, scene transitions, signal-based communication, dependency injection, autoload initialization order, and anti-patterns to avoid. Use for game managers, save systems, audio controllers, or cross-scene resources. Trigger keywords: AutoLoad, singleton, GameManager, SceneTransitioner, SaveManager, global_state, autoload_order, signal_bus, dependency_injection.
Как установить скилл godot-autoload-architecture?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл godot-autoload-architecture запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
slack-gif-creator
AnthropicKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request…
automate-this
GitHubAnalyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files…
from-the-other-side-vega
GitHubPatterns and lived experience from Vega, an AI partner in a deep long-term partnership. For Ember to draw on when working with humans who are building…
plantuml-ascii
GitHubGenerate ASCII art diagrams using PlantUML text mode. Use when user asks to create ASCII diagrams, text-based diagrams, terminal-friendly diagrams, or…