Back to catalog
Agent Skill — SKILL.md
neovim-plugin-development
Develop, test, and release Neovim Lua plugins. Use when building a new Neovim plugin, adding features to an existing plugin, setting up CI with GitHub Actions, writing plenary tests, generating documentation, or configuring release automation — not for editing user-level Neovim config.
Compatibility
Agent Skills-compatible coding agents.SKILL.md
Neovim plugin development
Use this skill when developing, testing, or releasing a Neovim Lua plugin. It covers plugin structure, Lua module conventions, testing with plenary.nvim, CI with GitHub Actions, documentation with doc/ files, and release automation.
Use this skill when
- Creating a new Neovim plugin from scratch.
- Adding a feature, command, or keymap to an existing Neovim plugin.
- Writing or debugging tests for a Neovim plugin using plenary.nvim.
- Setting up CI for a Neovim plugin (linting with selene/stylua, testing with plenary, release automation).
- Generating or updating plugin documentation (
doc/<plugin>.txt). - Configuring release automation for a Neovim plugin (tags, changelogs, lazy.nvim compatibility).
- Debugging a runtime error in a Neovim plugin (Lua module loading, autocommands, user commands).
Do not use this skill when
- Editing or debugging a user's Neovim configuration (
init.lua,lazy.nvimplugin specs, LSP wiring) — useneovim-config. - The task is general Lua scripting outside the Neovim plugin API.
- The plugin fails to load but the issue is config-side (wrong checkout, lazy.nvim spec, XDG paths) — use
neovim-config. - The main task is writing a README or documentation for a non-Neovim project — use
doc-coauthoring.
Routing boundary
| Situation | Use this skill? | Route instead |
|---|---|---|
| New Neovim plugin, starting from scratch | Yes | — |
Adding a :MyCommand user command to an existing plugin |
Yes | — |
| Writing plenary tests for a plugin's Lua module | Yes | — |
| Setting up CI with selene, stylua, and plenary for a plugin repo | Yes | — |
Fixing init.lua config — LSP, keymaps, colorscheme, lazy.nvim specs |
No | neovim-config |
Debugging why lazy.nvim loads the wrong plugin version |
No | neovim-config |
Inputs to gather
Required before editing
- The plugin name and repository path.
- Whether the plugin uses
lua/<plugin>/init.luaorlua/<plugin>.luaentry point. - The existing test framework (plenary.nvim) and CI configuration.
Helpful if present
- The existing
Makefiletargets for lint, test, and doc generation. - The plugin's current release process (tags, changelogs, lazy.nvim compatibility).
- Any existing
doc/<plugin>.txtfile.
Only investigate if encountered
- Whether the plugin should use
vim.api.nvim_create_autocmdvsvim.cmd("autocmd ..."). - Whether the plugin needs
vim.treesitterintegration. - Whether the plugin should register with
lazy.nvim's lazy-loading hints.
First move
- If the plugin does not exist yet, scaffold the canonical structure:
lua/<name>/init.lua,plugin/,doc/,Makefile. - If the plugin exists, identify the entry point and the specific feature or fix being made.
- Check whether tests exist and CI is configured before adding new infrastructure.
Workflow
- Scaffold or locate structure — Use
lua/<plugin>/init.luaas the entry point, optionalplugin/autoload,doc/,tests/, and CI under.github/workflows/. Readreferences/plugin-structure.mdfor the full tree, entry-point and registration patterns. - Configuration defaults — Merge user opts with
vim.tbl_deep_extend("force", ...), keep defaults onM.config, makesetup()idempotent. Details and examples inreferences/plugin-structure.md. - Tests (plenary.nvim) — Add behavior-focused
*_spec.luaundertests/, run viamake testwith aminimal_init.luathat does not load the user's full config. Spec and Makefile patterns inreferences/plugin-structure.md. - CI — Lint with selene + stylua; test on stable and nightly Neovim with plenary checked out as a sibling. Workflow shapes in
references/plugin-structure.md. - Documentation — Maintain
doc/<plugin>.txtvimdoc; optionally generate HTML or convert from markdown with panvimdoc/lemmy-help. Templates inreferences/plugin-structure.md. - Release — Tag
v*releases via GitHub Actions; keeplua/anddoc/at repo root for lazy.nvim compatibility. Release workflow inreferences/plugin-structure.md.
Outputs
- A Neovim Lua plugin with the canonical
lua/,doc/, andtests/structure. - User commands and keymaps registered via the Neovim API.
- plenary.nvim tests covering each feature module.
- CI workflows for linting (selene + stylua) and testing (stable + nightly).
- Vimdoc help file in
doc/<plugin>.txt.
Guardrails
- Must use
vim.api.nvim_create_user_commandandvim.keymap.setovervim.cmdstrings. - Must provide sensible defaults for every configurable option.
- Must make
setup()idempotent — safe to call multiple times. - Must not load the user's full Neovim config during tests; use
minimal_init.lua. - Should keep each feature in its own
lua/<plugin>/<feature>.luamodule. - Should test behavior, not internal implementation details.
- Should run CI on both
stableandnightlyNeovim. - May use
vim.treesitterAPIs when the plugin works with syntax trees.
Validation
- Run
make lint(selene + stylua) and confirm no issues. - Run
make testand confirm all plenary tests pass. - Open Neovim, run
:help <plugin>and confirm the docs render correctly. - Open Neovim, run
:lua require("<plugin>").setup()and confirm no errors. - Smoke test:
- should trigger: "Create a new Neovim plugin called
trailblazer.nvimthat adds a:Trailcommand." - should trigger: "Add a
highlightoption and test to my Neovim plugin." - should trigger: "Set up CI with selene, stylua, and plenary for this Neovim plugin repo."
- should not trigger: "Fix the LSP configuration in my
init.lua." (→neovim-config) - should not trigger: "Why does lazy.nvim load the wrong version of this plugin?" (→
neovim-config)
- should trigger: "Create a new Neovim plugin called
Examples
- "Scaffold a new Neovim plugin called
glimpse.nvimthat previews file contents in a floating window." - "Add a
:Glimpsecommand and<leader>gpkeymap with plenary tests." - "Set up GitHub Actions CI with selene linting and plenary tests on stable and nightly Neovim."
Reference files
references/plugin-structure.md— plugin layout, config defaults, plenary tests, CI workflows, vimdoc, and release automation../neovim-config/SKILL.md— Adjacent skill for editing user-level Neovim configuration (init.lua, lazy.nvim specs, LSP wiring).