/game-porting-skills:porting-validatefrom game-porting-skills
Runs a validation checklist for porting milestones: runtime verification, visual correctness, GPU frame capture, Metal validation, memory leaks, skill-driven code review, and data flow verification.
Ships in game-porting-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are entering Phase 3: Validate for the current milestone. The milestone's work is functionally complete. Mid-milestone commits for stable checkpoints are fine, but this full validation pass should happen before closing out the milestone.
Validation often runs in a fresh session after the execute phase. Skills loaded during execution are no longer in context. You MUST reload the skills you need before proceeding:
porting-methodology (for anti-patterns checklist and debugging escalation).using-gpucapture and using-gpudebug — you will need these for GPU frame capture and ground truth comparison. Do NOT attempt GPU capture workflows from memory.debugging-rendering-issues for structured diagnostic workflows.Work through each item and report findings:
The app must run. From M1 onward, do not declare a milestone complete based on code review alone — verify at runtime.
Verify rendering output. Metal validation does not catch wrong-but-valid states (wrong format, wrong color space, wrong blend mode, darker/brighter rendering).
screencapture on macOS) and analyze it visually — check that the scene is visible, geometry is present, and there are no obvious artifacts (black screen, missing objects, color issues).YOU MUST capture and analyze a GPU frame for any milestone that touches rendering. Do NOT skip this step. This catches issues invisible to both visual inspection and validation layers — wrong textures bound, empty buffers, missing descriptor entries, non-resident resources, stale reads from missing barriers.
Before capturing, ensure using-gpucapture is loaded. Before analyzing, ensure using-gpudebug is loaded. Do NOT attempt these workflows from memory — the skills contain required environment variables, API calls, and analysis procedures.
gpucapture, gpudebug) are unavailable, ask the user to capture a frame via Xcode and share the .gputrace file for analysis. Do NOT silently skip GPU frame validation — either do it yourself or get the user's help.Cross-reference available ground truths against the current milestone's output. Determine which ground truths are relevant based on what the milestone touches — the agent should select the appropriate comparisons, not run all of them mechanically. Only compare features that are expected to work at this milestone — do not flag missing functionality that belongs to future milestones.
Check the discovery report's Reference Artifacts table. Available ground truths and when they're relevant:
using-gpudebug for autonomous comparison.If no reference artifacts are available, skip this step.
Report: which ground truths were compared, discrepancies found, whether they're expected (incomplete milestone) or need investigation.
Run the app with Metal validation enabled. Load using-metal-validation for env-var setup, launch rule, and gotchas.
./App 2>&1 | grep -i error or ./App 2>metal_errors.log.log show --predicate 'subsystem == "com.apple.Metal"' --last 5m — but this may be sandboxed. Prefer stderr redirection.Check for memory issues using available tools:
-fsanitize=address or enable ASan in the Xcode scheme. Catches use-after-free, buffer overflows, stack corruption, and other memory errors that leak checkers miss. Run at least once per milestone.id<...> members before freeing C-allocated structs.MTL_HUD_ENABLED=1) memory counter. If it grows continuously, resources are leaking.For each domain skill loaded during this milestone, re-read its guidance sections — look for any of: Anti-Patterns, Common Mistakes, Common Pitfalls, Troubleshooting, Best Practices, Good Practices. Not all skills use the same headings. Some skills have reference subdirectories with additional anti-patterns — check any reference files relevant to the milestone's scope. Review your code against each item found.
CPU-side data flow: For every struct member you wrote to during this milestone:
GPU resource binding chain: For resources introduced or modified this milestone, trace the full path:
Resource creation (format, type, storage mode) → descriptor binding (correct entry type, address, metadata) → shader binding slot → shader consumption (how the shader reads it).
A break at any point in this chain produces silent corruption with no error.
Report: any mismatches found and fixed.
Walk through every function changed during this milestone. Look for:
default: return MTLVertexFormatFloat4)If you introduced any shortcuts, hacks, or temporary code during debugging in Phase 2, clean them up now:
Review all deferred work:
STUB(Mx) or TODO comments with clear descriptions.Present the validation results to the user:
## Validation Report: [milestone name]
### Runtime Verification
[Did the app run? Success criterion met? Crashes?]
### Visual Correctness
[Screenshot analysis, user-confirmed visual result, or issues identified]
### GPU Frame Capture
[Resource binding correctness confirmed, or issues identified. "N/A — non-rendering milestone" if skipped.]
### Ground Truth Comparison
[Which ground truths compared, discrepancies found, whether expected or needing investigation. "No reference artifacts available" if none.]
### Metal Validation
[Results — errors found/fixed/deferred]
### Memory and Safety
[Results — leaks found/fixed]
### Skill-Driven Review
[Guidance sections checked, violations found/fixed]
### Data Flow Verification
[Struct members traced, mismatches found/fixed. Resource binding chains verified.]
### Code Review
[Issues found/fixed]
### Pressure Hacks Cleaned
[What was refactored]
### Deferred Work
[STUB/TODO items remaining]
### Overall Status
[Clean / Issues remaining — recommendation to proceed or fix first]
After presenting the validation report, ask the user to review the changes and provide feedback. Incorporate any feedback before closing out the milestone.
Gate: STOP after presenting validation results. Wait for the user to review. The user will invoke /porting-handoff when satisfied.
"Validation complete. Run
/porting-handoffto write the handoff note and close out this milestone."
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub apple/game-porting-toolkit --plugin game-porting-skills24 skills in this plugin
/compiling-with-metal-shaderconverterALWAYS use when compiling DXIL/HLSL to metallib with Metal shader converter (commonly referred to as MSC) via the metal-shaderconverter CLI or libmetalirconverter (IRCompiler, IRObject, IRShaderReflection) at runtime. Covers offline/runtime DXIL compilation, root signatures, reflection output, ray tracing shaders, geometry/tessellation emulation compilation, framebuffer fetch in HLSL, programmable blending in HLSL, Metal_HLSL.inc, and compatibility flags. Do NOT trigger for binding compiled shaders to encoders — use integrating-metal-shaderconverter-shaders for that./creating-metal4-shader-pipelinesALWAYS use when creating Metal pipeline state objects with Metal 4 descriptors (MTL4RenderPipelineDescriptor, MTL4ComputePipelineDescriptor, MTL4MeshRenderPipelineDescriptor) via MTL4Compiler. Covers function descriptors, function constant specialization, flexible/unspecialized PSOs, color-attachment mapping, async compilation (MTL4CompilerTask), pipeline caching (MTL4Archive, MTL4PipelineDataSetSerializer), static/binary shader linking, and pipeline reflection. Do NOT trigger for HLSL/DXIL → metallib — use compiling-with-metal-shaderconverter./debugging-rendering-issuesALWAYS use when a user porting a game to Metal reports a rendering issue — blank screen, wrong output, or anything that looks incorrect on Metal vs. the source platform. Covers black screen, missing geometry, wrong colors, gamma/sRGB problems, texture artifacts, z-fighting, alpha blending, flickering, visual corruption, and upside-down/mirrored geometry. Works with or without a GPU trace. Do NOT trigger when the user just wants to inspect an existing .gputrace./integrating-metal-shaderconverter-shadersALWAYS use when integrating Metal shader converter (commonly referred to as MSC) shaders at runtime — binding model, top-level argument buffer (TLAB), root signature resource locations, descriptor/sampler heaps, static samplers, bindless resources, vertex fetch, separate stage-in, geometry/tessellation emulation, compute dispatch, unbounded arrays, and append/consume buffers. Do NOT trigger for compiling DXIL/HLSL to metallib — use compiling-with-metal-shaderconverter for that./managing-metal4-resourcesALWAYS use when working with Metal 4 resources — buffer / texture / heap creation, storage modes, `MTLResidencySet` management, heap aliasing, purgeable state, texture view pools, GPU lossless compression, and deferred destruction. Trigger for MTLBuffer, MTLTexture, MTLHeap, MTLResidencySet, addAllocation, requestResidency, useResidencySet, addResidencySet, MTLStorageMode*, MTLPurgeableState, MTLTextureViewPool, MTLResourceViewPool, newTextureViewWithPixelFormat:, copyFromBuffer:toTexture:, "GPU fault on resource", "non-resident resource", heap aliasing. Do NOT trigger for TBDR architecture or Metal 3 → Metal 4 namespace tables — use `translating-to-metal4-api`. Barrier visibility / `MTL4VisibilityOption*` / render-pass transition barriers — use `managing-metal4-synchronization`. `CAMetalLayer.residencySet` — use `presenting-metal-drawables`. `NS::SharedPtr` / autorelease pool / ARC bridging — use `managing-metal-cpp-lifetimes`./managing-metal4-synchronizationMetal 4 explicit synchronization — barriers, fences, events, and cross-API state translation (from D3D12, Vulkan, OpenGL). Use when porting GPU synchronization, translating resource state transitions, or debugging barrier-related visual corruption.Other plugins' skills for the same job