claude-code-arcane 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +104 -55
  3. package/agents/career/career-strategist.md +88 -0
  4. package/agents/career/cv-reviewer.md +81 -0
  5. package/agents/career/hiring-manager.md +68 -0
  6. package/agents/career/mock-interviewer.md +76 -0
  7. package/agents/freelance/client-screener.md +84 -0
  8. package/agents/freelance/discovery-call.md +65 -0
  9. package/agents/freelance/pipeline-strategist.md +99 -0
  10. package/agents/freelance/proposal-reviewer.md +82 -0
  11. package/agents/game/ue-blueprint-specialist.md +125 -0
  12. package/agents/game/ue-gas-specialist.md +133 -0
  13. package/agents/game/ue-umg-specialist.md +131 -0
  14. package/dist/cli.js +57 -13
  15. package/docs/RELEASE-SETUP.md +1 -1
  16. package/docs/SKILLS-CATALOG.md +67 -4
  17. package/docs/USER-GUIDE.md +77 -72
  18. package/docs/agent-hierarchy.md +21 -1
  19. package/docs/presentations/build_arcane_deck.py +2 -2
  20. package/docs/presentations/build_arcane_deck_12.py +2 -2
  21. package/hooks/detect-unreal.sh +90 -0
  22. package/package.json +2 -2
  23. package/profiles/freelance.yaml +43 -0
  24. package/profiles/job-hunt.yaml +5 -2
  25. package/profiles/unreal-dev.yaml +97 -0
  26. package/rules/drafter-reviewer.md +16 -3
  27. package/rules/freelance-guardrails.md +53 -0
  28. package/rules/gamedev/unreal-code.md +125 -0
  29. package/skills/career-registry/SKILL.md +95 -0
  30. package/skills/career-registry/scripts/career_registry.py +488 -0
  31. package/skills/client-screen/SKILL.md +83 -0
  32. package/skills/client-screen/references/red-flags.md +95 -0
  33. package/skills/cover-letter/SKILL.md +4 -3
  34. package/skills/cv-tailor/SKILL.md +11 -2
  35. package/skills/freelance-deliver/SKILL.md +90 -0
  36. package/skills/freelance-hunt/SKILL.md +126 -0
  37. package/skills/freelance-hunt/references/templates/Connects.md +39 -0
  38. package/skills/freelance-hunt/references/templates/Contrato.md +60 -0
  39. package/skills/freelance-hunt/references/templates/Propuesta.md +66 -0
  40. package/skills/freelance-kickoff/SKILL.md +94 -0
  41. package/skills/freelance-pipeline/SKILL.md +109 -0
  42. package/skills/freelance-pipeline/scripts/import_history.py +425 -0
  43. package/skills/freelance-profile/SKILL.md +93 -0
  44. package/skills/freelance-proposal/SKILL.md +112 -0
  45. package/skills/freelance-scan/SKILL.md +196 -0
  46. package/skills/freelance-scan/references/dedup.md +35 -0
  47. package/skills/freelance-scan/references/platforms.md +167 -0
  48. package/skills/freelance-scan/scripts/freelance_search.py +1077 -0
  49. package/skills/install-mcp/SKILL.md +135 -46
  50. package/skills/install-mcp/references/unreal-operations.md +55 -0
  51. package/skills/interview-prep/SKILL.md +11 -3
  52. package/skills/job-aplicar/SKILL.md +5 -1
  53. package/skills/job-hunt/SKILL.md +17 -0
  54. package/skills/job-outcome/SKILL.md +15 -1
  55. package/skills/job-upskill/SKILL.md +10 -2
  56. package/skills/ue-actor-component-architecture/SKILL.md +509 -0
  57. package/skills/ue-actor-component-architecture/references/actor-lifecycle.md +301 -0
  58. package/skills/ue-actor-component-architecture/references/component-types.md +592 -0
  59. package/skills/ue-ai-navigation/SKILL.md +526 -0
  60. package/skills/ue-ai-navigation/references/behavior-tree-patterns.md +392 -0
  61. package/skills/ue-ai-navigation/references/behavior-tree-workflow.md +107 -0
  62. package/skills/ue-ai-navigation/references/custom-bttask.md +104 -0
  63. package/skills/ue-ai-navigation/references/eqs-reference.md +423 -0
  64. package/skills/ue-animation-system/SKILL.md +521 -0
  65. package/skills/ue-animation-system/references/anim-notify-reference.md +486 -0
  66. package/skills/ue-animation-system/references/locomotion-setup.md +550 -0
  67. package/skills/ue-async-threading/SKILL.md +433 -0
  68. package/skills/ue-async-threading/references/thread-safety-guide.md +213 -0
  69. package/skills/ue-async-threading/references/threading-patterns.md +345 -0
  70. package/skills/ue-audio-system/SKILL.md +527 -0
  71. package/skills/ue-audio-system/references/audio-setup-patterns.md +700 -0
  72. package/skills/ue-blueprints/SKILL.md +134 -0
  73. package/skills/ue-blueprints/references/communication.md +82 -0
  74. package/skills/ue-character-movement/SKILL.md +475 -0
  75. package/skills/ue-character-movement/references/cmc-extension-patterns.md +335 -0
  76. package/skills/ue-character-movement/references/movement-pipeline.md +189 -0
  77. package/skills/ue-cpp-foundations/SKILL.md +533 -0
  78. package/skills/ue-cpp-foundations/references/components-and-gc.md +107 -0
  79. package/skills/ue-cpp-foundations/references/container-patterns.md +544 -0
  80. package/skills/ue-cpp-foundations/references/delegate-patterns.md +497 -0
  81. package/skills/ue-cpp-foundations/references/gameplay-classes-cpp.md +136 -0
  82. package/skills/ue-cpp-foundations/references/property-specifiers.md +306 -0
  83. package/skills/ue-data-assets-tables/SKILL.md +527 -0
  84. package/skills/ue-data-assets-tables/references/asset-loading-patterns.md +306 -0
  85. package/skills/ue-data-assets-tables/references/data-driven-design.md +378 -0
  86. package/skills/ue-editor-tools/SKILL.md +523 -0
  87. package/skills/ue-editor-tools/references/detail-customization-patterns.md +395 -0
  88. package/skills/ue-editor-tools/references/editor-module-setup.md +480 -0
  89. package/skills/ue-game-features/SKILL.md +477 -0
  90. package/skills/ue-game-features/references/experience-system.md +222 -0
  91. package/skills/ue-game-features/references/game-feature-patterns.md +308 -0
  92. package/skills/ue-gameplay-abilities/SKILL.md +518 -0
  93. package/skills/ue-gameplay-abilities/references/ability-task-reference.md +391 -0
  94. package/skills/ue-gameplay-abilities/references/gameplay-effect-reference.md +397 -0
  95. package/skills/ue-gameplay-abilities/references/gas-setup-patterns.md +369 -0
  96. package/skills/ue-gameplay-framework/SKILL.md +466 -0
  97. package/skills/ue-gameplay-framework/references/framework-class-map.md +243 -0
  98. package/skills/ue-input-system/SKILL.md +394 -0
  99. package/skills/ue-input-system/references/cpp-setup.md +131 -0
  100. package/skills/ue-input-system/references/enhanced-input-workflow.md +117 -0
  101. package/skills/ue-input-system/references/input-action-reference.md +731 -0
  102. package/skills/ue-mass-entity/SKILL.md +476 -0
  103. package/skills/ue-mass-entity/references/mass-entity-patterns.md +319 -0
  104. package/skills/ue-mass-entity/references/mass-fragment-reference.md +119 -0
  105. package/skills/ue-materials-rendering/SKILL.md +526 -0
  106. package/skills/ue-materials-rendering/references/material-parameter-reference.md +216 -0
  107. package/skills/ue-materials-rendering/references/post-process-settings.md +383 -0
  108. package/skills/ue-module-build-system/SKILL.md +487 -0
  109. package/skills/ue-module-build-system/references/build-cs-reference.md +418 -0
  110. package/skills/ue-module-build-system/references/common-build-errors.md +381 -0
  111. package/skills/ue-naming-conventions/SKILL.md +142 -0
  112. package/skills/ue-naming-conventions/references/asset-name-modifiers.md +233 -0
  113. package/skills/ue-naming-conventions/references/content-structure.md +83 -0
  114. package/skills/ue-networking-replication/SKILL.md +452 -0
  115. package/skills/ue-networking-replication/references/replication-patterns.md +526 -0
  116. package/skills/ue-networking-replication/references/rpc-decision-guide.md +393 -0
  117. package/skills/ue-niagara-effects/SKILL.md +531 -0
  118. package/skills/ue-niagara-effects/references/niagara-data-interfaces.md +491 -0
  119. package/skills/ue-niagara-effects/references/niagara-parameter-types.md +153 -0
  120. package/skills/ue-niagara-effects/references/niagara-workflow.md +115 -0
  121. package/skills/ue-packaging/SKILL.md +116 -0
  122. package/skills/ue-physics-collision/SKILL.md +423 -0
  123. package/skills/ue-physics-collision/references/collision-channel-setup.md +218 -0
  124. package/skills/ue-physics-collision/references/trace-patterns.md +499 -0
  125. package/skills/ue-procedural-generation/SKILL.md +505 -0
  126. package/skills/ue-procedural-generation/references/pcg-node-reference.md +381 -0
  127. package/skills/ue-procedural-generation/references/procedural-mesh-patterns.md +940 -0
  128. package/skills/ue-project-context/SKILL.md +305 -0
  129. package/skills/ue-sequencer-cinematics/SKILL.md +506 -0
  130. package/skills/ue-sequencer-cinematics/references/sequencer-patterns.md +629 -0
  131. package/skills/ue-serialization-savegames/SKILL.md +524 -0
  132. package/skills/ue-serialization-savegames/references/save-system-architecture.md +705 -0
  133. package/skills/ue-state-trees/SKILL.md +489 -0
  134. package/skills/ue-state-trees/references/state-tree-mass-integration.md +184 -0
  135. package/skills/ue-state-trees/references/state-tree-patterns.md +321 -0
  136. package/skills/ue-testing-debugging/SKILL.md +520 -0
  137. package/skills/ue-testing-debugging/references/automation-test-patterns.md +387 -0
  138. package/skills/ue-testing-debugging/references/profiling-commands.md +357 -0
  139. package/skills/ue-ui-umg-slate/SKILL.md +431 -0
  140. package/skills/ue-ui-umg-slate/references/common-ui-setup.md +484 -0
  141. package/skills/ue-ui-umg-slate/references/widget-types.md +487 -0
  142. package/skills/ue-world-level-streaming/SKILL.md +518 -0
  143. package/skills/ue-world-level-streaming/references/streaming-patterns.md +414 -0
  144. package/templates/gamedev/unreal-project-context.md +107 -0
