lua-guide
/lua-guide
Pomaga pisać ogólne skrypty Lua 5.4+: moduły, zakresy zmiennych, metatabele, korutyny i obsługę błędów w plikach .lua.
- Autor
- xonovex ↗
- Repozytorium
- platform ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 08.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 11
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 08.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Pomaga pisać ogólne skrypty Lua 5.4+: moduły, zakresy zmiennych, metatabele, korutyny i obsługę błędów w plikach .lua.
Wyzwalacze z opisu
Oryginalny opis (EN)
Use when editing general-purpose Lua 5.4+: modules, scripts, configuration. Triggers on `.lua` files and prompts about module patterns, local scoping, metatables, coroutines, error handling, even when the user doesn't say 'Lua'.
Jak działa
- Requirements
- Essentials
- Gotchas
- Progressive disclosure
Podgląd SKILL.md
--- name: lua-guide description: "Use when editing general-purpose Lua 5.4+: modules, scripts, configuration. Triggers on `.lua` files and prompts about module patterns, local scoping, metatables, coroutines, error handling, even when the user doesn't say 'Lua'." --- # Lua Coding Guidelines Write Lua modules with local state, explicit error handling, and clear interfaces. ## Requirements - Lua ≥ 5.4. ## Essentials - **Module pattern** - Always `local`, one module per file returning table, see [references/module-pattern.md](references/module-pattern.md), [references/local-variables.md](references/local-variables.md) - **Code organization** - Prefer table-based modules and simple functions, see [references/module-pattern.md](references/module-pattern.md), [references/metatables.md](references/metatables.md) - **Cooperative tasks** - Use coroutines for async patterns, see [references/coroutines.md](references/coroutines.md) - **Validation** - Validate inputs, see [references/input-validation.md](references/input-validation.md) - **Paradigm** - Functional style → **fp-guide**; class/OO design (metatable-based) → **oop-guide** ## Gotchas - Arrays are 1-indexed; a `nil` hole breaks the `#` length operator (it stops at the first nil) - Tables are both array and hash; mixing them is fine but iteration order isn't guaranteed for the hash part - `/` always returns a float; use `//` for integer floor division: `total // per_page`, not `math.floor(total / per_page)` - Variables are global by default unless declared `local`: forgetting `local` in a loop counter leaks into the surrounding scope ## Progressive disclosure - Read [references/module-pattern.md](references/module-pattern.md) - Load when creating reusable modules or organizing code structure - Read [references/local-variables.md](references/local-variables.md) - Load when encountering global variable issues or scoping problems - Read [references/metatables.md](references/metatables.md) - Load when implementing object-oriented patterns or operator overloading - Read [references/coroutines.md](references/coroutines.md) - Load when implementing cooperative multitasking or async patterns - Read [references/input-validation.md](references/input-validation.md) - Load when adding type checks or parameter validation - Read [references/idiomatic-patterns.md](references/idiomatic-patterns.md) - Load when learning common Lua idioms or patterns
Pliki w paczce (11)
- SKILL.md 2 KB
- SOURCES.md 1 KB
- eval-queries.json 5 KB
- evals.json 2 KB
- moon.yml 1 KB
- references/coroutines.md 1 KB
- references/idiomatic-patterns.md 1 KB
- references/input-validation.md 1 KB
- references/local-variables.md 1 KB
- references/metatables.md 1 KB
- references/module-pattern.md 1 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · xonovex/platform | 90 | MIT |
| ar4mirez/samuel | 100 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki f10609715d14 (skrót SHA-256 całej paczki)
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 85Lua C Integration
Omawia Lua C API do rozszerzania Lua kodem natywnym: operacje na stosie, wywołania C z Lua i odwrotnie, moduły C, userdata, metatabele i optymalizacje wydajności. - 100lua
Pomaga programować w Lua: tabele, metatabele, domknięcia, koroutyny i osadzanie w C, przy skryptach do gier, wtyczkach Neovim, modułach Nginx OpenResty i logice urządzeń wbudowanych. - 81Lua Tables Patterns
Wyjaśnia tabele Lua jako uniwersalną strukturę danych: tablice, słowniki, obiekty, metatabele, wzorce obiektowe i bardziej złożone operacje na tabelach. - 90typescript-to-lua-guide
Pomaga edytować TypeScript kompilowany do Lua przez TSTL 1.24+ w skryptach gier, Defold i silnikach osadzonych. - 100grandma3-lua-api
Pomaga pisać i debugować wtyczki oraz skrypty Lua dla grandMA3 z użyciem Object API, dialogów UI i struktury wtyczek XML. - 100xmake-scripting
Pomaga pisać logikę w xmake.lua: hooki on_build, import() modułów i budowanie natywnych modułów Lua w C/C++.