# Contributing to OpenLatch
Thank you for your interest in contributing to OpenLatch! Whether it's a bug fix, new agent integration, documentation improvement, or performance optimization — every contribution matters.
Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before participating.
---
## Getting Started
### Prerequisites
| Rust | stable (2021 edition) | Build and test |
| Git | any | Version control |
| cargo-tarpaulin | latest | Coverage reports (optional) |
### Setup
```bash
# Fork on GitHub, then:
git clone https://github.com/YOUR_USERNAME/openlatch-client.git
cd openlatch-client
cargo build
cargo test
```
---
## Development Workflow
### Branch Strategy
- **`main`** — stable, production-ready code
- **`feat/your-feature`** — new features
- **`fix/bug-description`** — bug fixes
- **`docs/improvement`** — documentation updates
### Making Changes
1. Create a new branch:
```bash
git checkout -b feat/your-feature-name
```
2. Make your changes following our [coding standards](#coding-standards)
3. Write tests (70% coverage minimum)
4. Run quality checks:
```bash
cargo fmt --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test
```
5. Commit using [Conventional Commits](https://www.conventionalcommits.org/):
```bash
git commit -m "feat: add health check endpoint"
git commit -m "fix: resolve envelope serialization issue"
git commit -m "docs: update CLI usage examples"
```
6. Push and create a Pull Request:
```bash
git push origin feat/your-feature-name
```
---
## Coding Standards
### Rust Style
- **Formatting**: `cargo fmt` (configured in `rustfmt.toml`)
- **Linting**: `cargo clippy` with `-D warnings`
- **Edition**: 2021
- **Max line width**: 100 characters
### Architecture Principles
- **Thin forwarder** — the client wraps raw hook events in envelopes and forwards to openlatch-platform
- **No local detection** — all intelligence is cloud-side
- **Latency target**: <200ms round-trip for hook events
See [AGENT.md](../AGENT.md) for detailed architecture and conventions.
---
## What to Contribute
### High Priority
- **Bug fixes** with tests
- **Documentation improvements**
- **Test coverage improvements**
- **Performance optimizations**
### Medium Priority
- **New agent integrations** (hook event sources)
- **Privacy filter improvements** (credential redaction patterns)
- **Developer tooling** (CLI ergonomics)
### Roadmap Items
See [GitHub Projects](https://github.com/OpenLatch/openlatch-client/projects) for planned features and good first issues.
---
## Pull Request Process
1. **Fill out the PR template** (auto-populated)
2. **Ensure CI passes**:
- Formatting (`cargo fmt --check`)
- Linting (`cargo clippy -- -D warnings`)
- Tests (`cargo test`)
- Coverage (70% project, 80% patch)
- Release build + E2E smoke tests
3. **Request review** and address feedback
4. **Merge** when approved + CI green
---
## Documentation
- **Code comments**: Explain *why*, not *what*
- **Doc comments**: Required for all public APIs (`///` style)
- **README updates**: For new user-facing features
---
## License
By contributing to OpenLatch, you agree that your contributions will be licensed under the **Apache License 2.0**.
---
## Getting Help
- **Slack**: [openlatch.slack.com](https://openlatch.slack.com) — fastest way to reach us
- **GitHub Discussions**: [github.com/OpenLatch/openlatch-client/discussions](https://github.com/OpenLatch/openlatch-client/discussions)
- **GitHub Issues**: [github.com/OpenLatch/openlatch-client/issues](https://github.com/OpenLatch/openlatch-client/issues)
---
## Recognition
Contributors are recognized in release notes and the GitHub contributor graph. Thank you for helping make AI agents safer!