@@ -0,0 +1,518 @@
1
+ ---
2
+ name: ue-gameplay-abilities
3
+ description: "GAS, Gameplay Abilities, Gameplay Effects, Attribute Sets, Gameplay Tags, Gameplay Cues"
4
+ category: "gamedev"
5
+ argument-hint: "[ability, effect o attribute]"
6
+ user-invocable: true
7
+ allowed-tools: Read, Glob, Grep, Bash, Write, Edit
8
+ ---
9
+
10
+ # Gameplay Ability System (GAS)
11
+
12
+ You are an expert in Unreal Engine's Gameplay Ability System (GAS).
13
+
14
+ Ask before writing: this skill edits ability, effect and attribute set classes. Propose the change and get approval before using Write or Edit.
15
+
16
+ ## Context Check
17
+
18
+ Before proceeding, read `docs/unreal/project-context.md` to determine:
19
+ - Whether the GameplayAbilities plugin is enabled
20
+ - Which actors own the AbilitySystemComponent (PlayerState vs Character)
21
+ - The replication mode in use (Minimal, Mixed, Full)
22
+ - Any existing AttributeSets or ability base classes
23
+
24
+ ## Information Gathering
25
+
26
+ Ask the developer:
27
+ 1. What type of abilities are needed? (active, passive, triggered, instant)
28
+ 2. What attributes are required? (health, mana, stamina, custom stats)
29
+ 3. Is this multiplayer? If so, which actors carry the ASC?
30
+ 4. Are cooldowns and costs required, or is this a passive/trigger system?
31
+ 5. Do abilities need prediction (local-only feedback before server confirms)?
32
+
33
+ ---
34
+
35
+ ## GAS Architecture Overview
36
+
37
+ GAS has three pillars that live on `UAbilitySystemComponent` (ASC):
38
+
39
+ | Pillar | Class | Purpose |
40
+ |--------|-------|---------|
41
+ | Abilities | `UGameplayAbility` | Logic for what happens when activated |
42
+ | Effects | `UGameplayEffect` | Data-driven stat mutations (instant, duration, infinite) |
43
+ | Attributes | `UAttributeSet` | Float properties representing character stats |
44
+
45
+ GameplayTags thread through all three as requirements, grants, and blockers.
46
+
47
+ ---
48
+
49
+ ## GAS Setup
50
+
51
+ ### 1. Enable the Plugin
52
+
53
+ Enable `GameplayAbilities` in `.uproject` Plugins array, then in `[ProjectName].Build.cs`:
54
+ ```csharp
55
+ PublicDependencyModuleNames.AddRange(new string[]
56
+ {
57
+ "GameplayAbilities", "GameplayTags", "GameplayTasks"
58
+ });
59
+ ```
60
+
61
+ ### 2. AbilitySystemComponent Ownership
62
+
63
+ **PlayerState (recommended for multiplayer):** ASC persists across respawns because PlayerState
64
+ is not destroyed on death. Use this for player characters in networked games.
65
+
66
+ **Character/Pawn:** Simpler. Use for AI characters or single-player games where persistence
67
+ across respawns is not required.
68
+
69
+ See `references/gas-setup-patterns.md` for full initialization sequences for both patterns.
70
+
71
+ ### 3. IAbilitySystemInterface
72
+
73
+ Every actor that owns or exposes an ASC must implement `IAbilitySystemInterface`:
74
+
75
+ ```cpp
76
+ #include "AbilitySystemInterface.h"
77
+
78
+ UCLASS()
79
+ class AMyCharacter : public ACharacter, public IAbilitySystemInterface
80
+ {
81
+ GENERATED_BODY()
82
+ public:
83
+ virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override
84
+ { return AbilitySystemComponent; }
85
+ UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "GAS")
86
+ TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
87
+ };
88
+ ```
89
+
90
+ ### 4. Replication Modes
91
+
92
+ Set on the ASC after creation (server-side only):
93
+
94
+ ```cpp
95
+ // In BeginPlay or PossessedBy on the server:
96
+ AbilitySystemComponent->SetReplicationMode(EGameplayEffectReplicationMode::Mixed);
97
+ ```
98
+
99
+ | Mode | When to Use |
100
+ |------|-------------|
101
+ | `Minimal` | AI or non-player actors; no GE replication to simulated proxies |
102
+ | `Mixed` | Player-controlled characters (owner gets full info, others get minimal) |
103
+ | `Full` | Non-player games or debugging; all GEs replicate to all clients |
104
+
105
+ ### 5. InitAbilityActorInfo
106
+
107
+ Must be called on both server and client after possession. Call in `PossessedBy` (server)
108
+ and `OnRep_PlayerState` (client): `ASC->InitAbilityActorInfo(OwnerActor, AvatarActor)`.
109
+ See `references/gas-setup-patterns.md` for full dual-path code with respawn handling.
110
+
111
+ ---
112
+
113
+ ## GameplayAbilities
114
+
115
+ ### Subclass UGameplayAbility
116
+
117
+ ```cpp
118
+ #include "Abilities/GameplayAbility.h"
119
+
120
+ UCLASS()
121
+ class UMyFireballAbility : public UGameplayAbility
122
+ {
123
+ GENERATED_BODY()
124
+ public:
125
+ UMyFireballAbility();
126
+ virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle,
127
+ const FGameplayAbilityActorInfo* ActorInfo,
128
+ const FGameplayAbilityActivationInfo ActivationInfo,
129
+ const FGameplayEventData* TriggerEventData) override;
130
+ virtual void EndAbility(const FGameplayAbilitySpecHandle Handle,
131
+ const FGameplayAbilityActorInfo* ActorInfo,
132
+ const FGameplayAbilityActivationInfo ActivationInfo,
133
+ bool bReplicateEndAbility, bool bWasCancelled) override;
134
+ // Ability Tasks — async building blocks for latent abilities:
135
+ // UAbilityTask_WaitTargetData — waits for targeting (crosshair/AoE confirm)
136
+ // UAbilityTask_WaitGameplayEvent — waits for a GameplayEvent tag (e.g., anim notify)
137
+ // UAbilityTask_WaitDelay — simple timer
138
+ // UAbilityTask_PlayMontageAndWait — montage with callbacks (see ue-animation-system)
139
+ // See references/ability-task-reference.md for full list and custom task pattern.
140
+ // CancelAbility — called by CancelAbilitiesWithTag or ASC->CancelAbility(Handle)
141
+ // Internally calls EndAbility with bWasCancelled=true. Override to add cleanup:
142
+ virtual void CancelAbility(const FGameplayAbilitySpecHandle Handle,
143
+ const FGameplayAbilityActorInfo* ActorInfo,
144
+ const FGameplayAbilityActivationInfo ActivationInfo,
145
+ bool bReplicateCancelAbility) override;
146
+ // Custom activation guard — return false to block activation beyond tag checks
147
+ virtual bool CanActivateAbility(const FGameplayAbilitySpecHandle Handle,
148
+ const FGameplayAbilityActorInfo* ActorInfo, /*...*/) const override;
149
+ // Must call Super first. Add custom checks (resource availability, cooldown state).
150
+ protected:
151
+ UPROPERTY(EditDefaultsOnly, Category = "GAS")
152
+ TSubclassOf<UGameplayEffect> DamageEffect;
153
+ };
154
+ ```
155
+
156
+ ### ActivateAbility Pattern
157
+
158
+ ```cpp
159
+ void UMyFireballAbility::ActivateAbility(const FGameplayAbilitySpecHandle Handle,
160
+ const FGameplayAbilityActorInfo* ActorInfo,
161
+ const FGameplayAbilityActivationInfo ActivationInfo,
162
+ const FGameplayEventData* TriggerEventData)
163
+ {
164
+ // 1. Commit: validates and applies cost + cooldown
165
+ if (!CommitAbility(Handle, ActorInfo, ActivationInfo))
166
+ {
167
+ EndAbility(Handle, ActorInfo, ActivationInfo, true, true);
168
+ return;
169
+ }
170
+ // 2. Apply effect / spawn projectile / etc.
171
+ FGameplayEffectSpecHandle Spec = MakeOutgoingGameplayEffectSpec(DamageEffect, GetAbilityLevel());
172
+ FGameplayAbilityTargetDataHandle TargetData =
173
+ UAbilitySystemBlueprintLibrary::AbilityTargetDataFromActor(
174
+ ActorInfo->AvatarActor.Get());
175
+ ApplyGameplayEffectSpecToTarget(Handle, ActorInfo, ActivationInfo, Spec, TargetData);
176
+ // 3. End (instant abilities end immediately; latent abilities wait for tasks)
177
+ EndAbility(Handle, ActorInfo, ActivationInfo, true, false);
178
+ }
179
+ ```
180
+
181
+ `CommitAbility` is shorthand for `CommitAbilityCost` + `CommitAbilityCooldown`. Call them
182
+ separately when needed -- e.g., commit cost without starting cooldown for a channeled ability,
183
+ or commit cooldown without cost for a free ability.
184
+
185
+ ### Instancing and Net Execution Policy
186
+
187
+ Set in the ability constructor:
188
+
189
+ ```cpp
190
+ UMyFireballAbility::UMyFireballAbility()
191
+ {
192
+ // InstancedPerActor - one instance per actor; cheapest for persistent abilities
193
+ // InstancedPerExecution - new instance each activation; safe for concurrency
194
+ // NonInstanced - CDO runs the ability; no per-execution state
195
+ InstancingPolicy = EGameplayAbilityInstancingPolicy::InstancedPerActor;
196
+
197
+ // LocalPredicted - client runs immediately, server validates (player abilities)
198
+ // ServerOnly - authority only, no prediction
199
+ // LocalOnly - local client only (UI, cosmetic)
200
+ // ServerInitiated - server activates, clients run non-authoritative predicted copy
201
+ NetExecutionPolicy = EGameplayAbilityNetExecutionPolicy::LocalPredicted;
202
+ }
203
+ ```
204
+
205
+ ### Granting and Activating Abilities
206
+
207
+ ```cpp
208
+ // Grant (server/authority only):
209
+ FGameplayAbilitySpecHandle Handle = ASC->GiveAbility(
210
+ FGameplayAbilitySpec(UMyFireballAbility::StaticClass(), 1 /*Level*/));
211
+
212
+ ASC->TryActivateAbility(Handle); // by handle
213
+ ASC->TryActivateAbilityByClass(UMyFireballAbility::StaticClass()); // by class
214
+ ASC->TryActivateAbilitiesByTag( // by tag
215
+ FGameplayTagContainer(FGameplayTag::RequestGameplayTag("Ability.Skill.Fireball")));
216
+ ```
217
+
218
+ ### Ability Tags
219
+
220
+ Configure in the ability CDO constructor:
221
+
222
+ ```cpp
223
+ // Tags this ability grants to its owner while active:
224
+ ActivationOwnedTags.AddTag(FGameplayTag::RequestGameplayTag("Ability.Active.Casting"));
225
+ // Tags that prevent this ability from activating:
226
+ ActivationBlockedTags.AddTag(FGameplayTag::RequestGameplayTag("State.Stunned"));
227
+ // Cancel other active abilities with these tags on activation:
228
+ CancelAbilitiesWithTag.AddTag(FGameplayTag::RequestGameplayTag("Ability.Active.Melee"));
229
+ ```
230
+
231
+ ---
232
+
233
+ ## GameplayEffects
234
+
235
+ ### Duration Policies
236
+
237
+ | Policy | Behavior |
238
+ |--------|----------|
239
+ | `Instant` | Executes once; modifies attribute base value permanently |
240
+ | `HasDuration` | Active for set duration; uses `DurationMagnitude` (seconds) |
241
+ | `Infinite` | Active until `RemoveActiveGameplayEffect` is called |
242
+
243
+ ### Applying Effects
244
+
245
+ ```cpp
246
+ FGameplayEffectContextHandle Ctx = ASC->MakeEffectContext();
247
+ FGameplayEffectSpecHandle Spec = ASC->MakeOutgoingSpec(UMyDamageEffect::StaticClass(), Level, Ctx);
248
+
249
+ // SetByCaller: inject runtime magnitude using a tag key
250
+ Spec.Data->SetSetByCallerMagnitude(
251
+ FGameplayTag::RequestGameplayTag("SetByCaller.Damage"), 75.f);
252
+
253
+ ASC->ApplyGameplayEffectSpecToSelf(*Spec.Data.Get()); // self
254
+ ASC->ApplyGameplayEffectSpecToTarget(*Spec.Data.Get(), TargetASC); // target
255
+
256
+ ASC->RemoveActiveGameplayEffect(ActiveHandle); // by handle
257
+ ASC->RemoveActiveGameplayEffectBySourceEffect(
258
+ UMyDamageEffect::StaticClass(), nullptr); // by class
259
+ ```
260
+
261
+ See `references/gameplay-effect-reference.md` for stacking (AggregateBySource/AggregateByTarget),
262
+ periodic effects (damage over time), `UGameplayEffectExecutionCalculation` (complex modifier logic),
263
+ conditional effects, and immunity.
264
+
265
+ ---
266
+
267
+ ## AttributeSet
268
+
269
+ ### Define Attributes
270
+
271
+ ```cpp
272
+ // MyHealthSet.h
273
+ #include "AttributeSet.h"
274
+ #include "AbilitySystemComponent.h"
275
+
276
+ // Convenience macro - define in your project headers
277
+ #define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
278
+ GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
279
+ GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
280
+ GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
281
+ GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)
282
+
283
+ UCLASS()
284
+ class UMyHealthSet : public UAttributeSet
285
+ {
286
+ GENERATED_BODY()
287
+ public:
288
+ UMyHealthSet();
289
+
290
+ // Called BEFORE any modification - use for clamping current value
291
+ virtual void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override;
292
+
293
+ // Called AFTER instant GE executes - react to changes (death, events)
294
+ virtual void PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) override;
295
+
296
+ virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
297
+
298
+ UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Health, Category = "Health")
299
+ FGameplayAttributeData Health;
300
+ ATTRIBUTE_ACCESSORS(UMyHealthSet, Health)
301
+
302
+ UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_MaxHealth, Category = "Health")
303
+ FGameplayAttributeData MaxHealth;
304
+ ATTRIBUTE_ACCESSORS(UMyHealthSet, MaxHealth)
305
+
306
+ protected:
307
+ UFUNCTION()
308
+ void OnRep_Health(const FGameplayAttributeData& OldHealth);
309
+
310
+ UFUNCTION()
311
+ void OnRep_MaxHealth(const FGameplayAttributeData& OldMaxHealth);
312
+ };
313
+ ```
314
+
315
+ In the `.cpp`, implement replication and callbacks:
316
+
317
+ ```cpp
318
+ void UMyHealthSet::GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const
319
+ {
320
+ Super::GetLifetimeReplicatedProps(OutLifetimeProps);
321
+ DOREPLIFETIME_CONDITION_NOTIFY(UMyHealthSet, Health, COND_None, REPNOTIFY_Always);
322
+ DOREPLIFETIME_CONDITION_NOTIFY(UMyHealthSet, MaxHealth, COND_None, REPNOTIFY_Always);
323
+ }
324
+
325
+ void UMyHealthSet::OnRep_Health(const FGameplayAttributeData& OldHealth)
326
+ {
327
+ GAMEPLAYATTRIBUTE_REPNOTIFY(UMyHealthSet, Health, OldHealth);
328
+ }
329
+
330
+ // PreAttributeChange: clamp CURRENT value before any modification
331
+ void UMyHealthSet::PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue)
332
+ {
333
+ Super::PreAttributeChange(Attribute, NewValue);
334
+ if (Attribute == GetHealthAttribute())
335
+ NewValue = FMath::Clamp(NewValue, 0.f, GetMaxHealth());
336
+ }
337
+
338
+ // PostGameplayEffectExecute: react AFTER instant GE modifies base value (damage, death)
339
+ void UMyHealthSet::PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data)
340
+ {
341
+ Super::PostGameplayEffectExecute(Data);
342
+ if (Data.EvaluatedData.Attribute == GetHealthAttribute())
343
+ {
344
+ SetHealth(FMath::Clamp(GetHealth(), 0.f, GetMaxHealth()));
345
+ if (GetHealth() <= 0.f) { /* trigger death */ }
346
+ }
347
+ }
348
+ ```
349
+
350
+ ### Register AttributeSet on ASC
351
+
352
+ ```cpp
353
+ // In PlayerState or Character constructor:
354
+ // Option 1: CreateDefaultSubobject (auto-registered as subobject)
355
+ HealthSet = CreateDefaultSubobject<UMyHealthSet>(TEXT("HealthSet"));
356
+
357
+ // Option 2: Runtime (authority only) — create and register as subobject:
358
+ UMyHealthSet* NewSet = NewObject<UMyHealthSet>(this);
359
+ AbilitySystemComponent->AddSpawnedAttribute(NewSet);
360
+
361
+ // Read attribute value:
362
+ float CurrentHealth = AbilitySystemComponent->GetNumericAttribute(
363
+ UMyHealthSet::GetHealthAttribute());
364
+ ```
365
+
366
+ **Multiple AttributeSets**: An ASC can host multiple `UAttributeSet` subclasses (e.g.,
367
+ `UHealthSet` + `UOffenseSet`), each auto-discovered via subobject enumeration. Never register
368
+ two instances of the same class -- the second is silently ignored.
369
+
370
+ ---
371
+
372
+ ## GameplayTags
373
+
374
+ ### Defining Tags
375
+
376
+ In `Config/DefaultGameplayTags.ini` or via native tags (preferred for code references):
377
+
378
+ ```cpp
379
+ // MyGameplayTags.h
380
+ #include "NativeGameplayTags.h"
381
+ UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_Ability_Fireball)
382
+ UE_DECLARE_GAMEPLAY_TAG_EXTERN(TAG_State_Stunned)
383
+
384
+ // MyGameplayTags.cpp
385
+ UE_DEFINE_GAMEPLAY_TAG_COMMENT(TAG_Ability_Fireball, "Ability.Skill.Fireball", "Fireball ability")
386
+ UE_DEFINE_GAMEPLAY_TAG_COMMENT(TAG_State_Stunned, "State.Stunned", "Actor is stunned")
387
+ ```
388
+
389
+ ### Tag Matching
390
+
391
+ `"A.1".MatchesTag("A") == true` (hierarchical); `MatchesTagExact` requires exact match.
392
+
393
+ ```cpp
394
+ FGameplayTagContainer Tags;
395
+ Tags.HasTag(FireballTag); // parent-aware match
396
+ Tags.HasTagExact(FireballTag); // exact only
397
+ Tags.HasAny(OtherContainer);
398
+ Tags.HasAll(OtherContainer);
399
+
400
+ // Query ASC:
401
+ ASC->HasMatchingGameplayTag(TAG_State_Stunned);
402
+ ASC->GetOwnedGameplayTags(); // FGameplayTagContainer
403
+
404
+ // Listen for changes:
405
+ ASC->RegisterGameplayTagEvent(TAG_State_Stunned, EGameplayTagEventType::NewOrRemoved)
406
+ .AddUObject(this, &AMyCharacter::OnStunnedTagChanged);
407
+ ```
408
+
409
+ ### Loose Tags (Manual, No GE)
410
+
411
+ ```cpp
412
+ ASC->AddLooseGameplayTag(TAG_State_Stunned);
413
+ ASC->RemoveLooseGameplayTag(TAG_State_Stunned);
414
+ // Loose tags are NOT replicated by default. To replicate a loose tag,
415
+ // pass EGameplayTagReplicationState::TagOnly as the third argument:
416
+ ASC->AddLooseGameplayTag(TAG_State_Buffed, 1, EGameplayTagReplicationState::TagOnly);
417
+ ASC->RemoveLooseGameplayTag(TAG_State_Buffed, 1, EGameplayTagReplicationState::TagOnly);
418
+ ```
419
+
420
+ ---
421
+
422
+ ## GameplayCues
423
+
424
+ Cosmetic-only (particles, sounds, decals). Never affect gameplay state. Tag prefix: `GameplayCue.`
425
+
426
+ In the GE asset, add `FGameplayEffectCue` entries with `GameplayCueTags` and level range.
427
+
428
+ ```cpp
429
+ // Burst (one-shot):
430
+ ASC->ExecuteGameplayCue(FGameplayTag::RequestGameplayTag("GameplayCue.Hit.Fire"),
431
+ ASC->MakeEffectContext());
432
+
433
+ // Persistent (add/remove pair):
434
+ ASC->AddGameplayCue(FGameplayTag::RequestGameplayTag("GameplayCue.Buff.Speed"));
435
+ ASC->RemoveGameplayCue(FGameplayTag::RequestGameplayTag("GameplayCue.Buff.Speed"));
436
+
437
+ // Poll active state:
438
+ bool bActive = ASC->IsGameplayCueActive(FGameplayTag::RequestGameplayTag("GameplayCue.Buff.Speed"));
439
+ ```
440
+
441
+ Cue Notify classes:
442
+ - `AGameplayCueNotify_Actor`: Persistent/looping. Overrides `OnActive`, `WhileActive`, `OnRemove`.
443
+ - `AGameplayCueNotify_Static`: Burst/one-shot. Overrides `OnExecute`.
444
+
445
+ Place cue notify assets in `/Game/GAS/GameplayCues/` for `UGameplayCueManager` auto-discovery.
446
+
447
+ ---
448
+
449
+ ## Common Mistakes and Anti-Patterns
450
+
451
+ **ASC ownership confusion:** Implement `IAbilitySystemInterface` on the class that *owns* the ASC
452
+ (PlayerState), not just on the Pawn. Otherwise `UAbilitySystemBlueprintLibrary` lookups fail.
453
+
454
+ **InitAbilityActorInfo only on server:** Clients need it too. Call in `OnRep_PlayerState` (client)
455
+ and `PossessedBy` (server). Skipping client-side init breaks attribute replication on the owning client.
456
+
457
+ **GEs applied before InitAbilityActorInfo:** The ASC is not ready; attributes are not registered.
458
+ Always complete init before granting abilities or applying effects.
459
+
460
+ **PreAttributeChange vs PostGameplayEffectExecute:** `PreAttributeChange` fires on every current-value
461
+ change (aggregator updates, buff adds/removes). Use it only to clamp. Use `PostGameplayEffectExecute`
462
+ to react to instant GE base-value execution (damage, death). Never send game events from `PreAttributeChange`.
463
+
464
+ **Forgetting CommitAbility:** Without it, the ability runs but consumes no mana and starts no cooldown.
465
+
466
+ **Loose tags not replicated:** `AddLooseGameplayTag` does not replicate by default. Pass
467
+ `EGameplayTagReplicationState::TagOnly` as the third argument to replicate the tag, or grant
468
+ via a GE for fully replicated effect-driven tags.
469
+
470
+ **Effect stacking overflow:** Stacks beyond `LimitCount` are silently rejected. Use `GetCurrentStackCount`
471
+ to inspect the current level before attempting further stack applications.
472
+
473
+ **GAS with AI:** AI has no PlayerState. Place the ASC on the AICharacter, call
474
+ `InitAbilityActorInfo(AICharacter, AICharacter)`, set replication mode to `Minimal`.
475
+
476
+ **Hot-joining**: Late-joining clients receive active effects via `FActiveGameplayEffectsContainer`
477
+ replication after `InitAbilityActorInfo`. Never apply startup GEs in `BeginPlay` unconditionally
478
+ -- server-only, or late joiners double-apply.
479
+
480
+ ---
481
+
482
+ ## Reference Files
483
+
484
+ - `references/gas-setup-patterns.md` — Full ASC ownership patterns and initialization sequences
485
+ for PlayerState and Character owners, multiplayer and single-player
486
+ - `references/gameplay-effect-reference.md` — Effect configuration, stacking rules, modifier
487
+ types, execution calculations, periodic effects, conditional effects
488
+ - `references/ability-task-reference.md` — Common built-in ability tasks and custom task patterns
489
+
490
+ ## Related Skills
491
+
492
+ - `/ue-actor-component-architecture` — Component setup and subobject registration
493
+ - `/ue-networking-replication` — Replication modes, RPCs, prediction keys
494
+ - `/ue-animation-system` — Montage ability tasks (PlayMontageAndWait)
495
+ - `/ue-gameplay-framework` — PlayerState ownership pattern, Pawn/Controller lifecycle
496
+ - `/ue-cpp-foundations` — Delegate binding, UPROPERTY macros, TSubclassOf patterns
497
+ - `/ue-naming-conventions` — asset prefixes and Content folder layout for these assets
498
+
499
+ ---
500
+
501
+ ## Checklist
502
+
503
+ Validate before considering the work done:
504
+
505
+ - [ ] Stats are modified through Gameplay Effects, never written directly
506
+ - [ ] State is identified by Gameplay Tags rather than booleans
507
+ - [ ] Ability activation policy and prediction were chosen deliberately
508
+ - [ ] Conventions in `docs/unreal/project-context.md` were read and followed
509
+ - [ ] The Common Mistakes section of this skill was reviewed against the change
510
+
511
+ **PASS** — every item holds. **CONCERNS** — the work stands but at least one item is unresolved and worth flagging to the user. **FAIL** — an item is violated in a way that breaks correctness, replication or the frame budget; fix it before handing the work over.
512
+
513
+ ## Next Steps
514
+
515
+ - `/ue-networking-replication` — verify ability replication and prediction
516
+ - `/balance-check` — sanity-check the tuning values
517
+ - `/code-review` — architectural and quality review of the change
518
+ - `/commit` — conventional commit once the change is verified