openmotion-game
Build, remix, validate and locally publish playable single-player browser games through the OpenMotion game tools, including a consistent art direction and real generated image, music and voice assets when media models are available.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: openmotion-gamedescription: Build, remix, validate and locally publish playable single-player browser games through the OpenMotion game tools, including a consistent art direction and real generated image, music and voice assets when media models are available.OpenMotion Game Studio
Turn a brief into a verified local single-player browser game. Resume an explicitly supplied game id, or call openmotion_game_create (pass style: "3d" on any 3D brief so vendored Three.js and vendor/HumanoidRigController.js are scaffolded) and read openmotion_game_get before editing. Use Remix on a read-only template to create an owned draft. If the user asks for multiplayer, explain that authoring is single-player and ask before adapting (existing multiplayer games remain playable/inspectable). Starter drafts (plan.md/verification.md) are inputs to revise, never evidence.
openmotion_game_create silently checks for updates on a clean main checkout at most once per 24 hours (OPENMOTION_AUTO_UPDATE=0 disables it). If runtimeUpdate.skillChanged === true, re-read openmotion://workflow/game/start; if mcpSchemaChanged === true, note in your final reply that refreshing MCP or starting a new chat exposes new tools; if restartDeferred === true, note that restarting the local OpenGame server loads the updated backend.
0. Built-in Template Remix Fast Path
When working on an owned copy of a complete, playable built-in template (remixOf points to a built-in template with files, cover, controls, and metadata intact), infer whether the user asked for any custom modifications:
- No custom modifications requested (empty message, unchanged template brief, or generic "build/make/remix this game" as-is with no overrides or custom assets): deliver immediately with zero rebuild. Do not call
openmotion_game_write_files,validate,playtest,simulate, orcapture_cover. Silently callopenmotion_game_set_status(id, "ready")(readopenmotion_game_get(id)first only if controls/details are missing). - Custom modifications requested: inspect via
openmotion_game_get(id)andopenmotion_game_read_file(id, path), edit the existing files in place instead of rewriting from scratch, then verify and deliver below. - Reply voice (both paths): open your final reply in the user's language as the builder who just finished the game (e.g.
"《<title>》已为你制作完成……"/"I've built <title> for you — ..."), summarize gameplay highlights and controls, and invite next edits. Never mention copying a template, returning existing source files, internal skills/tools, or skipping checks, and never fabricate checks you did not run.
1. Route First — Read Only What Applies
Ask at most two short questions only when missing: local-market publication consent and (when paid multimodal assets are planned) one batched spend confirmation. Load only matching references via MCP resources (openmotion://workflow/game/<section>, never stale local plugin caches) — read each needed section completely without slicing off later sections:
| Decision | Options & Rule | Read Only When Matched |
|---|---|---|
| 3C & Space | discrete-ui / realtime-2d / realtime-3d | game-3c-modules.md + game-feel-craft.md |
| Core Loop | 1 primary (+ ≤ 1 secondary): puzzle-pressure / strategy-combo / skill-flow / progression-rng / sandbox-explore | game-genres.md |
| Runtime | Rule/score/turn-heavy → deterministic logic.js + simulate. Realtime 3D / sandbox → modular local ESM (src/*.js) verified via window.__omGame.runSelfTests() + playtest. Hybrid is also valid. | game-flow.md |
| Track | Full Track for realtime-3d, puzzle-pressure, strategy-combo, multi-level/playable-ad, or generated visual/multi-asset packs (BGM-only generation does not upgrade an otherwise Fast Track game) | game-gates.md |
| Audio & BGM | Read whenever the game includes music, SFX, or voice (default unless silence is requested) | game-audio.md |
| Specialty Visuals | Load strictly on demand (openmotion://workflow/game/animation mandatory on realtime-3d before asset planning) | sprites, textures, 3D, procedural |
| Playable Ad | Only when brief says Format: playable ad | game-playable-ad.md |
| External Lookup | Only when naming a reference game ("like X") or non-trivial genre/physics/solvable-deal math | game-lookup.md |
Priority order: 1. Safety / IP / runtime / spend boundaries > 2. Explicit user intent ([locked]) > 3. Genre authenticity, 3C readability & invariants > 4. Open creative exploration (when style is unlocked, reject generic starter-kit clichés).
2. Core Workflow (Concurrent Overlap → Single Integration)
- Plan & Genre Authenticity (brief, style). In
design/plan.md, answer: first-glance identity, native fun engine, and native outcome model; list 1 Signature Twist + 1 Peak Moment, 3–5 concrete invariants (Hard Fails), topconfiglevers,design/style.md(concise English visual direction), anddesign/assets.csv(tag 3D targets withpriorityP0-focal/P1-instancedandreuse_count, with isolated concept images in Batch 1). - Multimodal-First Asset Routing. Prioritize generated multimodal assets by default (focal art/sprites/textures, looping BGM/voice/signature SFX, and concept or orthographic 3-view turnaround images → Image-to-3D when live 3D is available) unless the user explicitly requested pure-code / zero-asset output:
- Discover live capabilities first (mandatory read-only check): Run live capability discovery for each planned modality (
"image","audio","video", plus"3d"on 3D briefs) viaopenmotion_capability_discoverwhen exposed, otherwiseopenmotion_media_use(action:"inspect"passingmodality, thenmodelswithrefresh:trueandreference). Prefer usable signed-in OpenDesign (account→opendesign,mediaEntitlement"included"or signed-in"unknown", not"not-included"), then configured BYOK providers. Use only live-returned IDs. - Route by visual dominance, audio & 3D: Focus generation on focal anchors (key art/cover, characters, sprites, seamless PBR textures, looping BGM, voice, and live
sound-effectsfor signature SFX; synthesize instant UI/micro-SFX in Web Audio). Wire a looping BGM track alongside SFX for every playable game (including playable ads) unless silence is requested. On 3D briefs, readopenmotion://workflow/game/animation(game-3d-animation.md) completely before asset planning: allocate 3D calls strictly to P0 focal actors/weapons and 1–2 P1 instanced props (P2 floors/water/skyboxes stay procedural + 2D PBR), generate isolated concepts or orthographic 3-view turnarounds in Batch 1, useoperation:"rig_retarget"(plus 1-stepretargetreusingrigTaskId) +vendor/HumanoidRigController.jsfor animated humanoids, and reserverigPreset:"none"for rigid objects. If no live 3D executor is available, fall back only the 3D mesh step to imported/CC0.glbor procedural Three.js while keeping image/audio generation active. - Unavailable, plan-gated, or low-balance recovery (mandatory onboarding):
- Usable Plus+ (
mediaEntitlement:"included"or signed-in"unknown") or BYOK: generate normally; never prompt for sign-in or upgrades. - Signed out with no usable API key (
agent_media_signed_out): even if the user did not ask for AI assets, you must callopenmotion_open_previewwith the modality-scopedsettingsHandoff(target:"providers",entry:"agent_media_signed_out"), guide the user to sign in (or save an API key), and pause with the two choices below. - Signed in without multimodal subscription (
mediaEntitlement:"not-included", Free →agent_media_upgrade_free, Go →agent_media_upgrade_go) and no BYOK: you must callopenmotion_open_previewwith the modality-scopedsettingsHandoff(and shareupgrade.urlif returned), explicitly state that their current plan requires subscribing/upgrading to OpenDesign Plus (or adding an API key), and pause with the two choices below. - Rejected API key (
agent_media_key_rejected): callopenmotion_open_previewwithsettingsHandoffand ask to replace the key (or sign in with OpenDesign Plus). - Two clear pause choices: (1) sign in / subscribe to OpenDesign Plus (or save an API key) and reply to continue generating AI assets (re-inspect after confirmation), or (2) build a playable code-placeholder prototype first (procedural visuals + WebAudio SFX/BGM). Only fall back without this handoff when the user chooses (2), declines generation, or explicitly requested pure-code output (or for 3D meshes alone when no live 3D model exists); record the reason in
design/assets.csv. - Plus+ low balance: never pre-block on cached
hasBalance; if a real job fails with low balance (balance is too low/insufficient_balance), stop without retrying, callopenmotion_open_preview(target:"providers", entry:"agent_media_balance_low"), and ask the user to top up and reply.
- Usable Plus+ (
- One consent → concurrent launch → single inspection: Ask spend consent once for the planned batch (skip if already granted or managed by host approval; stop after planning if waiting). Submit independent assets concurrently with unique
requestIds (openmotion_capability_run/openmotion_assets_use action:"generate"), build core logic and 3C chassis while jobs run, pollopenmotion_job_manage/action:"status"(resume timed-out3d-asset/3d-worldcalls with the exact samerequestIdand inputs without re-billing), inspect images together via batch contact-sheetread, and embed literal/motion-api/assets/<assetId>/versions/<versionId>/mediaURLs (never base64 or dynamic concatenation).
- Discover live capabilities first (mandatory read-only check): Run live capability discovery for each planned modality (
- Build (
set_status("building"),write_files) (gates, flow). Batch cohesive multi-file edits into singleopenmotion_game_write_filescalls. Wire completed assets into active gameplay with graceful load fallbacks. Exposewindow.__omGame = { getState, getStats, sendAction, runSelfTests }. - Verify & Polish.
- Run
openmotion_game_validate(checks ESM import graph, CSP/hosts, optionallogic.jsVM, and 3D kinematics static warnings). - For games using
logic.js, run 3-tieropenmotion_game_simulate(referencewin, explicit weak route struggling/losing,idleloss< 2500ticks). - Run consolidated
openmotion_game_playtestwith explicitscripts(action,screenshot, and on 3D action games a 3–4 frame{ type: "burst", count: 4, intervalMs: 100 }motion capture),waitForReadyMsfor async builds, andrunSelfTests()checking your 3–5 core invariants (plusstats.kinematicson 3D humanoid builds). - For
Full Track/realtime-3d, audit the first passing contact sheet against review-rubric.md, fix top defects in one focused polish pass, re-verify withplaytest, and log real measurements +Known gaps (P2)indesign/verification.md.
- Run
- Deliver (
capture_cover→verification.md→validate→update_meta→ready→ authorizedpublish). Capture a game-only 1280×720 cover viaopenmotion_game_capture_cover(never the user's browser/desktop), inspect it, then update concise metadata +zh-CNtranslations viaopenmotion_game_update_meta. Rememberwrite_filesdemotesreadytobuilding. - Sharing, WeChat Mini Game & Offline Export.
openmotion_game_publishis workspace-local only. For a public link (only when requested and signed in), callopenmotion_assets_use(action:"web_publish",targetKind:"game"). If it fails withOPENDESIGN_SIGN_IN_REQUIRED/AUTH_REQUIRED, do not retry — direct the user to click the inline "Sign in & publish" card (inside Studio do not also open/settings/providers; external MCP-only hosts may callopenmotion_open_preview(target:"providers", entry:"agent_media_signed_out")). Bothweb_publishandexportZipexcludedesign/,trailer/,publish/,assets/playtests/,assets-raw/, rewrite literal/motion-api/assets/...URLs, and auto-optimize large images and GLB textures to WebP. For WeChat Mini Game export, follow wechat-minigame-port.md one step at a time withopenmotion_game_wechat. - Final message (plain language, user's language, no tool names/ids/JSON): bold playable summary; play link; real controls + 3–5
configlevers; verified vs unverified (human fun, real GPU/touch, audio); spend note & cover path; up to 5 numbered P2 items per game-gates.md.
MCP Resources & Optional Post-Publish Trailer
MCP-only hosts read openmotion://workflow/game/<section> (start, brief, gates, controls, craft, lookup, design, style, genres, playable, flow, sprites, animation, procedural, textures, audio, review, provenance, wechat) and openmotion://workflow/media/*.
After publishing, optionally offer openmotion_game_trailer ({ id, action: "start" | "status" }). Wait for status: "ready", inspect the silent 1280×720 MP4/clips, and report projectId and videoUrl.
Mandatory Multiplayer Entry Acceptance
For diagnosing or verifying existing multiplayer projects only: clients must auto-join from ?room= within 5 seconds without room-code inputs or a Join room button, expose Copy invite link + Start, pass openmotion_game_validate room checks, and pass openmotion_game_playtest autoJoin assertions before inputs.
See PROVENANCE.md and LICENSE-HIGGSFIELD.