RESOURCES / GUIDESUNREAL ENGINE

StemCode for Unreal Engine Developers: AI Coding with C++, modules, and plugins.

Use StemCode with Unreal Engine C++ projects, modules, plugins, UnrealBuildTool, AutomationTool, command-line tests, refactoring, and code review.

PUBLISHED 2026-10-01STEMCODE DEVELOPER GUIDELOCAL-FIRST AI CODING
PROJECT INSTRUCTIONS / AGENTS.MD

Give StemCode durable repository instructions before asking it to edit.

Add an AGENTS.md file at the repository root for persistent project instructions. StemCode loads AGENTS.md or .agent/AGENTS.md from the workspace into the model context, so this is the right place for architecture boundaries, generated-file rules, coding conventions, validation expectations, and manual setup notes that should apply across sessions.

Keep AGENTS.md practical and repository-specific

Prefer concrete rules the agent can act on: where important source lives, what it must not edit, which patterns it should preserve, and which checks it should run after a change.

# Unreal Engine Project Instructions

This is a Unreal Engine project.

Important source and configuration paths:
- *.uproject
- Source/
- Config/
- Plugins/
- *.Build.cs
- *.Target.cs

Generated or disposable paths — do not modify:
- Binaries/
- DerivedDataCache/
- Intermediate/
- Saved/
- .vs/
- Build output/

Follow these rules:
- This is an Unreal Engine project.
- Do not edit Binaries, DerivedDataCache, Intermediate, or Saved output.
- Do not treat binary .uasset or .umap files as normal text source.
- Respect runtime, developer, and editor module boundaries.
- Preserve Unreal reflection, serialization, Blueprint exposure, and replication semantics.
- Use the project's checked-in UBT/UAT wrappers and target configuration for automated validation.
- Explain required Blueprint, asset, project settings, or Editor changes after code edits.

Validation:
- "<UE_ROOT>/Engine/Build/BatchFiles/RunUBT.bat" <Target> <Platform> Development -Project="<Project>.uproject"
- "<UnrealEditor-Cmd>" "<Project>.uproject" -ExecCmds="Automation RunTest <TestFilter>;Quit" -ReportExportPath="TestReports" -unattended -nop4

Commit the file with the project so the same instructions are reviewable and shared by everyone using StemCode in the repository.

01 / WHY STEMCODE

Use repository-aware AI without replacing the tools your stack already needs.

StemCode works best when it can understand the repository around a task, inspect related files, use code intelligence where available, run the project's normal validation commands, and review the final diff before you accept a change.

GOOD FIT FOR UNREAL ENGINE WORK

Unreal Engine projects using C++, gameplay modules, plugins, UObjects, Actors, Components, subsystems, config files, UnrealBuildTool, AutomationTool, automation tests, source-controlled project files, and team build scripts.

02 / SETUP

Install StemCode and open the project root.

Launch StemCode from the Unreal project root so it can see the .uproject file, Source, Config, Plugins, build scripts, and Git history. Keep the Unreal Editor for Blueprint authoring, asset editing, profiling, cooking, packaging, and visual debugging.

npmnpm install -g stemcode
pnpmpnpm add -g stemcode
cd your-project
stemcode
/init

Keep StemCode at the repository root so project instructions, source, configuration, tests, and Git history are visible from one workspace.

03 / PROJECT CONTEXT

Keep authored source visible and generated Unreal output out of the search path.

Unreal repositories mix reviewable C++ and configuration with generated build products and often large binary assets. Focus the agent on source code, module definitions, plugins, configuration, and repository automation.

INSPECT

Keep source-of-truth files visible.

*.uproject
Source/
Config/
Plugins/
*.Build.cs
*.Target.cs
IGNORE

Skip generated or disposable output.

Binaries/
DerivedDataCache/
Intermediate/
Saved/
.vs/
Build output/

Add generated paths to Git ignore rules or .stemcode/.stemcodeignore so repository search stays focused.

FIRST PROMPT

Understand the project before changing it.

Analyze this Unreal Engine repository. Map modules, plugins, major gameplay systems, UObject and Actor relationships, subsystems, interfaces, build targets, configuration, and tests. Identify Blueprint or asset dependencies that code alone cannot fully describe. Do not modify files yet.

04 / CODE INTELLIGENCE

Combine C++ symbol navigation with Unreal naming and reflection context.

A C++ language server can help with definitions, references, diagnostics, and implementations, while repository search remains important for macros, generated reflection code boundaries, module dependencies, and configuration.

CLANGDInstall clangd and make it available on PATH
/lsp refresh
/lsp
Use both semantic navigation and repository search

Treat Unreal reflection macros, generated headers, module boundaries, ownership rules, replication, and engine lifecycle as first-class context. A mechanically valid C++ refactor can still be wrong if it breaks UPROPERTY/UFUNCTION expectations, module dependencies, serialization, or Blueprint exposure.

05 / NATIVE CLI

Use UnrealBuildTool, AutomationTool, and Editor command-line automation.

Unreal provides native command-line tooling rather than one single project CLI. UnrealBuildTool builds targets, AutomationTool handles unattended workflows such as BuildCookRun, and the Editor executable can run Automation tests from the command line. Keep engine-root and project paths in repository scripts or CI variables.

