Agent skill

Godot Composition

by thedivergentai in thedivergentai/GD-Agentic-Skills

Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component).

LGPL-3.0Auto-check passedGame Development

Install Godot Composition

skills CLI
$ npx skills add thedivergentai/GD-Agentic-Skills --skill godot-composition -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install thedivergentai/GD-Agentic-Skills godot-composition --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/thedivergentai/GD-Agentic-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/godot-composition .claude/skills/godot-composition && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
godot-composition
GitHub stars
821
Token cost
~3.7k tokens
SKILL.md length
1,101 words
Files
15 (incl. scripts, references)
Skills in repo
98
Repo updated
First seen
Licence
LGPL-3.0

At a glance

Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component).

  • Works in 5 steps: Connection Strategy: Typed Exports → Component Mindset → State-Component Pattern (FSM) → …
  • Designing player controllers
  • SKILL.md covers Core Philosophy, Decision Tree — Composition vs…, Available Scripts and NEVER Do in Composition, plus 5 more sections
  • Complex gameplay systems

What it does

Godot Composition is an agent skill from thedivergentai/GD-Agentic-Skills. 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.

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 17 other files, including scripts and reference files (for example `references/migration-notes.md` and `references/orchestrator-recipes.md`).

It sits in Game Development, covering Game development, Game design and Design patterns. It works with Godot. The repository describes itself as: The official "Long-Term Memory" for Godot 4.7+ AI Agents. A high-density library of 99 expert skills and 27 genre blueprints, providing audited, strictly typed GDScript patterns… The licence is LGPL-3.0.

When your agent uses it

  • Designing player controllers
  • Complex gameplay systems
  • Keywords: Entity-Component

Example prompts

  • “/godot-composition”

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Connection Strategy: Typed Exports
  2. Component Mindset
  3. State-Component Pattern (FSM)
  4. Component-Registry (O(1) Lookup)
  5. Dependency-Validation

What it can do on your machine

Read from SKILL.md and the folder at commit 4c4d0ff. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 10 files in scripts/, which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.godotengine.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Godot Composition loads about 3.7k tokens when it runs, and up to ~5.5k if it reads all its reference files. Until then it costs about 106 tokens; SKILL.md has 1,101 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~106
When it runs · the whole SKILL.md, loaded when a task matches
~3.7k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from thedivergentai/GD-Agentic-Skills at commit 4c4d0ff, republished under its LGPL-3.0 licence (© thedivergentai). 1,101 words, ~3,743 tokens.

