/xenodot:godot-effect-compositionfrom xenodot
Implements stateless data-driven effect composition for Godot 4.x using .tres Resources for abilities, effects, and target resolvers. Enables creating spells, melee swings, status effects without code.
Ships in xenodot. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Builds on godot-data-driven-composition (read it first: carrier + ordered-parts + guarded
seam + .tres-over-JSON + the .tres-sharing caveat + manager-earns-its-place). This flavour
fixes the part-shape to stateless, fire-once Effect Resources and adds the one piece the
base leaves open: a clean two-axis split — WHAT to do (Effect) is independent of WHOM to do
it to (TargetResolver). That split is why most engines/addons get abilities wrong: they bury
targeting inside the ability's activation method. Keep them apart and the same DamageEffect
works on an enemy, a destructible, or the player unchanged.
Specialized variants slot UNDER this skill as their own searchable skills (e.g.
godot-buff,godot-debuff,godot-dot) — each a namedEffecttaxonomy on this same stateless base.
godot-data-driven-composition — the shared core. This skill assumes it.godot-code-rules — Resources need class_name, typed @exports/returns; the duck-typed target
seam goes through has_method + @warning_ignore("unsafe_method_access").godot-composition — Effect / TargetResolver / the ability Resource are sub-resources; the
apply loop lives in the owning entity, never a god-object manager.Ability = a typed Resource (.tres). Holds metadata + @export var effects: Array[Effect]
(ordered) + @export var resolver: TargetResolver.
Effect Resource = WHAT. Tiny base with one virtual; concrete effects @export tunables
and reach the target via a guarded duck-typed seam (so one DamageEffect fits any host):
class_name Effect
extends Resource
func apply(_target: Node, _ctx: AbilityContext) -> void:
pass # no-op base; override per concrete effect
class_name DamageEffect
extends Effect
@export var amount: int = 1
func apply(target: Node, _ctx: AbilityContext) -> void:
if not target.has_method("apply_damage"):
return # no seam -> no-op, never a crash
@warning_ignore("unsafe_method_access")
target.apply_damage(amount)
TargetResolver Resource = WHOM. Answers "who receives the effects" independently of what
they are. Simplest returns the single hit body ([ctx.target]); richer ones do a radius query,
a raycast, a shapecast, or return the instigator (self-buff). Swapping the resolver changes
targeting with zero change to the effects.
class_name TargetResolver
extends Resource
func resolve(_ctx: AbilityContext) -> Array[Node]:
return [] # base; concrete returns hit body / radius query / instigator
Context DTO carries runtime state from the trigger to the effects — a plain RefCounted,
never a node:
class_name AbilityContext
extends RefCounted
var instigator: Node # who caused it
var target: Node # the primary hit (if any)
var origin: Vector3 # where it happened
var normal: Vector3 # surface normal at hit
Application lives in the owning entity (the spawned projectile on body_entered, the melee
hitbox on overlap, the trap) — not a manager:
var ctx := AbilityContext.new()
ctx.instigator = self
ctx.target = body
# ... fill origin/normal ...
for t: Node in ability.resolver.resolve(ctx):
for eff: Effect in ability.effects:
eff.apply(t, ctx)
SpellData, CastData, AbilityData,
TrapData). class_name, extends Resource, the two @exports above (+ metadata).Effect + TargetResolver bases once per project; reuse across every system.Effects (DamageEffect, HealEffect, KnockbackEffect, SlowEffect).
Each duck-types ONE seam method on the target.TargetResolvers (HitTargetResolver, RadiusTargetResolver,
RaycastTargetResolver, SelfTargetResolver → [ctx.instigator])..tres per ability — mix effects + pick a resolver. New ability = new .tres.godot-runtime-smoke): load the .tres, build a Context, run
the resolve+apply loop against a stub/real target, assert the observable. Mirror the entity's
exact loop lines so the test tracks the real path.Delivery-agnostic — swap only the resolver and the owning entity, REUSE the effects:
Owning entity: a melee Area3D hitbox on the weapon, enabled for the swing's active frames.
New resolver MeleeContactResolver — returns area.get_overlapping_bodies() filtered to a
group, so one swing hits everything in the arc:
class_name MeleeContactResolver
extends TargetResolver
func resolve(ctx: AbilityContext) -> Array[Node]:
var out: Array[Node] = []
if ctx.instigator is Area3D: # instigator carries the active hitbox Area3D
for b: Node3D in (ctx.instigator as Area3D).get_overlapping_bodies():
if b.is_in_group("enemies"):
out.append(b)
return out
Same DamageEffect + KnockbackEffect, same Context, same loop — only the resolver and the
trigger node differ. A melee_swing.tres with [DamageEffect(5), KnockbackEffect] +
MeleeContactResolver is a melee ability with zero new effect code. That reuse IS the payoff of
splitting WHAT from WHOM.
Reading sources, not dependencies; each is a C#/C++/migrating addon not adoptable into strict-typed GDScript, but the design ideas transfer:
| Extending toward… | Reference | What to lift |
|---|---|---|
| Prereq / cost / cooldown gate before an ability fires | OctoD godot-gameplay-systems (MIT) | Tag-based gating: tags_activation_required, tags_block, grant_tags_required |
| Delivery taxonomy / AoE & radius / projectile / trap resolvers | MachiTwo AbilitySystem — ASDelivery + ASPackage (MIT) | AreaTargetResolver, RaycastTargetResolver, ShapeCastTargetResolver, ProjectileTargetResolver |
Multi-event / sequenced / repeating effects (on_tick, on_bounce) | kibble-cabal ability-system (MIT) | Effect subclass taxonomy + a LoopEffect for sequenced/repeating; an EffectMap of event_key → [effects] |
| The core split itself (closest ancestor) | willnationsdev — godot-ideas discussion #29 | Targeter / Effect / Skill triad — read before any structural extension |
.tres ONLY (new effect mix / resolver swap) with no call-site
edit, and it works.resolver on an existing .tres (Hit → Radius) changes who is affected without
touching any Effect.Effect subclass is reused across at least two delivery systems (e.g. projectile +
melee) — confirming WHAT is decoupled from WHOM.godot-data-driven-composition.)| Symptom | Fix |
|---|---|
| Targeting logic duplicated across abilities | It belongs in a TargetResolver Resource, not in each effect/ability — extract it. |
| Adding a new resolver forces edits to every effect | They're coupled — the effect must read only the resolved target + ctx, never query targets itself. |
| Context is a Node and leaks / needs freeing | Make it a plain RefCounted DTO — no node lifecycle, no queue_free. |
| Spawned carrier's effects live in a manager → leaking linker nodes | Put hit→effect inside the spawned entity; reject an intermediate "instance" linking layer. |
A stateful Effect bleeds across casts | Effects must be stateless. If one needs per-cast state, it is the wrong flavour (see the .tres-sharing caveat in the base) or must be made unique. |
The stateless flavour of godot-data-driven-composition; stateful sibling godot-enemy-archetype. A game applies it concretely as a game-local skill (e.g. a cast-system). Reference lineage above is MIT-licensed study material, not a dependency.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
godot, effect-composition, data-driven, abilities, game-development
50 skills in this plugin
/agent-reportThe agent→orchestrator handoff protocol. A backgrounded worker's relayed result string truncates on long, tool-heavy turns, so the handoff is an artifact, not a string — the worker Writes its full report to a file, and the orchestrator reads that file directly. Load this whenever a task asks you to hand off a structured report to another agent. Any agent doing background work that must be handed off uses it — not only builders. Defines the report contract the writer follows./autonomous-main-goalThe hive's Autonomous Mode self-drive loop. When a standing Main Goal is active, evaluate it, break it into ordered slices, then on each `[Autonomous check/cavemanUltra-compressed communication mode — always active for this agent. Cuts token usage ~75% by dropping filler, articles, and pleasantries while keeping full technical accuracy. Drop only when interviewing the user via mcp__ui__form (labels/descriptions must be clear prose).
/godot-3d-pixelationSubViewport-based low-resolution crisp rendering of a 3D scene in Godot 4.x — the foundation of the "3D pixel art" style. Use for pixelated/retro/PSX/low-res 3D, setting SubViewport render resolution, "crisp pixels", restructuring a scene tree so 3D renders below window resolution, or when a downscaled viewport looks blurry./godot-animation-librariesImport and play skeletal animations on a sourced 3D character in Godot 4.6 — the separate-glTF workflow (one model file + anim-only files), merging anim clips into an AnimationLibrary loaded onto your own AnimationPlayer, and retargeting a foreign animation (e.g. Mixamo) onto your skeleton via SkeletonProfileHumanoid. Use when an animated rigged .glb arrives in assets/models/, when a character must stop being a static capsule and play a looping idle/walk, when animations come in their own glTF separate from the model, when a sourced animation targets a different skeleton than your character, or when an imported AnimationPlayer's clips won't play / play on the wrong bones. NOT for static-prop import (that is godot-mesh-import + its style delta), NOT for shader-time foliage sway (godot-foliage), NOT for 2D sprite-frame animation./godot-arena-spatial-designOPT-IN spatial-design principles for a combat/arena encounter space in Godot — nine measurable properties (loop topology, interior cover, partitioned sightlines, cover mix, bounded verticality, landmarks, spawn-to-engagement pacing, scale/density, choke-vs-open) that turn a flat blockout into a real firefight space. Use ONLY when the level being built is a combat/arena encounter (enemy waves, gunfights) — apply ALONGSIDE whichever build method is chosen (`godot-greybox` static default, `godot-runtime-arena` runtime, or `godot-gridmap-level` tile-fill). NOT the build mechanism itself, NOT a general level-design bar for non-combat spaces (that's `level-design-principles`).npx claudepluginhub arthur0n/xenodot-forge --plugin xenodotOther plugins' skills for the same job