Skip to content

Contributing to SMG

Thank you for your interest in contributing to Shepherd Model Gateway! This guide will help you get started.


Ways to Contribute

  • Report Bugs


    Found a bug? Open an issue with a clear description, steps to reproduce, and expected vs actual behavior.

    Open an issue

  • Suggest Features


    Have an idea? Open a feature request describing the problem you're solving and your proposed solution.

    Request a feature

  • Contribute Code


    Ready to code? Follow our development guide to set up your environment and submit a pull request.

    Development guide

  • Improve Docs


    Documentation improvements are always welcome! Fix typos, clarify explanations, or add examples.

    Edit on GitHub


Quick Start

1. Fork and Clone

# Fork the repository on GitHub, then:
git clone https://github.com/YOUR_USERNAME/smg.git
cd smg

2. Set Up Development Environment

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Build the project
cargo build

# Run tests
cargo test

3. Make Changes

# Create a branch
git checkout -b feature/my-feature

# Make your changes
# ...

# Run tests and linting
cargo test
cargo clippy
cargo fmt --check

4. Submit a Pull Request

# Push your branch
git push origin feature/my-feature

# Open a pull request on GitHub

Contribution Guidelines

Code Quality

  • All tests pass (cargo test)
  • Code is formatted (cargo fmt)
  • No clippy warnings (cargo clippy)
  • New code has tests
  • Documentation updated if needed

Commit Messages

Follow conventional commit format:

type(scope): description

[optional body]

[optional footer]

Types: feat, fix, docs, style, refactor, test, chore

Examples:

feat(routing): add weighted round-robin policy
fix(health): handle timeout in health checks
docs(readme): update installation instructions

Pull Request Process

  1. Open draft PR early for complex changes to get feedback
  2. Link related issues using "Fixes #123" or "Relates to #123"
  3. Update documentation for user-facing changes
  4. Add tests for new functionality
  5. Keep PRs focused - one feature or fix per PR

Getting Help


Code of Conduct

We are committed to providing a welcoming and inclusive environment. Please read and follow our Code of Conduct.


License

By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.