Agent skill

Agentic Lua Class

by carlos-algms in carlos-algms/agentic.nvim

MANDATORY before writing or editing ANY .lua file in this repo - classes, methods, fields, functions, or LuaCATS annotations.

MITAuto-check passed

Install Agentic Lua Class

skills CLI
$ npx skills add carlos-algms/agentic.nvim --skill agentic-lua-class -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install carlos-algms/agentic.nvim agentic-lua-class --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/carlos-algms/agentic.nvim.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/agentic-lua-class .claude/skills/agentic-lua-class && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
agentic-lua-class
GitHub stars
640
Token cost
~2k tokens
SKILL.md length
591 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

MANDATORY before writing or editing ANY .lua file in this repo - classes, methods, fields, functions, or LuaCATS annotations.

  • SKILL.md covers Inheritance Pattern, Class Design Guidelines:…, LuaCATS annotation syntax and Appending to typed arrays
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Agentic Lua Class is an agent skill from carlos-algms/agentic.nvim. MANDATORY before writing or editing ANY .lua file in this repo - classes, methods, fields, functions, or LuaCATS annotations. Holds the project's enforced Lua style: class pattern, visibility prefixes (private, protected), and optional-type syntax. Skipping it produces luals/selene failures at make validate. Load it before the first edit, not after.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with Lua. The repository describes itself as: Agentic Chat Interface directly in Neovim with ACP providers from Claude-Code, Gemini, Codex, OpenCode, and Cursor-agent. The licence is MIT.

Example prompts

  • “/agentic-lua-class”

What it can do on your machine

Read from SKILL.md and the folder at commit e280dee. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are lua).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Agentic Lua Class loads about 2k tokens when it runs. Until then it costs about 93 tokens; SKILL.md has 591 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~93
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from carlos-algms/agentic.nvim at commit e280dee, republished under its MIT licence (© carlos-algms). 591 words, ~2,002 tokens.

