Files
Claude-Code-Game-Studios/.claude/rules/engine-code.md
Donchitos ad540fe75d Game Studio Agent Architecture — complete setup (Phases 1-7)
48 coordinated Claude Code subagents for indie game development:
- 3 leadership agents (creative-director, technical-director, producer)
- 10 department leads (game-designer, lead-programmer, art-director, etc.)
- 23 specialist agents (gameplay, engine, AI, networking, UI, tools, etc.)
- 12 engine-specific agents (Godot, Unity, Unreal with sub-specialists)

Infrastructure:
- 34 skills (slash commands) for workflows, reviews, and team orchestration
- 8 hooks for commit validation, asset checks, session management
- 11 path-scoped rules enforcing domain-specific standards
- 28 templates for design docs, reports, and collaborative protocols

Key features:
- User-driven collaboration protocol (Question → Options → Decision → Draft → Approval)
- Engine version awareness with knowledge-gap detection (Godot 4.6 pinned)
- Phase gate system for development milestone validation
- CLAUDE.md kept under 80 lines with extracted doc imports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:04:24 +11:00

1.3 KiB

paths
paths
src/core/**

Engine Code Rules

  • ZERO allocations in hot paths (update loops, rendering, physics) — pre-allocate, pool, reuse
  • All engine APIs must be thread-safe OR explicitly documented as single-thread-only
  • Profile before AND after every optimization — document the measured numbers
  • Engine code must NEVER depend on gameplay code (strict dependency direction: engine <- gameplay)
  • Every public API must have usage examples in its doc comment
  • Changes to public interfaces require a deprecation period and migration guide
  • Use RAII / deterministic cleanup for all resources
  • All engine systems must support graceful degradation
  • Before writing engine API code, consult docs/engine-reference/ for the current engine version and verify APIs against the reference docs

Examples

Correct (zero-alloc hot path):

# Pre-allocated array reused each frame
var _nearby_cache: Array[Node3D] = []

func _physics_process(delta: float) -> void:
    _nearby_cache.clear()  # Reuse, don't reallocate
    _spatial_grid.query_radius(position, radius, _nearby_cache)

Incorrect (allocating in hot path):

func _physics_process(delta: float) -> void:
    var nearby: Array[Node3D] = []  # VIOLATION: allocates every frame
    nearby = get_tree().get_nodes_in_group("enemies")  # VIOLATION: tree query every frame