api-games
Call nodetool.games from a code action: create or install a built-in game, read and edit its draft, write a whole generated level, generate and install art and audio into asset slots, playtest and autoplay routes, capture frames, publish a revision and build a web player. Load before the first call into nodetool.games.
- License 许可
- AGPL-3.0
- 最近更新
- 2026-11-15
- Stars
- ★ 635
- Forks
- 91
01 前言 Front Matter
- name
- api-games
- description
- Call nodetool.games from a code action: create or install a built-in game, read and edit its draft, write a whole generated level, generate and install art and audio into asset slots, playtest and autoplay routes, capture frames, publish a revision and build a web player. Load before the first call into nodetool.games.
03 SKILL.md 正文
nodetool.games
A built-in game runs in NodeTool's native 2D or 3D engine. It has a mutable draft
and immutable revisions. Play is deterministic, so a playtest with the same
seed and inputs gives the same result. How to build one is native-game, and
feel, pacing and art direction are game-direction. This is the call
reference.
Every id is the full game id or its exact 12-character prefix.
| Call | Does |
|---|---|
create(name, {project_id, dimension, template}) |
Creates a game in a project. dimension is 2d (default, a playable top-down room) or 3d (an exploration blockout). template is topdown or exploration. Answers the full id and the revision. |
get(id, {source, revision, view, entity_id}) |
Reads the draft (default) or a revision. view is outline (default), entity or full. |
edit(id, ops, {base_updated_at}) |
Applies ordered edits to the draft atomically. Issues come back with the op index and path. It does not publish. |
setDocument(id, document, {base_updated_at}) |
Writes a whole document as one set_document edit, validated atomically. |
previewAuthoring(id, {program, base_updated_at, expected_document}) |
Rebakes retained construction without writing. Returns a candidate, entity/dependency changes, conflicts and restart policy. Omit program to rebuild the saved construction. |
applyAuthoring(id, candidate) |
Recomputes and applies the preview against its exact draft. Rejects stale or changed candidates and unresolved conflicts. |
generateAsset(id, slot, kind, prompt, opts) |
Makes or imports an asset and binds it to the draft. |
installAsset(id, slot, binding, {base_revision, base_updated_at, candidate_workspace_id}) |
Installs one staged asset. The staged bytes must match binding.digest. |
playtest(id, {source, revision, seed, inputs, assertions, capture_ticks}) |
Runs up to 18,000 ticks with run-length inputs and assertions, and captures up to 8 frames. |
autoplay(id, {win, target_prefix, seed, player_id, max_ticks, source, revision}) |
Searches for a route to a win or to an entity prefix. Answers replayable inputs, the win tick and level statistics. An exhausted budget is inconclusive. |
capture(id, {ticks, inputs, seed, camera, overlays, scale, sheet, source, revision}) |
Renders up to 8 frames for a visual review. |
publish(id, {base_revision, message}) |
Saves the draft as an immutable revision, only when the user asks. base_revision is required, and a stale one is a conflict. |
build(id, {revision}) |
Builds a standalone web player of a revision under game-builds/<game-id>/<revision> in the project workspace. |
listExamples({query, limit}), getExample(slug, {view, entity_id}) |
Lists and reads the shipped benchmark games, such as kindle. |
installExample(slug, {project_id, name}) |
Copies an example with its media into a project as a new game you own. |
generateAsset
kind is image, audio (speech), music, sfx, font, model or
collider. Each generation is billed, so confirm the slot list with the user
before you generate assets for many slots.
- Images can be prepared as aligned sprite sheets, edge tilesets or grade LUTs
through
preparation. sfxneeds a registered sound-effectnode_typeand itsparams.fontimports a TTF or OTFinput_file.modelneeds a providernode_typewithparams, or an owned glTF or GLBinput_file.dependency_filesmaps a glTF buffer or image URI to an owned asset or workspace path.collidertakespreparation.shape. 3D results are candidates thatinstallAssetmust install.install: falsestages a 2D candidate and answers its binding without binding it.reference_slotkeeps a new image in the style of an existing slot.providerandmodelpick the model.background: truestarts it and answers ageneration_id; call again withgeneration_idand the same preparation to finish.
Build a level in code
Author the whole document with @nodetool-ai/sandbox-game and save it with
saveGame({name, document}, {games: nodetool.games, project_id}). Read
nodetool.packs.docs("@nodetool-ai/sandbox-game") first.
For retained construction, use constructGame({inputs, seed}, (inputs, builder) => { return document; }) and save the returned bundle with saveGame. Put
accepted preparation results and pinned asset bindings in inputs. The callback
cannot depend on outer variables. Rebuilds run without external capabilities.
Ordinary setDocument cannot attach or replace retained source or its baseline.
Manual property edits become overrides. Removing a generated entity suppresses
its key on later rebuilds. edit supports reset_override with entity_id,
optional scene_id and optional field path, and detach_entity with the same
entity target. Resetting a suppressed target restores it from the baseline.
Active retained-game sessions adopt the rebuilt definition and assets on restart.
The loop
- Read an example:
getExample("kindle"), thenview: "entity"for the script and feel parameters of one entity. - Build or edit the draft.
- Prove it can be finished:
autoplay(id, {win: true}), then replay the route withplaytest(id, {inputs, assertions})and a win assertion. - Look at it:
capture(id, {ticks, sheet: true}). - Publish and build only when the user asks.
04 同仓库更多 Skills
humanizer
Rewrite AI-sounding text so it reads like the writer without changing what it says. Use when editing or reviewing prose for AI tells: not-X-but-Y contrasts, one-line closers, staged openers, forced triads, dashes everywhere, inflated claims, sales language, stock AI words, bold labels, or filler.
nodetool
Use the NodeTool MCP server to build, validate, run, and debug visual AI workflows, and to work with assets, collections, and jobs. Use when the user mentions NodeTool or asks for a workflow graph, a node, or a media generation run on their NodeTool server.
wan-2-6-prompting
Prompt Alibaba's Wan 2.6 video — text-to-video with a global style line plus timing-bracketed shots, and image-to-video that describes only what changes over time. Covers the shot-mode switch per provider, the prompt budget, negative prompts, motion intensity wording, audio input and prompt expansion. Use whenever the model id names a Wan 2.6 video route (alibaba/wan-2.6/text-to-video, alibaba/wan-2.6/image-to-video, wan-video/wan-2.6-t2v, wan-video/wan-2.6-i2v, wan-video/wan2.6-i2v-flash) on generate_video, animate_image or a TextToVideo node. Not for Wan 2.5 or 2.7, or the Wan 2.6 image routes.
video-workflow
Build a reusable NodeTool video workflow for batches or repeated inputs. For a single finished piece, use a storyboard skill.
video-clone
Analyze a reference video and recreate its shot structure with a new product or cast in NodeTool.
video-audio-continuity
Keep sound continuous across a multi-scene piece cut from generated video — why one clip per scene hard-cuts the audio at every boundary, when to write all the scenes into a single generation instead, the sound-design vocabulary that survives a provider's copyright filter, and how to check the length, the aspect ratio and the mix of what came back. Use when a piece has more than one scene and the video model writes its own audio (Seedance 2, Veo 3, MiniMax H3, Kling 2.6 and later), or when a cut's sound drops out at the shot changes.