Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Unreal Compile Loop?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/tipoli5890-unreal-compile-loop)
---
name: unreal-compile-loop
description: >-
Compile Unreal C++ from a terminal: target, platform and configuration, UnrealBuildTool and
compiler errors, Live Coding or a closed-editor rebuild.
---
# unreal-compile-loop — build, read the first error, rebuild
A compile loop an agent can trust runs the engine's build tool from the command line, keeps the whole
output, and reads the first real error rather than the last line. The verdict comes from the error
lines and the exit code together. A zero exit alone proves nothing.
## Load what the situation needs
| The situation | Read |
|---|---|
| The build command: target, platform, configuration, `-Project=`, one module | *The build* below; `reference/build-commands.md` §1–2 |
| A failed build: which line matters, what each phase's errors look like | `reference/reading-errors.md` |
| The editor is open: Live Coding, Hot Reload, or close it and rebuild | *Editor open or closed* below; `reference/live-coding.md` |
| Project files, deleting `Intermediate`, `BuildConfiguration.xml`, a non-unity check | `reference/build-commands.md` §4–5 |
| A header-tool error on a reflection macro | `unreal-cpp-reflection` |
| An include or link error: which module, macro or body is missing | `unreal-modules-build` |
| Cooking, staging, packaging a build | `unreal-packaging` |
| Running tests after a green build | `unreal-automation-tests` |
| Editor and game logs, crash folders | `unreal-config-logs` |
| Finding the engine in use and its folders | `unreal-project` → `reference/engine-discovery.md` |
## The build
The target triple is `<Target> <Platform> <Configuration>`. Targets come from the project's
`<Name>.Target.cs` files: `CourierRunEditor` for the editor, `CourierRun` for the game. Platforms are
`Win64`, `Mac` and `Linux`. Configurations are `Debug`, `DebugGame`, `Development`, `Test` and
`Shipping`. The Windows form, from the engine root:
```bat
Engine\Build\BatchFiles\Build.bat -Target="CourierRunEditor Win64 Development" -Project="C:\Work\CourierRun\CourierRun.uproject"
```
Add `-Module="CourierRun"` to build one module. Through the runner, which finds the platform's build
script under the engine root (`--engine` or `$UE_ROOT`), prints what it found, applies a wall-clock
timeout, and keeps the log:
```bash
python3 scripts/build_run.py run --engine "$UE_ROOT" --target CourierRunEditor --platform Mac \
--configuration Development --project ~/Work/CourierRun/CourierRun.uproject --log-out build.log
python3 scripts/build_run.py run --build-script /path/to/the/build/script --target CourierRun --platform Linux \
--configuration DebugGame --project CourierRun/CourierRun.uproject --module CourierRun --timeout 1800
python3 scripts/build_run.py log build.log # judge a saved log
python3 scripts/build_run.py --selftest
```
The verdict, the last line: `build-run: PASS` means exit 0 and no error line. `FAIL` means an error
line, or a non-zero exit with none. `UNVERIFIED` means no engine, no build script, a timeout, or no
output. Exit 0, 2, 3, and 1 for usage. Above the verdict come the first errors, each as
`ERROR <kind> line <n>` (`header-tool`, `include`, `link`, `rules`, `compile`, `build-tool`), and a
`HINT` naming the skill that owns the first one. The argument form is the Windows script's. On Mac and
Linux, read the platform script's own usage once, or build through `RunUAT BuildCookRun -Build`
(`unreal-packaging` → `reference/buildcookrun.md`).
## The loop
1. Close the editor for this project, unless the change is one Live Coding handles (below).
2. Build the editor target with the log kept: `build_run.py run ... --log-out build.log`.
3. Read the **first** `ERROR` line. The header tool runs before the compiler, so a header-tool error
means nothing compiled yet. Ten errors after one missing include are one error.
4. Include and link errors: `unreal-modules-build`'s `module_graph.py classify build.log` names the
missing module, export macro or function body. Header-tool errors: lint the header with
`unreal-cpp-reflection`'s `reflection_lint.py`.
5. Fix that one cause and rebuild. Repeat until `build-run: PASS`, then run the tests.
## Editor open or closed
| Change | With the editor open | Editor closed |
|---|---|---|
| A function body | Live Coding (`Ctrl+Alt+F11`) | |
| A constructor default in the `.cpp` | compiles, but existing objects keep the old value | rebuild, reopen |
| New functions or members, a refactor | Live Coding with reinstancing, and it may crash | preferred |
| A reflected header change: a `UPROPERTY`, `UFUNCTION`, specifier or new type | | **rebuild** |
| A new file or module, a Build.cs, Target.cs or descriptor change | | rebuild after regenerating project files |
A command-line build of the editor target replaces the module binaries a running editor has loaded.
Close the editor first, and run one build at a time per project. With Live Coding off the editor falls
back to Hot Reload. On Mac and Linux, plan for the closed-editor rebuild. Settings, reinstancing and
crashes: `reference/live-coding.md`. When an editor MCP server is configured, a Live Coding compile can
go through it (`unreal-mcp` decides).
## macOS
- The platform is `Mac`. Xcode project files come from right-clicking the `.uproject` > Generate Xcode
Files (`CourierRun.xcodeproj`). The build itself does not need them.
- `BuildConfiguration.xml` is read from `~/.config/Unreal Engine/UnrealBuildTool/` and the project's
`Saved/UnrealBuildTool/`.
- Architectures are `arm64`, `x86_64` and `arm64+x86_64`. A universal package is chosen at packaging
time (`-architecture=` for the automation tool, in `unreal-packaging`).
- The Mac build script and editor binary are found, never assumed: `build_run.py` finds the script
by glob, and `unreal-project` → `reference/engine-discovery.md` finds the editor. Report the paths found.
- Clang reports a missing header as "file not found". Apple's linker lists missing symbols under
"Undefined symbols for architecture arm64". Both are mapped by `module_graph.py classify`.
## Discipline
- **Keep the log.** A verdict without its log cannot be checked again.
- **First error first.** The summary at the end counts errors; it does not explain them.
- **Exit 0 is not a pass** while an error line stands in the log.
- **A timeout is UNVERIFIED**, never a pass; raise `--timeout` for a first build.
- **Regenerate project files** after adding files or modules. Delete `Intermediate` only as a reset:
it costs a full rebuild.
## Related skills
- `unreal-modules-build` → `reference/link-errors.md`: what each include and link error lacks.
- `unreal-cpp-reflection` → `reference/specifiers.md`: header-tool errors on specifiers.
- `unreal-packaging` → `reference/buildcookrun.md`: build, cook and stage in one command.
- `unreal-automation-tests` → `reference/running-tests.md`: the next step after a green build.
- `unreal-config-logs` → `reference/logging.md`: logs after the build.