Ways to Contribute
Questions
Have a question about building with XMTP? Ask in the XMTP Community Forums.Bug Reports
Report bugs using GitHub Issues. Please include:- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Rust version, etc.)
Feature Requests
Request features using GitHub Issues. Consider:- Describing the use case
- Explaining why existing features don’t address your needs
- Proposing a potential implementation approach
Pull Requests
PRs are encouraged, but consider starting with a feature request to temperature-check first.If the PR involves a major change to the protocol, the work should be fleshed out as an XMTP Improvement Proposal (XIP) before work begins.
Approval Process
After a pull request is submitted, a single approval is required to merge it.AI-Generated Contributions Policy
This includes:- Automated typo fixes or formatting changes
- Generic code improvements without context
- Mass automated updates or refactoring
To protect project quality and maintain contributor trust, we will restrict access for users who continue to submit AI-generated pull requests.
Using AI Tools Responsibly
If you use AI tools to assist your development process, please:Code Quality Requirements
Before submitting a PR, ensure your code meets quality standards:Linting
Formatting
Format all code before submitting:- Rust code
- Nix files
- TOML configuration
- TypeScript (Node.js bindings)
- Swift (iOS bindings)
- Kotlin (Android bindings)
Testing
Add test coverage for new functionality:Development Workflow
Set up environment
Follow the Development Setup guide to configure your environment.
Coding Standards
Rust Guidelines
- Follow the official Rust API Guidelines
- Use
rustfmtfor consistent formatting (run viajust format) - Address all
clippywarnings (run viajust lint-rust) - Write documentation for public APIs
- Add tests for new functionality
Test Writing
- Use
#[xmtp_common::test(unwrap_try = true)]instead of#[test] - Use
rstestfor parameterized tests - Use the
tester!macro for tests requiring wallets - Include both unit and integration tests where appropriate
Dependency Management
When adding dependencies:- Consider the impact on bundle size (especially for WASM)
- Ensure licenses are compatible
-
Regenerate the workspace-hack:
Architecture Guidelines
LibXMTP follows specific architectural patterns:- Generic Client:
Client<Context>parameterized by context - Builder Pattern: Use
ClientBuilderfor complex object construction - Trait Abstractions: Implement traits (
XmtpApi,XmtpDb,InboxOwner) for pluggability - Platform-specific code: Use
if_native!/if_wasm!macros
Documentation
Good documentation helps everyone:- Document public APIs with doc comments
- Include code examples in documentation
- Update relevant guides when changing behavior
- Keep the README up to date
Getting Help
If you need help with your contribution:- Ask questions in the XMTP Community Forums
- Review the CLAUDE.md file for project context
- Look at existing PRs for examples
- Reach out to maintainers via GitHub
Code Review Process
When your PR is submitted:- Automated checks will run (linting, tests, etc.)
- A maintainer will review your code
- You may be asked to make changes
- Once approved, your PR will be merged