Download SKILL.mdSave it as .claude/skills/godot-composition/SKILL.md (or your agent's skills folder). This skill also uses 14 other files; get the full folder from GitHub.
name
godot-composition
description
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.

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.

Show full SKILL.md (430 more words)Show less

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.
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.

© thedivergentai, LGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 14 other files (scripts, references) in skills/godot-composition of thedivergentai/GD-Agentic-Skills.

  • SKILL.md
  • references/migration-notes.md
  • references/orchestrator-recipes.md
  • resources/health_component.gd
  • resources/hitbox_component.gd
  • scripts/composition_root_init.gd
  • scripts/follower_component.gd
  • scripts/health_component.gd
  • scripts/hit_box_component.gd
  • scripts/hurt_box_component.gd
  • scripts/interaction_component.gd
  • scripts/state_component_vsm.gd
  • scripts/status_effect_component.gd
  • scripts/velocity_component.gd
  • scripts/visual_sync_component.gd

Open the folder on GitHubat commit 4c4d0ff

Compare with similar skills

Godot Composition next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Godot Composition compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Godot Composition this skillthedivergentai/GD-Agentic-Skills821—~3.7kAutomated safety check: PassLGPL-3.0
Godot Gdscript Patterns925236118/AlphaAgent10310 repos~5kAutomated safety check: PassMIT
Godot Ability Systemjame581/GodotPrompter805—~3kAutomated safety check: PassMIT
Godot Camera Systemsjame581/GodotPrompter805—~2.8kAutomated safety check: PassMIT
Input MapperRandallLiuXin/GodotMaker5501 repos~727Automated safety check: PassCustom licence
Dependency Injectionjame581/GodotPrompter805—~2.8kAutomated safety check: PassMIT

Similar skills

  • Godot Gdscript Patterns

    925236118/AlphaAgent

    Master Godot 4 GDScript patterns including signals, scenes, state machines, and optimization.

    103 GitHub starsUsed in 10 repos~5k tokens
    Game DevelopmentAuto-check passed
  • Godot Ability System

    jame581/GodotPrompter

    Builds a data-driven ability system in Godot 4 from Resources and a component node, with cooldowns, buffs, stat modifiers, gameplay tags and HUD binding.

    805 GitHub stars~3k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot Camera Systems

    jame581/GodotPrompter

    Shows how to build cameras in Godot 4.3 and later: smooth follow, trauma-based screen shake, camera zones and transitions, with GDScript and C# examples for 2D and 3D.

    805 GitHub stars~2.8k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Input Mapper

    RandallLiuXin/GodotMaker

    Manage Godot input action mappings in project.godot. An agent skill from RandallLiuXin/GodotMaker.

    550 GitHub starsUsed in 1 repo~727 tokens
    Game DevelopmentAuto-check passed
  • Dependency Injection

    jame581/GodotPrompter

    A skill your agent uses when managing dependencies between systems — autoloads, service locators, @export injection, and scene injection patterns

    805 GitHub stars~2.8k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot

    autonomous-ai/openharness

    Build Godot games with GDScript, native gameplay assertions and sandboxed Web exports.

    1.2k GitHub stars~570 tokensUpdated yesterday
    Game DevelopmentAuto-check passed

More from thedivergentai/GD-Agentic-Skills

All 98 skills in this repo
  • Godot 2D Animation

    thedivergentai/GD-Agentic-Skills

    Expert patterns for 2D animation in Godot using AnimatedSprite2D and skeletal cutout rigs.

    821 GitHub stars~3.6k tokensUpdated 1 mo ago
    Auto-check passed
  • Godot 3D World Building

    thedivergentai/GD-Agentic-Skills

    Expert patterns for 3D level design using GridMap with MeshLibrary, CSG constructive solid geometry, occlusion, and runtime GridMap builders.

    821 GitHub stars~3.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Godot Adapt 2D To 3D

    thedivergentai/GD-Agentic-Skills

    Expert patterns for migrating 2D games to 3D including node type conversions, camera systems (third-person, first-person, orbit), physics layer migration, sprite-to-model art pipeline, and control…

    821 GitHub stars~4.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Godot Adapt 3D To 2D

    thedivergentai/GD-Agentic-Skills

    Expert patterns for simplifying 3D games to 2D including dimension reduction strategies, 2.5D fake-depth, isometric ports, camera flattening, physics conversion, 3D-to-sprite art pipeline, and…

    821 GitHub stars~4.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Godot Agent Vision

    thedivergentai/GD-Agentic-Skills

    Agentic eyes for Godot work: cross-platform screenshot CLI (asset/region/window/screen) to budgeted WebP, TEMP editor viewport bridge under .gdskills/, and Taste Receptor Atlas v2 (~237…

    821 GitHub stars~3.5k tokensUpdated 1 mo ago
    Auto-check passed
  • Godot Animation Tree Mastery

    thedivergentai/GD-Agentic-Skills

    Expert patterns for AnimationTree including StateMachine transitions, BlendSpace2D for directional movement, BlendTree for layered animations, root motion, transition conditions, advance…

    821 GitHub stars~3.6k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about Godot Composition

What does Godot Composition do?

Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component). Godot Composition is an agent skill from thedivergentai/GD-Agentic-Skills. Expert architectural standards for building scalable Godot GAMES (RPGs, Platformers, Shooters) using the Composition pattern (Entity-Component).

When should I use Godot Composition?

Godot Composition fits situations like: designing player controllers; complex gameplay systems; keywords: Entity-Component.

How do I install Godot Composition in Claude Code?

Run `npx skills add thedivergentai/GD-Agentic-Skills --skill godot-composition -a claude-code`. Or copy the skill folder (skills/godot-composition in thedivergentai/GD-Agentic-Skills) into .claude/skills/godot-composition in your project. Claude Code loads it when a task matches its description.

How do I install Godot Composition in Codex?

Run `npx skills add thedivergentai/GD-Agentic-Skills --skill godot-composition -a codex`. Or copy the skill folder (skills/godot-composition in thedivergentai/GD-Agentic-Skills) into .agents/skills/godot-composition in your project. Codex loads it when a task matches its description.

Can I use Godot Composition in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add thedivergentai/GD-Agentic-Skills --skill godot-composition -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/godot-composition, .gemini/skills/godot-composition, .github/skills/godot-composition and .opencode/skills/godot-composition in your project.

What does Godot Composition need to run?

SKILL.md names no scripts, command-line tools or credentials: Godot Composition is instructions for the agent only.

Does Godot Composition access the network?

SKILL.md names 1 domain. As links in the text: docs.godotengine.org. This is read from the text; nothing was executed.

Is Godot Composition safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Godot Composition use?

Godot Composition is published under the LGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Godot Composition use?

About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.8k tokens, read only when the agent opens those files.

What are the alternatives to Godot Composition?

Skills that share tags, products or a category with Godot Composition: Godot Gdscript Patterns (925236118/AlphaAgent, 103 stars), Godot Ability System (jame581/GodotPrompter, 805 stars), Godot Camera Systems (jame581/GodotPrompter, 805 stars) and Input Mapper (RandallLiuXin/GodotMaker, 550 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Godot Composition?

thedivergentai (a GitHub user) maintains it in thedivergentai/GD-Agentic-Skills, which has 821 GitHub stars. The repository holds 98 skills in this directory. The repository was last updated on September 9, 2026.

Source: thedivergentai/GD-Agentic-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.