Defold Scripts Editing logo

Defold Scripts Editing

Organization
indiesoftby
defold-scripts-editing

Creates and edits Defold Lua script files (.script, .gui_script, .render_script, .editor_script) and plain Lua modules (.lua). Use when asked to create, modify, or configure any Defold script or Lua module.

Overview

Publisherindiesoftby
Repositorydefold-agent-config
Skill namedefold-scripts-editing
Stars
104
Forks
10
Bundled files
4
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by indiesoftby on GitHub. Read the source before you install it.

Installation

Install the Defold Scripts Editing AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/indiesoftby/defold-agent-config/tree/main/.agents/skills/defold-scripts-editing
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/indiesoftby/defold-agent-config.git /tmp/defold-agent-config
mkdir -p .claude/skills
cp -r /tmp/defold-agent-config/.agents/skills/defold-scripts-editing .claude/skills/defold-scripts-editing
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Defold Scripts Editing in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Defold Scripts Editing on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Defold Scripts Editing is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Editing Defold Script Files and Lua Modules

Defold has four Lua script types (each running in a different context with different APIs) and plain .lua modules for reusable logic.

For API details use defold-api-fetch skill. For conceptual manuals use defold-docs-fetch skill. This skill covers script structure, constraints, and templates.

Lua modules (.lua)

Plain .lua files are Lua modules used to encapsulate reusable logic. Extract frequently used universal logic into .lua modules — avoid duplication and keep scripts lean. Modules are required via require("path.to.module") (dots as path separators).

Defold projects typically use Lua shared state (shared_state in game.project). When enabled, all scripts, GUI scripts, and the render script run in the same Lua context. A Lua module required from any script has the same context and state within that single Lua interpreter instance — module-level locals and package.loaded are shared across all users of the module. Stateful modules behave like singletons.

Lua module structure (.lua)

Encapsulate data and functions in a local table, return it:

lua
local M = {}

function M.hello()
    print("Hello")
end

return M

Avoid globals in modules. For stateful modules, internal state is shared between all callers (singleton-like). For stateless logic, pass state explicitly or use constructors that return new state tables. See Modules manual.

Script types

ExtensionContextLua runtimego.property()Key namespaces
.scriptGame object componentLuaJITYesgo, msg, vmath, timer, sys, component namespaces (sprite, label, factory, collectionfactory, collectionproxy, tilemap, model, sound, particlefx, buffer, resource, physics)
.gui_scriptGUI componentLuaJITNogui, msg, vmath, sys
.render_scriptRender pipeline (one per project)LuaJITNorender, graphics, camera, msg, vmath, sys
.editor_scriptDefold editorLua 5.2 (luaj)Noeditor, editor.ui, editor.prefs, editor.tx, http, json, zip, zlib

File format

All script types and .lua modules are plain Lua files (not Protobuf Text Format). Scripts use specific extensions (.script, .gui_script, etc.); modules use .lua.

Runtime environment notes (.script, .gui_script, .render_script)

Platform-specific: html5 module is only available on the HTML5 platform.

App Manifest exclusions: Some built-in modules (liveupdate, image, types, profiler, sound, physics, etc.) can be excluded via the App Manifest to reduce binary size. If excluded, their APIs will not be available at runtime.

No utf8 module: For working with non-ASCII strings, use the defold-utf8 dependency (https://github.com/d954mas/defold-utf8/archive/refs/heads/master.zip). API reference: utf8.script_api.

Common runtime script patterns (.script, .gui_script, .render_script)

All runtime lifecycle callbacks receive self as the first parameter — a userdata that acts like a table for storing instance state.

Script structure

  1. Module requires (optional) — local M = require("module")
  2. Local helper functions (optional) — must be at module scope, never inside other functions
  3. Declarations (.script only: go.property() at top level)
  4. Lifecycle callbacks

Lifecycle callback availability

Callback.script.gui_script.render_script
init(self)✓✓✓
final(self)✓✓—
fixed_update(self, dt)✓——
update(self, dt) / update(self)✓ (dt)✓ (dt)✓ (no dt)
late_update(self, dt)✓——
on_message(self, message_id, message, sender)✓✓✓ (no sender)
on_input(self, action_id, action)✓✓—
on_reload(self)✓✓—

Key rules

  • Store per-instance state in self, not in module-level locals (module-level locals are shared across all instances).
  • Omit unused callbacks — especially update() and fixed_update() which cost a call per frame even if empty.
  • Keep local helper functions at module scope, never inside other functions.

Native extensions

Native extensions (C/C++/ObjC/Java) register their Lua functions into the global scope via the Lua C API (lua_register, luaL_openlib, etc.). This means extensions typically add a new global table (e.g., myext) with functions and constants accessible from any .script or .gui_script.

Extensions describe their API for editor auto-complete via *.script_api files (YAML format) located in their api/ directory. The format:

yaml
- name: extension_name
  type: table
  desc: Extension description
  members:
  - name: function_name
    type: function
    desc: Function description
    parameters:
    - name: param_name
      type: string
      desc: Parameter description
    returns:
    - name: return_name
      type: number
      desc: Return value description

Types: table, string, boolean, number, function. Multiple types: [type1, type2].

Lua preprocessing

Defold supports conditional compilation via the Lua preprocessor extension (applies to all Lua files including .lua modules):

lua
--#IF DEBUG
local lives = 999
--#ELSE
local lives = 3
--#ENDIF

Keywords: RELEASE, DEBUG, HEADLESS.

Type-specific references

Consult the references/ directory for constraints, templates, and patterns specific to each script type:

  • references/script.md — go.property() reference (types, constraints, overrides), templates
  • references/gui_script.md — GUI script constraints, template node access, templates
  • references/render_script.md — render pipeline architecture, system messages, full working templates
  • references/editor_script.md — module structure, commands, lifecycle hooks, execution modes, templates

Workflow

Creating a new Lua module (.lua)

  1. Use when logic is reusable across multiple scripts or screens.
  2. Create a local table, add functions, return it.
  3. Keep modules stateless when possible; if stateful, document that state is shared.
  4. Require with dot notation: require("main.utils"), require("screens.game.helpers").

Creating a new script

  1. Determine the correct extension for the script type.
  2. Read the corresponding type-specific reference in references/ for constraints and templates.
  3. Follow the structure pattern: requires → helpers → declarations → callbacks.
  4. Only add lifecycle callbacks you actually need.

Editing an existing script

  1. Read the current file.
  2. Preserve existing declarations (e.g., go.property() names) and callback signatures.
  3. Add/modify callbacks as needed.
  4. Changing a go.property() name or type may break overrides in .go and .collection files.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Defold Scripts Editing AI skill do?

Creates and edits Defold Lua script files (.script, .gui_script, .render_script, .editor_script) and plain Lua modules (.lua). Use when asked to create, modify, or configure any Defold script or Lua module.

Why use Defold Scripts Editing on TypingMind?

Because you install it once and use it with any model. Defold Scripts Editing is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Defold Scripts Editing in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/indiesoftby/defold-agent-config/tree/main/.agents/skills/defold-scripts-editing. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Defold Scripts Editing?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Defold Scripts Editing?

As many as you like. As long as a model supports skills, you can use Defold Scripts Editing with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Defold Scripts Editing AI skill free?

It is published on GitHub by indiesoftby. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