lua

Table Patterns (REQUIRED)

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "lua" with this command: npx skills add poletron/custom-rules/poletron-custom-rules-lua

Critical Patterns

Table Patterns (REQUIRED)

-- ✅ ALWAYS: Use tables for structured data local user = { name = "John", age = 30, greet = function(self) print("Hello, " .. self.name) end }

user:greet() -- method call with self

Module Pattern (REQUIRED)

-- ✅ ALWAYS: Return table for modules local M = {}

function M.process(data) return data:upper() end

return M

Error Handling (REQUIRED)

-- ✅ Use pcall for protected calls local ok, result = pcall(function() return risky_operation() end)

if not ok then print("Error: " .. result) end

Decision Tree

Need class-like? → Use metatables Need error handling? → Use pcall/xpcall Need iteration? → Use pairs/ipairs Need configuration? → Use external .lua files

Commands

lua script.lua # Run script luac -o out.luac script.lua # Compile luarocks install package # Install package

Resources

  • Best Practices: best-practices.md

  • Performance: performance.md

  • Scripting: scripting.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

lancedb

No summary provided by upstream source.

Repository SourceNeeds Review
General

git-flow

No summary provided by upstream source.

Repository SourceNeeds Review
General

coding-standards

No summary provided by upstream source.

Repository SourceNeeds Review
General

trpc

No summary provided by upstream source.

Repository SourceNeeds Review