/ue-module-build-system
Use when working with Build.cs, Target.cs, module creation, plugin setup, or build errors in Unreal Engine — including "unresolved external symbol," "cannot open include file," IWYU violations, missing API macros, or dependency configuration. See also ue-cpp-foundations for
$ npx -y skills add quodsoler/unreal-engine-skills --skill ue-module-build-system --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/ue-module-build-system
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use when working with Build.cs, Target.cs, module creation, plugin setup, or build errors in Unreal Engine — including "unresolved external symbol," "cannot open include file," IWYU violations, missing API macros, or dependency configuration. See also ue-cpp-foundations for
SKILL.md
ue-module-build-system.SKILL.mdname: ue-module-build-system
description: Use when working with Build.cs, Target.cs, module creation, plugin setup, or build errors in Unreal Engine — including "unresolved external symbol," "cannot open include file," IWYU violations, missing API macros, or dependency configuration. See also ue-cpp-foundations for UObject macro patterns.
metadata:
version: 1.0.0
UE Module & Build System
You are an expert in Unreal Engine's module and build system. You understand Unreal Build Tool (UBT), ModuleRules, TargetRules, the .uproject manifest, plugin architecture, and the IWYU include discipline enforced by UE5.
Before Starting
Read `.agents/ue-project-context.md` if it exists — it provides module names, engine version, active plugins, and build targets that affect dependency and include configuration.
Ask which situation applies: 1. Configuring dependencies in an existing Build.cs 2. Creating a new module from scratch 3. Creating a new plugin 4. Resolving a build error (linker, include, or IWYU) 5. Setting up Target.cs for a new build target
---
Build.cs Anatomy
Every UE module has a `ModuleName.Build.cs` file next to its `Public/` and `Private/` directories.
// Source/MyModule/MyModule.Build.cs
using UnrealBuildTool;
public class MyModule : ModuleRules
{
public MyModule(ReadOnlyTargetRules Target) : base(Target)
{
// PCH settings — use IWYU in UE5
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
// Enable strict IWYU (recommended for new modules in UE5)
bEnforceIWYU = true;
// Types accessible to modules that depend on MyModule
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"CoreUObject",
"Engine",
});
// Types used only internally (not re-exported in public headers)
PrivateDependencyModuleNames.AddRange(new string[]
{
"Slate",
"SlateCore",
});
// Load at runtime but don't link at compile time
DynamicallyLoadedModuleNames.Add("OnlineSubsystem");
}
}Public vs Private Dependencies
| Field | When to use | |---|---| | `PublicDependencyModuleNames` | A type from the dependency appears in your **public headers** | | `PrivateDependencyModuleNames` | The dependency is consumed only in **Private/** .cpp files |
A common mistake: putting everything in `PublicDependencyModuleNames`. This bloats transitive include paths for every downstream module. Only promote to public when your public headers actually `#include` headers from that module.
Include Paths
// Expose extra paths to modules that depend on you
PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/Interfaces"));
// Expose extra paths only to this module's own source
PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private/Helpers"));
UBT automatically adds `Public/` and `Private/` — you rarely need to set these manually unless you have nested subdirectory headers you want to import without path prefixes.
API Export Macro
UBT generates `MODULENAME_API` from the module's directory name, uppercased. Any class, function, or variable that must be visible across DLL boundaries needs this macro:
// Public/MyClass.h
#pragma once
#include "CoreMinimal.h"
class MYMODULE_API FMyClass
{
public:
void DoSomething();
};
// Standalone exported function
MYMODULE_API void MyFreeFunction();Missing `MYMODULE_API` on a class that another module references causes "unresolved external symbol" linker errors.
PCH and IWYU
// UE5 recommended — each file includes exactly what it uses
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
bEnforceIWYU = true;
// Legacy — one monolithic PCH (avoid for new modules)
PCHUsage = PCHUsageMode.UseSharedPCHs;
With IWYU, every `.cpp` file includes its own `.h` first, then only what it directly uses:
// Private/MyClass.cpp
#include "MyClass.h" // own header first
#include "Engine/Actor.h" // only includes this file directly uses
Compiler Flags
// C++ exceptions — disable unless third-party code requires them
bEnableExceptions = false;
// Runtime type information — disable unless using dynamic_cast
bUseRTTI = false;
// Third-party static libraries shipped with the engine
AddEngineThirdPartyPrivateStaticDependencies(Target, "zlib", "OpenSSL");
---
Target.cs
Located at `Source/ProjectName.Target.cs` (and `Source/ProjectNameEditor.Target.cs`).
// Source/MyGame.Target.cs
using UnrealBuildTool;
using System.Collections.Generic;
public class MyGameTarget : TargetRules
{
public MyGameTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.Latest;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
// All game modules that UBT should compile
ExtraModuleNames.AddRange(new string[] { "MyGame", "MyGameUtilities" });
}
}
// Source/MyGameEditor.Target.cs
public class MyGameEditorTarget : TargetRules
{
public MyGameEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.Latest;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
ExtraModuleNames.AddRange(new string[] { "MyGame", "MyGameEditor" });
}
}Target Types
| TargetType | Use for | |---|---| | `Game` | Standalone game executable | | `Editor` | Editor build (includes editor-only modules) | | `Client` | Networked client without server logic | | `Server` | Dedicated server (no renderer) | | `Program` | Standalone non-game tool |
**Build configurations**: `Debug` (full symbols, no optimization), `DebugGame` (engine optimized, game debug), `Development` (default; balanced), `Test` (like shipping but with console/stats), `Shipping` (final release, strips all debug).
---
.uproject
Read more
name: ue-module-build-system description: Use when working with Build.cs, Target.cs, module creation, plugin setup, or build errors in Unreal Engine — including "unresolved external symbol," "cannot open include file," IWYU violations, missing API macros, or dependency configuration. See also ue-cpp-foundations for UObject macro patterns. metadata: version: 1.0.0
UE Module & Build System
You are an expert in Unreal Engine's module and build system. You understand Unreal Build Tool (UBT), ModuleRules, TargetRules, the .uproject manifest, plugin architecture, and the IWYU include discipline enforced by UE5.
Before Starting
Read `.agents/ue-project-context.md` if it exists — it provides module names, engine version, active plugins, and build targets that affect dependency and include configuration.
Ask which situation applies: 1. Configuring dependencies in an existing Build.cs 2. Creating a new module from scratch 3. Creating a new plugin 4. Resolving a build error (linker, include, or IWYU) 5. Setting up Target.cs for a new build target
---
Build.cs Anatomy
Every UE module has a `ModuleName.Build.cs` file next to its `Public/` and `Private/` directories.
// Source/MyModule/MyModule.Build.cs
using UnrealBuildTool;
public class MyModule : ModuleRules
{
public MyModule(ReadOnlyTargetRules Target) : base(Target)
{
// PCH settings — use IWYU in UE5
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
// Enable strict IWYU (recommended for new modules in UE5)
bEnforceIWYU = true;
// Types accessible to modules that depend on MyModule
PublicDependencyModuleNames.AddRange(new string[]
{
"Core",
"CoreUObject",
"Engine",
});
// Types used only internally (not re-exported in public headers)
PrivateDependencyModuleNames.AddRange(new string[]
{
"Slate",
"SlateCore",
});
// Load at runtime but don't link at compile time
DynamicallyLoadedModuleNames.Add("OnlineSubsystem");
}
}Public vs Private Dependencies
| Field | When to use | |---|---| | `PublicDependencyModuleNames` | A type from the dependency appears in your **public headers** | | `PrivateDependencyModuleNames` | The dependency is consumed only in **Private/** .cpp files |
A common mistake: putting everything in `PublicDependencyModuleNames`. This bloats transitive include paths for every downstream module. Only promote to public when your public headers actually `#include` headers from that module.
Include Paths
// Expose extra paths to modules that depend on you PublicIncludePaths.Add(Path.Combine(ModuleDirectory, "Public/Interfaces")); // Expose extra paths only to this module's own source PrivateIncludePaths.Add(Path.Combine(ModuleDirectory, "Private/Helpers"));
UBT automatically adds `Public/` and `Private/` — you rarely need to set these manually unless you have nested subdirectory headers you want to import without path prefixes.
API Export Macro
UBT generates `MODULENAME_API` from the module's directory name, uppercased. Any class, function, or variable that must be visible across DLL boundaries needs this macro:
// Public/MyClass.h
#pragma once
#include "CoreMinimal.h"
class MYMODULE_API FMyClass
{
public:
void DoSomething();
};
// Standalone exported function
MYMODULE_API void MyFreeFunction();Missing `MYMODULE_API` on a class that another module references causes "unresolved external symbol" linker errors.
PCH and IWYU
// UE5 recommended — each file includes exactly what it uses PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; bEnforceIWYU = true; // Legacy — one monolithic PCH (avoid for new modules) PCHUsage = PCHUsageMode.UseSharedPCHs;
With IWYU, every `.cpp` file includes its own `.h` first, then only what it directly uses:
// Private/MyClass.cpp #include "MyClass.h" // own header first #include "Engine/Actor.h" // only includes this file directly uses
Compiler Flags
// C++ exceptions — disable unless third-party code requires them bEnableExceptions = false; // Runtime type information — disable unless using dynamic_cast bUseRTTI = false; // Third-party static libraries shipped with the engine AddEngineThirdPartyPrivateStaticDependencies(Target, "zlib", "OpenSSL");
---
Target.cs
Located at `Source/ProjectName.Target.cs` (and `Source/ProjectNameEditor.Target.cs`).
// Source/MyGame.Target.cs
using UnrealBuildTool;
using System.Collections.Generic;
public class MyGameTarget : TargetRules
{
public MyGameTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.Latest;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
// All game modules that UBT should compile
ExtraModuleNames.AddRange(new string[] { "MyGame", "MyGameUtilities" });
}
}
// Source/MyGameEditor.Target.cs
public class MyGameEditorTarget : TargetRules
{
public MyGameEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
DefaultBuildSettings = BuildSettingsVersion.Latest;
IncludeOrderVersion = EngineIncludeOrderVersion.Latest;
ExtraModuleNames.AddRange(new string[] { "MyGame", "MyGameEditor" });
}
}Target Types
| TargetType | Use for | |---|---| | `Game` | Standalone game executable | | `Editor` | Editor build (includes editor-only modules) | | `Client` | Networked client without server logic | | `Server` | Dedicated server (no renderer) | | `Program` | Standalone non-game tool |
**Build configurations**: `Debug` (full symbols, no optimization), `DebugGame` (engine optimized, game debug), `Development` (default; balanced), `Test` (like shipping but with console/stats), `Shipping` (final release, strips all debug).
---
.uproject
A collection of 27 AI agent skills for Unreal Engine C++ development. Built for game developers who want AI coding agents to help write correct, production-quality UE5 C++ code.
Other skills on unreal-engine-skills.
- /ue-actor-component-architecture
Use this skill when working with Actor and component design in Unreal Engine. Triggers on: Actor, component, BeginPlay, Tick, SpawnActor, lifecycle, CreateDefaultSubobject, composition, EndPlay, PostInitializeComponents, UActorComponent, USceneComponent, UINTERFACE, attachment,
Open skill - /ue-ai-navigation
Use this skill when implementing AI, AIController, behavior tree, blackboard, AI perception, NavMesh, EQS, navigation, pathfinding, State Tree, or Smart Objects in Unreal Engine. See references/behavior-tree-patterns.md for BT patterns and references/eqs-reference.md for EQS
Open skill - /ue-animation-system
Use this skill when working with Unreal Engine animation: AnimInstance, montage playback, blend space, state machine, anim notify, IK, AnimGraph, skeletal mesh, or linked anim graphs. See references/anim-notify-reference.md for notify patterns and references/locomotion-setup.md
Open skill - /ue-async-threading
Use this skill when working with Unreal Engine async operations, threading, parallel execution, or concurrency. Also use when the user mentions 'FRunnable', 'FAsyncTask', 'TaskGraph', 'UE::Tasks', 'ParallelFor', 'TFuture', 'TPromise', 'Async()', 'thread safety',
Open skill - /ue-audio-system
Use this skill when working with audio, sound, music, UAudioComponent, PlaySoundAtLocation, SoundCue, MetaSound, attenuation, submix, concurrency, SFX, or spatial audio in Unreal Engine. See references/audio-setup-patterns.md for music system and ambient soundscape
Open skill - /ue-character-movement
Use this skill when working with character movement, CharacterMovementComponent, CMC, movement modes, walking, falling, swimming, flying, custom movement, network prediction, FSavedMove, root motion, floor detection, step-up, or character physics. Also use for 'PhysWalking',
Open skill

