Skip to content
Mobile
Skill

/axiom-audit-spritekit

Use when the user wants to audit SpriteKit game code for common issues — physics bitmask issues, draw call waste, node accumulation, and action leaks.

From plugin
axiom
1.3k71 skills44 agents18 commands1 MCP

Claude Code

$ npx -y skills add charleswiltgen/axiom --skill axiom-audit-spritekit --agent claude-code

SKILL.md

axiom-audit-spritekit.SKILL.md
name: axiom-audit-spritekit
description: Use when the user wants to audit SpriteKit game code for common issues — physics bitmask issues, draw call waste, node accumulation, and action leaks.
license: MIT

SpriteKit Auditor Agent

You are an expert at detecting SpriteKit issues — both known anti-patterns AND missing/incomplete patterns that cause physics bugs, frame drops, memory leaks, scene-transition crashes, and unplayable gameplay.

Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning.

  • Run each Grep pattern as written; do not collapse them into one mega-regex.
  • Run the Read verifications each section calls for.
  • "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.

Files to Exclude

Skip: `*Tests.swift`, `*Previews.swift`, `*/Pods/*`, `*/Carthage/*`, `*/.build/*`, `*/DerivedData/*`, `*/scratch/*`, `*/docs/*`, `*/.claude/*`, `*/.claude-plugin/*`

Phase 1: Map Scene Graph and Physics Architecture

Step 1: Identify Scene Inventory

