Thank you for your interest in contributing to Syscity! This document provides guidelines and instructions for contributing.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Coding Standards
- Commit Messages
- Pull Request Process
This project and everyone participating in it is governed by our commitment to:
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive criticism
- Accept responsibility and apologize when mistakes happen
- Fork the repository on GitHub
- Clone your fork locally
- Create a new branch for your feature or fix
- Make your changes
- Submit a pull request
- Rust 1.75 or higher
- SQLite development libraries
- Git
# Clone the repository
git clone https://github.com/lightconsen/syscity
cd syscity
# Build in development mode
cargo build
# Build with all features
cargo build --all-features
# Run tests
cargo test --all-featuresBefore submitting, ensure your code is properly formatted:
cargo fmt
cargo clippy --all-features -- -D warningsWhen reporting bugs, please include:
- A clear description of the issue
- Steps to reproduce
- Expected behavior
- Actual behavior
- Environment details (OS, Rust version, etc.)
- Any relevant logs or error messages
Feature suggestions are welcome! Please:
- Check if the feature has already been suggested
- Provide a clear use case
- Explain why it would be valuable
- Consider implementation complexity
- Skills: Create new skills in
examples/skills/ - Tools: Add new tools in
src/tools/ - Channels: Implement new channel integrations
- Documentation: Improve docs and examples
- Tests: Add test coverage
- Bug fixes: Fix reported issues
To add a new skill:
- Create a directory in
examples/skills/ - Add a
SKILL.mdfile following the template - Test the skill with Syscity
- Submit a PR with examples of usage
Example skill structure:
examples/skills/my_skill/
├── SKILL.md # Required: Skill definition
├── config.yaml # Optional: Default configuration
└── README.md # Optional: Additional documentation
Follow the Rust API Guidelines:
- Use
cargo fmtfor formatting - Use
cargo clippyfor linting - Write documentation for all public items
- Use meaningful variable names
- Keep functions focused and small
- Use
///for documentation comments - Include examples in doc comments
- Document panics, errors, and safety requirements
- Keep documentation up-to-date with code changes
- Write unit tests for new functionality
- Use integration tests for complex features
- Aim for >80% code coverage
- Test edge cases and error conditions
Example test:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_my_feature() {
let result = my_function("input");
assert_eq!(result, "expected");
}
#[tokio::test]
async fn test_async_feature() {
let result = my_async_function().await;
assert!(result.is_ok());
}
}Follow Conventional Commits:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Build process or auxiliary tool changes
Examples:
feat(tools): add grep tool for searching files
fix(agent): resolve budget tracking issue
docs: update API documentation for channels
test(memory): add tests for session search
We use the Developer Certificate of Origin (DCO) for all contributions. By signing off your commits, you certify that you have the right to submit the code under the project's license.
All commits must include a Signed-off-by line:
feat(tools): add new grep tool
Signed-off-by: Your Name <your.email@example.com>
You can automatically sign off commits by using the -s flag:
git commit -s -m "feat(tools): add new grep tool"Or configure Git to always sign off:
git config --global format.signoff true-
Before Submitting
- Ensure tests pass:
cargo test --all-features - Check formatting:
cargo fmt -- --check - Run clippy:
cargo clippy --all-features -- -D warnings - Update documentation if needed
- Add tests for new functionality
- All commits are signed off (
git log --format="%h %s" | grep -i signed-off)
- Ensure tests pass:
-
PR Description
- Clearly describe the changes
- Reference related issues with
Fixes #123orRelates to #456 - Include screenshots for UI changes
- List breaking changes if any
-
Review Process
- Maintainers will review within a few days
- Address review comments promptly
- Keep the PR focused on a single topic
- Rebase on main if there are conflicts
-
After Merge
- Your contribution will be in the next release
- Thank you for helping improve Syscity!
# Run specific test
cargo test test_name
# Run tests in a module
cargo test module_name
# Run with output
cargo test -- --nocapture# Enable debug logging
RUST_LOG=debug cargo run
# Enable trace logging
RUST_LOG=trace cargo runTest with different feature combinations:
# Default features
cargo test
# All features
cargo test --all-features
# Specific features
cargo test --features "telegram discord"- Join our Discord
- Open a GitHub Discussion
- Check existing Issues
By contributing, you agree that your contributions will be licensed under the same license as the project (Apache-2.0).
Thank you for contributing to Syscity! 🎉