ue-coding-standards

Write Unreal Engine C++ conforming to Epic's coding standard and UHT reflection rules.

55|5|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-coding-standards-kevinpbuckley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ue-coding-standards
Source: https://github.com/kevinpbuckley/unreal-engine-skills/tree/main/skills/core/ue-coding-standards
Command: npx skills add https://github.com/kevinpbuckley/unreal-engine-skills --skill ue-coding-standards-kevinpbuckley

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Unreal C++ has strict, engine-enforced conventions — type prefixes, include ordering, reflection macros, and formatting rules — and violating them causes UHT build errors, broken generated code, or code that clashes with the engine and surrounding project style. This Skill gives an agent the exact rules and engine-source evidence to write or review UE C++ that matches Epic's standard. ## Core Features & Use Cases - Naming and type prefixes: Enforces U/A/F/E/I/T/S prefixes, PascalCase identifiers, the b prefix for booleans, enum class style, and Out/In parameter conventions. - Header and include structure: Specifies include order with generated.h last, IWYU discipline, forward declarations, #pragma once, and module *_API export macros. - Reflection and UHT rules: Covers UCLASS/USTRUCT/UENUM/UPROPERTY/UFUNCTION specifiers, GENERATED_BODY(), Category requirements, and TObjectPtr for UObject members. - Use Case: When writing a new AActor subclass with replicated properties and Blueprint-callable functions, use this Skill to structure the header correctly, choose the right specifiers, and avoid the common UHT pitfalls like a misplaced generated.h include. ## Quick Start Write a new Unreal C++ actor class with a health property and a BlueprintCallable damage function following Epic's coding standard.

Frequently Asked Questions about ue-coding-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write Unreal C++ that follows Epic's coding standard?

Use the mandatory type prefixes (U for UObject, A for AActor, F for structs, E for enums), PascalCase for all identifiers, the b prefix for booleans, Allman braces, and tabs for indentation. Match the surrounding code first, and use engine containers like TArray and FString instead of std equivalents.

What is the correct include order in an Unreal Engine header?

Start with #pragma once, then CoreMinimal.h, then engine or module headers the type directly needs, and the generated.h include always last. UHT requires generated.h to be the final include or it mis-generates code. In source files, include the matching header first.

Why does UHT fail with generated.h or GENERATED_BODY errors?

UHT fails when the generated.h include is not the last include in the header, when GENERATED_BODY() is missing as the first line of the class body, or when type prefixes are wrong. Reflected types must also be at global scope since UHT does not parse inside namespaces.

Should I use TObjectPtr or raw pointers for UObject members in Unreal?

Use TObjectPtr<T> for UPROPERTY members holding UObject-derived pointers; it is the modern UE5 form with access tracking in editor builds. Raw T* pointers still compile and appear in older engine code, but TObjectPtr is preferred for new code.

When should I use forward declarations instead of includes in Unreal headers?

Forward declare types in headers when you only need a pointer or reference to them, then include the full header in the .cpp file. This follows IWYU discipline, reduces compile times, and limits dependency coupling between modules.