Development Guidelines
Development Guidelines
Local Checks
Run the Go test suite before pushing code changes:
go test ./...Build a local binary without VCS stamping when working from a git worktree:
go build -buildvcs=false -o ./.miu-db/miudb ./cmd/miudb./.miu-db/miudb version --output jsonValidate the Neovim plugin Lua files after editing ui/miu-db.nvim:
luac -p ui/miu-db.nvim/lua/miu_db/*.lua ui/miu-db.nvim/plugin/miu_db.luaCode Boundaries
cmd/miudbonly wires the CLI entry point.internal/cliowns command definitions, output envelopes, and exit behavior.internal/configowns native config, secret refs, redaction, and migration compatibility.internal/adapterandinternal/adapters/*own database-specific behavior.internal/tunnelowns SSH tunnel setup.internal/query,internal/result, andinternal/schemaown execution, pagination, and inspection.ui/miu-db.nvimis a client and should not import adapter internals.
Secrets
Never log or serialize raw credentials. Use the redaction helpers in
internal/config for CLI errors, connection output, and diagnostics. New
connections should store sensitive fields through SecretRef providers instead
of writing passwords inline.
Output Contract
Agent-facing commands should keep data on stdout and diagnostics on stderr.
JSON output should keep the envelope shape documented in
CLI Contract, including stable kind, command,
request_id, summary, data, warnings, and structured errors.