Логотип Godot Composition

Godot Composition

Сообщество
thedivergentai
godot-composition

Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component). Use when designing player controllers, NPCs, enemies, weapons, or complex gameplay systems. Enforces "Has-A" relationships for game entities. Trigger keywords: Entity-Component, ECS, Gameplay, Actors, NPCs, Enemies, Weapons, Hitboxes, Game Loop, Level Design.

Обзор

Издательthedivergentai
РепозиторийGD-Agentic-Skills
Название навыкаgodot-composition
Звёзды
727
Форки
43
Файлы в комплекте
14
ЛицензияLGPL-3.0
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 14

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — thedivergentai. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Godot Composition в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/thedivergentai/GD-Agentic-Skills/tree/main/skills/godot-composition
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/thedivergentai/GD-Agentic-Skills.git /tmp/GD-Agentic-Skills
mkdir -p .claude/skills
cp -r /tmp/GD-Agentic-Skills/skills/godot-composition .claude/skills/godot-composition
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Godot Composition в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Godot Composition, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Godot Composition не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Core Philosophy

This skill enforces Composition over Inheritance ("Has-a" vs "Is-a"). In Godot, Nodes are components. A complex entity (Player) is simply an Orchestrator managing specialized Worker Nodes (Components).

The Golden Rules

  1. Single Responsibility: One script = One job.
  2. Encapsulation: Components are "selfish." They handle their internal logic but don't know who owns them.
  3. The Orchestrator: The root script (e.g., player.gd) does no logic. It only manages state and passes data between components.
  4. Decoupling: Components communicate via Signals (up) and Methods (down).

Decision Tree — Composition vs Autoload vs Inheritance

SituationChoose
Gameplay entity behaviors (HP, hitbox, move, interact)Composition — child components + orchestrator (composition_root_init.gd)
Cross-scene services (audio bus, save, net, economy ledger)Autoload — not a component on the player
True is-a engine specialization (custom Control/Node with shared lifecycle)Inheritance exception — rare; never for "adds a gun" / "adds HP"

Available Scripts

health_component.gd

Specialized Node for managing lifespan, damage logic, and death signals across any entity.

hit_box_component.gd

Area-based component for intercepting damage and delegating it to a HealthComponent.

hurt_box_component.gd

Area-based component for dealing damage specifically to HitBoxComponents.

velocity_component.gd

Encapsulated movement and acceleration logic for reuse across Players and Enemies.

interaction_component.gd

Decoupled interaction handler using injecting Callable logic for context-aware actions.

follower_component.gd

Decoupled tracking logic using NodePath injection for smooth entity following.

state_component_vsm.gd

Component-based state machine pattern using child nodes as individual states.

status_effect_component.gd

Managing temporary modifiers (buffs/debuffs) by stacking effect scenes as children.

visual_sync_component.gd

Separating logical state (velocity/direction) from visual representation (sprite flipping).

composition_root_init.gd

MANDATORY first read — Orchestrator wiring via typed @export (Inspector / %UniqueNames in the scene). Matches NEVER: no $ / get_node for components.

NEVER Do in Composition

  • NEVER use deep inheritance chains (e.g., Player > Entity > LivingThing > Node) — Creates brittle "God Classes" that are hard to refactor [21].
  • NEVER use get_node() or $ for components — This breaks if the scene tree is rearranged. Always use @export or %UniqueNames [22].
  • NEVER let a component reference its parent script directly — This makes the component impossible to reuse. Use signals or dependency injection [23].
  • NEVER mix Input, Physics, and Game Logic in one script — This violates Single Responsibility. Split them into specialized components [24, 13].
  • NEVER create components that require a specific SceneTree structure — A component should be "selfish" and only care about its own properties and direct children.
  • NEVER use inheritance to "add a feature" — If you want an enemy to shoot, add a ShootingComponent, don't make it inherit from ShooterEnemy.
  • NEVER hardcode component dependencies — If CombatComponent needs HealthComponent, look it up in _ready() or inject it via the parent [11].
  • NEVER treat Godot nodes as pure data — Nodes provide lifecycle (_process) and signals. If you only need data, use a Resource.
  • NEVER ignore the Node lifecycle in components — Use _enter_tree() and _exit_tree() for setup/cleanup that must happen regardless of the parent's state.
  • NEVER hide component points of access — Expose NodePath or Callable properties so the parent can wire the component in the Inspector [13].

