[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-115306":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":14,"forks30d":14,"starsTrendScore":17,"compositeScore":18,"rankGlobal":9,"rankLanguage":9,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":9,"pushedAt":29,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":14,"starSnapshotCount":14,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},115306,"reference-to-game","gokayfem\u002Freference-to-game","gokayfem","Input-agnostic reference-to-game skill: preserve style and colors while building playable games. Includes tools, fal asset workflows and four Three.js examples.",null,"Python",345,49,1,0,179,255,605,94.96,"MIT License",false,"main",true,[24,25,26,27,5,28],"agent-skills","art-direction","fal-ai","game-development","threejs","2026-11-22 20:17:34","2026-11-23 20:18:48","# Reference to Game\n\n**Turn images, videos, sheets, sketches, models, audio, links or a written idea into a playable game—without losing its visual identity.**\n\nAn input-agnostic skill and toolkit for coding agents. It gives Claude Code, Codex, Cursor and other agents a workflow for preserving **style, colors, shapes, materials, camera, motion and UI**, then turning that direction into real gameplay.\n\n![Jungle Jetboat Jump: reference on the left, playable Three.js implementation on the right](gallery\u002Fjungle-jetboat-jump.jpg)\n\n*Reference → playable implementation. The four games below were developed from image, sheet and video references. Their source and runtime assets are included.*\n\n[Install](#install) · [Try a game](#four-worked-games) · [Use](#use) · [Tools](#tools) · [Evidence](docs\u002FEVIDENCE.md) · [Scope](docs\u002FSCOPE.md)\n\n## Why references matter\n\nA prompt can describe “colorful” or “painterly” without specifying the decisions that make a particular game recognizable. References make those decisions concrete: the size of an accent color, a character's proportions, the softness of a shadow, the camera's distance, the way a UI panel feels like paper.\n\nThe challenge is carrying those decisions through implementation. A game can compile, run smoothly and have working mechanics while still looking unrelated to its reference. This workflow treats **visual identity and playability as separate requirements**. Neither can hide a failure in the other.\n\n- **Inspect before implementing.** Assign authority separately for appearance, identity, mechanics, motion and UI. Preserve originals and distinguish observation from invention.\n- **Lock style before expanding scope.** Build a small polished scene, compare it to the reference, and fix the largest mismatch before multiplying assets and levels.\n- **Choose the right representation.** Painted sprites, 2.5D layers, procedural geometry, generated meshes and shaders can coexist. Full 3D is not automatically the most faithful choice.\n- **Build actual gameplay.** Input, rules, state-driven UI, goals, recovery and restart. A screenshot or prerecorded showcase is not the implementation.\n- **Generate assets deliberately.** Optional fal workflows for images, models, textures, animation studies, audio and music, with durable job IDs and duplicate-submission protection.\n- **Deliver inspectable evidence.** Source-bound reviews, reference comparisons, rule tests, real input-driven playthroughs, measured performance and honest limitations.\n\n## Any reference, an appropriate workflow\n\n| Starting point | What the agent does |\n|---|---|\n| One screenshot, painting or sketch | Extracts style and composition; authors missing mechanics explicitly |\n| Gameplay video or animation | Inspects motion and events; separates camera movement from object movement and generated defects |\n| Full asset sheet or mood board | Reads the whole design system, then identifies useful regions; no mandatory grid or scene count |\n| A model or existing asset folder | Inspects geometry, material, scale, rigs and identity before integration |\n| Music or audio | Uses sound as mood\u002Ftiming evidence and designs the missing visual direction |\n| A URL, PDF or design document | Opens it with the appropriate viewer\u002Fconnector and records what was actually inspected |\n| A text-only idea | Designs a coherent art direction and playable loop; labels the visual choices as authored |\n| Mixed references | Resolves which source governs each dimension rather than averaging conflicting styles |\n\n**Input-agnostic does not mean universal automatic decoding.** The CLI handles intake and common media inspection; specialized formats and inaccessible links need an appropriate tool. The coding agent performs visual judgment and implementation. [Exact boundaries →](docs\u002FSCOPE.md)\n\nThe default implementation profile is **Three.js + TypeScript + Vite**, with support for 2D, layered 2.5D and full 3D. The contracts are engine-neutral; other engines can follow the workflow, but this release does not ship verified project generators for them.\n\n## Four worked games\n\n| Jetboat racing | Candy factory puzzle |\n|---|---|\n| [![Jetboat reference and game](gallery\u002Fjungle-jetboat-jump.jpg)](examples\u002Fjungle-jetboat-jump\u002F) | [![Jellyworks reference and game](gallery\u002Fjellyworks.png)](examples\u002Fjellyworks\u002F) |\n| **[Jungle Jetboat Jump](examples\u002Fjungle-jetboat-jump\u002F)** — 3D boat and crew, painted vegetation, procedural water; ordered gates, pickups, boost, jumps and recovery. | **[Jellyworks](examples\u002Fjellyworks\u002F)** — tactile machinery and candy; deterministic conveyors, mixing, molds, backpressure, edit\u002Frun modes and three solvable puzzles. |\n\n| Painted meadow exploration | First-person train action |\n|---|---|\n| [![Petal Pals reference and game](gallery\u002Fpetal-pals.jpg)](examples\u002Fpetal-pals\u002F) | [![Train Battle reference and game](gallery\u002Fsunshine-train-battle.png)](examples\u002Fsunshine-train-battle\u002F) |\n| **[Petal Pals](examples\u002Fpetal-pals\u002F)** — painted directional characters in a 2.5D world; observe, feed, photograph, befriend, explore and save. | **[Sunshine Train Battle](examples\u002Fsunshine-train-battle\u002F)** — cleaned generated meshes and a train-local world; shooting, shielding, reloading, jumping, checkpoints and restart. |\n\nEach example includes **runnable source, runtime assets, original image, full development sheet, style contract, visual comparison and case notes**. Full raw generation archives are intentionally excluded. The cases predate this packaged skill; they are worked examples, **not a controlled with\u002Fwithout-skill benchmark**. Read their remaining differences and historical validation reports rather than assuming pixel-perfect reconstruction.\n\nRun any example locally; no fal key is needed:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fgokayfem\u002Freference-to-game.git\ncd reference-to-game\u002Fexamples\u002Fpetal-pals\u002Fapp\nnpm ci\nnpm run dev\n```\n\nEach game has its own controls, tests and build scripts. Reference art\u002Fgenerated media are demonstration material with separate reuse considerations; [credits and licensing](CREDITS.md).\n\n## Install\n\n**Claude Code plugin:**\n\n```bash\nclaude plugin marketplace add gokayfem\u002Freference-to-game\nclaude plugin install reference-to-game@reference-to-game\n```\n\n**Agents that support the skills CLI:**\n\n```bash\nnpx skills add gokayfem\u002Freference-to-game\n```\n\nChoose the `reference-to-game` skill and your agent. Or copy `skills\u002Freference-to-game\u002F` into the agent's supported skill directory. The skill is self-contained: the tools and supporting guides travel with it. For a chat assistant without local execution, use [the handoff prompt](adapters\u002Fchat-prompt.txt).\n\nThe CLI requires **Python 3.10+**. Intake, prompts, validation and fal bookkeeping use the standard library. Image tools additionally need Pillow; audio\u002Fvideo inspection needs `ffmpeg` and `ffprobe`. Runtime helper tests use Node 20+; the example games recommend Node 22+.\n\n```bash\npython3 -m pip install -r skills\u002Freference-to-game\u002Fscripts\u002Frequirements.txt\n```\n\n## Use\n\nAsk naturally:\n\n> “Make a playable Three.js game from this image and full development sheet. The style and colors are the most important part. You can create fal assets.”\n\n> “Use this ink illustration for appearance and this clip for movement. Build a small exploration game without changing the drawing style.”\n\n> “Here is an existing prototype and a new art reference. Keep the rules, replace the visual direction, and show comparisons.”\n\nOr start a portable case explicitly:\n\n```bash\npython3 skills\u002Freference-to-game\u002Fscripts\u002Fr2g.py init cases\u002Fmy-game \\\n  --input \u002Fpath\u002Fto\u002Fconcept.png \\\n  --input \u002Fpath\u002Fto\u002Fmovement.mp4 \\\n  --brief \"Make this playable while preserving its style and colors\"\n\npython3 skills\u002Freference-to-game\u002Fscripts\u002Fr2g.py inspect cases\u002Fmy-game\npython3 skills\u002Freference-to-game\u002Fscripts\u002Fr2g.py prompt cases\u002Fmy-game \\\n  --out cases\u002Fmy-game\u002FIMPLEMENT.txt\n```\n\nGive the case and the prompt to your coding agent. It fills the style\u002Fgame\u002Fasset contracts, implements the game, compares it against the reference, then plays and verifies it. The full reusable prompt is also available at [prompts\u002Freference-to-game.md](prompts\u002Freference-to-game.md).\n\n## Tools\n\n| Command | What it actually does |\n|---|---|\n| `init` | Copies references without changing them, hashes them, records URLs, creates neutral case contracts |\n| `inspect` | Reads common media metadata, text previews and representative video frames; records unsupported inspection explicitly |\n| `palette` | Samples named semantic color roles from explicit normalized image coordinates |\n| `compare` | Makes a labelled reference\u002Fimplementation comparison without stretching or inventing a similarity score |\n| `prompt` | Writes a concrete implementation handoff from a case inventory |\n| `install-core` | Copies optional tested runtime helpers into the case |\n| `review-page` | Builds a portable offline viewer for source media and review evidence |\n| `freeze` | Fingerprints source\u002Fcontracts, records a snapshot manifest and resets review signoffs |\n| `evidence` | Attaches hashed files and an author's review notes to one check |\n| `validate --release` | Checks contract completeness, reference integrity and review freshness; does not judge aesthetics |\n| `fal-submit` | Plans an offline job; `--execute` submits under explicit generation settings and estimated budget |\n| `fal-status` | Polls one recorded job without resubmitting it |\n\n[Command examples and contracts →](skills\u002Freference-to-game\u002Freferences\u002Fcli.md)\n\nThe optional JavaScript helpers cover a bounded fixed-step clock, once-only reward IDs, swept-circle collision, frame-independent damping, input cleanup and seeded randomness. They contain no default palette, camera, character, level or genre.\n\n## fal asset generation\n\nfal is optional. The game runs on local assets, not live generation calls. Agents can choose suitable current endpoints for image editing, textures, sprites, 3D meshes, audio, music or motion references, then review and integrate the outputs.\n\nThe adapter persists intent **before** a potentially billable request, stores request IDs and queue URLs, deduplicates identical local jobs and reserves estimated budget. An uncertain POST stays **ambiguous** until reconciled; it is never silently retried. This is not an exactly-once billing guarantee or a server-side spending cap. Model schemas and pricing must be checked when used. [Full workflow →](skills\u002Freference-to-game\u002Freferences\u002Ffal.md)\n\n## Verification\n\n```bash\npython3 -m unittest discover -s tests -p 'test_*.py' -v\nnode --test tests\u002Fruntime.test.mjs\npython3 tests\u002Fcheck_repo.py\n```\n\nThe tests cover mixed inputs and unusual dimensions, reference preservation\u002Ftampering, path escape, palette sampling, stale review, runtime invariants, local fal deduplication, uncertain submissions and budget boundaries. They run without paid API calls. CI also builds and tests all four examples.\n\nA review pass means the required evidence is present and tied to the current source. It **does not** prove that a game is artistically faithful or that a claimed playthrough occurred; inspect the captures, logs and recordings. [Evidence and limits →](docs\u002FEVIDENCE.md)\n\n## Repository\n\n```text\nskills\u002Freference-to-game\u002F  installable skill, supporting guides, CLI, runtime helpers\nexamples\u002F                 four runnable games and their references\u002Fcomparisons\nprompts\u002F                  full reference-to-game implementation prompt\ngallery\u002F                  reference-to-game comparison images\ntests\u002F                    toolkit, negative-case and runtime tests\nevals\u002F                    proposed agent evaluation protocol, not claimed results\ndocs\u002F                     architecture, scope and measured evidence\n.claude-plugin\u002F            plugin and marketplace manifests\n```\n\nRelated work: [shader-skills](https:\u002F\u002Fgithub.com\u002Fgokayfem\u002Fshader-skills) · [video-to-blender](https:\u002F\u002Fgithub.com\u002Fgokayfem\u002Fvideo-to-blender) · [video-to-physics](https:\u002F\u002Fgithub.com\u002Fgokayfem\u002Fvideo-to-physics) · [video-to-css](https:\u002F\u002Fgithub.com\u002Fgokayfem\u002Fvideo-to-css).\n\nToolkit code and documentation: MIT. See [CREDITS.md](CREDITS.md) for example media and third-party attribution.\n","这是一个面向AI编程代理的‘参考转游戏’工具包，支持将任意形式的视觉或概念参考（如图像、视频、草图、资产表、音频或文字描述）转化为风格与色彩高度保真的可玩Three.js游戏。核心功能包括参考解析、视觉特征锁定（颜色、材质、相机、UI等）、分阶段验证流程，以及基于fal.ai的可追溯资产生成工作流。技术上融合了Python工具链、Three.js运行时实现和结构化决策框架，强调视觉一致性与实际可玩性并重。适用于AI代理辅助游戏原型开发、美术驱动的游戏快速实现、教育场景中的设计到代码转化等需要强风格保真与快速可执行验证的轻量级Web游戏开发任务。",2,"2026-11-24 04:50:36","CREATED_QUERY"]