Contributing
Setup
git clone https://github.com/mbaneshi/nexus.git
cd nexus
cargo build
cargo test
Requirements:
- Rust 1.85+ (edition 2024)
- lefthook for git hooks (optional but recommended)
Development workflow
# Run tests
cargo test
# Lint (must pass with 0 warnings)
cargo clippy -- -D warnings
# Format
cargo fmt --all
# Check format without changing
cargo fmt --all --check
Code conventions
- All public functions must have doc comments
- Error handling:
thiserrorin library crates,color-eyrein the binary - Use
tracingfor logging, neverprintln!in library code - Database access only through
core::db— no raw SQL in binaries - All SQL queries use parameterized statements
- TUI: follow ratatui’s Widget trait pattern
- Frontend: use
pnpm, nevernpm
Architecture rules
corehas zero dependency on any other workspace crate- Feature crates depend on
coreonly, never on each other - Surfaces (CLI, TUI, server) compose feature crates
- Only 2 port traits:
LlmPortandConfigStorePort
Pull requests
- CI must pass (fmt, clippy, test, build)
- Keep PRs focused — one concern per PR
- Write tests for new functionality