> ue5-cpp-scaffold
Generate Unreal Engine 5 C++ class boilerplate following Epic coding standards. Creates Actors, Components, Subsystems, GameplayAbilities, AttributeSets, Widgets, and more with proper UPROPERTY/UFUNCTION macros, include hierarchy, and module API macros. Use whenever creating new UE5 C++ classes, scaffolding gameplay systems, generating header/source pairs, or setting up GAS classes. Also use when the user asks to "create a new Actor", "add a component", "scaffold a gameplay ability", or "make a
curl "https://skillshub.wtf/antonioinnovateops/UnrealEngineAgent/ue5-cpp-scaffold?format=md"UE5 C++ Scaffold Skill
Generates production-quality UE5 C++ header/source file pairs following Epic's coding standard. Handles all the boilerplate — macros, includes, forward declarations, and module API exports.
How It Works
- Ask the user what class type they need
- Gather class name, parent class, and key properties/functions
- Generate the .h and .cpp files with full boilerplate
- Place files in the correct Source directory location
Class Type Templates
Actor
// MyActor.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor.generated.h"
UCLASS()
class MODULENAME_API AMyActor : public AActor
{
GENERATED_BODY()
public:
AMyActor();
protected:
virtual void BeginPlay() override;
virtual void Tick(float DeltaTime) override;
};
Character
// MyCharacter.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "AbilitySystemInterface.h"
#include "MyCharacter.generated.h"
class UAbilitySystemComponent;
class USpringArmComponent;
class UCameraComponent;
UCLASS()
class MODULENAME_API AMyCharacter : public ACharacter, public IAbilitySystemInterface
{
GENERATED_BODY()
public:
AMyCharacter();
virtual UAbilitySystemComponent* GetAbilitySystemComponent() const override;
protected:
virtual void BeginPlay() override;
virtual void SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) override;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera")
TObjectPtr<USpringArmComponent> SpringArmComponent;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera")
TObjectPtr<UCameraComponent> CameraComponent;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Abilities")
TObjectPtr<UAbilitySystemComponent> AbilitySystemComponent;
};
ActorComponent
// MyComponent.h
#pragma once
#include "CoreMinimal.h"
#include "Components/ActorComponent.h"
#include "MyComponent.generated.h"
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MODULENAME_API UMyComponent : public UActorComponent
{
GENERATED_BODY()
public:
UMyComponent();
protected:
virtual void BeginPlay() override;
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
};
SceneComponent
// MySceneComponent.h
#pragma once
#include "CoreMinimal.h"
#include "Components/SceneComponent.h"
#include "MySceneComponent.generated.h"
UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent))
class MODULENAME_API UMySceneComponent : public USceneComponent
{
GENERATED_BODY()
public:
UMySceneComponent();
protected:
virtual void BeginPlay() override;
};
GameplayAbility (GAS)
// GA_MyAbility.h
#pragma once
#include "CoreMinimal.h"
#include "Abilities/GameplayAbility.h"
#include "GA_MyAbility.generated.h"
UCLASS()
class MODULENAME_API UGA_MyAbility : public UGameplayAbility
{
GENERATED_BODY()
public:
UGA_MyAbility();
virtual void ActivateAbility(const FGameplayAbilitySpecHandle Handle,
const FGameplayAbilityActorInfo* ActorInfo,
const FGameplayAbilityActivationInfo ActivationInfo,
const FGameplayEventData* TriggerEventData) override;
virtual void EndAbility(const FGameplayAbilitySpecHandle Handle,
const FGameplayAbilityActorInfo* ActorInfo,
const FGameplayAbilityActivationInfo ActivationInfo,
bool bReplicateEndAbility, bool bWasCancelled) override;
virtual bool CanActivateAbility(const FGameplayAbilitySpecHandle Handle,
const FGameplayAbilityActorInfo* ActorInfo,
const FGameplayTagContainer* SourceTags = nullptr,
const FGameplayTagContainer* TargetTags = nullptr,
OUT FGameplayTagContainer* OptionalRelevantTags = nullptr) const override;
protected:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ability")
float CooldownDuration = 1.0f;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Ability")
float Cost = 10.0f;
};
AttributeSet (GAS)
// MyAttributeSet.h
#pragma once
#include "CoreMinimal.h"
#include "AttributeSet.h"
#include "AbilitySystemComponent.h"
#include "MyAttributeSet.generated.h"
#define ATTRIBUTE_ACCESSORS(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_PROPERTY_GETTER(ClassName, PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_GETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_SETTER(PropertyName) \
GAMEPLAYATTRIBUTE_VALUE_INITTER(PropertyName)
UCLASS()
class MODULENAME_API UMyAttributeSet : public UAttributeSet
{
GENERATED_BODY()
public:
UMyAttributeSet();
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
virtual void PreAttributeChange(const FGameplayAttribute& Attribute, float& NewValue) override;
virtual void PostGameplayEffectExecute(const FGameplayEffectModCallbackData& Data) override;
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Health, Category = "Attributes")
FGameplayAttributeData Health;
ATTRIBUTE_ACCESSORS(UMyAttributeSet, Health)
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_MaxHealth, Category = "Attributes")
FGameplayAttributeData MaxHealth;
ATTRIBUTE_ACCESSORS(UMyAttributeSet, MaxHealth)
UPROPERTY(BlueprintReadOnly, ReplicatedUsing = OnRep_Mana, Category = "Attributes")
FGameplayAttributeData Mana;
ATTRIBUTE_ACCESSORS(UMyAttributeSet, Mana)
protected:
UFUNCTION()
virtual void OnRep_Health(const FGameplayAttributeData& OldHealth);
UFUNCTION()
virtual void OnRep_MaxHealth(const FGameplayAttributeData& OldMaxHealth);
UFUNCTION()
virtual void OnRep_Mana(const FGameplayAttributeData& OldMana);
};
GameMode
// MyGameMode.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "MyGameMode.generated.h"
UCLASS()
class MODULENAME_API AMyGameMode : public AGameModeBase
{
GENERATED_BODY()
public:
AMyGameMode();
virtual void InitGame(const FString& MapName, const FString& Options, FString& ErrorMessage) override;
virtual APawn* SpawnDefaultPawnAtTransform_Implementation(AController* NewPlayer, const FTransform& SpawnTransform) override;
};
PlayerController
// MyPlayerController.h
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "MyPlayerController.generated.h"
class UInputMappingContext;
class UInputAction;
UCLASS()
class MODULENAME_API AMyPlayerController : public APlayerController
{
GENERATED_BODY()
public:
AMyPlayerController();
protected:
virtual void BeginPlay() override;
virtual void SetupInputComponent() override;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Input")
TObjectPtr<UInputMappingContext> DefaultMappingContext;
};
Subsystem
// MyGameInstanceSubsystem.h
#pragma once
#include "CoreMinimal.h"
#include "Subsystems/GameInstanceSubsystem.h"
#include "MyGameInstanceSubsystem.generated.h"
UCLASS()
class MODULENAME_API UMyGameInstanceSubsystem : public UGameInstanceSubsystem
{
GENERATED_BODY()
public:
virtual void Initialize(FSubsystemCollectionBase& Collection) override;
virtual void Deinitialize() override;
UFUNCTION(BlueprintCallable, Category = "MySubsystem")
void DoSomething();
};
UObject (Data Asset)
// MyDataAsset.h
#pragma once
#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "MyDataAsset.generated.h"
UCLASS(BlueprintType)
class MODULENAME_API UMyDataAsset : public UPrimaryDataAsset
{
GENERATED_BODY()
public:
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
FName ItemName;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
TObjectPtr<UTexture2D> Icon;
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Config")
float BaseValue = 1.0f;
virtual FPrimaryAssetId GetPrimaryAssetId() const override;
};
Interface
// Interactable.h
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "Interactable.generated.h"
UINTERFACE(MinimalAPI, Blueprintable)
class UInteractable : public UInterface
{
GENERATED_BODY()
};
class MODULENAME_API IInteractable
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Interaction")
void Interact(AActor* Caller);
UFUNCTION(BlueprintNativeEvent, BlueprintCallable, Category = "Interaction")
FText GetInteractionText() const;
};
AnimInstance (Animation Blueprint Base)
// MyAnimInstance.h
#pragma once
#include "CoreMinimal.h"
#include "Animation/AnimInstance.h"
#include "MyAnimInstance.generated.h"
UCLASS()
class MODULENAME_API UMyAnimInstance : public UAnimInstance
{
GENERATED_BODY()
public:
virtual void NativeInitializeAnimation() override;
virtual void NativeUpdateAnimation(float DeltaSeconds) override;
protected:
UPROPERTY(BlueprintReadOnly, Category = "Movement")
float Speed = 0.0f;
UPROPERTY(BlueprintReadOnly, Category = "Movement")
float Direction = 0.0f;
UPROPERTY(BlueprintReadOnly, Category = "Movement")
bool bIsInAir = false;
UPROPERTY(BlueprintReadOnly, Category = "Movement")
bool bIsAccelerating = false;
};
// MyAnimInstance.cpp
#include "MyAnimInstance.h"
#include "GameFramework/Character.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "KismetAnimationLibrary.h"
void UMyAnimInstance::NativeInitializeAnimation()
{
Super::NativeInitializeAnimation();
}
void UMyAnimInstance::NativeUpdateAnimation(float DeltaSeconds)
{
Super::NativeUpdateAnimation(DeltaSeconds);
if (APawn* Pawn = TryGetPawnOwner())
{
FVector Velocity = Pawn->GetVelocity();
Speed = Velocity.Size2D();
Direction = UKismetAnimationLibrary::CalculateDirection(Velocity, Pawn->GetActorRotation());
if (ACharacter* Character = Cast<ACharacter>(Pawn))
{
bIsInAir = Character->GetCharacterMovement()->IsFalling();
bIsAccelerating = Character->GetCharacterMovement()->GetCurrentAcceleration().Size() > 0.0f;
}
}
}
BlueprintFunctionLibrary (Static Utility Functions)
// MyBlueprintFunctionLibrary.h
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "MyBlueprintFunctionLibrary.generated.h"
UCLASS()
class MODULENAME_API UMyBlueprintFunctionLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintCallable, Category = "Utilities", meta = (WorldContext = "WorldContextObject"))
static AActor* FindClosestActorOfClass(const UObject* WorldContextObject, TSubclassOf<AActor> ActorClass, FVector Origin, float MaxDistance = 5000.0f);
UFUNCTION(BlueprintPure, Category = "Math")
static FVector GetRandomPointInRadius(FVector Origin, float Radius);
UFUNCTION(BlueprintCallable, Category = "Utilities")
static FString FormatTime(float TimeInSeconds);
};
Generation Rules
- Replace
MODULENAMEwith the actual module name in uppercase (e.g.,MYPROJECT_API) - File placement: Headers in
Source/[Module]/Public/[Category]/, sources inSource/[Module]/Private/[Category]/ - Forward declarations over includes in headers — include only in .cpp
- Use
TObjectPtr<>for all UObject pointer members - Include
[ClassName].generated.has the LAST include in every header - Match .cpp includes: Always include the matching header first, then engine headers
- Category organization: Group properties and functions by Category for editor display
Reference
For the full Epic C++ coding standard, see:
dev.epicgames.com/documentation/en-us/unreal-engine/epic-cplusplus-coding-standard-for-unreal-engine
For GAS documentation: github.com/tranek/GASDocumentation
> related_skills --same-repo
> ue5-project-setup
Scaffold and configure new Unreal Engine 5 projects with proper CLAUDE.md, .gitignore, Git LFS tracking, directory structure, and Epic coding conventions. Use this skill whenever someone mentions creating a new UE5 project, setting up a UE5 repo, initializing an Unreal project, configuring Git for Unreal, or writing a CLAUDE.md for a UE5 codebase. Also triggers for project organization, asset naming conventions, or module structure setup.
> ue5-docker-build
Build, package, and deploy Unreal Engine 5 projects using Docker containers. Generates Dockerfiles, docker-compose configurations, CI/CD pipelines, and GPU passthrough setups for UE5 game servers, pixel streaming, and automated builds. Use this skill when someone wants to containerize a UE5 project, set up Docker-based CI/CD for Unreal, deploy a UE5 dedicated server, configure pixel streaming in Docker, or build UE5 projects in containers. Also triggers for mentions of "ue4-docker", "unrealconta