Thank you for your interest in contributing to Helios Engine! This document provides guidelines and information for contributors.
-
Clone the repository:
git clone https://github.com/Ammar-Alnagar/Helios-Engine.git cd Helios-Engine -
Build the project:
cargo build
-
Run tests:
cargo test -
Format code:
cargo fmt
-
Check for issues:
cargo clippy
- Fork the repository on GitHub
- Create a feature branch:
git checkout -b feature/your-feature-name - Make your changes
- Run tests:
cargo test - Format code:
cargo fmt - Check for issues:
cargo clippy - Commit your changes:
git commit -m "Add your feature" - Push to your fork:
git push origin feature/your-feature-name - Create a Pull Request
main: Production-ready codedevelop: Integration branch for featuresfeature/*: New featuresbugfix/*: Bug fixeshotfix/*: Critical fixes for production
Follow conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test additions/modificationschore: Maintenance tasks
Examples:
feat(agent): add memory persistence to agent sessions
fix(tools): resolve memory leak in CalculatorTool
docs(readme): update installation instructions
- Create PR: Use descriptive titles and detailed descriptions
- Code Review: Address reviewer feedback
- Tests: Ensure all tests pass and add new tests if needed
- Documentation: Update docs for any user-facing changes
- Merge: Squash merge with clean commit message
# Run all tests
cargo test
# Run specific test
cargo test test_name
# Run tests with logging
RUST_LOG=debug cargo test
# Run integration tests
cargo test --test integration_tests
# Run tests with coverage (requires tarpaulin)
cargo tarpaulin --out Html#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_calculator_addition() {
let tool = CalculatorTool;
let args = serde_json::json!({
"expression": "2 + 2"
});
let result = tokio_test::block_on(tool.execute(args)).unwrap();
assert_eq!(result.content, "4");
}
}Add to tests/ directory:
// tests/agent_integration.rs
use helios_engine::{Agent, Config};
#[tokio::test]
async fn test_agent_with_tools() {
let config = Config::from_file("config.test.toml").unwrap();
let mut agent = Agent::builder("TestAgent")
.config(config)
.tool(Box::new(CalculatorTool))
.build()
.await
.unwrap();
let response = agent.chat("What is 10 + 5?").await.unwrap();
assert!(response.contains("15"));
}Create config.test.toml for testing:
[llm]
model_name = "gpt-3.5-turbo"
base_url = "https://api.openai.com/v1"
api_key = "test-key"
temperature = 0.0 # Deterministic for testing
max_tokens = 100- Use Markdown for all documentation
- Include code examples where relevant
- Provide both conceptual and practical information
- Keep documentation up-to-date with code changes
- Use clear, concise language accessible to different experience levels
- API Documentation: Update
docs/API.mdfor any public API changes - Guides: Update relevant guides in
docs/directory - Examples: Add examples to
examples/directory - README: Update main README.md for major changes
- Public API changes documented
- Breaking changes clearly marked
- Code examples tested and working
- Cross-references updated
- Table of contents accurate
# Format all code
cargo fmt
# Check formatting without changing files
cargo fmt --check# Run clippy linter
cargo clippy
# Fix auto-fixable issues
cargo clippy --fix- Follow Rust naming conventions
- Use meaningful variable and function names
- Add documentation comments for public APIs
- Handle errors gracefully
- Write comprehensive tests
- Minimize allocations in hot paths
- Use async/await appropriately
- Consider memory usage for large data structures
- Profile performance-critical code
- Use appropriate data structures
-
Implement the Tool trait:
use async_trait::async_trait; use helios_engine::{Tool, ToolParameter, ToolResult}; struct MyTool; #[async_trait] impl Tool for MyTool { fn name(&self) -> &str { "my_tool" } fn description(&self) -> &str { "Description of what my tool does" } fn parameters(&self) -> HashMap<String, ToolParameter> { // Define tool parameters } async fn execute(&self, args: Value) -> Result<ToolResult> { // Implement tool logic } }
-
Add to tool registry in
tools.rs -
Write comprehensive tests
-
Update documentation in
docs/TOOLS.md
- Validate all inputs
- Handle errors gracefully
- Provide meaningful error messages
- Document parameter formats
- Consider security implications
- Test edge cases thoroughly
agent.rs: Agent implementation and builder patternchat.rs: Chat messages and session managementconfig.rs: Configuration loading and validationerror.rs: Error types and handlingllm.rs: LLM client and provider implementationstools.rs: Tool registry and implementationsserve.rs: HTTP server for API endpoints
- Separation of Concerns: Each module has a single responsibility
- Dependency Injection: Use constructor injection for dependencies
- Error Handling: Use
Result<T, Error>consistently - Async/Await: Use async/await for I/O operations
- Type Safety: Leverage Rust's type system
- Use builder patterns for complex construction
- Provide sensible defaults
- Make APIs hard to misuse
- Document preconditions and postconditions
- Version APIs appropriately
- Input validation on all user inputs
- No hardcoded secrets or credentials
- Safe handling of file paths
- Proper error message sanitization
- No sensitive data in logs
- Secure default configurations
- DO NOT create public GitHub issues for security vulnerabilities
- Email security concerns to: [security email or maintainer contact]
- Provide detailed reproduction steps
- Allow time for fixes before public disclosure
Follow Semantic Versioning:
- MAJOR: Breaking changes
- MINOR: New features (backward compatible)
- PATCH: Bug fixes (backward compatible)
- Update version in
Cargo.toml - Update changelog
- Run full test suite
- Update documentation
- Create git tag
- Publish to crates.io
- Create GitHub release
# Update version
cargo release [patch|minor|major]
# Or manually:
cargo test
cargo publish- GitHub Issues: Bug reports and feature requests
- GitHub Discussions: General questions and discussions
- Pull Request Comments: Code review discussions
- Check existing issues and documentation first
- Use clear, descriptive issue titles
- Provide minimal reproduction cases
- Include relevant version information
- Performance optimizations
- Additional LLM provider support
- More built-in tools
- Improved error messages
- Better documentation
- Web UI interface
- Plugin system for tools
- Advanced RAG features
- Multi-modal support
- Integration with popular frameworks
- Mobile SDKs
- Desktop applications
- Cloud deployment templates
- Advanced orchestration features
- Be respectful and inclusive
- Focus on constructive feedback
- Help newcomers learn
- Maintain professional communication
- Respect differing viewpoints
Violations of the code of conduct may result in:
- Warning
- Temporary ban
- Permanent ban from the project
Contributors are recognized through:
- GitHub contributor statistics
- Mention in release notes
- Attribution in documentation
- Community recognition
Thank you for contributing to Helios Engine! 🎉