Contributing Guide¶
This guide explains how to contribute to the Bedrock Swarm framework. We welcome contributions of all kinds, from bug fixes to new features.
Getting Started¶
-
Fork the Repository
-
Set Up Development Environment
-
Create Feature Branch
Development Workflow¶
- Code Style
- Follow PEP 8
- Use type hints
- Write docstrings (Google style)
-
Keep functions focused
-
Testing
- Write unit tests
- Include integration tests
- Maintain coverage (90%+)
-
Test edge cases
-
Documentation
- Update API docs
- Add examples
- Include docstrings
- Update changelog
Testing¶
Run tests with:
# Run all tests
pytest
# Run with coverage
pytest --cov=bedrock_swarm
# Run specific test file
pytest tests/unit/test_agency.py
# Run with verbose output
pytest -v
Documentation¶
Build documentation with:
# Install documentation dependencies
pip install -e ".[docs]"
# Build documentation
mkdocs build
# Serve documentation locally
mkdocs serve
Code Quality¶
Maintain code quality with:
Pull Request Process¶
- Update Documentation
- Add/update API documentation
- Update README if needed
-
Add examples for new features
-
Run Tests
- Ensure all tests pass
- Add new tests as needed
-
Maintain coverage
-
Update Changelog
- Add entry to CHANGELOG.md
- Follow Keep a Changelog format
-
Include PR number
-
Submit PR
- Create detailed description
- Link related issues
- Request review
Commit Guidelines¶
Follow conventional commits:
Types: - feat: New feature - fix: Bug fix - docs: Documentation - style: Formatting - refactor: Code restructuring - test: Adding tests - chore: Maintenance
Example:
feat(agency): add thread pooling system
- Implements thread reuse
- Adds configuration options
- Updates documentation
Closes #123
Release Process¶
-
Version Bump
-
Create Tag
-
Build Package
-
Publish Release
Code Review¶
Guidelines for reviewers:
- Code Quality
- Clean and readable
- Well-documented
- Properly tested
-
Type safe
-
Architecture
- Follows patterns
- Maintainable
- Performant
-
Secure
-
Documentation
- Clear and complete
- Includes examples
- Up to date
- Well-structured
Community¶
- Issues: Use issue templates
- Discussions: Use GitHub Discussions
- Questions: Use issue tracker
- Security: Report privately
License¶
By contributing, you agree that your contributions will be licensed under the project's MIT License.