godot-gdscript-patternslisted
Install: claude install-skill haingt-dev/agent
# Godot GDScript Patterns
## Shared Conventions (Wildtide + Chimera)
### Naming
- Files/variables/functions: `snake_case`
- Classes: `PascalCase`
- Constants: `SCREAMING_SNAKE_CASE`
- Signals: `snake_case` past tense (`health_changed`, `died`)
### Typing
- Static typing mandatory: all vars, params, returns, loop vars
- `@export` for inspector, `@onready` for node refs
- `##` docstrings (double hash) for public API, not `#` comments
### Architecture Rules
- Resources (`.tres`) for data, scripts for logic — never hardcode tunable values
- Signals for decoupling — avoid `get_node()` chains between systems
- Composition over deep inheritance (especially Chimera)
- Max 3 autoloads (Wildtide: GameManager, MetricSystem, EventBus)
## Pattern Selection Guide
When building a new system, choose pattern based on the problem:
| Problem | Pattern | When NOT to use |
|---|---|---|
| Entity with multiple behavior modes | State Machine | <3 states (just use if/match) |
| Shared behavior across entity types | Component System | Behavior only used by 1 entity type |
| Game-wide event communication | Signal Bus (EventBus autoload) | Direct parent-child communication |
| Data variation (weapons, enemies, items) | Resource (`.tres` files) | Runtime-only calculated values |
| Frequently spawned/destroyed objects | Object Pool | <20 objects or infrequent spawning |
| Async scene transitions | Scene Manager | Simple `get_tree().change_scene_to_file()` |
| Persistent game state | Save Manager (