Documentation menu
On this page

Build a world with the Genesis skill

Describe your world, then let your coding agent build its interface, memory and rules. The included create-world-stream skill takes it through a local preview and a complete project export.

Requires a coding agent that can read local files and run commands, plus Node 20 or later.

Get Genesis ready

Clone the repository and build the local tools:

git clone https://github.com/sequencer-media/genesis.git
cd genesis
npm ci
npm run build

Open the genesis folder in your coding agent. The skill is already included at skills/create-world-stream/SKILL.md. Repo-aware agents can also discover it through AGENTS.md.

Describe your world

Paste this prompt into your agent. Change the setting, interactions and visual style to match your idea.

Read skills/create-world-stream/SKILL.md and use it to build Mosslight, a forest battle worldstream with a cream pixel interface.

Let two players take turns. Have the backend LLM create four moves per encounter. Remember inventory, health and progress.

Start with labeled local fixtures. Validate the project, test the controls, and give me a playable local preview and a complete ZIP export.

The agent chooses a starter, adapts its controls and rules, and checks the result. Tell it which model provider you want when you are ready to connect generation.

Play, refine and export

Open the preview URL your agent returns. Try a turn, switch players and check that inventory and progress carry forward. Ask for changes in the same conversation.

Your agent should give you:

  • A playable preview: Your interface and controls running locally.
  • An editable project: genesis.json, interface.html, controller.js and declared assets.
  • A complete ZIP: A validated bundle to import into a compatible host.

Want to inspect or export the project yourself? Follow the local starter guide.

Connect live generation

Local previews use prepared responses and media. The stock runner includes an arena move fixture; another response format needs a matching local provider fixture.

Choose a connection when you want generated images, audio and video:

Configure your provider and generation budget before requesting live media. Credentials and spending limits belong on the host server.

Skill reference

The skill ships with the Apache 2.0 licensed engine. Download SKILL.md, or expand the full instructions below.

Read the full authoring instructions

Turn the user's idea into a working world, a local preview and a validated exportable bundle. Choose mechanics, presentation and reasonable defaults from the prompt. Ask only for information that blocks the requested behavior. Preserve the user's chosen provider and existing world behavior. Sequencer is the default managed integration when a provider has not been chosen.

Read the package's README and docs/api.md. Use genesis init with the nearest template, then implement the requested world in genesis.json, interface.html and controller.js. Adapt the actual controls, rules and scene context to the idea. Use the local runner's labeled fixtures for an immediate preview; connect live generation when the provider is configured and spending is authorized.

The stock local runner returns the arena move fixture for LLM requests. For a different responseSchema, supply matching fixture data through a local host provider using createLlmProvider; keep preview-only providers outside the portable project. Do not present a fixture response as live generation.

Design and inspect the interface

For a new custom UI or substantial redesign, gather two or three relevant visual references and inspect their actual images, including a mobile example when available. Use the host's free reference tools when offered, or available web/browser research. Send only a public visual brief. Extract typography, hierarchy, palette, spacing and composition, then record concise design decisions and source URLs beside the interface styles. Small repairs use the established direction. If reference access fails, continue from the brief and disclose the limitation.

Keep the video prominent and the primary controls compact. Use a suitable available theme font with readable UI text and dependable fallbacks. Package font files and licenses through supported assets or embedding; check the actual sandbox and CSP before using external fonts or dependencies. Use HTML/CSS/SVG for editable controls. Keep model text as text.

When controls belong over the stream, set the host's explicit overlay placement and verify the iframe is inside the video. A stage layout alone does not select placement. Make html/body transparent and inspect the rendered background; a root color-scheme can still produce an opaque iframe. Size controls against the actual stage, including short mobile video frames. Keep drawers, labels, touch targets, focus states and host controls usable. Voting UIs should distinguish your selection, vote counts including zero, the current leader or tie, and the accepted winner. Keep compact ideas on one line with full text accessible. Show only controls and status needed for the requested experience.

Near completion, render the world itself at desktop and mobile sizes, look at the returned screenshots, and exercise a representative custom control through the Genesis bridge. Reference images and passing DOM checks do not verify the finished design. Check clipping, contrast, fonts, overlay transparency, video visibility, long labels and loading/error states. Fix observed defects and recheck affected views. Report unavailable visual testing explicitly.

Authoritative behavior and stream lifecycle

Use window.Genesis for browser actions, state subscriptions, seats and assets. Read actor eligibility from the accepted host view. Keep health, turn order, vote outcomes and permitted state transitions in synchronous onEvent(context). Render LLM names as text; never evaluate model output as HTML or JavaScript.

For generated moves or world choices, request tool.llm.generate with a bounded object responseSchema, a cost ceiling and a guard against stale battle, scene or stream IDs. Consume job.ready's event.data.data. Generate encounter moves once per encounter; recurring audience ideas follow the requested refresh clock. Prefetch the next set without replacing options during an open ballot. Bound concurrent work, queue depth and spend, and reject stale completions. Commit game outcomes before scene.request and wait for actual playback.completed before advancing playback-confirmed visual state. The arena-llm example covers four generated moves and player replacement.

Keep ballot deadlines, idea refreshes and video chunks independent. For a requested ten-second vote and five-second video cadence, use the ten-second controller timer and the host's nearest supported five-second chunk mode. Sequencer currently uses 124/24, 243/24 or 345/24 seconds; read the current host contract before selecting. An independent ballot may continue while earlier actions play, with ordered accepted outcomes and playback receipts. Test repeated cycles while a tool is slow, overdue participant joins, stale windows, duplicate actions and stream stop. A shared room worker must stay available for timers while asynchronous provider jobs run. Use existing host scheduling rather than network calls inside the controller. Stop stream-scoped refresh jobs and ignore late output after that stream ends.

