Imported from C-Nucifora/nvim-stm32 (
AGENTS.md). Install upstream withnpx skills add C-Nucifora/nvim-stm32. Copyright stays with the author.
AGENTS.md for nvim-stm32
Guidance for coding agents working in this repository.
Purpose
Build, flash, erase, monitor, and debug STM32 projects from Neovim. Existing
plugins require manual project configuration. Automatic detection is the main
reason this plugin exists. docs/design.md contains the approved design.
Deliberate choices
- Detection starts from the current buffer, not the working directory. One repository can hold many firmware folders. The walk stops at the Git root so a parent marker cannot select the wrong project.
targets.luais data-driven. Add support for a family with a table entry. A family-specific code branch means the table shape needs work.- Backends expose a pure
cmd(). This keeps most behavior testable without a connected board. - Every build and debug child gets
toolchain_pathprepended to$PATH. Otherwise a configured compiler can disappear from child processes. - snacks is optional. The float presenter uses
snacks.winwhen available andnvim_open_winotherwise. - Confidence follows the source. Only a
.iocresult isexact. Theagreementcount records corroborating signals separately.
Known traps
STM32_Programmer_CLIis not normally on$PATH, and its installation path contains a version. Compare numeric version segments. Lexical sorting puts2.9.0above2.23.0.- CubeMX puts the device macro in
cmake/stm32cubemx/CMakeLists.txt. Compiler flags live in the toolchain file undercmake/, not the top-level CMake file. - Linker scripts use both
STM32F429xx_FLASH.ldandSTM32F429ZITX_FLASH.ldspellings. scripts/test.shstarts Neovim with--noplugin. Tests for anything underplugin/must load its shim explicitly.:checkhealthchanges the current buffer tohealth://before the plugin's check runs. Project detection there must use the previous buffer.
Build and test gate
scripts/test.sh
stylua --check lua/ tests/
Fixtures under tests/fixtures/ are trimmed copies of real CubeMX projects.
Use genuine inputs for detection tests. Headless tests cannot expose UI stalls,
so check user-facing flows in a normal Neovim session as well.
Releases
The release workflow reads VERSION on main and tags vX.Y.Z.