# Component System

Use when building reusable node components, composition patterns, component...

- Repository: https://github.com/jame581/GodotPrompter (914 stars)
- Category: Design
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add jame581/GodotPrompter --skill component-system -g -a claude-code -y`
Codex: `npx skills add jame581/GodotPrompter --skill component-system -g -a codex -y`
Cursor: `npx skills add jame581/GodotPrompter --skill component-system -g -a cursor -y`
Gemini CLI: `npx skills add jame581/GodotPrompter --skill component-system -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add jame581/GodotPrompter`

## Description

Use when building reusable node components, composition patterns, component communication, and interface design

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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 inheritance | How components solve it |
|--------------------------|-------------------------|
| Deep chains are brittle, change one class, break many | Each component is an isolated scene with a single job |
| Sharing behavior across unrelated entities requires awkward base classes | Drop a component onto any entity that needs that behavior |
| Adding a new combination means a new subclass | Mix 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

The rest: https://github.com/jame581/GodotPrompter/blob/HEAD/skills/component-system/SKILL.md
