agentic-lua-class

Coding rules for Lua classes in agentic.nvim, including how to define classes, constructors, methods, inheritance, visibility markers, and LuaCATS type annotations. LuaCATS is Lua’s annotation format for editor and type-checking support.

In plain words
What is it for?
Use it before writing or editing any Lua class, method, field, function, or related type annotation in the repository.
Why use it?
It helps Lua changes match the repository’s required style and avoid validation errors from its language tools.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/carlos-algms/agentic.nvim/agentic-lua-class
Any agent
npx skills add carlos-algms/agentic.nvim --skill agentic-lua-class
Clone the repo
git clone --depth 1 https://github.com/carlos-algms/agentic.nvim

Made for: Claude Code, Codex.

Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,004 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00082 $0.02004
Opus 5 $0.00041 $0.01002
Sonnet 5 $0.00016 $0.00401
Haiku 4.5 $0.00008 $0.00200

Measured 2d ago against content hash 4bebf68a6773, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentic-lua-class scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/agentic-lua-class/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lua Class Pattern

Basic class structure:

--- @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):

local Parent = {}
Parent.__index = Parent

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

Constructor with parent initialization:

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:

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

Class Design Guidelines: creating and modifying

Read the full file on GitHub · 270 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 270 lines · 82 tokens per session scan A 4bebf68a6773

Subscribe to this mod's changes

agentic-lua-class is a skill published in the GitHub repository carlos-algms/agentic.nvim (609 stars, last pushed 10d ago), licensed MIT. It adds 82 tokens to every session and 2,004 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

add

Categorize new Neovim plugins and insert them into the correct markdown category files.

yutkat/my-neovim-pluginlist · 18 tokens

write-teach-commit

Draft teach: commit messages for .github/workflows/improve-add-skill.yml. Use when preparing or reviewing a correction commit that should trigger the Improve Add Skill workflow from $add categorization feedback, including moved plugin entries, removed or excluded plugins, changed .reason.md categories, or…

yutkat/my-neovim-pluginlist · 82 tokens

improve-add-skill

Improve the repo-local add skill from reviewed Neovim plugin categorization corrections. Use when a correction commit, PR review result, diff, or artifact such as a teach: commit shows that $add placed, excluded, or reasoned about plugins incorrectly and the reusable lesson should be folded back into…

yutkat/my-neovim-pluginlist · 75 tokens

git-branch-commit-pr

Automates the workflow of creating a feature branch, committing changes, and opening a PR. Use this when asked to create a branch, make changes, commit, and open a pull request for Lua code improvements or fixes.

juhaku/aiwaku.nvim · 51 tokens

source-drafting

Use when drafting documents, reports, posts, presentations, or review comments from source materials, or conducting research across provided documents. Enforces read-first drafting, a source map for every claim, agent verification, and separation of verified from unverified claims.

nicknisi/dotfiles · 54 tokens

github-pr-create

Create a pull request with an auto-generated description. Use when the user asks to open a PR for the current branch's changes.

aiya000/dotfiles · 30 tokens