thedivergentai/godot-combat-system
Expert patterns for combat systems including hitbox/hurtbox architecture, damage calculation (DamageData class), health components, combat state machines, combo systems, ability cooldowns, and damage popups. Use for action games, RPGs, or fighting games. Trigger keywords: Hitbox, Hurtbox, DamageData, HealthComponent, combat_state, combo_system, ability_cooldown, invincibility_frames, damage_popup.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-combat-system
Component combat pipeline — DamageData → Hitbox/Hurtbox → HealthComponent — not inline Hitbox/Combo/Ability novels.
target.health -= 10) — Bypass armor, resistances, and i-frames. Always DamageData + HealthComponent.take_damage.enum / @export_flags bitfields. String "physical" violates this skill’s own contract.has_method(&"take_damage") / is checks.OS.delay_msec() — Blocks the OS thread. Use tweens / Engine.time_scale + ignore_time_scale timers._process() — Use _physics_process / _integrate_forces.health_changed; HUD listens.set_deferred("disabled", true) on death.radius, size), not the node transform unevenly.Resource / RefCounted containers; duplicate() per instance.StringName (&"attacking").duplicate() on shared Resource stats — Shared templates = shared health pools.DamageData Resource with enum / flags for damage types (no String elements).take_damage + i-frame gate + health_changed / died signals.Do NOT re-inline Hitbox/Health/Combo/Ability tutorials in scenes. Route abilities to godot-ability-system; compose components per godot-composition; FSMs via godot-state-machine-advanced.
| Task | Load | Do NOT Load |
|------|------|-------------|
| Define damage payload | damage_data.gd | String damage_type fields |
| HP + i-frames | health_component.gd | Direct health -= n |
| Melee/projectile volumes | hitbox_hurtbox.gd / hitbox_component.gd | Permanent monitoring Areas |
| AoE / hit-stop / duck-type | combat_system_patterns.gd | Spawn temp Areas every tick |
| Ability cooldowns / skill bar | godot-ability-system | Inline AbilityManager novels here |
| Combo buffers | godot-input-handling + state machine | Embedding hit logic in _input |
# From damage_data.gd — prefer this shape everywhere
enum DamageType { PHYSICAL = 1, FIRE = 2, ICE = 4, LIGHTNING = 8, POISON = 16 }
@export_flags("Physical", "Fire", "Ice", "Lightning", "Poison")
var damage_types: int = DamageType.PHYSICAL
Hitboxes must pass DamageData (or equivalent AttackData built from the same flags), never "Physical" strings.
SceneTree.debug_collisions_hint.> MANDATORY for telemetry, networked hits, combos, and moved inline tutorials: elite-combat-patterns.md. Do NOT Load for first DamageData + HealthComponent pass.
> Progressive disclosure: Skim Official Documentation only for the APIs you are implementing (Areas, layers/masks, Resources, signals, timers, animation hit windows). Open Related Skills when wiring adjacent systems—do not preload the whole lattice.
area_entered / monitoring), not CharacterBody movement queries.monitoring/monitorable, area_entered, and layer/mask bits for team/faction filtering.HitboxComponent / hurtbox volumes use the same Area overlap model with 3D layers and shapes.set_deferred("disabled", …) so the physics server is not mutated mid-step; never non-uniform-scale the node.intersect_shape on PhysicsDirectSpaceState3D without spawning temporary Area nodes.DamageData / combat stats as data (Resource / RefCounted), and duplicate() shared templates per instance so enemies do not share one health pool.health_changed / died / damage events so HUD and VFX subscribe without coupling lifebars into the player script.Engine.time_scale = 0 must use create_timer(..., ignore_time_scale=true) or the thaw timer freezes with the world.@rpc before applying take_damage.CollisionShape2D deferred disable, and space queries are the physics substrate under hitbox/hurtbox filtering.HealthComponent / HitboxComponent children over baking combat into a monolithic Character script.DamageData, elemental flags, and combat stats belong in Resource/RefCounted data with safe duplicate() on spawn.DamageData.take_damage before health is written.can_act, not ad-hoc bool soup.Take thedivergentai/godot-combat-system from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.