Agent skill

Component System

by jame581 in jame581/GodotPrompter

A skill your agent uses when building reusable node components — composition patterns, component communication, and interface design

MITAuto-check passedGame Development

Install Component System

skills CLI
$ npx skills add jame581/GodotPrompter --skill component-system -a claude-code

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

GitHub CLI
$ gh skill install jame581/GodotPrompter component-system --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/jame581/GodotPrompter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/component-system .claude/skills/component-system && 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
component-system
GitHub stars
795
Token cost
~3.3k tokens
SKILL.md length
657 words
Files
1
Skills in repo
58
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when building reusable node components — composition patterns, component communication, and interface design

  • Works in 9 steps: Why Components → Component Design Rules → Common Components → …
  • Building reusable node components — composition patterns
  • SKILL.md covers 1. Why Components, 2. Component Design Rules, 3. Common Components and 4. HitboxComponent, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Component System is an agent skill from jame581/GodotPrompter. Use when building reusable node components — composition patterns, component communication, and interface design

Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Game Development, covering Game development, Design patterns and API design. It works with Godot. The repository describes itself as: Agentic skills framework for Godot 4.x. Domain-specific skills for AI coding agents (Claude Code, Copilot, Antigravity, Cursor). The licence is MIT.

When your agent uses it

  • Building reusable node components — composition patterns
  • Component communication
  • Interface design

Example prompts

  • “/component-system”

Workflow steps

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

  1. Why Components
  2. Component Design Rules
  3. Common Components
  4. HitboxComponent
  5. HurtboxComponent
  6. Component Communication
  7. Wiring Components
  8. Finding Components at Runtime
  9. Implementation Checklist

What it can do on your machine

Read from SKILL.md and the folder at commit 1e7d79d. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are gdscript and csharp).

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

  • Network

    No URLs in SKILL.md.

    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

Component System loads about 3.3k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 657 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~32
When it runs · the whole SKILL.md, loaded when a task matches
~3.3k

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); files beside SKILL.md are not scanned.

SKILL.md

The full file from jame581/GodotPrompter at commit 1e7d79d, republished under its MIT licence (© jame581). 657 words, ~3,330 tokens.

