Thank you for your interest in contributing to Nexum! This document outlines the standards and expectations for contributions to ensure consistency and quality across the project.
If you are using any kind of AI assistance while contributing to Nexum (code generation, documentation writing, PR descriptions, review responses, etc.), this must be disclosed in the pull request.
This disclosure requirement applies to all forms of AI assistance including but not limited to:
- Code generation or completion beyond trivial tab-completion of single keywords
- Documentation or comment generation
- Pull request descriptions and commit messages
- Responses to review comments
Why we require disclosure:
-
Respect for reviewers: Transparency about AI assistance allows maintainers to apply appropriate levels of scrutiny and helps set expectations for the review process.
-
Code ownership: You must thoroughly understand any code you submit, regardless of how it was generated. Be prepared to explain and defend implementation choices during review.
-
Quality expectations: AI-generated code often requires significant rework. Pull requests that require substantial changes due to quality issues may be closed.
-
Link to an accepted issue: Pull requests should correspond to previously discussed and accepted issues or feature proposals. Unsolicited PRs may be closed or remain stale indefinitely.
-
Use Discussions for design: Pull requests are not the place to discuss feature design or architecture decisions. Use matrix rooms for brainstorming and design conversations. Once design is settled and an issue is marked as "accepted," implementation can begin.
-
Self-review thoroughly: Review your own changes before requesting review from others. Ensure your code:
- Compiles without warnings (
cargo clippymust pass) - Passes all existing tests
- Includes tests for new functionality
- Follows existing code patterns and style
- Has appropriate documentation
- Compiles without warnings (
Every pull request must include:
- Summary: Clear description of what changes and why
- Testing: How the changes were tested
- AI Assistance: If applicable, disclose what AI tools were used and for what purpose
- Related Issues: Link to the issue(s) being addressed
- Be responsive to review feedback
- Be prepared to explain and defend your implementation choices
- Understand that maintainers may request significant changes or close PRs that don't meet quality standards
- Lints: Code must pass
cargo clippy --all-targets --all-features --workspace -- -Dwarnings - Tests: All tests must pass via
cargo test --all-targets --all-features --workspace - Documentation: Public APIs must have doc comments
- Error handling: Use appropriate error types (avoid
.unwrap()in library code) - Workspace lints: Follow the workspace-level lints defined in
Cargo.toml:- Warn on missing debug implementations and documentation
- Deny unused must-use and rust-2018-idioms
- Follow clippy warnings for code quality
- Size optimization: WASM modules must be optimized for size (use
wasm-pack build --release) - Error handling: Errors must be properly handled and communicated across the JS boundary
- Testing: WASM code should include
wasm-bindgen-testtests where applicable
- Use clear, descriptive commit messages
- Follow the conventional commit format:
<type>: <description>- Types:
feat,fix,docs,refactor,test,chore, etc.
- Types:
- Reference issue numbers when applicable:
fix: resolve timeout issue (#42)
- New functionality must include unit tests
- Bug fixes should include regression tests
- Tests should be focused and test one thing
- Changes to the extension or RPC layer may require integration tests
- Test important user-facing workflows
# Run all tests
cargo test --all-targets --all-features --workspace
# Run tests for a specific package
cargo test -p nexum-rpc
# Run a specific test
cargo test test_name
# Run WASM tests (requires wasm-pack)
wasm-pack test --headless --firefox- Maintainers will review for correctness, code quality, and adherence to project standards
- Be open to feedback and willing to make changes
- Reviews may take time - be patient
- Not all PRs will be accepted, even if well-written
- Public APIs must have doc comments
- Complex algorithms or non-obvious code should have inline comments explaining the "why"
- Update relevant documentation in the repository when adding features
- Be respectful and professional in all interactions
- Follow the Matrix community guidelines
- Issues and PRs are for actionable items - use Discussions for open-ended questions
- Matrix: Join the Nexum Matrix space for real-time discussion
- Discussions: Use GitHub Discussions for design questions and feature proposals
- Issues: Report bugs or propose accepted features via GitHub Issues
- Rust toolchain (MSRV: 1.88)
wasm-pack- For building WASM modulestrunk- For building the browser UIjust- Task runner (optional but recommended)web-ext- For running the extension (optional)
# Build the extension (creates crates/nexum/extension/dist/)
just build-ext
# Run the extension with web-ext (auto-reload on changes)
just run-ext
# Package the extension for distribution
just pack-ext# Build the TUI
cargo build -p tui
# Run the TUI
cargo run -p tui
# Or run directly after building
./target/debug/tui# Build the RPC server
cargo build -p nexum-rpc
# Run with custom configuration
cargo run -p nexum-rpc -- --help# Build the keycard CLI
cargo build -p keycard-cli
# Run keycard commands
cargo run -p keycard-cli -- --help# Run clippy on all code
just clippy
# or: cargo clippy --all-targets --all-features --workspace -- -Dwarnings
# Run all tests
just test
# or: cargo test --all-targets --all-features --workspace
# Build everything
just build
# or: cargo build --all-targets --all-features --workspace
# Check WASM-specific code (extension components)
cargo check --target wasm32-unknown-unknown -p worker -p injected -p injector -p browser-uiSee CLAUDE.md and docs/ARCHITECTURE.md for detailed architecture documentation and guidance on navigating the codebase.