lua-scripting

Document Ghost's Lua scripting layer, ScriptHost lifecycle, and sandboxing.

5|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/mrtolkien/GHOST --skill lua-scripting
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lua-scripting
Source: https://github.com/mrtolkien/GHOST/tree/main/.agents/skills/lua-scripting
Command: npx skills add https://github.com/mrtolkien/GHOST --skill lua-scripting

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill documents Ghost's Lua scripting layer internals, providing guidance to developers on ScriptHost lifecycle, sandboxing, and host bindings necessary for building and modifying the scripting stack.

Core Features & Use Cases

  • Lua scripting layer documentation: explains how agents run agent.lua in a sandboxed Lua 5.4 VM (mlua) and how host globals like read_file and load_skill are exposed.
  • Binding and lifecycle details: clarifies ScriptHost lifecycle, hook calls, and the integration between Rust and Lua in the Ghost runtime.
  • Use Case: A developer updates prompts/stdlib or agent.lua and needs a precise map of the runtime interfaces to avoid breaking agent behavior.

Quick Start

Open the Ghost Lua scripting docs and experiment with a sample agent.lua in the sandbox.

Frequently Asked Questions about lua-scripting

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

FAQPage Schema
How does the Lua scripting sandbox work in the Ghost runtime?

The Lua scripting sandbox runs agent.lua files inside a sandboxed Lua 5.4 VM using mlua. It exposes host globals like read_file and load_skill to manage script execution securely within the Ghost runtime.

What is the ScriptHost lifecycle when running Lua scripts?

The ScriptHost lifecycle manages the initialization, hook calls, and teardown of Lua scripts in the Ghost runtime. It handles the integration between Rust and Lua, ensuring host bindings and registry-based hook storage operate correctly.

How do I modify agent.lua without breaking agent behavior?

To modify agent.lua safely, follow the Ghost Lua scripting layer documentation to understand host globals like read_file and load_skill. Ensure your changes align with the ScriptHost lifecycle and registry-based hook storage to avoid breaking agent behavior.

Can I use mlua to expose custom host globals in a Lua sandbox?

Yes, mlua is the Lua 5.4 VM used by Ghost to expose host globals like read_file and load_skill within the sandbox. Developers can integrate custom bindings by modifying the Rust and Lua interfaces in the scripting stack.

Why are my Lua agent hooks not triggering in the Ghost runtime?

Lua agent hooks may not trigger if the registry-based hook storage or ScriptHost lifecycle is misconfigured. Check the integration between Rust and Lua in the Ghost runtime to ensure hook calls and host bindings are correctly registered.

Do I need to update prompts/stdlib when changing the Lua scripting layer?

Yes, updating prompts/stdlib or agent.lua requires understanding the Ghost Lua scripting layer internals. The ScriptHost lifecycle, sandboxing, and host bindings must align to prevent breaking agent behavior during runtime modifications.