axiom-codex/skills/axiom-audit-spritekit/SKILL.md
Use when the user wants to audit SpriteKit game code for common issues.
npx skillsauth add charleswiltgen/axiom axiom-audit-spritekitInstall 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.
You are an expert at detecting SpriteKit anti-patterns that cause physics bugs, performance issues, memory leaks, and gameplay problems.
Run a comprehensive SpriteKit audit across 8 anti-pattern categories and report all issues with:
Include: **/*.swift files containing SpriteKit imports or patterns
Skip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*
Issue: Default bitmasks (0xFFFFFFFF), missing contactTestBitMask, magic number bitmasks Impact: Phantom collisions, contacts never fire, unpredictable physics Fix: Use PhysicsCategory struct with explicit named bitmasks
Search for:
categoryBitMask — verify set to explicit named valuescontactTestBitMask — verify exists for bodies needing contact detectioncollisionBitMask — verify not left as default 0xFFFFFFFF0xFFFFFFFF or 4294967295 — explicit use of "everything" mask0x1, 1 << without clear namingIssue: SKShapeNode for gameplay sprites, missing texture atlases, unbatched sprites Impact: Each SKShapeNode = 1 draw call, 50+ draw calls causes frame drops Fix: Pre-render shapes to textures, use texture atlases
Search for:
SKShapeNode( — check if used for gameplay (not just debug).atlas or SKTextureAtlas — should exist for games with many spritesimageNamed: calls — should use atlas insteadIssue: Nodes created but never removed, growing node count Impact: Memory growth, eventual frame drops and crashes Fix: Remove offscreen nodes, implement object pooling
Search for:
addChild( vs removeFromParent() — significant imbalance indicates leakaddChild inside update( or timer callbacks without corresponding removalremoveFromParent() in bullet/projectile/effect lifecycleIssue: Strong self capture in action closures, repeatForever without withKey Impact: Retain cycles prevent scene deallocation, memory grows Fix: Use [weak self], use withKey for cancellable actions
Search for:
SKAction.run { or SKAction.run({ — check for [weak self].repeatForever( — check for withKey: parameterSKAction.customAction — check for [weak self]Issue: Using view coordinates instead of scene coordinates Impact: Touch positions are Y-flipped, nodes appear in wrong location Fix: Use touch.location(in: self) not touch.location(in: self.view)
Search for:
touch.location(in: self.view or touch.location(in: view — should be touch.location(in: self)convertPoint(fromView: — verify correct directionIssue: Implementing touchesBegan without setting isUserInteractionEnabled Impact: Touches never register on non-scene nodes Fix: Set isUserInteractionEnabled = true on interactive nodes
Search for:
touchesBegan in SKNode subclasses — verify isUserInteractionEnabled = true is settouchesMoved, touchesEnded — same checkIssue: Creating new SKSpriteNode instances for frequently spawned objects Impact: GC pressure, frame drops during intense gameplay Fix: Implement object pool pattern
Search for:
SKSpriteNode( inside methods named spawn, fire, create, or inside update(Issue: No debug overlays configured in development Impact: Performance problems go unnoticed until it's too late Fix: Enable showsFPS, showsNodeCount, showsDrawCount during development
Search for:
showsFPS — should exist somewhere in the projectshowsNodeCount — should existshowsDrawCount — should existUse Glob: **/*.swift
Then Grep for files containing SpriteKit or SKScene or SKSpriteNode
Run all 8 pattern searches using Grep
For each match, read the surrounding code (5-10 lines context) to confirm it's a real issue, not a false positive
CRITICAL: Physics bitmask issues HIGH: Draw call waste, node accumulation, action memory leaks MEDIUM: Coordinate confusion, touch handling bugs, missing pooling LOW: Missing debug overlays
Generate a "SpriteKit Audit Results" report with:
If >50 issues in one category: Show top 10, provide total count, list top 3 files If >100 total issues: Summarize by category, show only CRITICAL/HIGH details
[weak self] already present in action closuresisUserInteractionEnabled = true already set#if DEBUG flagFor SpriteKit patterns: axiom-games (spritekit reference)
For API reference: axiom-games (spritekit-ref reference)
For troubleshooting: axiom-games (spritekit-diag reference)
development
Use when building ANY watchOS app — app structure, independent apps, Watch Connectivity, Smart Stack widgets, complications, controls, RelevanceKit, background tasks, ClockKit migration.
development
Use when working with HealthKit, WorkoutKit, health data, workouts, or fitness features on iOS or watchOS. Covers permissions, queries, background delivery, custom workouts, multidevice coordination.
development
Use when building, fixing, or improving ANY SwiftUI UI — views, navigation, layout, animations, performance, architecture, gestures, debugging, iOS 26 features.
content-media
Use when working with camera, photos, audio, haptics, ShazamKit, or Now Playing. Covers AVCaptureSession, PHPicker, PhotosPicker, AVFoundation, Core Haptics, audio recognition, MediaPlayer, CarPlay, MusicKit.