On a Genesis conversion, activate the host's Genesis authored/game prompt path and preserve the desired participation separately. Audit and remove competing legacy automatic directions. Use regular managed Worldstream admission with the selected provider, normally self-hosted H3 on Sequencer; cloud placement and fallback remain host policy. Recorded startup footage belongs only in explicitly requested demo/pitch experiences. Keep playback identity tied to the stable room/session rather than rotating viewer tokens, and verify activity refreshes and buffering do not repeatedly remount the player or alternate it with startup UI.

Plan likely scene checkpoints in advance with frame.prepare. Use a semantic key, a fingerprint covering cast/pose/location/camera/style, a TTL, priority, exact scene-only prompt, accepted references, cost ceiling and state guard. Inspect server-only context.frameLibrary, and select a ready match with frameRef on the actual live.direction or scene.request. Preparation never commits a forecast outcome. Insert post-event frames only after observed playback, especially fainting or destruction. Let missing frames fall back to linked motion. Invalidate changed concepts and refresh expired frames through the bounded queue. An LLM may propose the plan through tool.llm.generate once per scene change; validate its bounded output before emitting effects. Deterministic games can forecast known poses directly. Keep the live stream animating while preparation runs.

Explicit speech and silence

Before authoring native audio, read the selected model's official prompting guide. For H3/FastH3, use the MiniMax H3 guide and the FastH3 model card. Preserve the requested model and native audio. Investigate prompt defects before asking the creator to choose another voice system.

Give each accepted scene an explicit speech or no-speech contract, using supported outcome data such as audioMode and authorizedDialogue on Sequencer. A no-speech scene says: "No words are spoken. No dialogue, narration, singing or background voices." Describe intended ambience and physical effects separately. For speech, authorize the exact short line, language and named speaker, retain stable speaker IDs and voice identity, and fit the words within the chunk duration. Keep other characters vocally silent and end speech after the authorized line. Candidate choices, character names and previous dialogue never authorize new speech. Idle/replayed footage stays wordless. If the interface shows audio status, label it as planned speech or no speech, never detected speech without an actual detector.

For native H3, the final prompt contains exactly one integrated_multimodal_description, overall_soundscape and non_diegetic_music field. Begin with visual description and put chronological audio staging in Action within the multimodal description. Bind dialogue explicitly, for example: Mira (S1), in a clear quiet voice, says: <d>[English] Hold the door.</d>. Only language and exact words go inside the tags; identity, timing and delivery stay outside. Keep soundscape to ambience, physical effects and intended nonverbal sounds. Use N/A for music when no score is wanted; use N/A for soundscape only for complete silence. Put scene constraints before the audio fields, and leave the music field last. Apply mode-specific first-frame instructions when using image-to-video/audio.

Audit the full prompt chain: project and accepted outcome, director system/user prompts, writer success and fallback, final section assembly, and actual provider payload. Fallbacks and length limits must retain the accepted physical action and exact authorized dialogue. Keep ballot options, UI state, private data and unrelated policy text out of the filmed action. Verify one speaking scene and one no-speech scene through actual playback when live testing is authorized. Listen to the generated audio; valid tags, labels, fixtures and playback receipts alone cannot prove clear speech or silence. Report remaining model audio failures explicitly.

Package and verify

Declare media under assets/ with MIME type and byte size. Export a complete ZIP with genesis export. Use relative paths in portable files; attach them through the host adapter for production. Hosts copy immutable assets and provide runtime URLs. Keep credentials, wallets and prices outside project files.

For paid actions on Sequencer, save declared actions first, then read get_world_commerce and register host-owned offers through set_world_commerce with current world and catalog revisions. Display prices from Genesis.commerce.offers() and invoke Genesis.commerce.purchase(offerId, viewerInput). The platform handles confirmation and charges. Grant benefits only on purchase.completed using event.actionId and event.data.payload. Handle purchase.refunded gracefully. Never accept a browser's claimed price, wallet balance or payment success. Continuous paid directions should use live.direction; delivery failure refunds the reserved gems. Editor previews simulate purchases.

For Sequencer, use a server-side SequencerClient with SEQUENCER_API_KEY. Read its model catalog and pricing before paid image, audio or video work. Pass a server-enforced maxCostUsd and a stable idempotencyKey to generate; read the resulting media through media(workspaceId, mediaId). Quote private streams for their chosen duration before starting. Save a version-checked draft with complete assets. Saving a draft does not start a stream or publish it. Supply your own authenticated server transport and monetization for custom deployments. For another provider, implement the provider contract and persistent result store described in docs/providers.md.

Run genesis validate, export the complete bundle and open an actual local preview. Exercise the changed custom control, repeat a turn, reject a wrong actor and stale action, and complete the rendered UI checks above. Run npm test when changing the runtime or provider contracts, plus repository-required readiness checks. Before featuring a world, verify real room creation, player controls, video boot and one full action through observed playback in a bounded authorized test. Stop the stream you started and remove only your test participant. Offline move/video fixtures demonstrate the protocol; describe them as fixtures. Deliver the project location, preview URL and bundle, or the saved draft when requested. Report any untested live-provider behavior. Publish only within the user's authorized scope.