UAT COMMANDS"<UE_ROOT>/Engine/Build/BatchFiles/RunUAT.bat" -List
BUILD TARGET"<UE_ROOT>/Engine/Build/BatchFiles/RunUBT.bat" <Target> <Platform> Development -Project="<Project>.uproject"
AUTOMATION TESTS"<UnrealEditor-Cmd>" "<Project>.uproject" -ExecCmds="Automation RunTest <TestFilter>;Quit" -ReportExportPath="TestReports" -unattended -nop4

On macOS and Linux, use the corresponding .sh scripts. Prefer checked-in wrappers around UBT/UAT so target, platform, engine version, and report paths are reproducible. BuildCookRun is useful for CI cooking and packaging, but reuse the project’s existing arguments instead of inventing a new release pipeline inside an AI prompt.

06 / DEVELOPMENT WORKFLOW

Let code changes respect the Engine’s object, module, and asset boundaries.

Use StemCode for source-level investigation and implementation, then validate behavior in Unreal Editor and the project’s established build pipeline. Avoid pretending binary .uasset content can be safely understood or rewritten as text.

FEATURE

Trace before implementing

Trace the existing interaction system across interfaces, Actors, Components, controllers, and subsystems. Then add the requested interaction type using the current patterns and list any Blueprint or asset setup that must be done in the Editor.

MODULES

Protect dependency boundaries

Review this change for incorrect module dependencies, public versus private include usage, Build.cs updates, and unnecessary coupling between runtime and editor modules.

REPLICATION

Review network behavior

Trace authority, replication, RPCs, ownership, and state synchronization for this feature. Identify client/server assumptions before making changes.

PERFORMANCE

Inspect hot paths

Review this gameplay path for repeated world queries, unnecessary ticking, avoidable allocations, expensive casts, and work that could be event driven.

07 / BUILD AND TEST

Build through the project’s real Unreal toolchain and automation.

Unreal build commands vary by engine installation, platform, target, and CI setup. Prefer scripts already committed to the repository or the same UnrealBuildTool, AutomationTool, and command-line test commands used by the team.

BUILD"<UE_ROOT>/Engine/Build/BatchFiles/RunUBT.bat" <Target> <Platform> Development -Project="<Project>.uproject"
TEST"<UnrealEditor-Cmd>" "<Project>.uproject" -ExecCmds="Automation RunTest <TestFilter>;Quit" -ReportExportPath="TestReports" -unattended -nop4

Start with the affected module or target when possible, then run broader automation. Open the project in Unreal Editor for Blueprint compilation, asset references, PIE behavior, replication checks, and any content-side validation the CLI cannot cover.

Run the smallest relevant validation first. If it passes, run the broader project checks and review the final diff.
08 / PROJECT MEMORY

Keep longer-lived architecture context alongside your project instructions.

Use AGENTS.md for concise rules the agent should follow on every task. Keep longer architecture notes, domain context, and workflow references in repository-level StemCode memory so both stay reviewable and versionable.

This is an Unreal Engine project.
Do not edit Binaries, DerivedDataCache, Intermediate, or Saved output.
Do not treat binary .uasset or .umap files as normal text source.
Respect runtime, developer, and editor module boundaries.
Preserve Unreal reflection, serialization, Blueprint exposure, and replication semantics.
Use the project's checked-in UBT/UAT wrappers and target configuration for automated validation.
Explain required Blueprint, asset, project settings, or Editor changes after code edits.
09 / REVIEW

Review the change in terms of your stack, not only the generated code.

Ask StemCode to inspect its own diff and check the integration points that are easiest to miss in a repository-wide change.

- UObject lifetime and ownership
- UPROPERTY and UFUNCTION reflection behavior
- module and plugin dependencies
- replication and authority assumptions
- tick and hot-path performance
- Blueprint/API compatibility
- required asset or Editor setup
- UBT/UAT and automation test results
10 / FAQ

Common setup questions.

What is the Unreal Engine CLI?

Unreal uses several command-line entry points instead of one CLI: UnrealBuildTool for targets, AutomationTool for unattended workflows such as BuildCookRun, and UnrealEditor or UnrealEditor-Cmd for commandlets and Automation tests.

Can StemCode edit Blueprints?

Repository-level code workflows are strongest on text source and configuration. Blueprint graphs and binary assets should be handled in Unreal Editor unless a dedicated integration exposes safe structured operations.

Should Intermediate or DerivedDataCache be indexed?

No in normal projects. They are generated and can overwhelm search. Keep Source, Config, Plugins, project files, and build scripts visible instead.

What about generated Unreal headers?

Treat generated output as derived state. Work from your authored headers and source while preserving the reflection macros and build rules that generate the engine-side code.

NEXT STEP

Put StemCode to work in a real repository.

Install StemCode, open the project you already work in, and begin with a repository-understanding task before asking the agent to change code. That gives the model better context and keeps the workflow reviewable.

INSTALL

Start with the CLI.

npm install -g stemcode
cd your-project
stemcode
LEARN

Go deeper.

Read the full StemCode documentation for providers, permissions, LSP integrations, memory, MCP, CI review, and advanced workspace configuration.

READ THE DOCS →