# Contributing

> Set up a development build, run the same checks as CI, and send a pull request that lands cleanly.

RaptorCode is open source under MIT OR Apache-2.0, and contributions are welcome: bug reports, fixes, documentation, tests and features that fit the [roadmap](https://github.com/RaptorLabsHQ/raptorcode/blob/main/ROADMAP.md).

- [Repository](https://github.com/RaptorLabsHQ/raptorcode): Source, issues and pull requests.
- [Discussions](https://github.com/RaptorLabsHQ/raptorcode/discussions): Questions, ideas and show and tell.
- [Contributing guide](https://github.com/RaptorLabsHQ/raptorcode/blob/main/CONTRIBUTING.md): The full guide in the repository.

## Before you start

- Search the issues first. For anything larger than a small fix, open an issue or start a thread in [Ideas](https://github.com/RaptorLabsHQ/raptorcode/discussions/categories/ideas) so the approach can be agreed before you invest time.
- Good first areas: packaging (Homebrew, AUR, Nix, Scoop, winget), provider implementations behind the existing `Provider` trait, polish for the terminal UI, and documentation.

## Development setup

You need Git and Rust 1.88 or newer. The repository pins its toolchain in `rust-toolchain.toml`, which rustup picks up automatically.

```bash
git clone https://github.com/RaptorLabsHQ/raptorcode.git
cd raptorcode
cargo build --workspace
cargo run -p raptor-cli --bin raptor -- --help
```

Run the same checks CI runs before you open a pull request:

```bash
cargo fmt --all -- --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
cargo deny check      # cargo install cargo-deny
cargo audit           # cargo install cargo-audit
```

## Pull requests

- Keep changes small, reviewable and focused on one thing.
- Use conventional commit subjects: `feat:`, `fix:`, `perf:`, `refactor:`, `docs:`, `test:`, `ci:`, `chore:`. Releases are cut automatically from `feat`, `fix`, `perf` and `refactor` commits on `main`, so the subject decides whether a release happens. Never hand-roll versions or tags.
- Add or update tests for behaviour changes. Linux, macOS and Windows are all blocking CI gates.
- Update the relevant documentation under `docs/` and add a line to the `Unreleased` section of `CHANGELOG.md`.
- Preserve developer control: nothing an agent does may bypass the consent prompts, the tool policy or the supervised merge path.

## Code standards

- Safe Rust only; `unsafe` needs a written justification in the pull request.
- Explicit error handling with `Result` and typed errors; `unwrap` is denied by the workspace lints.
- Treat model output and user-provided identifiers as untrusted input.
- Avoid new dependencies unless they clearly reduce risk or complexity, and keep them permissively licensed; `cargo deny check` enforces the allow-list.
- Never commit secrets, tokens, local credentials or machine-specific paths.

> **Danger:** Do not open public issues for exploitable vulnerabilities. Report them privately through [GitHub's private vulnerability reporting](https://github.com/RaptorLabsHQ/raptorcode/security/advisories/new).

By contributing, you agree that your contribution is dual-licensed under MIT OR Apache-2.0, without additional terms or conditions.
