[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M79NG63G5N3RPCW7S2DCC07S":3,"skill-same:01M79NG63G5N3RPCW7S2DCC07S":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M79NG63G5N3RPCW7S2DCC07S","defold-core",null,"Build and debug the core of a Defold game in Lua: game.project settings, collections, game objects and components, script lifecycle and self state, go.property, input focus and bindings, URLs and message passing, factories, collection factories and collection proxies, plus building and smoke-running with Bob. Use when a project has game.project or .collection, .go, .script, .gui_script or .input_binding files, or the request mentions Defold, msg.post, on_message, on_input, acquire_input_focus, factory.create, collection proxy, bob.jar, or a Defold build error.","JunMystery\u002FAgent-Guidance","JunMystery","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F161468934?v=4","01M79MTMV8F0BY8NK1A92RA8A0","Jun","01M79MTMWCFBKPHN5B25E6V20B",0,"MIT","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fdefold-core\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: defold-core\ndescription: >\n  Build and debug the core of a Defold game in Lua: game.project settings, collections, game\n  objects and components, script lifecycle and self state, go.property, input focus and\n  bindings, URLs and message passing, factories, collection factories and collection\n  proxies, plus building and smoke-running with Bob. Use when a project has game.project or\n  .collection, .go, .script, .gui_script or .input_binding files, or the request mentions\n  Defold, msg.post, on_message, on_input, acquire_input_focus, factory.create, collection\n  proxy, bob.jar, or a Defold build error.\n---\n\n# Defold Core\n\nStructure, wire and verify a Defold game: editor resource files, the Lua script lifecycle,\naddressing and messages, runtime spawning and world loading, and a Bob build-and-run check.\nExamples target **Defold 1.14.0**; they were built with Bob 1.14.0 and run on the 1.14.0\nheadless engine. An existing project keeps its Defold version (see [Version](#version)).\n\n## When to use\n\n- Use when adding or fixing game objects, collections, scripts, input, messages, spawning or\n  level loading in a Defold project (`game.project` in the root, `.collection`, `.go`,\n  `.script`, `.gui_script` files), or when Bob reports a missing resource.\n\n**When *not* to use:** plain Lua or LÖVE projects (`love2d-core`); GUI layout, sprites,\ntilemaps and physics depth beyond the pointers in the references; engine-agnostic design\nhandled by the related skills below.\n\n## Workflow\n\n1. **Inspect first.** Read `game.project` (`[bootstrap] main_collection`, `[input]\n   game_binding`, `[project] dependencies`), the main collection, and the scripts near the\n   request. Follow the project's folder layout, id naming and message names; do not\n   reorganize. Note which Defold\u002FBob version CI or the team uses.\n2. **Edit the right file type.** Game objects (`.go`) hold components; collections\n   (`.collection`) place game objects and other collections; logic goes in `.script`\n   (game objects), `.gui_script` (GUI) or shared `.lua` modules. Editor files are\n   protobuf text: keep their structure, and copy shapes from\n   `references\u002Ffile-formats.md` instead of guessing fields.\n3. **Check references.** Run `python scripts\u002Fcheck_defold_project.py \u003Cproject-dir>` (path\n   relative to this skill folder; Python 3.10+, no Defold install needed). Fix every `ERROR`\n   (missing or wrong-case `\u002Fpaths`, a `game.project` path without the compiled `c` suffix,\n   a `require` whose file does not exist). Warnings cover files nothing uses yet, unfetched\n   library dependencies and runtime-loaded files. Re-run until it exits 0.\n4. **Build with Bob.** `java -jar bob.jar --root . --variant headless --archive resolve\n   build` needs JDK 25 and a `bob.jar` matching the project's Defold version. Exit 1 plus\n   an `ERROR:` line means a broken reference or a Lua syntax error (with file and line);\n   `references\u002Ffile-formats.md` shows how to trace an error that names a generated file.\n5. **Run it.** A build does not prove the game works. Run a headless bundle under a timeout\n   (`references\u002Fbuild-and-run.md`) and read the log: `ERROR:SCRIPT:` lines are Lua runtime\n   errors, `ERROR:GAMEOBJECT:` lines bad addresses or socket clashes. Require a line your\n   test prints when it finishes; the exit code alone proves nothing. The headless engine has\n   no keyboard or mouse, so check input changes in the editor or a desktop build, and say\n   what you could not verify.\n\n## Patterns\n\n### Project and resource references\n\n`game.project` is an INI file in the project root. Resource paths everywhere are\nroot-absolute (`\u002Fmain\u002Fplayer.go`). In `game.project` they name the **compiled** file, so the\nsource path gets a trailing `c`:\n\n```ini\n[bootstrap]\nmain_collection = \u002Fmain\u002Fmain.collectionc\n\n[input]\ngame_binding = \u002Finput\u002Fgame.input_bindingc\n```\n\nBob builds only what is reachable from `game.project`; `\u002Fbuiltins\u002F...` ships with the engine.\n\n### Collections, game objects, components\n\nA collection places instances and can override script properties per instance; a game object\nlists file components and embedded components (escaped `data:` strings). Full verified\nfiles are in `references\u002Ffile-formats.md`.\n\n```text\n# main.collection (excerpt): place player.go and override its script's speed\ninstances {\n  id: \"player\"\n  prototype: \"\u002Fmain\u002Fplayer.go\"\n  component_properties {\n    id: \"player\"\n    properties { id: \"speed\" value: \"250.0\" type: PROPERTY_TYPE_NUMBER }\n  }\n}\n```\n\n### Script lifecycle, `self` and properties\n\n```lua\ngo.property(\"speed\", 200)                   -- top level only, literal default; editable per instance\n\nlocal LEFT = hash(\"left\")                   -- hash ids once, not every frame\nlocal RIGHT = hash(\"right\")\nlocal FIRE = hash(\"fire\")\n\nfunction init(self)\n\tmsg.post(\".\", \"acquire_input_focus\")    -- no focus, no on_input calls\n\tself.held = {}                          -- per-instance state lives on self\nend\n\nfunction update(self, dt)\n\tlocal dir = (self.held[RIGHT] and 1 or 0) - (self.held[LEFT] and 1 or 0)\n\tif dir ~= 0 then\n\t\tlocal pos = go.get_position()\n\t\tpos.x = pos.x + dir * self.speed * dt    -- dt-scaled: same speed at any frame rate\n\t\tgo.set_position(pos)\n\tend\nend\n\nfunction on_input(self, action_id, action)\n\tif action_id == LEFT or action_id == RIGHT then\n\t\tif action.pressed then self.held[action_id] = true\n\t\telseif action.released then self.held[action_id] = nil end\n\t\treturn true                         -- consumed: listeners lower on the stack skip it\n\telseif action_id == FIRE and action.pressed then\n\t\tfactory.create(\"#bulletfactory\", go.get_position(), nil,\n\t\t\t{ velocity = vmath.vector3(0, 600, 0) })\n\t\treturn true\n\tend\nend\n\nfunction final(self)\n\tmsg.post(\".\", \"release_input_focus\")\nend\n```\n\nCallbacks: `init`, `final`, `fixed_update`, `update`, `late_update` (after every `update`,\nbefore render), `on_message`, `on_input`, `on_reload`. Update order between game\nobjects is unspecified. `fixed_update` runs 0..N times per frame at `[engine]\nfixed_update_frequency`; set `[physics] use_fixed_timestep = 1` too so physics steps at the\nsame rate, and put physics-driven code there. `self` is userdata: store\nfields on it, but `pairs(self)` and `pprint(self)` do not work. Property types: number,\nboolean, hash, `msg.url`, `vmath.vector3`\u002F`vector4`, `vmath.quat`, resources such as\n`resource.atlas(\"\u002Fmain\u002Fmain.atlas\")`, and (since 1.13.2) strings.\n\n### Input bindings and the input stack\n\n`.input_binding` maps devices to action names (`key_trigger`, `mouse_trigger`, plus\ngamepad, touch and text triggers). Every component that acquired focus sits on an input\nstack; the last to acquire is on top and gets input first, and returning `true` from\n`on_input` stops it there, which is how pause menus block gameplay input. Key actions report\n`pressed` and `released`; track held keys yourself as above.\n\n### Addressing and messages\n\nA URL is `[socket:][path][#fragment]`: `\".\"` is this game object, `\"#\"` this component,\n`\"#sprite\"` a sibling component, `\"enemy#ai\"` a relative object, `\"\u002Fmanager#controller\"` an\nabsolute one, `\"main:\u002Floader#loader\"` an object in another world. Collections create naming\nscopes, so a string id is resolved relative to the sender's collection; a pre-hashed id is\nalways absolute.\n\n```lua\nmsg.post(\"\u002Fmanager#controller\", \"enemy_spotted\", { id = go.get_id() })\n\nfunction on_message(self, message_id, message, sender)\n\tif message_id == hash(\"enemy_spotted\") then\n\t\tprint(\"from\", sender, \"id\", message.id)\n\tend\nend\n```\n\nMessages are queued and dispatched later in the frame; the table is capped at 2 KB. A bad\naddress logs `ERROR:GAMEOBJECT: Instance '\u002Fx' could not be found when dispatching message`.\n\n### Factories and collection factories\n\n```lua\n-- factory component \"#bulletfactory\" -> one game object; properties override go.property values\nlocal id = factory.create(\"#bulletfactory\", pos, nil, { velocity = vmath.vector3(0, 600, 0) })\n\n-- collectionfactory component \"#wavefactory\" -> table of collection ids -> new instance ids\nlocal ids = collectionfactory.create(\"#wavefactory\", vmath.vector3(480, 500, 0))\nlocal leader = ids[hash(\"\u002Fleader\")]         -- e.g. hash: [\u002Fcollection0\u002Fleader]\ngo.delete(ids, true)                        -- later: delete them and their children\n```\n\nPosition and rotation default to the spawning object's. `go.delete()` takes effect at the\nend of the frame. Per-instance properties for a collection factory are keyed by id:\n`{ [hash(\"\u002Fleader\")] = { hp = 5 } }`.\n\n### Collection proxies (load another world)\n\n```lua\n-- excerpt from the loader script; the collection's \"#levelproxy\" component is a collectionproxy\nfunction init(self)\n\tmsg.post(\".\", \"acquire_input_focus\")        -- else the loaded world gets no input\n\tmsg.post(\"#levelproxy\", \"async_load\")       -- or \"load\"\nend\n\nfunction on_message(self, message_id, message, sender)\n\tif message_id == hash(\"proxy_loaded\") then\n\t\tmsg.post(sender, \"init\")\n\t\tmsg.post(sender, \"enable\")\n\telseif message_id == hash(\"level_done\") then\n\t\tmsg.post(\"#levelproxy\", \"unload\")       -- disables and finalizes first\n\telseif message_id == hash(\"proxy_unloaded\") then\n\t\t-- safe to load the next level here\n\tend\nend\n```\n\nThe loaded world's socket is the **`name:` of the loaded collection file**, so scripts in it\nreply with `msg.post(\"main:\u002Floader#loader\", ...)` and its own URLs read\n`level1:\u002Flevel#level`. `set_time_step { factor = 0, mode = 0 }` pauses a proxy world.\n\n## Version\n\n`game.project` has no engine version key. Use the Defold editor or `bob.jar` version the\nproject is built with (CI often pins a release sha1), and `library.defold_min_version` when the\nproject is a library. `java -jar bob.jar --version` prints the version and sha1. Keep that\nversion; do not migrate unless asked.\n\n## Pitfalls\n\n- **Bob: `the bootstrap.main_collection '\u002Fmain\u002Fmain.collectio' can't be found`** → the\n  setting lacks the compiled suffix and Bob stripped the last letter. Write\n  `\u002Fmain\u002Fmain.collectionc` (same for `input.game_binding` → `.input_bindingc`).\n- **Bob: `ERROR: build\u002Fdefault\u002F_generated_….factory:0: the prototype '\u002Fmain\u002Fx.go' can't be\n  found`** → an embedded component in some `.go` points at a missing file. Search the\n  sources for the quoted path (`\u002Fmain\u002Fx.go`), not the generated name, or run the checker.\n- **`on_input` never fires** → the object never sent `acquire_input_focus`, the action name\n  differs from the binding, `input.game_binding` points elsewhere, or a listener higher on\n  the stack returns `true`.\n- **Input dead inside a proxy-loaded level** → the game object holding the collection proxy\n  did not acquire input focus.\n- **`already a socket with the same name` and the proxy never sends `proxy_loaded`** → the\n  loaded collection's `name:` equals an already loaded world (often both are `\"main\"` or\n  `\"default\"`). Give every proxied collection a unique name.\n- **`fixed_update` never runs** → `[engine] fixed_update_frequency` is 0 (default 60). For\n  physics also set `[physics] use_fixed_timestep = 1`, as the manual requires both.\n- **`module 'modules.util' not found` at run time although Bob succeeded** → a `require` used\n  slashes (`require \"modules\u002Futil\"`). Use the dotted path from the project root,\n  `require \"modules.util\"` for `\u002Fmodules\u002Futil.lua`.\n- **`tostring(id)` prints `hash: [\u003Cunknown:…>]`** → hashes keep their source text only in\n  debug builds. Compare hashes, never their strings.\n- **A second engine logs `Failed to initialize Remotery`, or a test run never ends** → the\n  debug engine opens an engine service (port 8001), a log server and a profiler port, and\n  waits forever without `sys.exit`. Run one engine at a time and always use a timeout.\n\n## References\n\n- `references\u002Ffile-formats.md` — verified minimal `game.project`, `.collection`, `.go`,\n  `.atlas`, `.input_binding` and script files, and how to trace build errors back to a\n  source file; read before writing editor files by hand.\n- `references\u002Fbuild-and-run.md` — JDK 25 and `bob.jar`, Bob commands, platforms and\n  variants, a headless smoke test with timeout and log checks, and pointers for GUI,\n  sprites, tilemaps and collision objects.\n- `scripts\u002Fcheck_defold_project.py` — read-only reference checker; `--help` lists every check.\n\n## Related skills\n\n- `input-systems` — rebinding, gamepad support and buffering on top of Defold bindings.\n- `game-ui-ux` — HUD and menu design to build with GUI scenes and `.gui_script`.\n- `physics-tuning` — fixed-timestep and collision tuning for collision objects.\n- `camera-systems` — follow\u002Fdeadzone logic, typically applied in `late_update`.\n- `save-systems` — save formats and slots; pair with Defold's `sys.save`\u002F`sys.load`.\n- `game-feel` — juice built from `go.animate` and timers.\n- `platformer`, `level-design` — genre and layout guidance that binds to this skill.\n- `love2d-core` — the other Lua engine in this catalog, for LÖVE projects.\n","# Defold Core\n\nStructure, wire and verify a Defold game: editor resource files, the Lua script lifecycle,\naddressing and messages, runtime spawning and world loading, and a Bob build-and-run check.\nExamples target **Defold 1.14.0**; they were built with Bob 1.14.0 and run on the 1.14.0\nheadless engine. An existing project keeps its Defold version (see [Version](#version)).\n\n## When to use\n\n- Use when adding or fixing game objects, collections, scripts, input, messages, spawning or\n  level loading in a Defold project (`game.project` in the root, `.collection`, `.go`,\n  `.script`, `.gui_script` files), or when Bob reports a missing resource.\n\n**When *not* to use:** plain Lua or LÖVE projects (`love2d-core`); GUI layout, sprites,\ntilemaps and physics depth beyond the pointers in the references; engine-agnostic design\nhandled by the related skills below.\n\n## Workflow\n\n1. **Inspect first.** Read `game.project` (`[bootstrap] main_collection`, `[input]\n   game_binding`, `[project] dependencies`), the main collection, and the scripts near the\n   request. Follow the project's folder layout, id naming and message names; do not\n   reorganize. Note which Defold\u002FBob version CI or the team uses.\n2. **Edit the right file type.** Game objects (`.go`) hold components; collections\n   (`.collection`) place game objects and other collections; logic goes in `.script`\n   (game objects), `.gui_script` (GUI) or shared `.lua` modules. Editor files are\n   protobuf text: keep their structure, and copy shapes from\n   `references\u002Ffile-formats.md` instead of guessing fields.\n3. **Check references.** Run `python scripts\u002Fcheck_defold_project.py \u003Cproject-dir>` (path\n   relative to this skill folder; Python 3.10+, no Defold install needed). Fix every `ERROR`\n   (missing or wrong-case `\u002Fpaths`, a `game.project` path without the compiled `c` suffix,\n   a `require` whose file does not exist). Warnings cover files nothing uses yet, unfetched\n   library dependencies and runtime-loaded files. Re-run until it exits 0.\n4. **Build with Bob.** `java -jar bob.jar --root . --variant headless --archive resolve\n   build` needs JDK 25 and a `bob.jar` matching the project's Defold version. Exit 1 plus\n   an `ERROR:` line means a broken reference or a Lua syntax error (with file and line);\n   `references\u002Ffile-formats.md` shows how to trace an error that names a generated file.\n5. **Run it.** A build does not prove the game works. Run a headless bundle under a timeout\n   (`references\u002Fbuild-and-run.md`) and read the log: `ERROR:SCRIPT:` lines are Lua runtime\n   errors, `ERROR:GAMEOBJECT:` lines bad addresses or socket clashes. Require a line your\n   test prints when it finishes; the exit code alone proves nothing. The headless engine has\n   no keyboard or mouse, so check input changes in the editor or a desktop build, and say\n   what you could not verify.\n\n## Patterns\n\n### Project and resource references\n\n`game.project` is an INI file in the project root. Resource paths everywhere are\nroot-absolute (`\u002Fmain\u002Fplayer.go`). In `game.project` they name the **compiled** file, so the\nsource path gets a trailing `c`:\n\n```ini\n[bootstrap]\nmain_collection = \u002Fmain\u002Fmain.collectionc\n\n[input]\ngame_binding = \u002Finput\u002Fgame.input_bindingc\n```\n\nBob builds only what is reachable from `game.project`; `\u002Fbuiltins\u002F...` ships with the engine.\n\n### Collections, game objects, components\n\nA collection places instances and can override script properties per instance; a game object\nlists file components and embedded components (escaped `data:` strings). Full verified\nfiles are in `references\u002Ffile-formats.md`.\n\n```text\n# main.collection (excerpt): place player.go and override its script's speed\ninstances {\n  id: \"player\"\n  prototype: \"\u002Fmain\u002Fplayer.go\"\n  component_properties {\n    id: \"player\"\n    properties { id: \"speed\" value: \"250.0\" type: PROPERTY_TYPE_NUMBER }\n  }\n}\n```\n\n### Script lifecycle, `self` and properties\n\n```lua\ngo.property(\"speed\", 200)                   -- top level only, literal default; editable per instance\n\nlocal LEFT = hash(\"left\")                   -- hash ids once, not every frame\nlocal RIGHT = hash(\"right\")\nlocal FIRE = hash(\"fire\")\n\nfunction init(self)\n\tmsg.post(\".\", \"acquire_input_focus\")    -- no focus, no on_input calls\n\tself.held = {}                          -- per-instance state lives on self\nend\n\nfunction update(self, dt)\n\tlocal dir = (self.held[RIGHT] and 1 or 0) - (self.held[LEFT] and 1 or 0)\n\tif dir ~= 0 then\n\t\tlocal pos = go.get_position()\n\t\tpos.x = pos.x + dir * self.speed * dt    -- dt-scaled: same speed at any frame rate\n\t\tgo.set_position(pos)\n\tend\nend\n\nfunction on_input(self, action_id, action)\n\tif action_id == LEFT or action_id == RIGHT then\n\t\tif action.pressed then self.held[action_id] = true\n\t\telseif action.released then self.held[action_id] = nil end\n\t\treturn true                         -- consumed: listeners lower on the stack skip it\n\telseif action_id == FIRE and action.pressed then\n\t\tfactory.create(\"#bulletfactory\", go.get_position(), nil,\n\t\t\t{ velocity = vmath.vector3(0, 600, 0) })\n\t\treturn true\n\tend\nend\n\nfunction final(self)\n\tmsg.post(\".\", \"release_input_focus\")\nend\n```\n\nCallbacks: `init`, `final`, `fixed_update`, `update`, `late_update` (after every `update`,\nbefore render), `on_message`, `on_input`, `on_reload`. Update order between game\nobjects is unspecified. `fixed_update` runs 0..N times per frame at `[engine]\nfixed_update_frequency`; set `[physics] use_fixed_timestep = 1` too so physics steps at the\nsame rate, and put physics-driven code there. `self` is userdata: store\nfields on it, but `pairs(self)` and `pprint(self)` do not work. Property types: number,\nboolean, hash, `msg.url`, `vmath.vector3`\u002F`vector4`, `vmath.quat`, resources such as\n`resource.atlas(\"\u002Fmain\u002Fmain.atlas\")`, and (since 1.13.2) strings.\n\n### Input bindings and the input stack\n\n`.input_binding` maps devices to action names (`key_trigger`, `mouse_trigger`, plus\ngamepad, touch and text triggers). Every component that acquired focus sits on an input\nstack; the last to acquire is on top and gets input first, and returning `true` from\n`on_input` stops it there, which is how pause menus block gameplay input. Key actions report\n`pressed` and `released`; track held keys yourself as above.\n\n### Addressing and messages\n\nA URL is `[socket:][path][#fragment]`: `\".\"` is this game object, `\"#\"` this component,\n`\"#sprite\"` a sibling component, `\"enemy#ai\"` a relative object, `\"\u002Fmanager#controller\"` an\nabsolute one, `\"main:\u002Floader#loader\"` an object in another world. Collections create naming\nscopes, so a string id is resolved relative to the sender's collection; a pre-hashed id is\nalways absolute.\n\n```lua\nmsg.post(\"\u002Fmanager#controller\", \"enemy_spotted\", { id = go.get_id() })\n\nfunction on_message(self, message_id, message, sender)\n\tif message_id == hash(\"enemy_spotted\") then\n\t\tprint(\"from\", sender, \"id\", message.id)\n\tend\nend\n```\n\nMessages are queued and dispatched later in the frame; the table is capped at 2 KB. A bad\naddress logs `ERROR:GAMEOBJECT: Instance '\u002Fx' could not be found when dispatching message`.\n\n### Factories and collection factories\n\n```lua\n-- factory component \"#bulletfactory\" -> one game object; properties override go.property values\nlocal id = factory.create(\"#bulletfactory\", pos, nil, { velocity = vmath.vector3(0, 600, 0) })\n\n-- collectionfactory component \"#wavefactory\" -> table of collection ids -> new instance ids\nlocal ids = collectionfactory.create(\"#wavefactory\", vmath.vector3(480, 500, 0))\nlocal leader = ids[hash(\"\u002Fleader\")]         -- e.g. hash: [\u002Fcollection0\u002Fleader]\ngo.delete(ids, true)                        -- later: delete them and their children\n```\n\nPosition and rotation default to the spawning object's. `go.delete()` takes effect at the\nend of the frame. Per-instance properties for a collection factory are keyed by id:\n`{ [hash(\"\u002Fleader\")] = { hp = 5 } }`.\n\n### Collection proxies (load another world)\n\n```lua\n-- excerpt from the loader script; the collection's \"#levelproxy\" component is a collectionproxy\nfunction init(self)\n\tmsg.post(\".\", \"acquire_input_focus\")        -- else the loaded world gets no input\n\tmsg.post(\"#levelproxy\", \"async_load\")       -- or \"load\"\nend\n\nfunction on_message(self, message_id, message, sender)\n\tif message_id == hash(\"proxy_loaded\") then\n\t\tmsg.post(sender, \"init\")\n\t\tmsg.post(sender, \"enable\")\n\telseif message_id == hash(\"level_done\") then\n\t\tmsg.post(\"#levelproxy\", \"unload\")       -- disables and finalizes first\n\telseif message_id == hash(\"proxy_unloaded\") then\n\t\t-- safe to load the next level here\n\tend\nend\n```\n\nThe loaded world's socket is the **`name:` of the loaded collection file**, so scripts in it\nreply with `msg.post(\"main:\u002Floader#loader\", ...)` and its own URLs read\n`level1:\u002Flevel#level`. `set_time_step { factor = 0, mode = 0 }` pauses a proxy world.\n\n## Version\n\n`game.project` has no engine version key. Use the Defold editor or `bob.jar` version the\nproject is built with (CI often pins a release sha1), and `library.defold_min_version` when the\nproject is a library. `java -jar bob.jar --version` prints the version and sha1. Keep that\nversion; do not migrate unless asked.\n\n## Pitfalls\n\n- **Bob: `the bootstrap.main_collection '\u002Fmain\u002Fmain.collectio' can't be found`** → the\n  setting lacks the compiled suffix and Bob stripped the last letter. Write\n  `\u002Fmain\u002Fmain.collectionc` (same for `input.game_binding` → `.input_bindingc`).\n- **Bob: `ERROR: build\u002Fdefault\u002F_generated_….factory:0: the prototype '\u002Fmain\u002Fx.go' can't be\n  found`** → an embedded component in some `.go` points at a missing file. Search the\n  sources for the quoted path (`\u002Fmain\u002Fx.go`), not the generated name, or run the checker.\n- **`on_input` never fires** → the object never sent `acquire_input_focus`, the action name\n  differs from the binding, `input.game_binding` points elsewhere, or a listener higher on\n  the stack returns `true`.\n- **Input dead inside a proxy-loaded level** → the game object holding the collection proxy\n  did not acquire input focus.\n- **`already a socket with the same name` and the proxy never sends `proxy_loaded`** → the\n  loaded collection's `name:` equals an already loaded world (often both are `\"main\"` or\n  `\"default\"`). Give every proxied collection a unique name.\n- **`fixed_update` never runs** → `[engine] fixed_update_frequency` is 0 (default 60). For\n  physics also set `[physics] use_fixed_timestep = 1`, as the manual requires both.\n- **`module 'modules.util' not found` at run time although Bob succeeded** → a `require` used\n  slashes (`require \"modules\u002Futil\"`). Use the dotted path from the project root,\n  `require \"modules.util\"` for `\u002Fmodules\u002Futil.lua`.\n- **`tostring(id)` prints `hash: [\u003Cunknown:…>]`** → hashes keep their source text only in\n  debug builds. Compare hashes, never their strings.\n- **A second engine logs `Failed to initialize Remotery`, or a test run never ends** → the\n  debug engine opens an engine service (port 8001), a log server and a profiler port, and\n  waits forever without `sys.exit`. Run one engine at a time and always use a timeout.\n\n## References\n\n- `references\u002Ffile-formats.md` — verified minimal `game.project`, `.collection`, `.go`,\n  `.atlas`, `.input_binding` and script files, and how to trace build errors back to a\n  source file; read before writing editor files by hand.\n- `references\u002Fbuild-and-run.md` — JDK 25 and `bob.jar`, Bob commands, platforms and\n  variants, a headless smoke test with timeout and log checks, and pointers for GUI,\n  sprites, tilemaps and collision objects.\n- `scripts\u002Fcheck_defold_project.py` — read-only reference checker; `--help` lists every check.\n\n## Related skills\n\n- `input-systems` — rebinding, gamepad support and buffering on top of Defold bindings.\n- `game-ui-ux` — HUD and menu design to build with GUI scenes and `.gui_script`.\n- `physics-tuning` — fixed-timestep and collision tuning for collision objects.\n- `camera-systems` — follow\u002Fdeadzone logic, typically applied in `late_update`.\n- `save-systems` — save formats and slots; pair with Defold's `sys.save`\u002F`sys.load`.\n- `game-feel` — juice built from `go.animate` and timers.\n- `platformer`, `level-design` — genre and layout guidance that binds to this skill.\n- `love2d-core` — the other Lua engine in this catalog, for LÖVE projects.\n",{"name":5,"description":7},"main","5d0a87185c0e172c3901e2a6e5916b6d544b8b94","skills\u002Fdefold-core","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance","https:\u002F\u002Fgithub.com\u002FJunMystery","AI is the typist, I am the architect. Building efficient, secure, and user-centric products through disciplined AI prompt engineering.","2026-11-13 17:41:25",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add JunMystery\u002FAgent-Guidance --skill defold-core",{"tool":37,"command":38},"bunx","bunx skills add JunMystery\u002FAgent-Guidance --skill defold-core",{"tool":40,"command":41},"pnpm","pnpm dlx skills add JunMystery\u002FAgent-Guidance --skill defold-core","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fdefold-core\u002FSKILL.md",true,[45,51,55,59],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"agents\u002Fopenai.yaml","REFERENCE","参考文档",229,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fdefold-core\u002Fagents\u002Fopenai.yaml",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fbuild-and-run.md",6884,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fdefold-core\u002Freferences\u002Fbuild-and-run.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Ffile-formats.md",7407,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fdefold-core\u002Freferences\u002Ffile-formats.md",{"path":60,"resourceType":61,"resourceTypeDesc":62,"sizeBytes":63,"sourceHtmlUrl":64},"scripts\u002Fcheck_defold_project.py","SCRIPT","脚本",29664,"https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fdefold-core\u002Fscripts\u002Fcheck_defold_project.py",[66,72,78,84,90,96],{"skillNo":67,"name":68,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M79QR1E309VJ6CTQKB32AWWA","zero-trust-architecture-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fzero-trust-architecture-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M79QQV7GHYR02DYGN41S23WN","xss-filter-evasion-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxss-filter-evasion-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M79QQNSN7YB8XB61FFSCS3WH","xs-leaks-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxs-leaks-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M79QQHZZJKFDY9132G5A65C2","xpath-injection-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxpath-injection-prevention-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":19},"01M79QQB9ZSD3DJG8658EHQXR1","xml-security-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-security-cheat-sheet\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M79QQ60WKV7PFMXWT9CW8PM6","xml-external-entity-prevention-cheat-sheet","https:\u002F\u002Fgithub.com\u002FJunMystery\u002FAgent-Guidance\u002Fblob\u002Fmain\u002Fskills\u002Fxml-external-entity-prevention-cheat-sheet\u002FSKILL.md",[],[]]