Implementation Standards

1. Connection Strategy: Typed Exports

Do not rely on tree order. Use explicit dependency injection via @export with static typing.

The "Godot Way" for strict godot-composition:

gdscript
# The Orchestrator (e.g., player.gd)
class_name Player extends CharacterBody3D

# Dependency Injection: Define the "slots" in the backpack
@export var health_component: HealthComponent
@export var movement_component: MovementComponent
@export var input_component: InputComponent

# Use Scene Unique Names (%) for auto-assignment in Editor
# or drag-and-drop in the Inspector.

2. Component Mindset

Components must define class_name to be recognized as types.

Standard Component Boilerplate:

gdscript
class_name MyComponent extends Node 
# Use Node for logic, Node3D/2D if it needs position

@export var stats: Resource # Components can hold their own data
signal happened_something(value)

func _ready() -> void:
    _validate_dependencies()

func _validate_dependencies() -> void:
    # 2. Dependency-Validation: Fail early during development if setup is wrong [2]
    # NOTE: assert() is stripped in release builds [10].
    assert(stats != null, "Stats Resource missing on %s" % name)

func do_logic(delta: float) -> void:
    # Perform specific task
    pass

Standard Components — Use Scripts

Inline Input/Movement/Health recipes removed. MANDATORY: start from composition_root_init.gd, then load the matching script:

Typed @export wiring stays under Implementation Standards above.

Expert Composition Patterns

1. State-Component Pattern (FSM)

Encapsulate complex behaviors into child nodes that act as states. The parent StateComponent delegates lifecycle calls to the active child [4, 6].

MANDATORY: Read state_component_vsm.gd — do not paste an inline StateMachine. For deeper VSM / hierarchical FSMs, open godot-state-machine-advanced.

2. Component-Registry (O(1) Lookup)

Avoid slow tree traversal for sibling communication. Catalog children in a Dictionary at ready (by name or group).

gdscript
var _components: Dictionary = {}

func _ready() -> void:
    for child in get_children():
        _components[child.name] = child
        for group in child.get_groups():
            _components[group] = child

func get_comp(key: StringName) -> Node:
    return _components.get(key)

3. Dependency-Validation

Fail fast with @export asserts, not get_node_or_null paths (paths break when the tree is rearranged).

gdscript
@export var health_component: HealthComponent
@export var input_component: InputComponent

func _ready() -> void:
    assert(health_component != null, "Missing HealthComponent export!")
    assert(input_component != null, "Missing InputComponent export!")

MANDATORY for Input/Movement/Health orchestrator recipes and registry depth: orchestrator-recipes.md. Do NOT Load when composition_root_init.gd + one component script suffice.

Performance Note

Nodes are lightweight. Do not fear adding 10-20 nodes per entity. The organizational benefit of Composition vastly outweighs the negligible memory cost of Node instances.

Reference

Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.

Official Documentation

  • Scene organization — Canonical signal-up / call-down ownership so orchestrators wire components without sibling hard-coupling.
  • Nodes and Scenes — Why Godot treats nodes as reusable building blocks (components) assembled into entity scenes.
  • What are Godot classes — Prefer scene composition and class_name components over deep inheritance trees for gameplay entities.
  • When and how to avoid using nodes for everything — Keep pure data in Resources; reserve Nodes for lifecycle, signals, and process ticks.
  • Logic preferences — Placement of game logic across scene trees so parents orchestrate and children stay single-purpose.
  • Data preferences — Choose Node vs Resource vs plain data for stats and config that components consume.
  • Using signals — Past-tense component events (health_depleted, state_changed) parents connect without reverse dependencies.
  • GDScript exported properties — Typed @export slots for Inspector dependency injection instead of brittle $ paths.
  • Scene Unique Nodes — %Name lookups that survive scene-tree reorders when wiring composition roots.
  • Groups — Tag components for O(1)-style registry / interface-like lookup without inheritance.
  • Godot notifications — Safe _ready / enter-tree timing for validating and connecting component dependencies.
  • Resources — Share tunables (max health, speeds) as Resources so components stay reusable across entities.

