[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ET2PEG58W02C9JCK3A5PJ1":3,"skill-same:01M7ET2PEG58W02C9JCK3A5PJ1":45},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7ET2PEG58W02C9JCK3A5PJ1","ams-lua-pro",null,"TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-lua-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: lua-pro\ndescription: Idiomatic Lua: tables as the universal structure, metatables, modules, and embedding patterns. Use when writing, reviewing, or structuring Lua code (games, embedded scripting, Neovim, Redis, nginx).\ncategory: development\n---\n\n# Lua Pro\n\n## Overview\n\nLua's genius — **one data structure (the table), first-class functions, and ruthless simplicity** —\nmakes it the premier embedding language (games, Redis, nginx\u002FOpenResty, Neovim, Wireshark). Professional\nLua means mastering tables deeply, using metatables judiciously, writing clean modules, and respecting\nthe 1-based, dynamically-typed reality instead of fighting it.\n\nThe through-line: small language, deep mastery — tables, closures, and coroutines cover nearly everything.\n\n## When to use\n\n- Writing or reviewing Lua for games, embedded scripting, or config (Neovim, AwesomeWM).\n- Designing Lua modules and APIs for host applications.\n- Using metatables, metamethods, and OOP-ish patterns in Lua.\n- Debugging table, scoping, or coroutine issues.\n- Embedding Lua in a C\u002FC++ host or extending Redis\u002Fnginx.\n\n## Core concepts\n\n- **Tables are everything.** Arrays (1-based!), dictionaries, objects, modules, namespaces — all\n  tables. Master the idioms: `t[#t+1] = v` (append), `ipairs` for sequences, `pairs` for maps,\n  and the critical distinction (a table with holes is not a sequence — `#` is undefined on it).\n- **Modules via return.** The modern pattern: a file builds a local table and `return`s it;\n  `require` caches by name. Avoid the old `module()` function and global pollution — locals and\n  explicit returns keep namespaces clean.\n- **Metatables: power with restraint.** `__index`\u002F`__newindex` for defaults, prototypes, and\n  read-only tables; `__call`, `__tostring`, arithmetic metamethods for DSLs. Prototype-based OOP\n  via `__index` chains works — but keep hierarchies shallow and document the magic.\n- **Closures over classes.** Lua's closures capture upvalues beautifully — factories returning\n  closures often beat metatable-OOP for encapsulation (true private state, no `self` bookkeeping).\n- **Coroutines for cooperative control flow.** `coroutine.create`\u002F`resume`\u002F`yield` — perfect for\n  iterators, state machines, and game scripting (cutscenes, AI sequences). They're stackful and\n  cheap; don't fear them, but don't use them where a simple iterator suffices.\n- **Know the version.** Lua 5.1 (LuaJIT, Redis, nginx) vs 5.3\u002F5.4 (integers, `\u002F\u002F`, bitwise ops,\n  `\u003Cclose>` for to-be-closed variables). Write to your target's version — 5.1-isms and 5.4-isms\n  don't mix.\n\n## Practical workflow\n\n1. **Structure as modules.** One file per module, local table, `return` at end; `require` for\n   deps. Keep the global namespace clean (`_G` pollution is the original Lua sin).\n2. **Be explicit about types at boundaries.** Dynamic typing means validation at API edges:\n   `assert(type(x) == \"table\")` with messages in dev; graceful errors for host-provided data.\n3. **Use the stdlib fully.** `string` (patterns — not regex! learn the pattern language),\n   `table` (`insert`, `remove`, `sort`, `concat`, `pack`\u002F`unpack`), `math`, `os`, `io`.\n   `table.concat` beats loop-concatenation for building strings.\n4. **Handle errors with pcall\u002Fxpcall.** Protected calls at host boundaries; `error()` with\n   informative messages (include context!); don't let Lua errors crash the host silently —\n   decide the policy per embedding.\n5. **Test where it matters.** `busted` for unit tests; test pure logic heavily (it's easy to\n   isolate); integration-test against the real host (Redis scripts against Redis, game logic in\n   the engine harness).\n6. **Lint and format.** `luacheck` (catches globals leaks, unused vars — essential in a\n   dynamic language), `stylua` for formatting. In CI, always.\n\nModule pattern:\n\n```lua\n-- order.lua\nlocal Order = {}\nOrder.__index = Order\n\nfunction Order.new(id, items)\n  assert(type(id) == \"string\", \"id must be a string\")\n  return setmetatable({ id = id, items = items or {} }, Order)\nend\n\nfunction Order:total()\n  local sum = 0\n  for _, item in ipairs(self.items) do\n    sum = sum + item.price * item.qty\n  end\n  return sum\nend\n\nreturn Order\n```\n\n## Common pitfalls\n\n- **0-based thinking.** `t[0]` is valid Lua — it's just not part of the sequence. Off-by-one bugs\n  from other languages' habits; `#t` and `ipairs` ignore index 0.\n- **Tables with holes.** Setting `t[3] = nil` in a 5-element sequence makes `#t` undefined —\n  iteration silently drops elements. Use `table.remove` or rebuild; never nil-out sequence middles.\n- **Global leaks.** Forgetting `local` creates a global — silent, far-reaching bugs. `luacheck`\n  with `globals` whitelisting catches this; strict mode (`setmetatable(_G, ...)`) in dev.\n- **Metatable magic without documentation.** `__index` chains three deep that nobody can trace.\n  Metatables should make call sites *clearer*; if they confuse, use plain functions.\n- **String patterns assumed to be regex.** Lua patterns aren't regex (`%d`, `%a`, no `|` alternation,\n  `-` is non-greedy). Read the pattern docs once; it saves hours.\n- **Floating-point as integer.** Pre-5.3 Lua has only doubles — `1\u002F2 == 0.5`, large integers lose\n  precision. Know your version's number model (5.3+ has true integers).\n- **Not handling host errors.** A Redis Lua script error aborts the script; a Neovim plugin error\n  breaks the editor loop. Wrap host entry points in `pcall` and define failure behavior.\n","# Lua Pro\n\n## Overview\n\nLua's genius — **one data structure (the table), first-class functions, and ruthless simplicity** —\nmakes it the premier embedding language (games, Redis, nginx\u002FOpenResty, Neovim, Wireshark). Professional\nLua means mastering tables deeply, using metatables judiciously, writing clean modules, and respecting\nthe 1-based, dynamically-typed reality instead of fighting it.\n\nThe through-line: small language, deep mastery — tables, closures, and coroutines cover nearly everything.\n\n## When to use\n\n- Writing or reviewing Lua for games, embedded scripting, or config (Neovim, AwesomeWM).\n- Designing Lua modules and APIs for host applications.\n- Using metatables, metamethods, and OOP-ish patterns in Lua.\n- Debugging table, scoping, or coroutine issues.\n- Embedding Lua in a C\u002FC++ host or extending Redis\u002Fnginx.\n\n## Core concepts\n\n- **Tables are everything.** Arrays (1-based!), dictionaries, objects, modules, namespaces — all\n  tables. Master the idioms: `t[#t+1] = v` (append), `ipairs` for sequences, `pairs` for maps,\n  and the critical distinction (a table with holes is not a sequence — `#` is undefined on it).\n- **Modules via return.** The modern pattern: a file builds a local table and `return`s it;\n  `require` caches by name. Avoid the old `module()` function and global pollution — locals and\n  explicit returns keep namespaces clean.\n- **Metatables: power with restraint.** `__index`\u002F`__newindex` for defaults, prototypes, and\n  read-only tables; `__call`, `__tostring`, arithmetic metamethods for DSLs. Prototype-based OOP\n  via `__index` chains works — but keep hierarchies shallow and document the magic.\n- **Closures over classes.** Lua's closures capture upvalues beautifully — factories returning\n  closures often beat metatable-OOP for encapsulation (true private state, no `self` bookkeeping).\n- **Coroutines for cooperative control flow.** `coroutine.create`\u002F`resume`\u002F`yield` — perfect for\n  iterators, state machines, and game scripting (cutscenes, AI sequences). They're stackful and\n  cheap; don't fear them, but don't use them where a simple iterator suffices.\n- **Know the version.** Lua 5.1 (LuaJIT, Redis, nginx) vs 5.3\u002F5.4 (integers, `\u002F\u002F`, bitwise ops,\n  `\u003Cclose>` for to-be-closed variables). Write to your target's version — 5.1-isms and 5.4-isms\n  don't mix.\n\n## Practical workflow\n\n1. **Structure as modules.** One file per module, local table, `return` at end; `require` for\n   deps. Keep the global namespace clean (`_G` pollution is the original Lua sin).\n2. **Be explicit about types at boundaries.** Dynamic typing means validation at API edges:\n   `assert(type(x) == \"table\")` with messages in dev; graceful errors for host-provided data.\n3. **Use the stdlib fully.** `string` (patterns — not regex! learn the pattern language),\n   `table` (`insert`, `remove`, `sort`, `concat`, `pack`\u002F`unpack`), `math`, `os`, `io`.\n   `table.concat` beats loop-concatenation for building strings.\n4. **Handle errors with pcall\u002Fxpcall.** Protected calls at host boundaries; `error()` with\n   informative messages (include context!); don't let Lua errors crash the host silently —\n   decide the policy per embedding.\n5. **Test where it matters.** `busted` for unit tests; test pure logic heavily (it's easy to\n   isolate); integration-test against the real host (Redis scripts against Redis, game logic in\n   the engine harness).\n6. **Lint and format.** `luacheck` (catches globals leaks, unused vars — essential in a\n   dynamic language), `stylua` for formatting. In CI, always.\n\nModule pattern:\n\n```lua\n-- order.lua\nlocal Order = {}\nOrder.__index = Order\n\nfunction Order.new(id, items)\n  assert(type(id) == \"string\", \"id must be a string\")\n  return setmetatable({ id = id, items = items or {} }, Order)\nend\n\nfunction Order:total()\n  local sum = 0\n  for _, item in ipairs(self.items) do\n    sum = sum + item.price * item.qty\n  end\n  return sum\nend\n\nreturn Order\n```\n\n## Common pitfalls\n\n- **0-based thinking.** `t[0]` is valid Lua — it's just not part of the sequence. Off-by-one bugs\n  from other languages' habits; `#t` and `ipairs` ignore index 0.\n- **Tables with holes.** Setting `t[3] = nil` in a 5-element sequence makes `#t` undefined —\n  iteration silently drops elements. Use `table.remove` or rebuild; never nil-out sequence middles.\n- **Global leaks.** Forgetting `local` creates a global — silent, far-reaching bugs. `luacheck`\n  with `globals` whitelisting catches this; strict mode (`setmetatable(_G, ...)`) in dev.\n- **Metatable magic without documentation.** `__index` chains three deep that nobody can trace.\n  Metatables should make call sites *clearer*; if they confuse, use plain functions.\n- **String patterns assumed to be regex.** Lua patterns aren't regex (`%d`, `%a`, no `|` alternation,\n  `-` is non-greedy). Read the pattern docs once; it saves hours.\n- **Floating-point as integer.** Pre-5.3 Lua has only doubles — `1\u002F2 == 0.5`, large integers lose\n  precision. Know your version's number model (5.3+ has true integers).\n- **Not handling host errors.** A Redis Lua script error aborts the script; a Neovim plugin error\n  breaks the editor loop. Wrap host entry points in `pcall` and define failure behavior.\n",{},"main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-lua-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":7,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill ams-lua-pro",{"tool":37,"command":38},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill ams-lua-pro",{"tool":40,"command":41},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill ams-lua-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-lua-pro\u002FSKILL.md",true,[],[46,53,61,68,75,82],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":18},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":57,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":18},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":18},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":18},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":18},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]