/liv:liv-plugin-authoringfrom liv
Conventions for writing a liv plugin — one Lua source that runs on both Vim 9 (+lua) and Neovim. Use when creating or editing code in a liv-based plugin, deciding where a module belongs (liv.core/liv.std/liv.lua), or reviewing liv code for the framework's hard rules (own-the-contract naming, 1-based ranges, Lua 5.1 dialect, string-literal require, barrel/leaf splits).
Ships in liv. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
liv lets you write a single Lua source that runs on both Vim 9 (+lua) and
Neovim, where end users install only your plugin — every dependency is vendored
in by liv.bundler. Target the constrained side (Vim +lua, Lua 5.1); Neovim
(LuaJIT) is satisfied naturally.
Runtime (vendored into the consumer plugin):
liv.core — the seam. Owns value marshaling and the vimscript seam
(call/eval/cmd). The only place that marshals and the only caller of
vim.call/vim.eval/vim.command. Keep it minimal; never add per-feature APIs.liv.std — liv's own editor-dependent cross-editor API, named by purpose
(liv.std.buffer, liv.std.process, …). Degrades via liv.std.has.liv.lua — editor-independent pure Lua (liv.lua.compat, liv.lua.async,
liv.lua.path, …). Never touches the editor, not even liv.core.Dev tools (pure Lua, never vendored): liv.bundler, liv.tester,
liv.generator.
Placement: needs the editor to function → liv.std; pure computation →
liv.lua; raw editor primitive → liv.core (rare). Never flatten std and lua
behind one re-export — the namespace must keep advertising whether a module is
editor-dependent (can degrade) or pure (guaranteed).
nvim_*,
vim.api, extmark, vim.uv, vim.schedule, vim.keymap.set). "Similar but
different" breeds silent bugs. Use liv's own vocabulary. Domain words
(buffer/window/tabpage/option/autocmd) are fine — different behavior gets a
different name.0 or nil means current.{line, col}, 1-based.error() (pcall-able); async errors propagate through await._vim backend, never exposed.)goto/labels (5.2+), integer division // and bitwise
& | ~ << >> (5.3+), <close>/<const> (5.4), reliance on math.type /
integer subtypes. Use liv.lua.compat for bit ops, unpack,
package.loaders, removed stdlib fns. Detect integrality with n % 1 == 0.require must use a string literal. The bundler analyzes requires
statically. Declare dynamic deps and non-.lua companions (Vim 9 .vim, data
files) in a dependency manifest beside the module.liv.std area is
area/init.lua selecting _nvim or _vim ONCE (a factory
function(core) return {...} end). Never branch on is_nvim per call.vim.api.*, vim.uv, vim.json) over
a vimscript builtin when it differs observably — but cross editor values
through core.marshaled, never hand-rolled.The bundler closure is file-grained (follows literal requires, vendors whole
files, no per-function dead-code elimination). So the split between files is what
determines bundle size.
init.lua) MAY require its
leaves for a convenience/dispatch API. A leaf MUST NOT require its barrel —
that re-pulls the whole family. An internal consumer of one leaf requires THAT
leaf directly (e.g. liv.lua.png.decode requires liv.lua.zlib.inflate, not
liv.lua.zlib)._). _ is for
truly-internal shared helpers (liv.lua.png._crc).require
overhead, lost cohesion) is itself a cost.Write the failing test first. L1 (spec/, no editor, plain lua/busted) for
pure logic; L3 (test/, real Vim +lua AND Neovim, headless) for liv.core
and each backend. Inject liv.core (and async schedule) so tests can substitute
fakes; avoid global state. See the liv-tester skill.
Code → How, Tests → What, Commits → Why, Comments → Why not.
Normative specs live in the vim-liv repo under .claude/specs/:
0001-overview, 0002-principles, 0003-architecture, 0004-core,
0005-marshaling, 0006-std, 0007-async. Related skills: liv-library-api,
liv-bundler, liv-tester.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
4 skills in this plugin
/liv-bundlerHow to vendor liv (and other pure-Lua deps) into a consumer plugin with liv.bundler, so end users install only the plugin. Use when bundling/vendoring liv into a plugin, running :LivAdd/:LivUpdate/:LivCheck/:LivRemove or bin/liv-bundler, choosing a source resolver (rtp/git/path/luarock), understanding the lockfile/tree-shaking/migration-notices, or declaring dynamic deps and .vim companions in a manifest./liv-library-apiReference for the liv runtime API a plugin author consumes — liv.core (call/eval/cmd/marshaled/is_nvim + marshaling), the liv.std.* editor-dependent modules (buffer, window, process, task, fs, fetch, ui, option, variable, autocmd, mapping, keys, highlight, sign, text, log, has, …) and the liv.lua.* pure modules (compat, async, path, uri, argument, base64, hash, color, png/zlib/msgpack, …). Use when calling or looking up a liv API, choosing the right module, or checking capability/degradation./liv-testerHow to write and run cross-editor tests for a liv plugin with liv.tester — L1 (spec/, editor-free) vs L3 (test/, real Vim +lua AND Neovim, headless), describe/it/assert, selectors (name:/tag:, it.only/it.skip), reporters (spec/tap/jsonl/junit), and bin/liv-tester / :LivTest flags (--select, --failed, --seed, --watch, --jobs, --editor, --fail-fast/--max-failures). Use when writing test specs, running the suite, debugging failures, or filtering tests.npx claudepluginhub lambdalisue/vim-liv --plugin liv