unreal-cpp

unreal-cpp is a skill for Claude Code, Codex from Wade-DevCode/awesome-coding-skills-cn. It costs 33 tokens per session (2,429 once invoked), scanned A, original, MIT.

A safety guide for writing Unreal Engine C++ and Blueprint code involving engine objects, memory cleanup, reflection, and frame updates.

In plain words
What is it for?
Use it when creating or changing UObject-based classes, exposing C++ to Blueprints, working with Actor updates or timers, or investigating object-lifetime crashes.
Why use it?
It helps avoid crashes from objects being collected too early, excessive Blueprint exposure, unsafe update loops, and unclear boundaries between C++ and Blueprint.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or changing UObject-based classes, exposing C++ to Blueprints, working with Actor updates or timers, or investigating object-lifetime crashes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Wade-DevCode/awesome-coding-skills-cn --skill unreal-cpp
Clone the repo
git clone --depth 1 https://github.com/Wade-DevCode/awesome-coding-skills-cn

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unreal-cpp

README.md
[![agentmods](https://agentmods.dev/badge/skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp/github.svg)](https://agentmods.dev/skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp)
Your own site
<a href="https://agentmods.dev/skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp"><img src="https://agentmods.dev/badge/skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unreal-cpp

Your own site · 80×15
<a href="https://agentmods.dev/skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp"><img src="https://agentmods.dev/badge/skills/wade-devcode/awesome-coding-skills-cn/unreal-cpp.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,429 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.02429
Opus 5.5 $0.00013 $0.00972
Sonnet 5.5 $0.00007 $0.00486
Haiku 4.5 $0.00003 $0.00243

Measured 1mo ago against content hash 466560c8eadd, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

unreal-cpp scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/unreal-cpp/SKILL.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Unreal C++/蓝图

何时用

  • 新建或修改任何继承自 UObject/AActor/UActorComponent 的 C++ 类时。
  • 给蓝图暴露 C++ 函数或属性,或从 C++ 调用蓝图事件时。
  • Actor 的 Tick 频率、Timer、委托连接有疑问时。
  • 划分哪些逻辑该放 C++、哪些留给蓝图时。
  • 遇到偶发崩溃、GC 踢掉对象、野指针问题时。

核心规则

1. UObject 与 GC:UPROPERTY() 是安全绳

规则: 所有持有 UObject 派生类(Actor、Component、Asset 等)的成员变量,必须加 UPROPERTY();弱引用用 TWeakObjectPtr;原生裸指针不做持有。

为什么——真实会犯的错: 在 .h 里写了 AEnemy* CachedEnemy; 没加 UPROPERTY(),开发期看起来没问题,进入关卡切换或 GC 整理周期后,引擎把 CachedEnemy 回收了,下一帧 CachedEnemy->TakeDamage(...) 直接崩溃。Crash log 里只有 Access violation,根本看不出是 GC 问题,排查半天。

怎么做:

  • 成员变量持有 UObject 子类 → 加 UPROPERTY()(至少空括号),让 GC 追踪引用计数。
  • 不希望阻止 GC 回收(如缓存目标但目标销毁时自动置 null)→ 用 TWeakObjectPtr<AEnemy>,使用前先 IsValid()。
  • 函数局部变量、函数参数、返回值不需要 UPROPERTY(),GC 周期内不会出问题。
  • 禁止用裸指针做持有,new UObject() 也不要手动调,用 NewObject<T>() 或 SpawnActor<T>()。

2. 反射宏:按需标注,不滥标

规则: UCLASS/UFUNCTION/UPROPERTY 只在真正需要反射、蓝图互操时标注;不把所有东西都往蓝图暴露。

为什么——真实会犯的错: 把所有函数都加 BlueprintCallable、所有变量都加 EditAnywhere,编译时间膨胀,蓝图节点列表被几百个无意义函数污染,策划误用了不该在蓝图调的内部函数,出现生命周期顺序问题。另一个常见错误:忘记在 UFUNCTION() 里标 BlueprintImplementableEvent 却在 C++ 里给了函数体,导致链接错误,新手往往不知道该怎么修。

怎么做:

  • 只给蓝图调用的函数加 BlueprintCallable;只给蓝图重写的函数加 BlueprintImplementableEvent 或 BlueprintNativeEvent。
  • BlueprintImplementableEvent 的 C++ 函数不能有函数体;BlueprintNativeEvent 的实现写在 FuncName_Implementation 里。
  • 纯 C++ 内部函数不加任何蓝图标记,保持私有或 protected。
  • 变量只在需要编辑器/蓝图访问时才加 EditAnywhere/BlueprintReadWrite;运行时内部状态加 Transient 或不标。

3. Tick 性能:默认关,按需开

规则: Actor/Component 创建时默认设 PrimaryActorTick.bCanEverTick = false;确实需要逐帧逻辑再开,并评估能否用 Timer 或事件替代。

为什么——真实会犯的错: 场景里生成了 300 个 ABullet,每颗子弹的 Tick 里做了一次 LineTrace,帧率掉到 20 fps,Profiler 里看到几百条 ABullet::TickComponent 占满 CPU。这些子弹大多数时间都在直线飞行,根本不需要每帧 LineTrace——改成 SetActorTickInterval(0.05f) 或抛给 Projectile Movement Component 之后帧率立刻回来了。

怎么做:

  • 构造函数里 PrimaryActorTick.bCanEverTick = false 作为默认值。
  • 需要倒计时、延迟、周期回调 → 用 GetWorldTimerManager().SetTimer(),比 Tick 里减计数更清晰。
  • 需要响应状态变化 → 用 Delegate/Event,而不是 Tick 里每帧 poll。
  • 确实需要 Tick 时,用 PrimaryActorTick.TickInterval 降低频率;或在运行时 SetActorTickEnabled(false) 关掉不活跃对象的 Tick。

Read the full file on GitHub · 174 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 174 lines · 33 tokens per session scan A 466560c8eadd

Subscribe to this mod's changes

unreal-cpp is a skill published in the GitHub repository Wade-DevCode/awesome-coding-skills-cn (7 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 2,429 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

cpp

Expert modern C++ (C++17/C++20/C++23) assistance covering RAII, smart pointers, template metaprogramming, STL containers, move semantics, and memory profiling. Use when developing high-performance native systems, low-latency algorithms, game engines, or embedded C++ codebases.

G1Joshi/Agent-Skills · 65 tokens

unreal-thirdparty

Expert guide for integrating third-party C/C++ libraries into Unreal Engine 5.x projects and plugins. Covers static linking, dynamic linking (DLL/SO/dylib), Build.cs configuration, ModuleType.External, delay loading, runtime dependency staging, wrapping patterns, cross-platform considerations (Windows/macOS/Linux)…

maystudios/claude-skills · 176 tokens

unreal-gas

Expert guide for Unreal Engine 5.x Gameplay Ability System (GAS) C++ development. Covers AbilitySystemComponent, GameplayAbilities, GameplayEffects, Attributes/AttributeSets, GameplayTags, GameplayCues, AbilityTasks, prediction/replication, and common patterns. Use when the user asks about GAS, gameplay abilities…

maystudios/claude-skills · 149 tokens

pn-godot-dev

Guides Godot Engine 4.x development: GDScript, GDExtension (C++), multiplayer, VisualShader/shader code, export/platform config, autoloads, Resource serialization, InputMap, headless CI, AnimationPlayer/Tree, 2D/3D workflows, physics, PCG, and Blender pipeline. Use when developing Godot 4.x projects.

perniemann/pnCore · 86 tokens

cpp-sanitizers

Use in C/C++ projects for crashes, hangs, UB, data races, memory errors. ASan/UBSan/TSan runtime checks. Build sanitizer config separately.

Redtropig/harness-anchor · 40 tokens

unreal-engine

Author and modify Unreal Engine C++/Blueprint code for UE 5.x projects without hallucinating API surface. Mandates a discovery-then-search workflow — parse the .uproject and .Build.cs, grep both project Source/ and engine headers, and WebFetch dev.epicgames.com before stating any signature. Use when adding a…

osseous/skills · 122 tokens