game-session-host
Hosts a game module through one typed seam: game screen, pause, undo, hints, a rescue, saved runs, results. Use when assembling a game or wiring the Game screen or registry. Not for rules (game-rules-engine).
- License 许可
- MIT
- 最近更新
- 2026-10-22
- Stars
- ★ 13
- Forks
- 2
01 前言 Front Matter
- name
- game-session-host
- description
- Hosts a game module through one typed seam: game screen, pause, undo, hints, a rescue, saved runs, results. Use when assembling a game or wiring the Game screen or registry. Not for rules (game-rules-engine).
02 资源文件 112
- 资产文件assets/shared.json3.2 KB
- 脚本examples/app-wiring/game-feedback.ts746 B
- 脚本examples/app-wiring/game-host-config.ts858 B
- 脚本examples/app-wiring/game-registry.ts1.0 KB
- 其他examples/app-wiring/games-root.tsx1.7 KB
- 脚本examples/app-wiring/lights-out-hosted.ts1.0 KB
- 脚本examples/app-wiring/lights-out-tutorial.ts1.6 KB
- 其他examples/game-screen/game-route.tsx800 B
- 其他examples/game-screen/game-screen.tsx2.6 KB
- 其他examples/game-screen/use-game-model.test.tsx5.8 KB
- 脚本examples/game-screen/use-game-model.ts5.7 KB
- 脚本examples/sqlite-game-runs/sqlite-game-runs-repository.test.ts6.2 KB
- 脚本examples/sqlite-game-runs/sqlite-game-runs-repository.ts7.6 KB
- 脚本examples/sqlite-game-runs/v0002-create-game-runs.ts1.5 KB
- 参考文档references/assembling-a-game.md7.9 KB
- 参考文档references/host-architecture.md19.9 KB
- 参考文档references/session-flow.md22.7 KB
- 脚本scripts/check-game-host.mjs8.1 KB
- 脚本scripts/check-lib.mjs117.1 KB
- 脚本scripts/lib/app-modules.mjs8.7 KB
- 脚本scripts/lib/host-layout.mjs7.4 KB
- 脚本scripts/lib/host-probes.mjs32.2 KB
- 脚本scripts/lib/host-static.mjs16.3 KB
- 脚本scripts/lib/source-scan.mjs35.1 KB
- 脚本scripts/lib/zustand-stand-in.mjs2.1 KB
- 脚本scripts/selftest.mjs735 B
- 脚本templates/src/core/game-results/run-ref.test.ts453 B
- 脚本templates/src/core/game-results/run-ref.ts973 B
- 脚本templates/src/core/game/difficulty.test.ts1.8 KB
- 脚本templates/src/core/game/difficulty.ts1.6 KB
- 脚本templates/src/core/game/game-engine.ts1.6 KB
- 脚本templates/src/core/game/game-input.ts1.5 KB
- 脚本templates/src/core/game/game-module.ts1.9 KB
- 脚本templates/src/core/game/game-rules.ts1.4 KB
- 脚本templates/src/core/game/level-kit/daily-start.test.ts646 B
- 脚本templates/src/core/game/level-kit/daily-start.ts828 B
- 脚本templates/src/core/game/level-kit/star-rating.test.ts2.0 KB
- 脚本templates/src/core/game/level-kit/star-rating.ts1.9 KB
- 脚本templates/src/core/game/levels.ts2.7 KB
- 脚本templates/src/core/game/messages.ts555 B
- 脚本templates/src/core/game/persistence.ts1.1 KB
- 脚本templates/src/core/game/stats.ts683 B
- 脚本templates/src/core/game/testing.ts499 B
- 脚本templates/src/core/game/testing/contract-intents.test.ts3.2 KB
- 脚本templates/src/core/game/testing/contract-intents.ts5.1 KB
- 脚本templates/src/core/game/testing/engine-contract.test.ts12.2 KB
- 脚本templates/src/core/game/testing/engine-contract.ts12.1 KB
- 脚本templates/src/core/game/testing/json-shape.test.ts1.2 KB
- 脚本templates/src/core/game/testing/json-shape.ts1.8 KB
- 脚本templates/src/core/game/testing/play-bot.test.ts1.7 KB
- 脚本templates/src/core/game/testing/play-bot.ts2.5 KB
- 脚本templates/src/core/game/testing/play-choices.test.ts711 B
- 脚本templates/src/core/game/testing/play-choices.ts1.4 KB
- 脚本templates/src/data/game-runs/fake-game-runs-repository.test.ts3.6 KB
- 脚本templates/src/data/game-runs/fake-game-runs-repository.ts3.1 KB
- 脚本templates/src/data/game-runs/game-runs-repository.ts4.4 KB
- 其他templates/src/hooks/use-pause-on-background.test.tsx2.2 KB
- 脚本templates/src/hooks/use-pause-on-background.ts1.5 KB
- 脚本templates/src/services/game-host/board-host-model.test.ts1.9 KB
- 脚本templates/src/services/game-host/board-host-model.ts3.1 KB
- 其他templates/src/services/game-host/create-board-host.test.tsx2.2 KB
- 其他templates/src/services/game-host/create-board-host.tsx2.4 KB
- 其他templates/src/services/game-host/game-host-context.test.tsx1.6 KB
- 其他templates/src/services/game-host/game-host-context.tsx1.4 KB
- 脚本templates/src/services/game-host/game-host.test.ts6.1 KB
- 脚本templates/src/services/game-host/game-host.ts7.1 KB
- 脚本templates/src/services/game-host/host-runs.test.ts2.6 KB
- 脚本templates/src/services/game-host/host-runs.ts7.6 KB
- 脚本templates/src/services/game-host/hosted-game.ts3.4 KB
- 脚本templates/src/services/game-host/measure-counters.test.ts1.6 KB
- 脚本templates/src/services/game-host/measure-counters.ts2.3 KB
- 脚本templates/src/services/game-host/open-session.test.ts3.5 KB
- 脚本templates/src/services/game-host/open-session.ts4.9 KB
- 脚本templates/src/services/game-host/play-clock.test.ts932 B
- 脚本templates/src/services/game-host/play-clock.ts1.0 KB
- 脚本templates/src/services/game-host/run-end-policy.test.ts2.4 KB
- 脚本templates/src/services/game-host/run-end-policy.ts2.2 KB
- 脚本templates/src/services/game-host/run-summary.test.ts3.7 KB
- 脚本templates/src/services/game-host/run-summary.ts5.4 KB
- 脚本templates/src/services/game-host/session-controller.test.ts10.7 KB
- 脚本templates/src/services/game-host/session-controller.ts10.4 KB
- 脚本templates/src/services/game-host/session-extras.test.ts772 B
- 脚本templates/src/services/game-host/session-extras.ts1.5 KB
- 脚本templates/src/services/game-host/session-persist.test.ts3.5 KB
- 脚本templates/src/services/game-host/session-persist.ts6.7 KB
- 脚本templates/src/services/game-host/session-view-of.test.ts2.8 KB
- 脚本templates/src/services/game-host/session-view-of.ts3.6 KB
- 脚本templates/src/services/game-host/session-view.ts3.8 KB
- 脚本templates/src/services/game-host/tutorial-script.test.ts1.7 KB
- 脚本templates/src/services/game-host/tutorial-script.ts1.9 KB
- 其他templates/src/services/game-host/use-game-session.test.tsx2.9 KB
- 脚本templates/src/services/game-host/use-game-session.ts2.1 KB
- 脚本templates/src/stores/game-session/game-session-store.test.ts2.5 KB
- 脚本templates/src/stores/game-session/game-session-store.ts2.9 KB
- 脚本templates/src/stores/game-session/game-session-transitions.test.ts6.5 KB
- 脚本templates/src/stores/game-session/game-session-transitions.ts7.7 KB
- 脚本templates/src/stores/game-session/game-session-types.ts3.5 KB
- 脚本templates/src/stores/game-session/saved-run.test.ts4.4 KB
- 脚本templates/src/stores/game-session/saved-run.ts6.3 KB
- 脚本templates/test/games/game-host-test-deps.ts1.8 KB
- 脚本templates/test/games/tally-game.ts5.9 KB
- 其他templates/test/games/tally-hosted.tsx2.1 KB
- 脚本templates/test/games/tally-runs.ts1.5 KB
- 参考文档tests/bases/app/contracts/architecture.json62 B
- 参考文档tests/bases/app/package.json211 B
- 脚本tests/bases/app/src/core/dates/daily-seed.ts985 B
- 脚本tests/bases/app/src/core/result.ts1.8 KB
- 脚本tests/bases/app/src/games/lights-out/lights-out-game.ts3.6 KB
- 参考文档tests/bases/app/tsconfig.json128 B
- 参考文档tests/fixtures/check-game-host/CASES.json23.5 KB
- 参考文档tests/fixtures/check-game-host/good/CASE.txt60 B
- 参考文档tests/fixtures/check-game-host/SUITE.json151 B
03 SKILL.md 正文
Game session host
Makes every game playable inside the app the same way: the typed game module enters through one
generic seam (createGameHost), each run lives in a per-run store that writes the run before the
board animates it, a finished run is recorded in one repository transaction before its result
shows, and screens see only plain data and commands. The skill ships the host (templates), the
wiring around it (examples) and a checker that proves the invariants by running the app's own host
modules against a tiny test game, on iOS and Android alike (the host is pure TypeScript and React).
Rules that must hold
createGameHost(game, deps)is the only place the app touches a game's own types. Screens, routes, UI, stores and shared hooks use the erasedGameHost,SessionHandleandSessionView; only the registry (src/games/game-registry.ts) names a game, one factory per game; no cast anywhere in the seam. Why: TypeScript cannot hold "a module of some type" without a cast (strictFunctionTypes makes the intent parameter contravariant), and a cast hides exactly the errors the compiler exists to catch. (unsafe-cast,screens-type-erased)- Every change is reduced, persisted, then published. The per-run store calls its persist step
before
set(); a failed write publishes nothing and the view showssaveFailureso the screen offers a retry. Why: iOS and Android end background apps without warning; a kill during an animation must reopen the exact state on screen. (save-before-publish,save-failure-shown) - Only the game's
intentToMovemakes moves;nullmeans nothing happens. The reducer ignores moves while paused or decided, and undo never steps out of a loss; screens send commands (undo, hint, continue, pause, finish, leave), never moves. Why: bots, solvers and players share one legality, and no illegal state can be saved. (intent-legality,moves-only-while-playing,undo-not-after-loss) - A run ends in ONE repository transaction, before its result shows: the result row, the best,
the statistics and counters, and the saved run cleared (
recordRunEnd). The move that decided the run then plays the win or lose feedback once. Why: a result on screen that is not on disk breaks trust, streaks and statistics. (run-end-once,result-feedback) - At most one rescue per run, only after a loss, only when the rules have one and the app's config
allows it (
src/config/game-host-config.ts, never a literal). A rescuable loss stays saved and unrecorded until the player continues or declines (finish); a new run of the same game first records a decided saved run (declined) and, if that write fails, writes nothing. Why: a Continue the rules cannot honour does nothing, and an abandoned loss must still reach results and streaks. (continue-once,rescue-pending,abandoned-run-recorded,config-rules,continue-from-config) - Never strand a finished run. A pending loss whose rescue offer is
'hidden'(ads off, offline, no consent, no Premium) is finished at once: the Game screen's model sends{ type: 'finish' }once pereventSeqwhenisLossStranded(view, offer); a loading ad is'loading', never hidden. Why: an endless run in an ads-off build otherwise never shows its result and is never counted. (loss-not-stranded,game-screen-wiring) - A saved run is validated by the game's own parsers at boot and on resume. An unreadable run is
dropped alone and logged (results stay); a replay that differs from the snapshot keeps the
position and drops only the undo history; a resumed run starts paused. Why: one damaged row must
never cost progress or crash the app. (
saved-run-validated) - Hosts are created once, in the composition root, after the data layer opened, never at import
time or in a render (a
useStateinitializer), and provided once (GameHostsProviderinside the navigation theme). Opening a run writes nothing (dropping an unreadable saved run is the one idempotent exception); its handlebegin()s inuseGameSession's effect. Why: a host reads and validates saved runs, and a render React repeats (StrictMode) must write nothing. (host-not-created,host-at-import,host-in-render,host-not-provided) - The Game screen opens its run with
useGameSession, renders the host'sBoardHost, pauses on background, blur or a full-screen ad, and guards Back withbackCommandOf. iOS reportsinactive(app switcher, calls) and keepsactiveunder a Google full-screen ad; Android reports onlybackground; all pause, and Pause shows afterwards on both. Back (header, iOS swipe, Android button, predictive back) is caught withusePreventRemovewhile the run is live and unrecorded: pause in play, resume in Pause, finish a pending loss; Pause -> Home sets a leaving flag first so the guard lets that one removal through. Why: coming back must show Pause, and only Pause -> Home leaves a live run. (game-screen-wiring,back-guard) - Paid perks are sent only after payment, and offered only when they can be given: a hint or a
continue is sent when the rewarded ad completed, the allowance was spent or the player owns
Premium (the monetization layer's
pay(then)); the hint is offered only whileview.isHintAvailable. Why: a perk granted before the ad completes is free forever, and a paid hint with nothing to show is wasted. (Proven by the Game screen's model test.) - A tap-then-tap selection is UI state of the board host, never a move. A tap in one of
input.selectRegionstoggles it, the next tap reachesintentToMovewithselectedfilled in, and any new move, undo, rescue, run end or drag clears it. Why: bots, solvers, par, undo and the counters must never see a selection. (board-host-model.test.ts;intent-legality) - Stars come from the level's own star rule, counters from the kept moves, play time only while
playing (each step clamped to 0..300,000 ms), and the first finished attempt of a daily is the
day's result: a replay is practice (
isPractice: no new best, no statistics, no streak). Why: undone moves must not count, a phone asleep on the result screen must not add hours, and a replayed daily must not rewrite the day. (stars-from-table,counters-from-log,play-time,daily-practice) - Each game is one binding, registered, with its options and save policy right:
src/games/<id>/<id>-hosted.tsis{ ...<ID>_GAME, Surface[, tutorial] }typedHostedGame, the registry hosts it, its options promise nothing its rules lack, a game with a real-time loop (sim/) saves at save points and a turn-based one after every move, andcontracts/architecture.jsongameFacinglists the seam. Why: the binding is the one place the app types a game. (hosted-binding,game-registered,save-policy,game-facing-recorded) - A real-time game saves through the host at its save points: its board calls
onSavePoint(realtime.snapshot(copy), inputLog)at each save point and at the run's end; the host writes it through the same persist step (never per move) and records the run once when that state decides it. Why: a direct write would bypass the store and the run-end transaction. (save-point-write) - A tutorial (optional) plays its script beside the saved run, in memory: each step accepts
only its expected move, nothing is written or recorded, and every step is legal from its start.
Why: replaying the tutorial must never cost the player their run or count in statistics.
(
tutorial-beside-run,tutorial-legal) - Test-build shortcuts end runs through the same persist step as real play and reach only the
debug layer (
host.debugControls()), never store builds. Why: an E2E flow must see the real run-end write and the real result. (debug-run-end)
Workflow
- Check what exists. Run
node ${CLAUDE_SKILL_DIR}/scripts/check-game-host.mjs .. It prints NOT APPLICABLE until the app has a game. The game's rules and module come first (game-rules-engine:src/core/game/andsrc/games/<id>/<id>-game.ts); levels make level, daily and endless runs possible (level-generation-and-solvers). Read references/host-architecture.md for the seam and the files. - Install the host once per app. Copy
templates/into the repo at the paths line 1 of each file names:src/services/game-host/,src/stores/game-session/,src/data/game-runs/(the port and its fake),src/core/game-results/,src/hooks/use-pause-on-background.tsandtest/games/(the tally test game).templates/src/core/game/holds synced copies of game-rules-engine's kit and level-generation-and-solvers'level-kit/star-rating.tsandlevel-kit/daily-start.ts: keep the copies the app already has. Runnpm run typecheckandnpx jest src/services/game-host src/stores/game-session src/data/game-runs --ci --coverage --coverageThreshold='{}'. - Store runs in the data layer. Add a SQLite
GameRunsRepositoryfromexamples/sqlite-game-runs/and hand it down with the app's data (useAppData()). Its migration is a new schema version (persistence-and-migrations, "Adding version N+1"): register the step, then add that version's frozen fixture database, its checksum and itsFIXTURESentry, or the "every shipped version has a fixture" test fails. - Wire the composition. Read "The composition" in host-architecture.md. Write
src/games/game-registry.ts,src/config/game-host-config.tsand the games root fromexamples/app-wiring/, and mountGamesRootinside the navigation theme (app-startup-and- bootstrap's provider order). Prove the providers with one render test through the real root. - Assemble each game. Read references/assembling-a-game.md:
the binding (
examples/app-wiring/lights-out-hosted.ts), its registry factory, its options from its rules, its save policy, its optional tutorial (examples/app-wiring/lights-out-tutorial.ts), and"gameFacing": ["src/services/game-host/hosted-game.ts"]incontracts/architecture.json(architecture-and-boundaries). - Build the Game screen from
examples/game-screen/(the model hook, the view, the thin route): read references/session-flow.md first. In navigation-and-routing'scontracts/navigation.json, list the route inroutes, its params parser inparamParsers, and{ "route": "game/[gameId]", "hook": "src/features/game/use-game-model.ts", "gesture": "off" }inguarded(hookis required: the file that callsusePreventRemove), withgestureEnabled: falseandfullScreenGestureEnabled: falsein the route's screen options. Copy the model's route test (examples/game-screen/use-game-model.test.tsx: Back perbackCommandOf, Pause -> Home leaves in one tap) and add the perk cases (perks only after payment, a stranded loss finished once, a full-screen ad pauses). - Format, lint, type-check and test:
npx eslint --fixandnpx prettier --writeon the changed files,npm run typecheck,npx eslint --max-warnings 0, then the Jest run of step 2 plussrc/features/game. - Run the check
node ${CLAUDE_SKILL_DIR}/scripts/check-game-host.mjs . --game <game-id>; fix everyFAILline (file, rule, fix) and rerun until it printsRESULT: PASS. - Get device evidence (the kill test: move, kill during the animation, relaunch lands paused in the same state; a full level to its result) on a named iOS simulator and a named Android emulator (session-flow.md, "Device evidence"; ios-simulator-build, android-emulator-build, e2e-maestro). Report what works, what was verified and what still needs the developer (ads, purchases, feel).
Definition of done
- [ ] Every host template is in place with its test; the host's Jest run passes.
- [ ] A SQLite
GameRunsRepositoryrecords a run end in one transaction (its test runs on Node'snode:sqlitedriver). - [ ] The registry hosts every game, the config gives each game options its rules can honour, and
GamesRootcreates the hosts once after the data layer opened; a root render test passes. - [ ] Each game has its
<id>-hosted.tsbinding andgameFacinglists the seam; a game with a tutorial keeps it insrc/games/<id>/tutorial/<id>-tutorial.ts; a real-time board sends its save points throughonSavePoint. - [ ] The Game screen opens its run with
useGameSession, rendersBoardHost, pauses on background, blur and full-screen ads, guards Back withbackCommandOf, sends perks only after payment and finishes a stranded loss; its model test proves the last three. - [ ] The kill test and a full level to its result pass on a named iOS simulator and Android emulator.
- [ ]
npm run typecheck,npx eslint --max-warnings 0andnpx prettier --checkpass. - [ ]
node ${CLAUDE_SKILL_DIR}/scripts/check-game-host.mjs . --game <game-id>printsRESULT: PASS(expected SKIP lines:src/features/game [game-screen-wiring]before the Game screen exists,contracts/architecture.json [game-facing-recorded]before architecture-and-boundaries made it).
Anti-patterns
game as unknown as HostedGame<unknown, ...>to keep games in a list or a context. Keep one factory per game in the registry; each closes over its typed module and returns an erased host.- Animating first and saving in an effect afterwards. A kill during the animation loses the move;
the persist step runs inside the store's dispatch, before
set. - Writing the result, the best and the statistics in three calls, or after the result mounted.
One
recordRunEndtransaction inside the persist step, then publish. - Recording a loss the moment it happens while a rescue is on offer, or keeping it pending while the offer is hidden. Keep it saved and pending; finish it as soon as nobody can rescue it.
- Calling
applyMoveor dispatchingapply-movefrom a screen, or aselectmove in the rules. Screens send commands; the board host routes intents; the selection is UI state. - Sending
hintand then showing the rewarded ad. Pay first; send when the perk is paid for. - Creating hosts at module level or in a render. Create them once in a
useStateinitializer of the games root, below the data and services providers. - Writing a run while opening it (in a
useStateinitializer or a render). Opening writes nothing; the handle'sbegin()writes from an effect, so StrictMode's second render writes nothing. - Overwriting the saved run with a new one without looking at it. A pending loss left behind (Back, a crash, Home) is recorded first; a failed record blocks the overwrite.
- A real-time screen calling
writeRunat its save points. SendonSavePoint(state, log)through the board host: the store, the save policy and the one run-end write stay in charge. - A tutorial controller with the real repository, or a tutorial run as the debug target. The tutorial writes and records nothing and is never the active run.
- Guarding Back only while playing. Back in Pause or on a pending loss would drop a live run.
- A literal
isContinueAllowed: truein the registry. It belongs in the config, where the checker compares it with the rules. - Resuming a saved run straight from storage (
JSON.parse(row) as State). The game'sparseState/migrateStatedecide; an unreadable run is dropped alone.
Files in this skill
| File | What it is | Read/run when |
|---|---|---|
| references/host-architecture.md | The seam, the files and their homes, one move end to end, the composition, the board host and tap-then-tap, the Game screen and Back, multi-package and React Navigation notes, every checker rule | Workflow steps 1, 2 and 4 |
| references/session-flow.md | Opening and resuming runs, when a run is written, undo, hints, the rescue, the run end, stars and bests, counters, play time, pause on iOS and Android, stranded losses, save failures, debug controls, device evidence | Step 6, and before changing the controller |
| references/assembling-a-game.md | The binding, the registry, options against rules, save policy, gameFacing, the run repository on SQLite, catalog keys, the tally test game | Steps 3 and 5 |
templates/src/services/game-host/ |
The seam (game-host.ts, hosted-game.ts, host-runs.ts), the controller, its persist step (session-persist.ts) and extras, the view, opening runs, the tutorial script, the run summary and counters, the play clock, the stranded-loss and Back policy, the board host and its pure model, the hosts context and useGameSession, each with its test |
Step 2 (copy verbatim) |
templates/src/stores/game-session/ |
The run's types, its pure reducer (game-session-transitions.ts), the per-run store (persist before publish) and the saved-run codec, with tests |
Step 2 |
templates/src/data/game-runs/ |
GameRunsRepository (the port) and its in-memory fake with its test |
Step 2 |
templates/src/core/game-results/ |
RunRef and runKeyOf, with tests |
Step 2 |
templates/src/core/game/ |
Synced copies (never edit here): game-rules-engine's game contract kit, and level-generation-and-solvers' level-kit/star-rating.ts (the one starsFor) and level-kit/daily-start.ts (the one daily seed and difficulty), with their tests |
Step 2, only when the app lacks them |
templates/src/hooks/ |
use-pause-on-background.ts: pauses a playing run when the app or the screen goes away, with its test |
Step 2 |
templates/test/games/ |
The tally test game (with its tutorial), its hosted form, run helpers and host test dependencies | Step 2 |
examples/app-wiring/ |
The registry, the per-game config, a game's binding and tutorial, the games root and its result cue table | Steps 4 and 5 |
examples/game-screen/ |
The Game screen's model hook (with the leaving flag), its route test over Expo Router's in-memory router (Back, Pause -> Home, pending loss, stack reset), the view and the thin route | Step 6 |
examples/sqlite-game-runs/ |
The SQLite repository (practice rows for replayed dailies, the extendRunEnd hook inside the run-end transaction), its migration and its node:sqlite test |
Step 3 |
scripts/check-game-host.mjs |
The checker (rules in references/host-architecture.md, --help lists them) |
Steps 1 and 8 |
scripts/lib/ |
host-layout.mjs, host-static.mjs, host-probes.mjs, zustand-stand-in.mjs (self-tests only), and the synced app-modules.mjs and source-scan.mjs |
When changing the checker |
scripts/selftest.mjs |
Proves the checker: the templates and examples pass, every planted bug fails under its rule | After changing a checker, template or example |
scripts/check-lib.mjs |
Shared script library (synced; do not edit here) | Never by hand |
assets/shared.json |
The shared files this skill copies in | When adding a shared file |
tests/bases/app/ |
The fixture app: one small game, the architecture contract, synced result.ts and daily-seed.ts |
When adding a fixture |
tests/fixtures/check-game-host/ |
good/, one bad-* case per rule, pass-* and error-* cases (overlay format) |
When adding a rule |
Related skills
game-rules-engine- the game module, its kit and its pure rules.level-generation-and-solvers- levels, packs, par and the daily level a run opens.realtime-game-loop- save points and the loop of a real-time game.skia-canvas-rendering,canvas-gestures-and-hit-testing- the game'sSurfaceand its intents.state-management-zustand- stores, persist before publish, the undoable session pattern.persistence-and-migrations- the SQL driver, repositories and the migration list.architecture-and-boundaries- zones,gameFacing, the composition root.app-startup-and-bootstrap- the root provider order the games root joins.navigation-and-routing- the Game route, guarded Back,dismissTo.audio-and-haptics-feedback- the win and lose feedback.admob-ads-and-consent,in-app-purchases- rescue and hint offers, paying first.dates-streaks-and-statistics- streaks and statistics from recorded runs.debug-menu-and-test-hooks,e2e-maestro- the debug controls and device flows.
04 同仓库更多 Skills
demo
Planted skill folder (never scanned).
demo
Planted installed skill (its files must never be scanned).
web-support
Ships the web build of an Expo app: platform files, APIs missing in react-native-web, expo-sqlite headers. Use when adding web, a .web.tsx file or expo export --platform web. Not for responsive layout (adaptive-layout).
value-objects-money-and-units
Stores money as ISO 4217 minor units, quantities in canonical units, instants as epoch ms. Use when adding a price, currency, tax, split, unit or timestamp, or a total is a cent off. Not for calendar days (dates-streaks-and-statistics).
unit-and-component-tests
Sets up Jest, checks unit, component and route tests (RNTL 14, renderWithProviders, SDK mocks, fakes, fast-check, Stryker). Use when writing a test or mock, or Jest fails or flakes. Not for goldens (golden-and-snapshot-tests).
ui-states-and-feedback
Builds loading, empty, failed and offline states, delayed skeletons, toasts, banners, confirms, Undo. Use when a screen loads data, shows a spinner, toast, retry or delete prompt. Not for failure values (error-handling-typed-results).