Universal Game Primitives
by @stusatwork-oss
Universal game architecture DSL with six primitives (LOOP, TILEGRID, CONTROLBLOCK, POOL, EVENT, DISPATCHER). Use when: (1) designing portable game/sim loops, (2) translating between architectures (68K β Cell β CUDA β ECS), (3) explaining engine structure to AI agents, (4) refactoring chaos into explicit state + flow. Invocation produces: Primitive Map, Dataflow Sketch, Worked Example, Portability Notes.
clawhub install primitives-dslπ About This Skill
name: primitives-dsl description: "Universal game architecture DSL with six primitives (LOOP, TILEGRID, CONTROLBLOCK, POOL, EVENT, DISPATCHER). Use when: (1) designing portable game/sim loops, (2) translating between architectures (68K β Cell β CUDA β ECS), (3) explaining engine structure to AI agents, (4) refactoring chaos into explicit state + flow. Invocation produces: Primitive Map, Dataflow Sketch, Worked Example, Portability Notes."
primitives-dsl β Universal Game Architecture Patterns
What this skill does
Provides a small, portable DSL of six universal primitives that appear across 68K-era loops, Cell/PPU+SPU orchestration, CUDA/GPU kernels, and modern ECS engines.
Primitives: LOOP Β· TILEGRID Β· CONTROLBLOCK Β· POOL Β· EVENT Β· DISPATCHER
Use this skill to:
When to use it
When NOT to use it
The DSL (definitions)
LOOP A repeated update cycle with explicit phases. Owns time slicing and ordering.
TILEGRID A spatial index with stable adjacency rules (2D/3D grids, nav tiles, zone cells, chunk maps).
CONTROLBLOCK A compact, authoritative state record (flags, counters, handles, timers) used to coordinate behavior and enforce constraints.
POOL
A bounded allocator for frequently-created things (entities, bullets, particles, jobs). No unbounded new in hot paths.
EVENT A structured message representing "something happened" with minimal payload and explicit routing metadata.
DISPATCHER Routes work and events to handlers (CPU threads, SPUs, GPU kernels, ECS systems). Also where scheduling policy lives.
Output contract (what you must produce)
When invoked, produce:
1. Primitive Map β Identify which parts of the system correspond to each primitive 2. Dataflow Sketch β Text diagram or table describing movement of state/events 3. One Worked Example β Or cite an existing example file 4. Portability Notes β How this maps to 68K / Cell / CUDA / ECS
Invocation patterns (copy/paste prompts)
"Apply primitives-dsl to design a loop for ___ . Provide a Primitive Map + Dataflow + Portability.""Translate this architecture into LOOP/TILEGRID/CONTROLBLOCK/POOL/EVENT/DISPATCHER."
"Given these constraints (___), propose a primitives-dsl design and a worked example."
Guardrails / style rules
References
assets/quick_card.md β One-page referencereferences/architecture_mapping.md β Platform translation table + full code examplesreferences/example_shooter.md β Classic shooter loop
- references/example_mall_tick.md β GLITCHDEXMALL zone sim
- references/example_npc_step.md β NPC state machine step