Download SKILL.mdSave it as .claude/skills/agentic-lua-class/SKILL.md (or your agent's skills folder).
name
agentic-lua-class
description
MANDATORY before writing or editing ANY .lua file in this repo - classes, methods, fields, functions, or LuaCATS annotations. Holds the project's enforced Lua style: class pattern, visibility prefixes (_private, __protected), and optional-type syntax. Skipping it produces luals/selene failures at make validate. Load it before the first edit, not after.

Lua Class Pattern

Basic class structure:

lua
--- @class Animal
local Animal = {}
Animal.__index = Animal

function Animal:new()
    self = setmetatable({}, self)
    return self
end

function Animal:move()
    print("Animal moves")
end

Key points:

  • Set __index to self for inheritance
  • Use setmetatable to create instances
  • Return the instance from constructor

Method definition syntax:

  • function Class:method() - Instance method, receives self implicitly

    • Called as: instance:method() or instance.method(instance)
    • Use for methods that need access to instance state
  • function Class.method() - Module function, static, does NOT receive self

    • Called as: Class.method() or instance.method() (both work, but no self)
    • Use for utility functions, constructors, or static helpers

Inheritance Pattern

Class setup (module-level):

lua
local Parent = {}
Parent.__index = Parent

--- @class Child : Parent
local Child = setmetatable({}, { __index = Parent })
Child.__index = Child

Constructor with parent initialization:

lua
function Parent:new(name)
    local instance = {
        name = name,
        parent_state = {}
    }
    return setmetatable(instance, self)
end

function Child:new(name, extra)
    -- Call parent constructor with Parent class
    local instance = Parent.new(Parent, name)

    -- Add child-specific state
    instance.child_state = extra

    -- Re-metatable to child class for proper inheritance chain
    return setmetatable(instance, Child)
end

Critical rules:

  • Always pass parent class explicitly: Parent.new(Parent, ...) not Parent.new(self, ...)
  • Re-assign metatable to child class after parent initialization
  • Inheritance chain: instance → Child → Parent

Calling parent methods:

lua
function Child:move()
    Parent.move(self)  -- Explicit parent method call
    print("Child-specific movement")
end

Class Design Guidelines: creating and modifying

  • Minimize class properties - Only include properties that:

    • Are accessed by external code (other modules/classes)
    • Are part of the public API
    • Need to be accessed by subclasses
  • Use visibility prefixes for encapsulation - Control what external code can access:

    Visibility levels (configured in .luarc.json):

    • _*: Private - Hidden from external consumers (applies to class methods/fields ONLY)
    • __*: Protected - Visible to subclasses
    • No prefix: Public - Visible everywhere

    IMPORTANT: Module-level local functions and variables do NOT need _ prefix:

    • ✅ local function helper() - correct (already private by local scope)
    • ❌ local function _helper() - incorrect (redundant _ prefix)
    • ✅ local config = {} - correct
    • ❌ local _config = {} - incorrect (redundant _ prefix)
    • ✅ function MyClass:_private_method() - correct (class method needs _)
    • ✅ @field _private_field - correct (class field needs _)
    lua
    -- ❌ Bad: Unnecessary public exposure of `counter` property, not used externally
    --- @class MyClass
    --- @field counter number
    local MyClass = {}
    MyClass.__index = MyClass
    
    function MyClass:new()
        return setmetatable({ counter = 0 }, self)
    end
    
    -- ✅ Good: Proper visibility control
    --- @class MyClass
    local MyClass = {}
    MyClass.__index = MyClass
    
    function MyClass:new()
        return setmetatable({
          -- Counter is internal state, not exposed publicly
          _counter = 0
        }, self)
    end
    
    --- @protected
    function MyClass:__protected_method()
        self._counter = self._counter + 1
    end
    
    --- Module-level helper functions (no underscore prefix needed)
    local function format_value(val)
        return tostring(val)
    end
    
    --- @class Child : MyClass
    function Child:use_parent_state()
        self:__protected_method()
    end

    Note: The @private annotation is NOT necessary for private class methods

    • LuaLS infers privacy from the _ prefix automatically
    • Only use @protected for protected methods (__*, luals limitation)
  • Document intent with LuaCATS - Use visibility annotations:

    lua
    --- @class MyClass
    --- @field public_field string Public API
    --- @field __protected_field table For subclasses
    --- @field _private_field number Internal only
  • Regular cleanup - When adding new code, review class definitions and remove:

    • Unused properties
    • Properties that were needed during development but are no longer used
    • Properties that could be local variables instead

LuaCATS annotation syntax

Space after --- for descriptions and annotations. Do NOT write param/return descriptions unless requested. Group related annotations together.

Show full SKILL.md (285 more words)Show less
Return format

@return {type} return_name description (type first, then name).

  • RIGHT: @return boolean success Whether the operation succeeded
  • WRONG: @return boolean Whether the operation succeeded (missing name)
  • WRONG: @return success boolean (wrong order)
Optional types

Format depends on annotation type. See LuaLS issue #2385 for the underlying validator limitation.

@param and fun() - MUST use type|nil:

  • RIGHT: @param winid number|nil
  • RIGHT: @param callback fun(result: table|nil)
  • WRONG: @param winid? number (LuaLS does not validate optional syntax)
  • WRONG: fun(result?: table) (optional syntax ignored)

@field - Use variable? type:

  • RIGHT: @field _state? string
  • RIGHT: @field diff? { all?: boolean } (inline tables also use ?)
  • WRONG: @field _state string|nil (use ? here instead)
  • WRONG: @field _state string? (? goes after variable name, not type)

For a partial variant of an existing class, use @class (partial) extending the source type instead of re-declaring every field as optional.

  • RIGHT: @class (partial) MyOptsOverride: MyOpts
  • WRONG: re-listing @field field? type for every field from MyOpts

@return, @type, @alias - Use explicit type|nil:

  • RIGHT: @return string|nil result, @type table<string, number|nil>, @alias MyType string|nil
  • WRONG: trailing ? on the type (e.g. string?, number?)
Typed variables before return

LuaLS cannot infer types from inline returns of complex types. Use a typed intermediate variable:

lua
-- Bad: LuaLS cannot infer the return type
function M.create_block(lines)
    return {
        start_line = 1,
        end_line = #lines,
        content = lines,
    }
end

-- Good: Type annotation enables proper type checking
--- @return MyModule.Block block
function M.create_block(lines)
    --- @type MyModule.Block
    local block = {
        start_line = 1,
        end_line = #lines,
        content = lines,
    }
    return block
end

Appending to typed arrays

Use arr[#arr + 1] = value, not table.insert(arr, value), when arr has a LuaCATS element type (string[], agentic.acp.Content[], a typed field, etc.).

table.insert's second arg is variadic any, so LuaLS skips assign-type-mismatch (an Error in .luarc.json). The indexed-assignment form is type-checked against the element type and catches wrong-type appends and stale @return / @type annotations.

  • RIGHT: lines[#lines + 1] = value (flags a non-string pushed to string[])
  • WRONG: table.insert(lines, value) (push silently accepted)

table.insert stays fine for positional inserts (table.insert(t, i, v)) and untyped scratch tables where no element type is declared.

© carlos-algms, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/agentic-lua-class of carlos-algms/agentic.nvim.

Open the folder on GitHubat commit e280dee

Compare with similar skills

Agentic Lua Class next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Agentic Lua Class compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Agentic Lua Class this skillcarlos-algms/agentic.nvim640—~2kAutomated safety check: PassMIT
Pandoc DOCX TemplateAchuan-2/pandoc_docx_template1.1k—~1kAutomated safety check: PassNone
Add Lua Binding Simplecataclysmbn/Cataclysm-BN1.3k—~846Automated safety check: PassCustom licence
Cpp Compiler FlagsSerial-Studio/Serial-Studio7.2k—~2.1kAutomated safety check: PassCustom licence
Luamakeactboy168/luamake210—~2kAutomated safety check: PassMIT
Lua Ecozhaojh329/lua-eco103—~1.7kAutomated safety check: PassMIT

Similar skills

  • Pandoc DOCX Template

    Achuan-2/pandoc_docx_template

    A skill your agent uses when converting Markdown to Word DOCX or DOCX back to Markdown with Pandoc, especially when the output should use the bundled Chinese Word reference templates, heading…

    1.1k GitHub stars~1k tokensUpdated 3 mo ago
    Documents & OfficeAuto-check passed
  • Add Lua Binding Simple

    cataclysmbn/Cataclysm-BN

    Add simple Cataclysm-BN Lua bindings for stringid types, enums, and basic read-only C++ types.

    1.3k GitHub stars~846 tokensUpdated today
    Auto-check passed
  • Cpp Compiler Flags

    Serial-Studio/Serial-Studio

    C++ compiler/linker flag guidance for Serial Studio's build (GCC, Clang, AppleClang, MSVC cl.exe, clang-cl, MinGW, IntelLLVM).

    7.2k GitHub stars~2.1k tokensUpdated today
    DevelopmentAuto-check passed
  • Luamake

    actboy168/luamake

    Luamake 构建系统指南——用于当前项目的 luamake / make.lua / Ninja 生成流程。当用户需要编写、修改、排查或理解 make.lua、目标定义、lm:conf、deps / objdeps、代码生成、Lua C 模块、Bee 运行时集成,或需要解决当前项目中由 luamake 驱动的构建问题时,使用此 skill。即使用户没有明确提到…

    210 GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed
  • Lua Eco

    zhaojh329/lua-eco

    International lua-eco public API skill for writing, reviewing, explaining, and fixing Lua 5.4 code that runs on the eco runtime.

    103 GitHub stars~1.7k tokensUpdated 8 days ago
    Backend & APIsAuto-check passed
  • Ss Cpp Modern

    Serial-Studio/Serial-Studio

    Modern C++20 authoring guidance for Serial Studio (Qt 6.11, C++20): concepts, ranges, move/RAII, std smart pointers, constexpr, lock-free SPSC atomics.

    7.2k GitHub stars~1.6k tokensUpdated today
    DevelopmentAuto-check passed

More from carlos-algms/agentic.nvim

All 8 skills in this repo
  • Agentic GitHub Discussion

    carlos-algms/agentic.nvim

    A skill your agent uses when creating, listing, or managing GitHub discussions in carlos-algms/agentic.nvim repository

    640 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Agentic Acp Protocol Flow

    carlos-algms/agentic.nvim

    MANDATORY before editing ACPClient, ACPTransport, AgentInstance, ACP provider flow, tool-call parsing, permission requests, provider switch, reconnect, or ACP subprocess lifecycle in agentic.nvim.

    640 GitHub stars~636 tokensUpdated yesterday
    Auto-check passed
  • Agentic Testing

    carlos-algms/agentic.nvim

    MANDATORY before creating, editing, or reviewing tests in agentic.nvim, and before behavior changes that require TDD.

    640 GitHub stars~828 tokensUpdated yesterday
    Auto-check passed
  • Agentic Vimdoc

    carlos-algms/agentic.nvim

    A skill your agent uses when writing or updating agentic.nvim vimdoc (doc/agentic.txt), or after changing init.lua, configdefault.lua, theme.lua, or README install/keymaps - those edits require a…

    640 GitHub stars~298 tokensUpdated yesterday
    Auto-check passed
  • Agentic Acp Docs And Schema

    carlos-algms/agentic.nvim

    A skill your agent uses when ACP schema is necessary to clarify the work or when the user asks for ACP data, rules, events, or documentation

    640 GitHub stars~468 tokensUpdated yesterday
    Auto-check passed
  • Agentic UI Message Writer

    carlos-algms/agentic.nvim

    MANDATORY before editing MessageWriter, PermissionManager, tool-call block rendering, sender headers, thinking blocks, auto-scroll, folds, status rows, permission buttons, or chat-buffer tool-call…

    640 GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Agentic Lua Class

What does Agentic Lua Class do?

MANDATORY before writing or editing ANY .lua file in this repo - classes, methods, fields, functions, or LuaCATS annotations. nvim.lua file in this repo - classes, methods, fields, functions, or LuaCATS annotations.

How do I install Agentic Lua Class in Claude Code?

Run `npx skills add carlos-algms/agentic.nvim --skill agentic-lua-class -a claude-code`. Or copy the skill folder (.agents/skills/agentic-lua-class in carlos-algms/agentic.nvim) into .claude/skills/agentic-lua-class in your project. Claude Code loads it when a task matches its description.

How do I install Agentic Lua Class in Codex?

Run `npx skills add carlos-algms/agentic.nvim --skill agentic-lua-class -a codex`. Or copy the skill folder (.agents/skills/agentic-lua-class in carlos-algms/agentic.nvim) into .agents/skills/agentic-lua-class in your project. Codex loads it when a task matches its description.

Can I use Agentic Lua Class in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add carlos-algms/agentic.nvim --skill agentic-lua-class -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/agentic-lua-class, .gemini/skills/agentic-lua-class, .github/skills/agentic-lua-class and .opencode/skills/agentic-lua-class in your project.

What does Agentic Lua Class need to run?

SKILL.md names no scripts, command-line tools or credentials: Agentic Lua Class is instructions for the agent only.

Does Agentic Lua Class access the network?

SKILL.md names 1 domain. As links in the text: github.com. This is read from the text; nothing was executed.

Is Agentic Lua Class safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Agentic Lua Class use?

Agentic Lua Class is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Agentic Lua Class use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Agentic Lua Class?

Skills that share tags, products or a category with Agentic Lua Class: Pandoc DOCX Template (Achuan-2/pandoc_docx_template, 1.1k stars), Add Lua Binding Simple (cataclysmbn/Cataclysm-BN, 1.3k stars), Cpp Compiler Flags (Serial-Studio/Serial-Studio, 7.2k stars) and Luamake (actboy168/luamake, 210 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Agentic Lua Class?

carlos-algms (a GitHub user) maintains it in carlos-algms/agentic.nvim, which has 640 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 7, 2026.

Source: carlos-algms/agentic.nvim on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.