Download SKILL.mdSave it as .claude/skills/component-system/SKILL.md (or your agent's skills folder).
name
component-system
description
Use when building reusable node components — composition patterns, component communication, and interface design

Component System in Godot 4.3+

Build behavior through composition. Attach small, focused components to any entity rather than climbing an inheritance chain. All examples target Godot 4.3+ with no deprecated APIs.

Related skills: scene-organization for scene tree composition, event-bus for decoupled component communication, resource-pattern for data-driven component configuration, physics-system for Area2D/3D overlap detection and collision shapes, ability-system for an AbilityComponent example built on this pattern.


1. Why Components

Problem with inheritanceHow components solve it
Deep chains are brittle — change one class, break manyEach component is an isolated scene with a single job
Sharing behavior across unrelated entities requires awkward base classesDrop a component onto any entity that needs that behavior
Adding a new combination means a new subclassMix and match components freely at the scene level

Key benefits:

  • Reuse across entities — a HealthComponent works on a player, an enemy, a destructible crate, or a boss with no code changes.
  • Separation of concerns — damage detection, health tracking, and state animation are each their own file. Debugging is local.
  • Mix-and-match behaviors — give an enemy a HitboxComponent and a PatrolComponent independently. Removing one does not affect the other.

2. Component Design Rules

  1. One responsibility per component. If you find yourself naming it HealthAndShieldAndRegenComponent, split it.
  2. Communicate via signals, not direct sibling access. A component must not call get_parent().get_node("SiblingComponent"). Emit a signal instead.
  3. Stateless where possible. Prefer deriving state from inputs and @export configuration over storing mutable state. When state is necessary, keep it private.
  4. Use @export for all configuration. Damage amount, cooldown duration, and layer masks belong in the Inspector, not hardcoded constants.

3. Common Components

ComponentPurposeKey Signals
HealthComponentTracks current and max HP, applies damage and healinghealth_changed(current, maximum), died
HitboxComponentDetects overlapping hurtboxes and triggers damagehit(target_hurtbox)
HurtboxComponentReceives hits, routes damage to HealthComponenthurt(damage_amount)
InteractableComponentMarks an entity as interactable and fires on player overlapinteracted(interactor)
StateMachineComponentDelegates _process and _physics_process to child state nodesstate_changed(from, to)

4. HitboxComponent

Attach to any entity that deals damage. Configure damage in the Inspector.

GDScript (hitbox_component.gd)
gdscript
class_name HitboxComponent
extends Area2D

## Damage dealt to the target hurtbox on contact.
@export var damage: int = 10

## Minimum seconds between successive hits (0 = no cooldown).
@export var cooldown_duration: float = 0.5

signal hit(target_hurtbox: HurtboxComponent)

var _on_cooldown: bool = false

@onready var _cooldown_timer: Timer = _build_timer()


func _ready() -> void:
	area_entered.connect(_on_area_entered)


func _on_area_entered(area: Area2D) -> void:
	if _on_cooldown:
		return
	if area is not HurtboxComponent:
		return
	hit.emit(area)
	area.receive_hit(damage)
	if cooldown_duration > 0.0:
		_on_cooldown = true
		_cooldown_timer.start(cooldown_duration)


func _on_cooldown_timeout() -> void:
	_on_cooldown = false


func _build_timer() -> Timer:
	var t := Timer.new()
	t.one_shot = true
	t.timeout.connect(_on_cooldown_timeout)
	add_child(t)
	return t
C# (HitboxComponent.cs)
csharp
using Godot;

public partial class HitboxComponent : Area2D
{
    /// <summary>Damage dealt to the target hurtbox on contact.</summary>
    [Export] public int Damage { get; set; } = 10;

    /// <summary>Minimum seconds between successive hits (0 = no cooldown).</summary>
    [Export] public float CooldownDuration { get; set; } = 0.5f;

    [Signal] public delegate void HitEventHandler(HurtboxComponent targetHurtbox);

    private bool _onCooldown;
    private Timer _cooldownTimer;

    public override void _Ready()
    {
        _cooldownTimer = new Timer { OneShot = true };
        _cooldownTimer.Timeout += OnCooldownTimeout;
        AddChild(_cooldownTimer);

        AreaEntered += OnAreaEntered;
    }

    private void OnAreaEntered(Area2D area)
    {
        if (_onCooldown) return;
        if (area is not HurtboxComponent hurtbox) return;

        EmitSignal(SignalName.Hit, hurtbox);
        hurtbox.ReceiveHit(Damage);

        if (CooldownDuration > 0f)
        {
            _onCooldown = true;
            _cooldownTimer.Start(CooldownDuration);
        }
    }

    private void OnCooldownTimeout() => _onCooldown = false;
}

5. HurtboxComponent

Attach to any entity that can take damage. Wire it to a sibling HealthComponent via @export.

GDScript (hurtbox_component.gd)
gdscript
class_name HurtboxComponent
extends Area2D

## Reference to the HealthComponent on the same entity.
@export var health_component: HealthComponent

## Invincibility frame duration in seconds (0 = none).
@export var invincibility_duration: float = 0.0

signal hurt(damage_amount: int)

var _invincible: bool = false

@onready var _iframes_timer: Timer = _build_timer()


func receive_hit(damage: int) -> void:
	if _invincible:
		return
	hurt.emit(damage)
	if health_component:
		health_component.take_damage(damage)
	if invincibility_duration > 0.0:
		_invincible = true
		_iframes_timer.start(invincibility_duration)


func _on_iframes_timeout() -> void:
	_invincible = false


func _build_timer() -> Timer:
	var t := Timer.new()
	t.one_shot = true
	t.timeout.connect(_on_iframes_timeout)
	add_child(t)
	return t
C# (HurtboxComponent.cs)
csharp
using Godot;

public partial class HurtboxComponent : Area2D
{
    /// <summary>Reference to the HealthComponent on the same entity.</summary>
    [Export] public HealthComponent HealthComponent { get; set; }

    /// <summary>Invincibility frame duration in seconds (0 = none).</summary>
    [Export] public float InvincibilityDuration { get; set; } = 0f;

    [Signal] public delegate void HurtEventHandler(int damageAmount);

    private bool _invincible;
    private Timer _iframesTimer;

    public override void _Ready()
    {
        _iframesTimer = new Timer { OneShot = true };
        _iframesTimer.Timeout += OnIframesTimeout;
        AddChild(_iframesTimer);
    }

    public void ReceiveHit(int damage)
    {
        if (_invincible) return;

        EmitSignal(SignalName.Hurt, damage);
        HealthComponent?.TakeDamage(damage);

        if (InvincibilityDuration > 0f)
        {
            _invincible = true;
            _iframesTimer.Start(InvincibilityDuration);
        }
    }

    private void OnIframesTimeout() => _invincible = false;
}

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

6. Component Communication

Components must not call methods on siblings directly. Use signals to keep them decoupled.

┌─────────────────────────────────────────────────────┐
│  Entity (CharacterBody2D)                            │
│                                                      │
│  ┌──────────────┐    hit(hurtbox)                    │
│  │ HitboxComponent ──────────────────────────────┐  │
│  └──────────────┘                                 │  │
│                                                   ▼  │
│                              ┌─────────────────────┐ │
│                              │  HurtboxComponent   │ │
│                              │  receive_hit(dmg)   │ │
│                              │  ──── calls ──────► │ │
│                              │  HealthComponent    │ │
│                              │  .take_damage(dmg) │ │
│                              └────────┬────────────┘ │
│                                       │              │
│                              health_changed / died   │
│                                       │              │
│                              ┌────────▼────────────┐ │
│                              │  HealthComponent    │ │
│                              │  emits: died        │ │
│                              └─────────────────────┘ │
└─────────────────────────────────────────────────────┘

Flow explained:

  1. HitboxComponent detects an overlapping HurtboxComponent via area_entered.
  2. It emits hit(target_hurtbox) (for the entity's own logic, e.g. playing a sound) and calls target_hurtbox.receive_hit(damage) — the only cross-component call, and it targets the direct interface of the hurtbox, not a sibling.
  3. HurtboxComponent.receive_hit() emits hurt(damage_amount) for animation/VFX, then calls health_component.take_damage(damage) on its explicitly wired reference.
  4. HealthComponent.take_damage() updates HP and emits health_changed or died. Listeners (UI, GameManager, etc.) connect to those signals without touching the combat components.

7. Wiring Components

Three patterns in order of preference:

@export NodePath — most flexible, works across the scene tree
gdscript
# hurtbox_component.gd
@export var health_component: HealthComponent

# Inspector: drag the HealthComponent node into the slot.

Gotcha: @export node references are wired via the editor inspector. If you build scenes programmatically or hand-write .tscn files, the reference may be null at runtime. In that case, wire it explicitly in the parent's _ready():

gdscript
hurtbox.health_component = health_component
@onready direct child — simple when the component is a known child
gdscript
# enemy.gd
@onready var health: HealthComponent = $HealthComponent
@onready var hurtbox: HurtboxComponent = $HurtboxComponent
get_node pattern — when the path is dynamic or optional
gdscript
func _ready() -> void:
	var health := get_node_or_null("HealthComponent") as HealthComponent
	if health:
		health.died.connect(_on_died)

Prefer @export when the wired node lives elsewhere in the tree. Prefer @onready for direct children that are always present. Use get_node_or_null when the component is optional.

C# parity
csharp
// Pattern 1: [Export] property — drag-and-drop in the Inspector.
public partial class HurtboxComponent : Area3D
{
    [Export] public HealthComponent Health { get; set; }
}

// Pattern 2: GetNode<T> for a known child path (equivalent to @onready var x := $Path).
public partial class Enemy : CharacterBody3D
{
    private HealthComponent _health;
    private HurtboxComponent _hurtbox;

    public override void _Ready()
    {
        _health = GetNode<HealthComponent>("HealthComponent");
        _hurtbox = GetNode<HurtboxComponent>("HurtboxComponent");
        _health.Died += QueueFree;
    }
}

// Pattern 3: GetNodeOrNull<T> when the component is optional (equivalent to get_node_or_null).
public partial class Pickup : Node3D
{
    public override void _Ready()
    {
        var health = GetNodeOrNull<HealthComponent>("HealthComponent");
        if (health != null)
            health.Died += OnDied;
    }

    private void OnDied() { /* ... */ }
}

8. Finding Components at Runtime

Use a static utility to locate the first component of a given type on any entity. This avoids hardcoding node names across different entity scenes.

GDScript (component_utils.gd)
gdscript
class_name ComponentUtils


## Returns the first child of [param entity] that is an instance of [param component_type],
## or null if none is found.
static func get_component(entity: Node, component_type: GDScript) -> Node:
	for child in entity.get_children():
		if is_instance_of(child, component_type):
			return child
	return null


## Example usage:
##   var health := ComponentUtils.get_component(enemy, HealthComponent) as HealthComponent
##   if health:
##       health.take_damage(5)
C# (ComponentUtils.cs)
csharp
using Godot;

public static class ComponentUtils
{
    /// <summary>
    /// Returns the first child of <paramref name="entity"/> that is of type
    /// <typeparamref name="T"/>, or null if none is found.
    /// </summary>
    public static T GetComponent<T>(Node entity) where T : Node
    {
        foreach (var child in entity.GetChildren())
        {
            if (child is T component)
                return component;
        }
        return null;
    }
}

// Example usage:
//   var health = ComponentUtils.GetComponent<HealthComponent>(enemy);
//   health?.TakeDamage(5);

9. Implementation Checklist

  • Each component is saved as its own .tscn scene and reused by instancing
  • Components communicate through signals — no get_parent().get_node("Sibling") calls
  • No direct sibling access anywhere inside a component script
  • All tuneable values (damage, max_health, cooldown_duration) are @export
  • Each component can be tested by attaching it to a minimal test scene in isolation

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

Files

Just SKILL.md in skills/component-system of jame581/GodotPrompter.

Open the folder on GitHubat commit 1e7d79d

Compare with similar skills

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

Component System compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Component System this skilljame581/GodotPrompter795—~3.3kAutomated safety check: PassMIT
Godot Autoload Architecturethedivergentai/GD-Agentic-Skills809—~3.4kAutomated safety check: PassLGPL-3.0
Godot Compositionthedivergentai/GD-Agentic-Skills809—~3.7kAutomated safety check: PassLGPL-3.0
Godot Composition Appsthedivergentai/GD-Agentic-Skills809—~3.6kAutomated safety check: PassLGPL-3.0
Godot Gdscript Patterns925236118/AlphaAgent10310 repos~5kAutomated safety check: PassMIT
2D Map and Scene Generator0x0funky/agent-sprite-forge4.3k—~2.9kAutomated safety check: PassMIT

Similar skills

  • Godot Autoload Architecture

    thedivergentai/GD-Agentic-Skills

    Expert patterns for Godot AutoLoad (singleton) architecture including global state management, scene transitions, signal-based communication, dependency injection, autoload initialization order, and…

    809 GitHub stars~3.4k tokensUpdated 29 days ago
    Game DevelopmentAuto-check passed
  • Godot Composition

    thedivergentai/GD-Agentic-Skills

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

    809 GitHub stars~3.7k tokensUpdated 29 days ago
    Game DevelopmentAuto-check passed
  • Godot Composition Apps

    thedivergentai/GD-Agentic-Skills

    Expert architectural standards for scalable Godot Apps, Tools, EditorPlugins, and Control-heavy UIs using Composition (Has-A Orchestrator + components).

    809 GitHub stars~3.6k tokensUpdated 29 days ago
    Game DevelopmentAuto-check passed
  • 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
  • 2D Map and Scene Generator

    0x0funky/agent-sprite-forge

    Plans and builds 2D game maps and scenes, from tilemaps and parallax backgrounds to HD-2D plates, with collision checks, a playable HTML preview and Tiled, Godot or LDtk export.

    4.3k GitHub stars~2.9k tokensUpdated yesterday
    Game DevelopmentAuto-check passed
  • Godot UI Containers

    thedivergentai/GD-Agentic-Skills

    Expert blueprint for responsive UI layouts using Container nodes (HBoxContainer, VBoxContainer, GridContainer, MarginContainer, ScrollContainer, HFlowContainer, SubViewportContainer).

    809 GitHub starsUsed in 1 repo~3.7k tokens
    Game DevelopmentAuto-check passed

More from jame581/GodotPrompter

All 58 skills in this repo
  • Godot 2D Essentials

    jame581/GodotPrompter

    Covers Godot 4.3+ 2D systems with GDScript and C# examples: canvas layers, draw order, TileMaps, parallax, lights and shadows, particles and custom drawing.

    795 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Godot 3D Essentials

    jame581/GodotPrompter

    Covers Godot 4.3+ 3D systems such as materials, lighting, shadows, environment, global illumination, fog, LOD, occlusion culling and decals, with GDScript first and C# second.

    795 GitHub stars~3.7k tokensUpdated yesterday
    Auto-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.

    795 GitHub stars~3k tokensUpdated yesterday
    Auto-check passed
  • Godot Addon Development

    jame581/GodotPrompter

    Covers Godot 4.3+ editor plugins: plugin folders, @tool scripts, the EditorPlugin lifecycle, custom inspectors, dock panels and gizmos, in GDScript and C#.

    795 GitHub stars~3.3k tokensUpdated yesterday
    Auto-check passed
  • Godot AI Navigation

    jame581/GodotPrompter

    Covers pathfinding and enemy movement in Godot 4.3 and later: navigation regions, NavigationAgent nodes, steering, behavior trees and patrol routes.

    795 GitHub stars~3.5k tokensUpdated yesterday
    Auto-check passed
  • Godot Animation System

    jame581/GodotPrompter

    Covers animation in Godot 4.3 and later: AnimationPlayer basics, AnimationTree blend trees and state machines, sprite animation, skeleton IK and code-driven motion.

    795 GitHub stars~3.8k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Component System

What does Component System do?

A skill your agent uses when building reusable node components — composition patterns, component communication, and interface design. Component System is an agent skill from jame581/GodotPrompter.

When should I use Component System?

Component System fits situations like: building reusable node components — composition patterns; component communication; interface design.

How do I install Component System in Claude Code?

Run `npx skills add jame581/GodotPrompter --skill component-system -a claude-code`. Or copy the skill folder (skills/component-system in jame581/GodotPrompter) into .claude/skills/component-system in your project. Claude Code loads it when a task matches its description.

How do I install Component System in Codex?

Run `npx skills add jame581/GodotPrompter --skill component-system -a codex`. Or copy the skill folder (skills/component-system in jame581/GodotPrompter) into .agents/skills/component-system in your project. Codex loads it when a task matches its description.

Can I use Component System 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 jame581/GodotPrompter --skill component-system -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/component-system, .gemini/skills/component-system, .github/skills/component-system and .opencode/skills/component-system in your project.

What does Component System need to run?

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

Does Component System access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Component System 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. Review the folder before installing.

What licence does Component System use?

Component System is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Component System use?

About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Component System?

Skills that share tags, products or a category with Component System: Godot Autoload Architecture (thedivergentai/GD-Agentic-Skills, 809 stars), Godot Composition (thedivergentai/GD-Agentic-Skills, 809 stars), Godot Composition Apps (thedivergentai/GD-Agentic-Skills, 809 stars) and Godot Gdscript Patterns (925236118/AlphaAgent, 103 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Component System?

jame581 (a GitHub user) maintains it in jame581/GodotPrompter, which has 795 GitHub stars. The repository holds 58 skills in this directory. The repository was last updated on October 6, 2026.

Source: jame581/GodotPrompter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.