# godot-composition

Tells your agent to build Godot entities from components instead of inheritance chains, with ready-made GDScript files for health, hitboxes and movement.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 519 installs · ★ 893
- Author: thedivergentai
- License: LGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-composition/SKILL.md
- Updated: 2026-10-16
- HTML: https://affpapa.org/en/nevibecode/skills/godot-composition

## What it does

The skill pushes a "Has-A" model: a player, enemy or weapon is a root orchestrator node holding specialised child components. That root script carries no logic of its own — it passes data between children. Shipped scripts cover `health_component.gd`, `hit_box_component.gd`, `hurt_box_component.gd`, `velocity_component.gd`, `interaction_component.gd`, `follower_component.gd`, `state_component_vsm.gd`, `status_effect_component.gd` and `visual_sync_component.gd`.

Wiring goes through typed `@export` slots or `%UniqueNames` in the scene. Reaching for `$` or `get_node()` to grab a component is off the table, because rearranging the tree breaks those paths. A component stays selfish: it never references its owner, talking upward with signals and receiving calls downward. The skill marks `composition_root_init.gd` as the mandatory first read.

A decision table sorts the grey areas. Gameplay behaviours belong in components, cross-scene services such as audio or saves go to `Autoload`, and inheritance is reserved for genuine engine-class specialisation. You need Godot and GDScript — this is a set of rules plus scripts, not a library you import into a project.

## Requirements
- Works with: Godot

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-composition -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/godot-composition/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/godot-composition/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-composition -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/godot-composition/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-composition -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/godot-composition/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install thedivergentai/Game-Dev-Agentic-Skills godot-composition
```

2. **Manually: put the files in place**
- File: `.github/skills/godot-composition/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-composition -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/thedivergentai/Game-Dev-Agentic-Skills --path skills/godot-composition
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/godot-composition/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add thedivergentai/Game-Dev-Agentic-Skills --skill godot-composition -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/thedivergentai/Game-Dev-Agentic-Skills/tree/HEAD/skills/godot-composition/SKILL.md

## When to use it
- split a player controller into separate components
- reuse health logic across players and enemies
- wire hitboxes and damage areas without hardcoded scene paths
- build a state machine out of child nodes
- keep sprite flipping out of movement logic

## Example prompts
- Refactor `player.gd` into components following godot-composition
- Give this enemy shooting through a separate component, no inheritance
- Check my scene: components should be wired with `@export`, not `$`

## Similar
- [godot-nodes-scenes](https://affpapa.org/en/nevibecode/skills/godot-nodes-scenes.md) — skill · 6400 installs
- [godot-csharp](https://affpapa.org/en/nevibecode/skills/godot-csharp.md) — skill · 5900 installs
- [cli-anything-godot](https://affpapa.org/en/nevibecode/skills/cli-anything-godot.md) — skill · 548 installs
- [godot-best-practices](https://affpapa.org/en/nevibecode/skills/godot-best-practices.md) — skill · 2100 installs
- [godot-prompter](https://affpapa.org/en/nevibecode/plugins/godot-prompter.md) — plugin · ★ 867
- [godot](https://affpapa.org/en/nevibecode/rules/godot.md) — rule · ★ 3579

From the same set: [thedivergentai/game-dev-agentic-skills](https://affpapa.org/en/nevibecode/by/thedivergentai/game-dev-agentic-skills.md) — 51 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
