Install any skill in seconds. Free to start, no credit card required.
Get Started Free →jame581/component-system
Use when building reusable node components — composition patterns, component communication, and interface design
Passed 16 of 22 test cases with the skill, and 14 of 22 without it.
and 4 more in the full report
4 fixed12 passed either way4 still failing2 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
I'm building a Godot 4.3 2D action game and want to implement modular combat hit detection using component architecture. Could you write GDScript scripts for a damage-dealing Area2D component and a hit-receiving Area2D component? I need the damage dealer to support temporary attack cooldowns, emit custom signals when hitting a target, and trigger damage on the target. The receiver should support invincibility frames and pass damage through to an exported health component reference if present.
| Checked | Without skill | With skill |
|---|---|---|
| Hitbox component defines signal hit(target_hurtbox: HurtboxComponent) | Missed | Passed |
| Hurtbox component defines method receive_hit(damage: int) | Missed | Passed |
| Hurtbox component defines signal hurt(damage_amount: int) | Missed | Passed |
The instructions your model reads when the skill loads.
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.
| 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:
HealthComponent works on a player, an enemy, a destructible crate, or a boss with no code changes.HitboxComponent and a PatrolComponent independently. Removing one does not affect the other.HealthAndShieldAndRegenComponent, split it.get_parent().get_node("SiblingComponent"). Emit a signal instead.@export configuration over storing mutable state. When state is necessary, keep it private.@export for all configuration. Damage amount, cooldown duration, and layer masks belong in the Inspector, not hardcoded constants.| Component | Purpose | Key Signals |
|---|---|---|
HealthComponent | Tracks current and max HP, applies damage and healing | health_changed(current, maximum), died |
HitboxComponent | Detects overlapping hurtboxes and triggers damage | hit(target_hurtbox) |
HurtboxComponent | Receives hits, routes damage to HealthComponent | hurt(damage_amount) |
test cases passed, vs 14 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.