Use this skill when the chosen game type is roguelike. Covers genre pillars (permadeath, procgen, turn-based depth, emergent narrative, run-based meta), the required systems checklist, the recommended stack (Vite + TS + PixiJS + rot.js), the loop pattern (turn-based speed scheduler), genre-specific pitfalls, the spec template, and reference exemplars. TRIGGER when: docs/concept.md names "roguelike" as the chosen genre, or the user says "roguelike", "permadeath", "procgen run", "dungeon crawl", "NetHack-like", "DCSS-like", "Brogue-like", "ToME-like", "Caves of Qud-like". DO NOT TRIGGER when: docs/concept.md does not yet exist — use game-concept first; the genre is something other than roguelike (use the matching game-<genre> skill); the question is purely technical with no genre context — use the relevant generic skill (game-scaffold / game-loop / game-systems / game-perf).
A roguelike is a turn-based game where the world is procedurally generated, death is permanent, and most of the long-term interest comes from the interaction of small simple systems rather than scripted content. Modern usage stretches the term ("roguelite"), so be honest with the user about which axis you're on.
This skill captures what is specific to the genre. Implementation patterns (FOV, dungeon gen, scheduler, save/load) live in the generic skills; this file links to them and tells you which ones you actually need.
If you remove any of these, it stops being a roguelike:
State explicitly in docs/concept.md whether you are building a classic roguelike (all five pillars; e.g. NetHack, DCSS) or a roguelite (relaxed permadeath, real-time, or scripted content; e.g. Hades, Slay the Spire). The pillars you skip define the work you avoid.
Each item links into the generic skills; do not re-implement.
Math.random call goes through one injected RNG. → see game-scaffold § "Phase 3 — Seeded RNG first" and game-systems § "Determinism checklist".ROT.FOV.PreciseShadowcasting.energy by speed, act when energy ≥ 100. → see game-loop § "Pattern B — Turn-based speed scheduler".Action union. → see game-systems § "Input → Action mapping".World + scheduler + RNG state; bump SAVE_VERSION on schema changes. → see game-systems § "Save / load".If your concept is a roguelite (real-time movement, scripted floors, run-resetting meta-progression), the speed scheduler is replaced by the fixed-timestep loop (game-loop § "Pattern A"); FOV may not apply; everything else still does.
Vite + TypeScript + PixiJS + rot.js.
Override only when you have a reason: raw Canvas 2D for learning, Phaser for pixel-art roguelites that need scenes/physics/tweens, KAPLAY for jam scope.
game-scaffold will pick this up from docs/concept.md and skip its own matrix.
Pattern B (turn-based speed scheduler) from game-loop.
The main loop becomes: wait for input → player acts → run scheduler until player is next → render. requestAnimationFrame still drives the animation layer between logical turns; the sim layer is event-driven, not frame-driven. See game-loop § "Pattern B — Turn-based speed scheduler" for the full implementation.
If the concept demands real-time movement (a roguelite), use Pattern A (fixed-timestep accumulator) instead and drop the scheduler.
Map/Set iteration order in sim. JS preserves insertion order, but if entities are added in different orders across saves you get divergence. Sort by entity id before iterating in any decision-making system.try/catch, write to a scratch key, then atomically rename. Never overwrite the previous save until the new one is verified.isAnimating() is true, decide once: drop input or queue it. Document the choice. Mixing the two creates ghost moves.MonsterPool early; every generateLevel(depth) samples from it.Date.now() in damage rolls, setTimeout in AI, requestAnimationFrame callback ordering driving sim — all break replays. Audit before shipping a "share your seed" feature.docs/concept.md)After Phase 5 of game-concept, append a ## Roguelike spec section with:
game-concept Phase 1.game-scaffold — bootstrap Vite + TS + PixiJS + rot.js with the folder layout already specified.game-loop — implement Pattern B (speed scheduler) plus the animation layer.game-systems — wire FOV, pathfinding, dungeon gen, input mapping, save/load, event bus, determinism audit.game-perf — only after profiling shows a measurable problem (FPS drops with many entities, slow generation, GC pauses).