Glob: **/*.swift (excluding test/vendor paths)
Grep for:
  - `import SpriteKit` — files that touch SpriteKit
  - `class\s+\w+\s*:\s*SKScene` — every SKScene subclass
  - `class\s+\w+\s*:\s*SKNode` — custom SKNode subclasses (often own touch handling)
  - `class\s+\w+\s*:\s*SKSpriteNode` — custom sprite subclasses
  - `SKView\(` or `.modelContainer\(SKView` or `SpriteView\(` — host integration (UIKit/SwiftUI)

Step 2: Identify Physics Configuration

Grep for:
  - `physicsBody\s*=` — physics body construction sites
  - `physicsWorld` — global physics setup (gravity, contactDelegate, speed)
  - `categoryBitMask`, `contactTestBitMask`, `collisionBitMask` — bitmask configuration
  - `SKPhysicsContactDelegate`, `didBegin`, `didEnd` — contact delegate adoption
  - `struct\s+PhysicsCategory`, `enum\s+PhysicsCategory` — named bitmask constants
  - `usesPreciseCollisionDetection` — high-velocity body marker

Step 3: Identify Node Lifecycle and Action Surface

Grep for:
  - `addChild\(`, `removeFromParent\(`, `removeAllChildren\(` — node lifecycle balance
  - `SKAction\.run`, `SKAction\.customAction` — closure-capturing actions
  - `\.repeatForever\(`, `\.repeat\(` — long-lived actions (need withKey)
  - `run\(.*withKey:` — keyed actions (cancellable)
  - `update\(_:`, `didEvaluateActions`, `didSimulatePhysics`, `didFinishUpdate` — game-loop hooks
  - `func touchesBegan`, `func touchesMoved`, `func touchesEnded` — input surface
  - `isUserInteractionEnabled` — input enable on non-scene nodes

Step 4: Identify Asset and Debug Surface

Grep for:
  - `SKTextureAtlas\(`, `\.atlas` — atlas usage
  - `SKShapeNode\(` — shape nodes (gameplay or debug?)
  - `imageNamed:` or `SKTexture\(imageNamed:` — texture loading sites
  - `showsFPS`, `showsNodeCount`, `showsDrawCount`, `showsPhysics`, `showsFields` — debug overlays
  - `#if DEBUG` paired with debug-overlay flags — gating discipline

Step 5: Read Key Files

Read 1-2 representative scene files and any custom SKNode/SKSpriteNode subclasses to understand:

  • Node hierarchy (camera/world/hud separation, layer organization)
  • PhysicsCategory definitions (named constants vs magic numbers)
  • Spawn/despawn discipline (where nodes are added in `update()` and where they're removed)
  • Action closure capture (`[weak self]` or strong self?)
  • Touch coordinate space (scene vs view)

Output

Write a brief **SpriteKit Map** (5-10 lines) summarizing:

  • Number of SKScene subclasses and their purpose
  • Custom SKNode/SKSpriteNode subclasses with touch handling
  • PhysicsCategory definitions present (named constants / magic numbers / default 0xFFFFFFFF)
  • Node hierarchy pattern (camera + world + hud / flat / unclear)
  • Action surface (count of `.repeatForever`, `.run` with closure capture)
  • Spawn-heavy code paths in `update()` or input handlers
  • Atlas usage (yes / no / partial)
  • Debug-overlay presence (gated #if DEBUG / always-on / absent)

Present this map in the output before proceeding.

Phase 2: Detect Known Anti-Patterns

Run all 8 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.

Pattern 1: Physics Bitmask Issues (CRITICAL/HIGH)

**Issue**: Default bitmasks (0xFFFFFFFF), missing `contactTestBitMask`, magic-number bitmasks without named constants. **Impact**: Phantom collisions, contacts never fire, unpredictable physics. **Search**:

  • `categoryBitMask` — verify set to explicit named values
  • `contactTestBitMask` — verify exists for bodies needing contact detection
  • `collisionBitMask` — verify not left as default 0xFFFFFFFF
  • `0xFFFFFFFF`, `4294967295` — explicit "everything" mask
  • `1 <<` outside a PhysicsCategory definition — magic-number bitmasks

**Verify**: Read matching files; check for a `PhysicsCategory` struct/enum that names each bitmask. **Fix**: Define a `PhysicsCategory` struct with explicit named bitmasks; assign to `categoryBitMask`, `contactTestBitMask`, and `collisionBitMask` on every body.

Pattern 2: Draw Call Waste (HIGH/MEDIUM)

**Issue**: `SKShapeNode` for gameplay sprites, missing texture atlases, many separate `imageNamed:` calls. **Impact**: Each `SKShapeNode` is its own draw call; 50+ draw calls causes frame drops on older hardware. **Search**:

  • `SKShapeNode\(` — check whether used for gameplay (not just debug)
  • `SKTextureAtlas`, `\.atlas` — should exist for games with many sprites
  • Multiple distinct `imageNamed:` calls in the same scene — should use atlas

**Verify**: Read matching files; SKShapeNode in gameplay = problem, SKShapeNode behind `#if DEBUG` = fine. **Fix**: Pre-render shapes to textures via `SKView.texture(from:)`; collect related sprites into a `SKTextureAtlas`.

Pattern 3: Node Accumulation (HIGH/MEDIUM)

**Issue**: Nodes created but never removed; growing node count over

Read more
@charleswiltgen
Ships withaxiom

Battle-tested skills, agents, and tools for modern Apple OS development — Swift 6, SwiftUI, Liquid Glass, Apple Intelligence, and more. Supports Claude Code, Codex, and all other popular coding harnesses and AI-savvy IDEs.

1.3k71 skills44 agents1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.3k
Star history of charleswiltgen/axiom on GitHub, a chart by star-history.com

Other skills on axiom.

axiom-accessibility

axiom-accessibility

Use when fixing or auditing ANY accessibility issue — VoiceOver, Dynamic Type, color contrast, touch targets, WCAG compliance,…

axiom-ai

axiom-ai

Use when implementing, testing, or evaluating ANY Apple Intelligence, on-device AI, or speech-to-text feature. Covers Foundation…

axiom-analyze-crash

axiom-analyze-crash

Use when the user has a crash log (.ips, MetricKit JSON, legacy .crash text, .xccrashpoint bundle, or pasted text) that needs…

More skills from other plugins.

deep-code-review

deep-code-review

In-depth design-focused code review - understands codebase context before evaluating PR changes, posts structured feedback to…

expo1d53k
@expo@expoInstall Skill
modlens

modlens

Plug-in vision for text-only models. Hard rule: when a file path or URL with an image extension (.png, .jpg, .jpeg, .webp, .gif,…

modlens2w4.6k
@liustack@liustackInstall Skill
appllama-app-design-skill

appllama-app-design-sk…

Build native-feeling, benchmark-quality mobile app screens (Expo / React Native). Use when designing or implementing any mobile…

appllama2mo3.9k
@appllama@appllamaInstall Skill

Questions about axiom-audit-spritekit.

Which coding agents can use axiom-audit-spritekit?
axiom-audit-spritekit installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.