Related Skills

Prerequisites
  • godot-project-foundations — Scene ownership, project layout, and Inspector wiring conventions every composition root assumes.
  • godot-gdscript-mastery — class_name, typed @export, Callables, and assert patterns required for typed component APIs.
  • godot-signal-architecture — Signal-up / call-down connect hygiene so selfish components never grab parent scripts.
Complements
  • godot-resource-data-patterns — Stats and effect definitions as Resources; composition nodes own runtime mutation and emit change events.
  • godot-state-machine-advanced — Child-node FSM / VSM patterns that plug in as a StateComponent without bloating the orchestrator.
  • godot-input-handling — Sense-layer InputComponents that only sample actions; parents pass directions into movement components.
  • godot-characterbody-2d — Physics-body movement APIs VelocityComponents and composition roots call via move_and_slide.
  • godot-2d-physics — Area2D layers/masks and overlap rules HitBox/HurtBox/Interaction components depend on.
  • godot-scene-management — Spawn/despawn entities as composed scenes and re-wire exports when instances are swapped.
Downstream / consumers
  • godot-combat-system — Damage pipelines assemble Health/HitBox/HurtBox components under combat orchestrators.
  • godot-ability-system — Abilities attach as composed workers (cooldowns, targeting) rather than subclassing every caster.
  • godot-rpg-stats — Stat sheets feed Health/StatusEffect components as Resources plus change signals.
  • godot-monte-carlo-balancer — Simulate tunable component exports (HP, damage, speeds) before locking entity kits.
  • godot-composition-apps — Same Has-A node composition applied to tools/apps rather than gameplay entities.
Master
  • godot-master — Library router and mirrored module entry; open when discovering which Domain Skill owns a cross-cutting architecture concern.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Godot Composition?

Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component). Use when designing player controllers, NPCs, enemies, weapons, or complex gameplay systems. Enforces "Has-A" relationships for game entities. Trigger keywords: Entity-Component, ECS, Gameplay, Actors, NPCs, Enemies, Weapons, Hitboxes, Game Loop, Level Design.

Зачем использовать Godot Composition в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Godot Composition — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Godot Composition в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/thedivergentai/GD-Agentic-Skills/tree/main/skills/godot-composition. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Godot Composition?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Godot Composition?

С любым количеством. В TypingMind вы можете использовать Godot Composition с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Godot Composition?

Да. Навык опубликован на GitHub по лицензии LGPL-3.0. Издатель — thedivergentai. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип openclaw

Gitcrawl

openclaw
ОрганизацияПопулярный

Архив GitHub: поиск issue/PR, актуальность синхронизации, группы дубликатов, текущая передача дел на GitHub и работа с репозиториями Gitcrawl.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Graincrawl

openclaw
ОрганизацияПопулярный

Архив Granola: поиск, актуальность синхронизации, заметки, расшифровки, панели, подсчёты SQL и работа с репозиториями Graincrawl.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Changelog Update

openclaw
ОрганизацияПопулярный

Заново формируйте разделы журнала изменений релизов OpenClaw по истории Git перед выпуском бета-, стабильной или расширенной стабильной версии.

82.2K
391K
Файлы: 1
Открыть
Логотип openclaw

Openclaw Ci Limits

openclaw
ОрганизацияПопулярный

Управляйте GitHub Actions и ресурсами CI Blacksmith в OpenClaw: бюджетами регистрации раннеров, ограничениями fanout, одновременным запуском только одного задания для отправок в main, размером шардов, переносом задач на хостed-раннеры, состоянием очереди и безопасным…

82.2K
391K
Файлы: 1
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