Token导航 LogoToken导航TokenDH.com
前端设计执行命令github未标认证来源可访问许可证需确认审计通过

lua-projectslua 项目

Agent Skill

lua-projects 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

272

周安装

11

GitHub Stars

公开资料未说明

下载量

85
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:lua-projects(lua 项目)
来源仓库:https://github.com/kaynetik/skills
仓库路径:skills/lua-projects
安装命令:
npx skills add https://github.com/kaynetik/skills --skill lua-projects
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kaynetik/skills --skill lua-projects

简介

lua-projects 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在开发协作场景中整理代码变更事项。

  • 适用于围绕仓库状态、分支管理和团队协作流程进行信息梳理和任务跟进。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装,需确认权限范围和是否触发命令执行或文件访问。
  • 建议在使用前核实仓库活跃度和技能的实际覆盖范围,避免误用或越权操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Lua Projects

Scope: Lua 5.4 (with LuaJIT notes where relevant). Targets config-driven projects like Neovim distributions, SketchyBar setups, and general Lua modules.

Style and Formatting

Naming

  • snake_case for variables, functions, and file names
  • PascalCase only for class-like constructor tables (rare)
  • UPPER_SNAKE for true constants
  • Prefix unused variables with _ (e.g., for _, v in ipairs(t))

Indentation and Layout

  • Use 2 spaces (common in Neovim/LazyVim ecosystem) or tabs (SketchyBar default) -- be consistent within a project
  • Wrap lines at 100 characters; hard limit 120
  • Trailing commas in multi-line tables are encouraged
  • No spaces inside {}, (), or []; spaces after commas and around operators

Formatter: StyLua

StyLua (v2.4+) is the standard Lua formatter. Configure via stylua.toml at the project root:

column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferDouble"

For SketchyBar configs using tabs:

indent_type = "Tabs"

Run: stylua. or integrate as a pre-commit hook / editor format-on-save.

Linting

Selene (recommended)

Modern Lua linter written in Rust. Actively maintained (v0.30+). Provides rich diagnostics with named lint rules.

Config file selene.toml:

std = "lua54"

For Neovim configs, use the vim standard library definition so globals like vim are recognized:

std = "lua54+vim"

Run: selene.

Luacheck (legacy)

Still detects some things Selene does not (uninitialized vars, unreachable code), but has been unmaintained since 2018. Use as a secondary pass if needed.

Config file .luacheckrc:

std = "lua54"
globals = { "vim" }

Language Server: LuaLS

lua-language-server (LuaLS) provides diagnostics, completion, hover, and type checking.

Settings file .luarc.json at project root:

{
  "runtime": { "version": "Lua 5.4" },
  "diagnostics": { "globals": ["vim"] },
  "workspace": {
    "library": [],
    "checkThirdParty": false
  }
}

For SketchyBar projects, add the SbarLua install path to workspace.library so LuaLS resolves the sketchybar module:

"workspace": {
  "library": ["~/.local/share/sketchybar_lua"]
}

Type Annotations

LuaLS supports EmmyLua-style annotations. Use them for public API surfaces:

---@param name string
---@param opts? { padding?: number, icon?: string }
---@return table item
local function add_item(name, opts)
  -- ...
end

Module Patterns

The Return-Table Pattern

Every module file should return a table (or a single value). Avoid polluting globals.

local M = {}

function M.greet(name)
  return "hello " .. name
end

return M

Init Modules

A directory with an init.lua is requireable by its directory name. Use init.lua to re-export or orchestrate sub-modules:

items/
  init.lua      -- require("items") loads this
  apple.lua
  calendar.lua
-- items/init.lua
require("items.apple")
require("items.calendar")

Avoid Globals

-- BAD: implicit global
sbar = require("sketchybar")

-- GOOD: local binding (use upvalues or pass explicitly)
local sbar = require("sketchybar")

Exception: SketchyBar's example config sets sbar as a global in init.lua because sub-modules reference it without an explicit require path. If following that convention, document it clearly and configure your linter to allow it:

# selene.toml
[lints]
global_usage = "allow"

Project Structure Patterns

Neovim Config (LazyVim / lazy.nvim)

~/.config/nvim/
  init.lua                -- minimal bootstrap: vim.loader.enable(), require("config.lazy")
  lua/
    config/
      lazy.lua            -- lazy.nvim bootstrap and setup
      options.lua
      keymaps.lua
      autocmds.lua
    plugins/
      lsp.lua
      treesitter.lua
      ui.lua
      editor.lua

Key conventions:

  • init.lua stays minimal -- call vim.loader.enable() then require config
  • One plugin spec per file (or group related specs) in lua/plugins/
  • lazy.nvim auto-loads everything in lua/plugins/
  • Use opts table merging over config functions when possible

Plugin spec pattern:

return {
  "author/plugin.nvim",
  event = "VeryLazy",
  dependencies = { "nvim-lua/plenary.nvim" },
  opts = {
    setting = true,
  },
  keys = {
    { "<leader>x", "<cmd>PluginAction<cr>", desc = "Do thing" },
  },
}

SketchyBar Config (SbarLua)

