Contributing
Thank you for your interest in contributing to MoFA!
Getting Started
1. Fork and Clone
git clone https://github.com/YOUR_USERNAME/mofa.git
cd mofa
2. Set Up Development Environment
# Install Rust (1.85+)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Build the project
cargo build
# Run tests
cargo test
3. Create a Branch
git checkout -b feature/your-feature-name
Development Guidelines
Code Style
- Run
cargo fmtbefore committing - Run
cargo clippyand fix all warnings - Follow Rust naming conventions
- Add documentation comments (
///) for public APIs
Architecture
MoFA follows strict microkernel architecture. See CLAUDE.md for detailed rules:
- Kernel layer: Only trait definitions, no implementations
- Foundation layer: Concrete implementations
- Never re-define traits from kernel in foundation
Commit Messages
Follow conventional commits:
feat: add new tool registry implementation
fix: resolve memory leak in agent context
docs: update installation guide
test: add tests for LLM client
refactor: simplify workflow execution
Testing
- Write unit tests for new functionality
- Ensure all tests pass:
cargo test - Test with different feature flags if applicable
# Run all tests
cargo test --all-features
# Test specific crate
cargo test -p mofa-sdk
# Test with specific features
cargo test -p mofa-sdk --features openai
Pull Request Process
- Create an issue first for significant changes
- Make your changes following the guidelines above
- Update documentation if needed
- Run all checks:
cargo fmt --check
cargo clippy --all-targets --all-features
cargo test --all-features
- Submit PR with a clear description
PR Checklist
- Code compiles without warnings
- Tests pass
- Documentation updated
- CLAUDE.md architecture rules followed
- Commit messages follow convention
Documentation
- Update relevant
.mdfiles indocs/ - Add inline documentation for public APIs
- Update
CHANGELOG.mdfor notable changes
Questions?
- Open an issue for bugs or feature requests
- Join Discord for discussions
- Check GitHub Discussions
License
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.