thedivergentai/godot-rpg-stats
Expert blueprint for RPG stat systems (attributes, leveling, modifiers, damage formulas) using Resource-based stats, stackable modifiers, and derived stat calculations. Use when implementing character progression OR equipment/buff systems. Keywords stats, attributes, leveling, modifiers, CharacterStats, derived stats, damage calculation, XP.
npx skills add https://github.com/thedivergentai/GD-Agentic-Skills --skill godot-rpg-stats
Resource-based stats, modifier stacks, and derived calculations define flexible character progression.
> MANDATORY by scenario — read before implementing:
> - Templates / base attributes → base_stats_resource.gd
> - Runtime stack + reactive recalc → stats_component_reactive.gd + stat_modifier_stacking.gd
> - Buff/debuff data → status_effect_data.gd (Type.ADDITIVE / MULTIPLICATIVE / OVERRIDE)
> - Combat math → damage_formula_handler.gd
Core data container for base attributes (Str, Dex, Int) and derived scaling rules.
Serialized buff/debuff definition using StatusEffectData.Type { ADDITIVE, MULTIPLICATIVE, OVERRIDE }.
Orchestrator for JIT (Just-In-Time) stat calculation with active modifier stacking.
Data-driven level-up curve definition using growth factors and base XP.
Reactive UI hook for syncing Labels to stat changes without polling.
Centralized RefCounted utility for complex combat math and damage calculations.
Logic for handling unique vs. stackable buffs and refreshing durations.
Pattern for extending base stats with specialized attributes (Elemental Resists).
Managing the serialization of character progression to .tres files.
Logic for awarding experience and triggering level-up benefits.
Capped base stat Resource with setter clamps + stat_changed signal.
Derived stat that recalculates when base stat dependencies change.
BBCode equipment comparison tooltips (_make_custom_tooltip).
float (0.0–1.0 or 0.0–100.0) to avoid truncation.pow() overflows or soft-locks levels.maxi(val, 1))._process() — Recalc only on modifier/base change (reactive).StatusEffectData.Type and the stacking scripts.| Layer | Responsibility | Script |
|-------|----------------|--------|
| Resource template | Designer-authored base attributes, curves, inheritance | base_stats_resource.gd, exp_progression_resource.gd, resource_stat_inheritance.gd |
| Runtime StatsComponent | Duplicate/instance template, apply/remove modifiers, emit signals, JIT derived stats | MANDATORY stats_component_reactive.gd + stat_modifier_stacking.gd |
| StatusEffectData | Typed buff rows (ADDITIVE / MULTIPLICATIVE / OVERRIDE) | status_effect_data.gd |
| DamageFormula (RefCounted) | Pure combat math shared by Player/NPC | MANDATORY damage_formula_handler.gd |
| Persistence | Save progression; strip runtime buffs first | persistent_character_stats.gd |
| UI sync | Labels listen to signals — no polling | dynamic_stat_label_sync.gd |
Do not paste beginner class_name Stats / Dictionary equipment tutorials — route to the scripts above.
# Author buffs as Resources — not ad-hoc Dictionary modifiers
var haste := StatusEffectData.new()
haste.name = "Haste"
haste.type = StatusEffectData.Type.MULTIPLICATIVE
haste.attribute = "speed"
haste.value = 1.25
haste.duration = 8.0
var flat_str := StatusEffectData.new()
flat_str.type = StatusEffectData.Type.ADDITIVE
flat_str.attribute = "strength"
flat_str.value = 5.0
var break_def := StatusEffectData.new()
break_def.type = StatusEffectData.Type.OVERRIDE
break_def.attribute = "defense"
break_def.value = 0.0
Stacking / refresh / unique-vs-stackable behavior: MANDATORY stat_modifier_stacking.gd. Apply through stats_component_reactive.gd so derived stats recalc once per change.
_process.Equipment hooks, damage formula, skill gates, elite cap/derived/tooltip patterns — references/elite-stat-patterns.md.
> Progressive disclosure: open Official Documentation links only when researching a specific API; load Related Skills when routing to a peer domain — do not preload the whole lattice.
Resource templates you duplicate or instance per character.duplicate(), resource_local_to_scene, and shared-vs-unique semantics that prevent every enemy sharing one HP Resource.@export / @export_group so designers tune attributes and scaling in the Inspector without code edits.stat_changed / stats_recalculated so UI and derived stats react without _process polling.user:// vs res:// for persistent character .tres saves.exists / load paths when restoring progression on boot.create_timer for timed buff expiry without a per-effect Node..tres templates, and composition patterns for attribute data.hp_changed / level_up do not create UI cycles.Take thedivergentai/godot-rpg-stats 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.