This section contains documentation for developers working on Sage Agent.
- Development Setup - Setting up your development environment
- Building the Project - How to build Sage Agent
- Running Tests - Running the test suite
- Development Workflow - Recommended development workflow
- Contributing Guide - How to contribute to the project
- Code Review Process - Code review guidelines
- Issue Guidelines - Reporting bugs and requesting features
- Pull Request Process - Submitting changes
- Code Style Guide - Rust coding standards and conventions
- Documentation Standards - Code documentation requirements
- Naming Conventions - Variable and function naming
- Error Handling - Error handling patterns
- Testing Strategy - Overall testing approach
- Unit Testing - Writing unit tests
- Integration Testing - Integration test guidelines
- Performance Testing - Performance benchmarking
- Test Coverage - Maintaining test coverage
- MCP Integration Plan - Model Context Protocol integration
- Tools Expansion Plan - Tool ecosystem expansion
- Design Patterns - Common design patterns used
- API Design Guidelines - API design principles
- Release Process - How releases are managed
- Versioning Strategy - Semantic versioning approach
- Changelog Management - Maintaining changelogs
- Deployment Process - Deployment procedures
- Rust (latest stable) - Primary programming language
- Cargo - Rust package manager and build tool
- Git - Version control system
- IDE/Editor - VS Code, IntelliJ IDEA, or similar
- rust-analyzer - Rust language server
- clippy - Rust linter
- rustfmt - Code formatter
- cargo-watch - Automatic rebuilding
- cargo-audit - Security vulnerability scanner
# Build the project
cargo build
# Run tests
cargo test
# Run with logging
RUST_LOG=debug cargo run
# Format code
cargo fmt
# Run linter
cargo clippy
# Check for security vulnerabilities
cargo auditsage-agent/
├── crates/
│ ├── sage-core/ # Core library
│ ├── sage-cli/ # Command-line interface
│ ├── sage-sdk/ # High-level SDK
│ └── sage-tools/ # Built-in tools
├── docs/ # Documentation
├── examples/ # Usage examples
├── configs/ # Configuration templates
└── trajectories/ # Execution trajectories
- Each crate should have a clear, single responsibility
- Use
pub(crate)for internal APIs - Minimize dependencies between crates
- Follow Rust module conventions
- Create Issue - Describe the feature or bug
- Create Branch - Use descriptive branch names
- Implement Changes - Follow coding standards
- Write Tests - Ensure adequate test coverage
- Update Documentation - Keep docs current
- Submit PR - Follow PR template
- Code Review - Address review feedback
- Merge - Squash and merge when approved
- Use
RUST_LOG=debugfor detailed logging - Use
cargo test -- --nocapturefor test output - Use debugger integration in your IDE
- Add temporary debug prints with
dbg!()macro
- Use
cargo benchfor benchmarking - Profile with
perfon Linux - Use
cargo flamegraphfor flame graphs - Monitor memory usage with
valgrind
- Clippy - Rust linter for common mistakes
- Rustfmt - Consistent code formatting
- Cargo Audit - Security vulnerability scanning
- Cargo Deny - License and dependency checking
- Minimum 80% test coverage for new code
- All public APIs must have tests
- Integration tests for key workflows
- Performance regression tests
- All public APIs must be documented
- Include usage examples in documentation
- Keep README files up to date
- Document architectural decisions
For system architecture details, see the Architecture Documentation. For user-facing documentation, see the User Guide.