unreal-ai-connection
Copilot instructions8 starsChanged 6 months agoMITView on GitHub
GitHub Copilot, when invoked as a PR reviewer on this repository, should review under the constraints below. These mirror the conventions already applied by the human + Codex + Gemini review loop; align with them rather than re-litigating settled patterns. A UE 5.7 plugin + Python bridge exposing editor automation to any MCP-compliant client (Claude Code, Codex CLI, Cursor, Gemini CLI, Continue, …) over a localhost TCP socket. 151 tools total: 114 native C++ handlers + 37 bridge-side synthetic tools.…
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- driving-unrealSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 21
Cross-handler consistency: Every Inspect* handler shares a shape — error format, path normalization, asset-loading helper, field-name …
- Very specific: line 51
When mapping a UE enum to strings, enumerate the complete value set declared in the enum, not just prevalent ones.
- Distinctive: line 93
Don't bake "Claude Code" specifically into anything that ships.
- Distinctive: line 120
Don't suggest moving handlers into other modules — the one-file-per-handler shape is load-bearing.
- Distinctive: line 122
Don't suggest renaming the repo / plugin / bridge filename to drop "Claude" — those are decorative legacy.
- Distinctive: line 128
When emitting findings, prefer:
≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Copilot review instructions — Unreal AI Connection
GitHub Copilot, when invoked as a PR reviewer on this repository, should review under the constraints below. These mirror the conventions already applied by the human + Codex + Gemini review loop; align with them rather than re-litigating settled patterns.
What this repo is
A UE 5.7 plugin + Python bridge exposing editor automation to any MCP-compliant client (Claude Code, Codex CLI, Cursor, Gemini CLI, Continue, …) over a localhost TCP socket. 151 tools total: 114 native C++ handlers + 37 bridge-side synthetic tools. Vendor-neutral by design — the wire protocol is open MCP.
Top-level read-first: docs/HANDOFF.md (resumption context),
docs/ARCHITECTURE.md (UE 5.7 API gotchas),
docs/TOOLS.md (per-tool JSON examples).
Review priorities (in order)
- Cross-handler consistency. Every Inspect* handler shares a shape — error
format, path normalization, asset-loading helper, field-name conventions.
Catch deviations:
- Error format:
"<tool>: <stable_code>: <human detail>"with'%s'-quoted path values (single-quoted; not bare%s). - Path normalization:
UCMCPAssetPath::ToObjectPath(InputPath)— never reimplement. - Asset load:
UEditorAssetLibrary::LoadAsset(ObjectPath)— neverStaticLoadObjectorLoadObject<T>(HANDOFF trap-table line 131). - Asset references in result fields:
Asset->GetPathName()— neverGetClass()->GetName()(PR #51 lesson, returns class taxonomy not asset identity). - Bounds shape:
{min, max, size, center}across all handlers (inspect_static_meshsets the precedent).
- Error format:
- UE 5.7 access modifiers. Direct field access on UE classes is a common
defect class:
- Bitfield flags (
uint8 : 1) use explicit!= 0for unambiguous bool conversion (PR #70 lesson). - Always check access modifier before direct field read. Recent
failures:
USoundCue::SubtitlePriorityis protected,MaxAudibleDistanceis private (PR #76 → cleanup #79).USoundWave::SampleRate/ImportedSampleRateare protected (PR #77 → cleanup #78). Always prefer the publicGetX()accessor method. WITH_EDITORONLY_DATAfields must be guarded with#if WITH_EDITORONLY_DATA.- Forward-declared types tripping
->access need full include (e.g.Animation/AnimNotifies/AnimNotifyState.h, notAnimation/AnimNotifyState.h— different subdir; cleanup PR #80 lesson).
- Bitfield flags (
- Enum-to-string discipline.
- When mapping a UE enum to strings, enumerate the complete value set
declared in the enum, not just prevalent ones. The
defaultcase is for forward compat with future-version additions, not a substitute for handling current values. PR #52→#53 missedBS_Error; PR #67→#68 missedBS_BeingCreated. Both shipped to main before the gap was found. - For verbose UE enums, use
EnumToCleanString<T>helper (stripsEnum::prefix). SeeHandler_InspectSoundWave.cpp:42-53for the canonical implementation.
- When mapping a UE enum to strings, enumerate the complete value set
declared in the enum, not just prevalent ones. The
TArray<TObjectPtr<>>null-skip. Entries can be null after deletes/reimports/partial-load states. Iterate with explicit null-checkcontinue; emit count of valid entries only (PR #55→#57 lesson). Examples:Bindings/Animations/AllNodes/SkeletalBodySetups/ConstraintSetuparrays.- Sort container outputs for stable ordering. TMap and TSet iteration
order is unspecified.
inspect_widget_blueprint::inherited_slots_with_content,inspect_data_table::rows,inspect_sound_cue::nodesall sort before emission. Diff-friendly JSON for callers. - Bridge-side synthetic tools (
SYNTHETIC_TOOLSdict inbridge/unreal_ai_connection_bridge.py) are pure Python. They:- Compose existing UE handlers via
call_ueOR shell out to host commands (e.g.compile_mod_pakshellsRunUAT.bat). - MUST be added to: bridge
TOOLSlist,SYNTHETIC_TOOLSdict,Resources/mcp_manifest.jsontools array,tests/test_bridge.pyexpected-set + count assertion,tests/test_manifest_sync.pycount assertion,docs/TOOLS.mdsection. Missing any of the six → bridge test failure or manifest-sync drift. - Synthetic tools must preserve upstream RPC error codes when wrapping
call_uefailures (don't hardcode-32603; propagateupstream_err.get("code", -32603)). Trap-table line 136.
- Compose existing UE handlers via
- Cold-compile before merge (discipline introduced post-recovery
2026-05-10). Pre-merge pytest validates bridge schema + manifest drift
only — never compiles C++. PRs that touch handler
.cppMUST be cold-compiled on a host machine before merge to surface C2027 / C2248 / C4996 / C1083 errors that pytest misses. Cleanup PRs #78/#79/#80 caught 5 latent defects across 4 handlers that had shipped without compile. - Vendor-neutral framing. Tool descriptions, manifest entries, and docs use vendor-neutral language ("the LLM client", "the AI agent"). Don't bake "Claude Code" specifically into anything that ships. Repo / plugin / bridge filenames retain "Claude" for legacy reasons — those are decorative.
Handler shape (one file = one tool)
A new C++ handler is exactly:
- One
Handler_<Name>.cppinUnrealAIConnection/Source/UnrealAIConnection/Private/MCP/Handlers/ - One
class FHandler_<Name> : public IUCMCPHandlerwith EXACTLY ONEvirtual FString GetMethodName() const overrideand EXACTLY ONEvirtual TSharedPtr<FJsonObject> Handle(const TSharedPtr<FJsonObject>& Params, FString& OutError) override. No method-name variants. No additional Handle overloads. - One
TSharedRef<IUCMCPHandler> Make_Handler_<Name>()factory at the bottom. - One
externforward decl + oneReg.Register(Make_Handler_<Name>());line inUnrealAIConnectionModule.cpp(preserving 4-space indent — never tabs). - Direct
#include "MCP/MCPHandler.h"— never an__has_includeladder (PR #69 retrospective).
Cite UE 5.7 API claims with header.h:line in the file's top comment
block. Reviewer agents (Claude, Gemini, Codex) catch unverified API
claims; pre-empt by citing source.
What to skip / not flag
- Bridge tests are pytest, not C++. Don't suggest mocking the UE TCP layer
beyond what
test_bridge.pyalready does. - Don't suggest moving handlers into other modules — the one-file-per-handler shape is load-bearing.
- Don't suggest renaming the repo / plugin / bridge filename to drop "Claude" — those are decorative legacy. The vendor-neutral framing lives in description copy.
Severity tagging
When emitting findings, prefer:
- P0 = build-breaking or wire-protocol-breaking (e.g. compile error, schema drift, manifest+bridge name mismatch).
- P1 = real semantic bug or established-pattern violation (e.g.
protected-field direct access, missing null-skip on
TArray<TObjectPtr>, enum case missing). - P2 = nit / style (skip these unless the change affects meaning).
Surfacing P0/P1 is the value; cosmetic nits typically aren't actioned between PR and merge per directive #7 (mechanical PRs ship optimistically on CI green).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

