From ue-inspector
This skill should be used when the user asks about "AI-friendly code", "AI readable code", "code for AI", "Unreal C++ best practices for AI", "how to write code AI can understand", "CodeHealth", "refactoring for AI tools", or needs guidance on making C++ code more parseable by AI assistants and tools.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ue-inspector:ai-friendly-ue-cppThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
This skill provides guidance for writing Unreal Engine C++ code optimized for AI tool compatibility.
This skill provides guidance for writing Unreal Engine C++ code optimized for AI tool compatibility.
Human-friendly code = AI-friendly code
Research (arXiv 2601.02200v1) shows CodeHealth >= 9 reduces AI tool error rates by 15-30%.
| Pillar | Key Practices |
|---|---|
| Explicit Expression | this->, explicit types, namespaces, parameter names |
| Structural Clarity | One class per file, consistent ordering, header/source separation |
| Bounded Complexity | 50-line functions, 3-level nesting, 4 parameters max |
// Use this-> for members
this->Health += Delta;
// Explicit types over auto
APlayerState* State = GetPlayerState();
// Full namespaces
UE::Math::FVector Position;
// Named parameters in headers
void SetTransform(FVector Location, FRotator Rotation, FVector Scale);
// One class per file
// MyActor.h -> AMyActor only
// Consistent section order
class AMyActor
{
public: // Constructors, then public methods
protected: // Protected methods, then protected variables
private: // Private methods, then private variables
};
// Forward declarations over includes
class UInventoryComponent; // Instead of #include
| Metric | Limit |
|---|---|
| Function length | <= 50 lines |
| Nesting depth | <= 3 levels |
| Parameters | <= 4 (use struct if more) |
Use Early Return pattern to reduce nesting:
for (auto* Actor : Actors)
{
if (!Actor) continue;
if (!Actor->IsAlive()) continue;
ProcessActor(Actor);
}
When inspecting code, check for:
this-> on member accessauto usageFor detailed patterns and complete code examples:
references/guidelines.md - Complete guidelines with all code examplesreferences/checklist.md - Quick reference checklist for code reviewWhen analyzing or refactoring code:
Guides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
npx claudepluginhub juyeongyi/jylee_claude_marketplace --plugin ue-inspector