defold-scripts-editing

Create and edit Defold Lua scripts and modules with correct structure.

Updated Apr 16, 2026
One-click install
npx skills add https://github.com/zarkua/Defolancer --skill defold-scripts-editing-zarkua
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: defold-scripts-editing
Source: https://github.com/zarkua/Defolancer/tree/main/.agents/skills/defold-scripts-editing
Command: npx skills add https://github.com/zarkua/Defolancer --skill defold-scripts-editing-zarkua

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defold projects often face inconsistent script types and boilerplate Lua module patterns across assets, leading to errors and wasted time.

Core Features & Use Cases

  • Supports all Defold script types: .script, .gui_script, .render_script, .editor_script, and standalone .lua modules.
  • Guides correct structure, property declarations, and lifecycle callbacks, reducing errors and improving consistency across projects.
  • Use cases include creating new scripts/modules, refactoring existing code, and aligning scripts with Defold templates and best practices.

Quick Start

Create a new script or Lua module by choosing the correct extension and following the standard module structure and lifecycle guidelines.

Frequently Asked Questions about defold-scripts-editing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a new Defold Lua script with the correct lifecycle callbacks?

Defold Lua scripts require correct file extensions like .script or .gui_script, along with proper property declarations and lifecycle callbacks, to ensure correct runtime behavior and editor integration. This Skill automates applying those module patterns and templates.

What is the difference between .script and .gui_script files in Defold?

Defold uses distinct script types for different contexts: .script for game objects, .gui_script for GUI components, .render_script for rendering pipelines, and .editor_script for editor extensions. Each requires specific lifecycle callbacks and structural constraints.

How do I structure a plain Lua module for a Defold project?

Structuring a plain Lua module for Defold requires adhering to standard module patterns to avoid runtime errors. This involves defining the module correctly and ensuring it integrates seamlessly with Defold's lifecycle callbacks and game object properties.

Does Defold require specific property declarations in Lua scripts?

Yes, Defold requires specific property declarations in Lua scripts to expose variables to the editor and runtime. Correct property declarations alongside lifecycle callbacks ensure proper editor integration and predictable game object behavior.

Why does my Defold script throw errors when loaded?

Defold scripts often throw errors due to inconsistent script types, incorrect file extensions, or missing lifecycle callbacks. Aligning scripts with Defold templates, standard module patterns, and property declarations reduces these runtime errors.