lua-guide

Installation
SKILL.md

Lua Guide

Applies to: Lua 5.4+, LuaJIT 2.1, Neovim Plugins, Love2D, Embedded Scripting

Core Principles

  1. Tables Are Everything: Arrays, maps, objects, modules, and namespaces -- master them
  2. Local by Default: Always declare variables local; globals are a performance and correctness hazard
  3. Explicit Error Handling: Use pcall/xpcall for recoverable errors; error() for programmer mistakes
  4. Minimal Metatables: Use metatables for genuine OOP needs, not as decoration on simple data
  5. Embed-Friendly Design: Lua exists to be embedded; keep the host/script boundary clean and narrow

Guardrails

Code Style

  • Use local for every variable and function unless it must be global
  • Naming: snake_case for variables/functions, PascalCase for class-like tables, UPPER_SNAKE_CASE for constants
  • Indent with 2 spaces; one statement per line; avoid semicolons
Related skills
Installs
14
Repository
ar4mirez/samuel
First Seen
Mar 1, 2026