skills/n2c-code-generator/SKILL.md
Generate C++ header and implementation from N2C JSON with project context. Sub-agent of n2c-orchestrator.
npx skillsauth add sipherxyz/universal-ue-skills n2c-code-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generates C++ code from NodeToCode JSON using project-verified context.
{
"jsonPath": "{project.root}/Saved/NodeToCode/Export/GA_Jump.json",
"context": {
"includeMap": { ... },
"baseClassContext": { ... },
"apiPatterns": { ... },
"namingConventions": { ... },
"potentialConflicts": [ ... ]
},
"outputClassName": "UGA_Jump",
"moduleName": "S2"
}
Success:
{
"success": true,
"header": "// Full .h file content...",
"implementation": "// Full .cpp file content...",
"notes": [
"Used K2_OverrideRuntimeData_Implementation signature from base class",
"Renamed AnimationData to LocalAnimData to avoid shadowing",
"Added GameplayTasks to Build.cs dependencies"
],
"buildDependencies": ["GameplayAbilities", "GameplayTags", "GameplayTasks"]
}
Failure:
{
"success": false,
"errorCode": "GENERATION_FAILED",
"errorMessage": "Failed to generate code for graph EventGraph",
"partialOutput": { ... }
}
Read N2C JSON and context:
n2c_json = read_json(json_path)
context = input.context
include_map = context.includeMap
base_class = context.baseClassContext
api_patterns = context.apiPatterns
conflicts = context.potentialConflicts
Build the prompt with all context:
<projectContext>
<includeMap>
{
"USipherGameplayAbilityRuntime": "GameplayAbilities/SipherGameplayAbilityRuntime.h",
"FSipherAbilityData_Animation": "GameplayAbilities/AbilityData/SipherAbilityData_Animation.h"
}
</includeMap>
<baseClassSignatures>
{
"className": "USipherGameplayAbilityRuntime",
"virtualMethods": [
{
"name": "K2_OverrideRuntimeData_Implementation",
"signature": "virtual bool K2_OverrideRuntimeData_Implementation(TInstancedStruct<FSipherGenericAbilityData>& OverridenData)"
}
]
}
</baseClassSignatures>
<apiPatterns>
- UAITask_MoveTo: Use OnMoveTaskFinished.AddUObject, NOT OnMoveFinished.AddDynamic
- AbilityWaitDelay: Use UAbilityTask_WaitDelay::WaitDelay, NOT UGameplayTask_WaitDelay
- TSoftObjectPtr: Call .LoadSynchronous() when assigning to raw pointer
- K2Functions: Use native functions, NOT K2_ wrappers
</apiPatterns>
<namingConventions>
- Actor classes: ASipher{Name}
- Components: USipher{Name}Component
- Structs: FSipher{Name}
- Avoid shadowing: {conflicts}
</namingConventions>
<avoidShadowing>
Base class has these members - do NOT use as local variable names:
- AnimationData
- AbilityData
</avoidShadowing>
</projectContext>
<nodeToCodeJson>
{Full N2C JSON content}
</nodeToCodeJson>
<task>
Convert this Blueprint to C++ following the project context above.
CRITICAL RULES:
1. Use ONLY include paths from includeMap - do not guess
2. Match base class method signatures EXACTLY
3. Follow apiPatterns for UE5.7 compatibility
4. Rename local variables that would shadow base class members
5. Structure: .generated.h last in header, own header first in .cpp
</task>
Use the CodeGen_CPP.md system prompt to generate code.
Parse the LLM response:
{
"graphs": [
{
"graph_name": "ActivateAbility",
"graph_type": "Function",
"graph_class": "UGA_Jump",
"code": {
"graphDeclaration": "...",
"graphImplementation": "...",
"implementationNotes": "..."
}
}
]
}
Combine all graph outputs into complete .h and .cpp files:
Header Assembly:
// Copyright (c) 2025 Sipher. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "{BaseClassInclude}"
// Other includes from graphs...
#include "{ClassName}.generated.h"
// Forward declarations...
/**
* @brief {BlueprintName} converted from Blueprint
* @note Auto-generated by NodeToCode
*/
UCLASS()
class {MODULE}_API {ClassName} : public {BaseClass}
{
GENERATED_BODY()
public:
{ClassName}();
// Graph declarations...
{graphDeclarations}
protected:
// Protected members...
private:
// Private members...
};
Implementation Assembly:
// Copyright (c) 2025 Sipher. All Rights Reserved.
#include "{ClassName}.h"
// Other includes...
{ClassName}::{ClassName}()
{
// Constructor from graphs
}
// Graph implementations...
{graphImplementations}
Parse includes to determine Build.cs dependencies:
build_dependencies = set()
# Map include paths to module names
include_to_module = {
"GameplayAbilities/": "GameplayAbilities",
"GameplayTags/": "GameplayTags",
"GameplayTasks/": "GameplayTasks",
"AIModule/": "AIModule",
"NavigationSystem/": "NavigationSystem"
}
for include in all_includes:
for pattern, module in include_to_module.items():
if pattern in include:
build_dependencies.add(module)
{
"success": true,
"header": "// Full assembled .h content",
"implementation": "// Full assembled .cpp content",
"notes": [
"Used K2_OverrideRuntimeData_Implementation signature from base class",
"Renamed AnimationData to LocalAnimData to avoid shadowing"
],
"buildDependencies": ["GameplayAbilities", "GameplayTags"]
}
CoreMinimal.h{ClassName}.generated.h (ALWAYS LAST){ClassName}.h (ALWAYS FIRST)nullptr not NULLthis-> for member access in lambdasconst correctness// Blueprint latent node becomes:
UAbilityTask_WaitDelay* DelayTask = UAbilityTask_WaitDelay::WaitDelay(this, Duration);
DelayTask->OnFinish.AddDynamic(this, &ThisClass::OnDelayFinished);
DelayTask->ReadyForActivation();
// Blueprint ForEachLoop becomes:
for (const auto& Element : ArrayToIterate)
{
// Loop body
}
// Blueprint Branch becomes:
if (Condition)
{
// True branch
}
else
{
// False branch
}
// Blueprint Sequence becomes sequential statements:
// Then 0
DoFirstThing();
// Then 1
DoSecondThing();
// Then 2
DoThirdThing();
development
This skill should be used when implementing features in isolation using git worktrees. Triggers on "create worktree", "isolated workspace", "parallel development", or when starting implementation that should not affect main workspace.
testing
Manage VFX team issues on GitHub Projects - timeline scheduling, status updates, member commit checks, bulk assign. Use when managing VFX team project board, adding issues to timeline, checking member progress, or bulk-updating issue fields.
tools
Generate C++ validation rules from JSON definitions. Use when team updates ValidationRules.json or asks to add/modify validation rules.
development
Check codebase for Microsoft Xbox XR (Xbox Requirements) compliance issues. Scans for account picker, cloud saves, achievements, Quick Resume, and Xbox certification requirements. Use before console submission or when preparing for Microsoft certification. Triggers on "XR", "Xbox certification", "Microsoft compliance", "Xbox cert", "Xbox requirements", "GDK compliance".