lang-lua
Skill5 starsChanged 46 days agoMITView on GitHub
use this when writing, reviewing, or testing Lua — *.lua including Neovim, game, and embedded scripts. do not use for JavaScript.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- maintainers/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- buying-researcherSkill
- cursor-cloud-agents-whenSkill
- debug-anthropicSkill
- debug-pocockSkill
- debugSkill
- discover-the-ideaSkill
- docs-google-styleSkill
- golang-safetySkill
- golang-securitySkill
- golang-testingSkill
- grok-acpSkill
- host-config-pyinfraSkill
- lang-cppSkill
- lang-csharpSkill
- lang-cSkill
- lang-dartSkill
- lang-dockerSkill
- lang-goSkill
- lang-javaSkill
- lang-js-tsSkill
- lang-kotlinSkill
- lang-makefileSkill
- lang-phpSkill
- lang-powershellSkill
- lang-protobufSkill
- lang-pythonSkill
- lang-rubySkill
- lang-rustSkill
- lang-shellSkill
- lang-sqlSkill
- lang-swiftSkill
- lang-terraformSkill
- language-routerSkill
- lang-web-markupSkill
- modern-pythonSkill
- pr-reviewSkill
- sdlc-artifactsSkill
- sdlc-onboardingSkill
- security-hardeningSkill
- shell-safetySkill
- tddSkill
- tracker-sdlcSkill
- ui-craftSkill
- ux-designSkill
- verify-before-doneSkill
- yagniSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 18
Run the project's test or the host (nvim headless, game harness) on the changed file.
- Very specific: line 36
Do not swallow with empty pcall unless you handle both returns.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lua
Thin-but-complete guide. You actually write Lua. No scripts/.
Process skills that may load with this one: load-with list.
Iron law
Indexes start at 1. pairs is not ipairs. Know which Lua you are
on.
Tooling / verify
Run the project's test or the host (nvim headless, game harness) on the
changed file. luacheck if the tree already has it.
Idioms a linter misses
- 1-based sequences. Do not port 0-based loops blindly.
ipairsfor the array part;pairsfor maps. Do not mix and assume order.localby default. Globals are a bug unless_Gis the point.requirepaths stay inside the project.- Lua 5.1 / LuaJIT: no integer subtype. Beware bitwise libs and numbers past 2^53.
- Tables are the only data structure. Document whether a table is a list, a map, or both.
Errors
error/assertor the project's result convention (nil, err).- Do not swallow with empty
pcallunless you handle both returns.
Concurrency
- Lua is typically single-threaded. Coroutines are not threads. Do not share a table across two hosts without a plan.
- Neovim: respect the event loop. No blocking syscalls on the main thread if the plugin already uses async.
Testing
- Busted / the host's test command if present. Otherwise a small
assertdriver next to the module.
PR review
- Off-by-one from a JS/C port.
- New global.
load/loadstringof anything that is not a literal in-repo chunk.
Security
- No
load/loadstring/dofileof untrusted text. os.execute/io.popen: argument hygiene; prefer none.- Neovim: no executing user text as Lua.
Always
local.ipairsvspairschosen on purpose. Tests or a host run.
Ask first
- Switching Lua version (5.1 / 5.2 / 5.3 / 5.4 / LuaJIT).
- Loading C modules.
Never
load/loadstringof untrusted text.- Assuming 0-based arrays.
- Mutating
_Gas architecture.
Red flags
- "Arrays start at 0"
- "pairs and ipairs are the same"
- "I'll loadstring the user config"
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

