Thank you for your interest in contributing to sf-agentscript! This document provides guidelines and best practices for contributing.
- Install Rust: Follow the instructions at https://rustup.rs/
- Clone the repository:
git clone https://github.com/composable-delivery/sf-agentscript.git cd sf-agentscript - Install development tools:
cargo install cargo-audit cargo-deny cargo-llvm-cov
-
Create a new branch:
git checkout -b feature/your-feature-name
-
Ensure everything builds:
cargo build cargo test
- Write code following Rust conventions
- Add tests for new functionality
- Update documentation as needed
- Format code:
cargo fmt
- Check for issues:
cargo clippy --all-features --workspace -- -D warnings
Run the complete check suite:
# Format check
cargo fmt --check
# Linting
cargo clippy --all-features --workspace -- -D warnings
# Tests
cargo test --all-features --workspace
# Security audit
cargo audit
# Dependency checks
cargo deny check
# Documentation
cargo doc --no-deps --all-features --workspaceUse clear, descriptive commit messages:
- Start with a verb in present tense (Add, Fix, Update, Remove)
- Keep the first line under 72 characters
- Add details in subsequent lines if needed
Examples:
Add parser support for conditional expressions
Fix runtime panic when handling empty arrays
Update documentation for parser module
- Follow the Rust API Guidelines
- Use
rustfmtfor formatting (configuration inrustfmt.toml) - Address all
clippywarnings - Prefer standard library types when possible
- Write unit tests for all public APIs
- Add integration tests for complex scenarios
- Test against examples in
agent-script-recipes/ - Aim for high code coverage
- Add doc comments (
///) for all public items - Include examples in doc comments when helpful
- Keep documentation up-to-date with code changes
- Run
cargo docto verify documentation builds
- Never commit secrets or credentials
- Review dependencies for vulnerabilities
- Follow secure coding practices
- Report security issues privately (see SECURITY.md)
- Push your branch to your fork
- Create a Pull Request with:
- Clear title describing the change
- Description of what changed and why
- Reference to any related issues
- Wait for CI checks to pass
- Address review feedback if requested
- Squash commits if asked (optional)
Before submitting, ensure:
- Code compiles without errors
- All tests pass
- Code is formatted (
cargo fmt) - No clippy warnings
- Security checks pass
- Documentation is updated
- New tests added for new functionality
- Questions: Open a discussion on GitHub
- Bugs: Open an issue with reproduction steps
- Features: Open an issue to discuss before implementing
Be respectful, inclusive, and professional in all interactions. We are committed to providing a welcoming environment for all contributors.
By contributing, you agree that your contributions will be licensed under the MIT License.