lua/claudecode/: Core plugin modules (init.lua,config.lua,diff.lua,terminal/,server/,tools/,logger.lua, etc.).plugin/: Lightweight loader that guards startup and optional auto-setup.tests/: Busted test suite (unit/,integration/,helpers/,mocks/).fixtures/: Minimal Neovim configs for manual and integration testing.scripts/: Development helpers;dev-config.luaaids local testing.
make check: Syntax checks +luacheckonlua/andtests/.make format: Format with StyLua (via Nixnix fmtin this repo).make test: Run Busted tests with coverage (outputsluacov.stats.out).make clean: Remove coverage artifacts. Examples:- Run all tests:
make test - Run one file:
busted -v tests/unit/terminal_spec.lua
- Lua: 2‑space indent, 120‑column width, double quotes preferred.
- Formatting: StyLua configured in
.stylua.toml(require-sort enabled). - Linting:
luacheckwith settings in.luacheckrc(usesluajit+bustedstd). - Modules/files: lower_snake_case; return a module table
Mwith documented functions (EmmyLua annotations encouraged). - Avoid one-letter names; prefer explicit, testable functions.
- Frameworks: Busted + Luassert; Plenary used where Neovim APIs are needed.
- File naming:
*_spec.luaor*_test.luaundertests/unitortests/integration. - Mocks/helpers: place in
tests/mocksandtests/helpers; prefer pure‑Lua mocks. - Coverage: keep high signal; exercise server, tools, diff, and terminal paths.
- Quick tip: prefer
make test(it setsLUA_PATHand coverage flags).
- Commits: Use Conventional Commits (e.g.,
feat:,fix:,docs:,test:,chore:). Keep messages imperative and scoped. - PRs: include a clear description, linked issues, repro steps, and tests. Update docs (
README.md,ARCHITECTURE.md, orDEVELOPMENT.md) when behavior changes. - Pre-flight: run
make format,make check, andmake test. Attach screenshots or terminal recordings for UX-visible changes (diff flows, terminal behavior).
- Do not commit secrets or local paths; prefer environment variables. The plugin honors
CLAUDE_CONFIG_DIRfor lock files. - Local CLI paths (e.g.,
opts.terminal_cmd) should be configured in user config, not hardcoded in repo files.