Unreal source code navigator

From OrionUE/Orion_FreeEdition · View interactive version

Unreal source code navigator is an AI agent skill from the GitHub repository OrionUE/Orion_FreeEdition. Use when Codex must write, modify, review, or explain Unreal Engine C++/plugin/editor/gameplay code and needs to learn actual local APIs before acting: source indexes, class hierarchy, module/plugin ownership, Build.cs, uplugin descriptors, dependencies, includes, UHT reflection, properties, functio

How to use this skill

Skill file

Unreal Source Code Navigator

本 Skill 用于在编写或分析 Unreal Engine 代码前,从当前机器的真实项目、插件和引擎源码里学习 API。不要凭记忆调用函数;先定位声明、模块、依赖和调用样例,再写代码。

工作流

  1. 先识别上下文:定位 <ProjectRoot>、<EngineRoot>、<PluginRoot>、.uproject、.uplugin、*.Build.cs 和 *.Target.cs。如果没有显式传入 <EngineRoot>,先读取 <ProjectRoot>/Saved/OrionUE/UnrealEngine/InstallDirectory.txt 中记录的本机 UE 安装目录。
  2. 先查源码再写代码:确认类声明、父类、生命周期函数、UFUNCTION、UPROPERTY、委托声明、接口和调用样例。
  3. 先确认模块再添加 include:用 *.Build.cs 判断 Public/Private 依赖,避免把 include 问题误当成 API 问题。
  4. 遇到版本差异时,以本机源码为准;不要把通用 UE 知识当成当前版本事实。
  5. 实现后验证:优先使用目标模块构建、UHT 输出、Editor-Cmd 或日志确认。

脚本

脚本均为只读工具,核心逻辑使用 Python 3.10+,可在 Windows、macOS、Linux 运行。

python scripts/find_unreal_context.py --root <ProjectRoot>
python scripts/search_unreal_symbol.py UActorComponent --root <ProjectRoot> --engine-root <EngineRoot>
python scripts/inspect_unreal_class.py UActorComponent --root <ProjectRoot> --engine-root <EngineRoot>
python scripts/inspect_unreal_module.py Engine --root <ProjectRoot> --engine-root <EngineRoot>
python scripts/inspect_unreal_delegate.py FOnClicked --root <ProjectRoot> --engine-root <EngineRoot>
python scripts/build_command_hint.py --root <ProjectRoot> --target <TargetName> --config Development

可选包装脚本:

scripts\run.ps1 context --root <ProjectRoot>
scripts\run.ps1 search UActorComponent --root <ProjectRoot>
scripts/run.sh context --root <ProjectRoot>
scripts/run.sh search UActorComponent --root <ProjectRoot>

路由

何时读取 references

约束

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.