~/.config/sketchybar/
  sketchybarrc              -- shell entry: sketchybar --config init.lua (or similar)
  init.lua                  -- requires sbar, wraps in begin_config/end_config, runs event_loop
  bar.lua                   -- bar-level properties
  default.lua               -- default item properties
  colors.lua                -- color palette table
  icons.lua                 -- icon constants (SF Symbols / Nerd Font)
  settings.lua              -- shared settings (paddings, fonts)
  items/
    init.lua                -- requires each item module
    spaces.lua
    front_app.lua
    media.lua
    ...
  helpers/
    init.lua
    app_icons.lua
    default_font.lua
    event_providers/        -- native helpers (C compiled)

Key conventions:

  • Wrap all setup between sbar.begin_config() / sbar.end_config() for batching
  • Always call sbar.event_loop() at the end of init.lua
  • Use sbar.exec() instead of os.execute() to avoid blocking the event handler
  • Properties use sub-tables instead of dot notation: icon = {y_offset = 10} not icon.y_offset
  • Color values are 0xAARRGGBB hex integers
  • Keep color/icon/settings as pure data modules that return a table

Common Patterns

Safe Require

local ok, mod = pcall(require, "optional_module")
if not ok then
  return
end

Metatables for OOP-ish Tables

local Item = {}
Item.__index = Item

function Item.new(name)
  return setmetatable({ name = name }, Item)
end

function Item:display()
  return self.name
end

Config Merging

local defaults = { padding = 4, color = 0xffffffff }

local function apply(user_opts)
  local cfg = {}
  for k, v in pairs(defaults) do cfg[k] = v end
  for k, v in pairs(user_opts or {}) do cfg[k] = v end
  return cfg
end

For deep merging in Neovim: vim.tbl_deep_extend("force", defaults, user_opts).

Testing

Busted

The standard Lua test framework. Install via luarocks:

luarocks install busted
-- spec/greet_spec.lua
describe("greet", function()
  local mod = require("mymod")

  it("returns greeting", function()
    assert.are.equal("hello world", mod.greet("world"))
  end)

  it("handles nil", function()
    assert.has_error(function() mod.greet(nil) end)
  end)
end)

Run: busted or busted spec/

Neovim Plugin Testing

Use plenary.nvim's test harness for Neovim-specific tests:

nvim --headless -c "PlenaryBustedDirectory tests/ {minimal_init = 'tests/init.lua'}"

Performance Notes

  • local lookups are register-based; global lookups go through _ENV hash. Always localize hot-path references.
  • Pre-size tables with known lengths: local t = table.create and table.create(n) or {}
  • String concatenation in loops: accumulate in a table and table.concat() at the end
  • Prefer ipairs over pairs when iterating sequential arrays (faster and order-guaranteed)
  • In LuaJIT (Neovim): avoid NYI (Not Yet Implemented) operations in tight loops -- check https://wiki.luajit.org/NYI

Lua 5.4 Specifics

Features available in 5.4 that older references may not cover:

  • Integer subtype: integers and floats are distinct; type(1) is "number" but math.type(1) is "integer"
  • Bitwise operators: &, |, ~ (xor), ~ (unary not), <<, >> -- no need for bit32 or bit libraries
  • Integer for-loop: for i = 1, n uses native integers
  • Generational GC: collectgarbage("generational") for lower-latency collection
  • <const> and <close>: local attributes for immutability and deterministic cleanup
local path <const> = "/tmp/data"
local f <close> = io.open(path, "r")

Note: Neovim uses LuaJIT (Lua 5.1 compatible), so 5.4 features are not available in Neovim configs. Use 5.4 features only in standalone Lua or SketchyBar (if built against Lua 5.4).

Debugging

  • print(vim.inspect(t)) in Neovim for table inspection
  • print(require("inspect")(t)) in standalone Lua (install via luarocks)
  • SketchyBar logs to ~/.local/share/sketchybar/ -- check there for Lua errors
  • LuaLS diagnostics surface most type/require errors before runtime

Tooling Summary

ToolPurposeConfig FileInstall
StyLuaFormatterstylua.tomlcargo install stylua or npm
SeleneLinterselene.tomlcargo install selene
LuaLSLanguage server.luarc.jsonvia Mason or package manager
BustedTest framework.bustedluarocks install busted
LuarocksPackage manager*.rockspecsystem package manager

Reference Projects

ProjectURLFocus
LazyVimhttps://github.com/LazyVim/LazyVimNeovim distribution, plugin orchestration
lazy.nvimhttps://github.com/folke/lazy.nvimPlugin manager, spec system
SbarLuahttps://github.com/FelixKratz/SbarLuaSketchyBar Lua bindings
SketchyBarhttps://github.com/FelixKratz/SketchyBarmacOS bar, config examples
nvim-lspconfighttps://github.com/neovim/nvim-lspconfigLSP client configs
plenary.nvimhttps://github.com/nvim-lua/plenary.nvimNeovim Lua utilities and test harness
telescope.nvimhttps://github.com/nvim-telescope/telescope.nvimFuzzy finder, well-structured plugin

Additional Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.57%
按下载量换算32

Claude

31.08%
按下载量换算26

Cursor

19.91%
按下载量换算17

Gemini CLI

8.94%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/kaynetik/skills --skill lua-projects 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills