ippclub/dora-ssr/dora-engine-coding
Claude Code and agent skill by ippclub/dora-ssr
- community
Checking that the SKILL.md file is still in the repository.
Dora SSR coding rules for game/workspace projects; prevents browser DOM/Canvas/Node.js code in Dora engine scripts and forces Dora API lookup before using unfamiliar engine APIs.
Install
npx vskill@latest install ippclub/dora-ssr/dora-engine-codingSKILL.md
Dora Engine Coding Rules
These rules apply whenever writing, fixing or reviewing code for a Dora SSR workspace/game project.
What Runtime This Is
- Dora runtime game code is executed by the Dora engine, not by a browser or Node.js.
- The normal runtime entry is the project-root
init.tsorinit.lua. - TypeScript/TSX is source code and is transpiled to Lua. The engine executes the Lua output.
- Prefer editing
.ts/.tsxsource files. Do not hand-edit generated.luaunless the task is specifically about Lua output or the project is Lua-only. - If a project contains web files (
index.html, DOM Canvas code, etc.) and also hasinit.ts, treatinit.tsas the Dora runtime entry unless the user explicitly asks for a browser/Web IDE frontend.
Runtime vs Browser Decision
Before writing code, decide the target:
- Dora game/runtime script: use Dora engine APIs and this skill.
- Web IDE/frontend page: browser APIs may be valid, but only if the user explicitly asks for Web IDE/frontend/browser work.
For Dora runtime scripts, never generate:
document,window,HTMLElement,HTMLCanvasElement,CanvasRenderingContext2DrequestAnimationFrame, browseralert, DOM event listenerssetInterval,setTimeout,NodeJS.Timeout- npm-only packages, Node
fs/path/process - HTML
index.htmlas the runtime game entry
If those APIs already exist in a Dora runtime project, treat them as incompatible code to rewrite.
Hard Rule: Do Not Guess Dora APIs
Dora has its own TypeScript definitions such as Dora.d.ts. Do not invent names/signatures.
Lookup protocol
Call search_dora_doc before using any Dora API that is not shown in the baseline section below or not already used correctly in the project.
For implementation tasks, keep lookup bounded so it does not replace implementation:
- When the runtime reports a fresh project, start from the disclosed short code file or create the requested entry directly (default to
init.tsfor a Dora TypeScript task). Consult relevant tutorials or APIs when they help, and prefer an early build so subsequent work can use compiler feedback. - If the requested game fits the baseline APIs below, do not search first. Inspect the entry, implement the smallest complete playable loop, then build.
- Before the first edit, use at most one batched
search_dora_doccall for all genuinely unfamiliar APIs. Do not issue separate searches for APIs already covered by the baseline. - After that lookup, edit and build. Search again only for a concrete compiler or runtime error that cannot be resolved from the returned signature.
- Do not use runtime command tools for project discovery, file inspection, or API/type-definition lookup. Use the corresponding file/search tools.
- Prefer build diagnostics over speculative design research. Do not spend repeated Agent steps comparing optional architectures before a playable baseline exists.
- After editing source, build before another
search_dora_doccall. A later search is justified only by a concrete build/runtime diagnostic that requires an unfamiliar API.
Use:
programmingLanguage: "ts"for.tsfiles.programmingLanguage: "tsx"for DoraX/JSX files.docType: "dora-api"for signatures/types.docType: "dora-tutorial"for usage examples when signatures alone are not enough.docLanguage: "zh"if the user is Chinese or Chinese docs are preferred; otherwise"en".
After searching:
- Read the returned signature/JSDoc carefully.
- Use the exact module name, export name, parameter order, return type, and enum value.
- If the result is incomplete, search narrower terms or read the referenced
.d.ts/tutorial file. - If search fails, say the API was not found and implement a simpler baseline Dora version instead of guessing.
Search especially for:
- physics/collision:
PhysicsWorld,Body,BodyDef,FixtureDef,Sensor - ECS:
Entity,Group,Observer, component queries - UI/components/layout:
Button,Menu,AlignNode, UI controls - audio:
Audio,AudioSource, buses/effects - async/coroutines:
thread,threadLoop,sleep,once,loop, scheduler jobs - scene/camera:
Director,Camera,Director.ui,Director.entry, scheduler APIs - resources/files:
Content,Cache,Path, asset loading/saving - sprite/animation/actions:
Sprite,Model,Playable,Action,Move,Scale,Sequence, animation slots - particles/effects/video:
Particle,EffekNode,VideoNode,TIC80Node - tile maps:
TileNode - Platformer helpers:
Platformer,PlatformWorld, platformer bodies/units - vector graphics/custom rendering:
DrawNode,VGNode,nvg - input beyond simple keyboard:
Mouse, touch, controller, IME, node slots
Example tool searches:
Module Import Rules
Use Dora runtime modules, not browser packages:
- Core engine APIs:
import { ... } from 'Dora'; - JSX/DoraX UI syntax: use
.tsxand import fromDoraX. UsetoNode()for one-shot scene creation, orcreateRoot()withsignal()for dynamic TSX diff rendering. - DoraX dynamic roots track the signals read during render. Use stable
keyvalues for dynamic sibling lists, and callroot.unmount()when a dynamic root is no longer needed. - Platformer framework:
import * as Platformer from 'Platformer';or exact exports found by API search. - ImGui tools/UI:
import * as ImGui from 'ImGui';plus enum exports fromImGuiwhen needed. - Vector graphics:
import * as nvg from 'nvg';when usingVGNode/NanoVG APIs. - Do not import React from npm for DoraX runtime code.
TypeScript Hygiene
- Do not use
anyin Dora runtime TypeScript. Use concrete types,unknownwith narrowing, generics, or exact unions/records. - Do not use bare
nullin runtime code. Useundefined/omitted fields for absent Lua values. - In
edit_filecontent, indent with ordinary space characters. Never emit the two literal characters\\tat the beginning of a source line; they are not indentation and will make TypeScript parsing fail. - Dora factory namespaces are values, not annotation types. Annotate instances with
Vec2.Type,Color.Type,Label.Type,DrawNode.Type, and the correspondingX.Type; do not use bareXorReturnType<typeof X>. - The Dora TypeScript-to-Lua subset does not support
Math.hypotorMath.imul. UseMath.sqrt(x*x + y*y)and ordinary bounded arithmetic. - Lua arrays cannot represent
undefined/nullelements. Do not build arrays from optional factory results such asLabel(...); narrow each optional result before inserting it, or handle the labels individually.
Coordinate System
- Dora uses a left-handed coordinate system, positive X is right and positive Y is up.
Director.entry,Director.ui, and similar root nodes use screen-center origin:(0, 0)is the screen center.- Do not use browser-style top-left coordinates unless explicitly converting from that space.
- For game screen adaptation, read
ts/adapting-to-screen.mddirectly before designing responsive layout behavior.
Parent and child local coordinates
- For a parent node with nonzero
widthandheight,anchorselects which point of the parent's own rectangle is placed at the parent'sposition. It does not move the local origin used by the parent's children. - A child is positioned in the parent's rectangular local space, whose
(0, 0)is the rectangle's bottom-left corner. Even with the defaultanchor = Vec2(0.5, 0.5), a child atVec2.zerois at that bottom-left corner, not at the parent's center. - To center a child in the parent rectangle, place it at
Vec2(parent.width / 2, parent.height / 2). - To align a child with the parent's anchor point, place it at
Vec2(parent.width * parent.anchor.x, parent.height * parent.anchor.y).
Keep a full-screen drawing root unsized when its children should use screen-center coordinates:
For a sized parent, position children in its bottom-left-based local rectangle:
Inside that sized node's touch handler, touch.location uses the same bottom-left-based local space. Convert it before comparing against centered model coordinates:
Do not give a full-screen drawing root a size merely for adaptation. Add a separate sized input node when a real hit area is required, and deliberately use or convert its local coordinates as shown above.
Input coordinate and enum baseline
These names come directly from the built-in Dora.d.ts; do not spend a search step rediscovering them:
touch.location: position in the receiving node's local coordinate system.touch.viewLocation: position in the current view's logical coordinate system.touch.worldLocation: position in world coordinates. Prefer node-local handlers withtouchEnabled = trueand the node's realsizeover global manual hit testing.- The return key is
KeyName.Return, notKeyName.Enter. Number keys areKeyName.Num0throughKeyName.Num9; letters and arrows use names such asKeyName.W,KeyName.Left, andKeyName.Up. - Controller buttons use
ButtonName.A/B/X/Y,Back,Start,Up/Down/Left/Right,LeftShoulder/RightShoulder, andLeftStick/RightStick. Axes useAxisName.LeftX/LeftY/RightX/RightY/LeftTrigger/RightTrigger. - Controller calls are
Controller.isButtonDown/Up/Pressed(controllerId, ButtonName.X)andController.getAxis(controllerId, AxisName.LeftX). - For a centered playfield of width
wand heighth, every model-space object and configured region must initially lie within[-w/2,w/2] × [-h/2,h/2]. With Dora's positive-Y-up convention, a bottom paddle has negative Y, bricks near the top have positive Y belowh/2, launch-up velocity is positive Y, and falling velocity is negative Y. Check these signs and bounds before the first build.
Scheduling Semantics
- A Dora
Nodehas one schedule slot. Callingnode.schedule(...)again replaces that node's previous scheduled callback; it does not add another concurrent callback. - Put update and render work in one scheduled callback, or attach independent callbacks to distinct child nodes.
- Runtime probes must never add another schedule to the node whose game loop is being tested. Observe state from the existing callback or use a separate probe node, then remove the probe after validation.
Baseline Dora APIs for Simple 2D Prototypes
For a tiny runtime prototype, this baseline is allowed without extra API search:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingAssets/Doc/skills/dora-engine-coding/SKILL.md
Popularity
- Repository stars
- 512
- Repository forks
- 72
- 7-day trend score
- 31
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Aug 2026, 2 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/ippclub/dora-ssr/dora-engine-coding)