Thank you for your interest in contributing to Safebots Infrastructure! This document provides guidelines for contributing to the project.
- Code of Conduct
- Getting Started
- Development Setup
- How to Contribute
- Pull Request Process
- Component Development
- Testing
- Documentation
This project adheres to a code of conduct. By participating, you are expected to uphold this code:
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on what is best for the community
- Show empathy towards other community members
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/your-username/Infrastructure.git cd Infrastructure/aws - Add upstream remote:
git remote add upstream https://github.com/Safebots/Infrastructure.git
- AWS account with EC2 access
- Amazon Linux 2023 or compatible system
- Root/sudo access
- Git, bash, jq installed
./scripts/install-dev-deps.sh# Build smallest configuration for testing
sudo ./scripts/build-ami.sh base,llm-tiny- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear title and description
- Steps to reproduce
- Expected vs actual behavior
- System information (AMI version, instance type)
- Relevant logs
- Check Discussions for existing suggestions
- Create a new discussion with:
- Clear use case description
- Proposed solution
- Alternatives considered
- Impact on existing functionality
See Component Development below.
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Follow existing code style
- Add tests if applicable
- Update documentation
-
Test your changes:
./scripts/run-tests.sh
-
Commit with clear messages:
git commit -m "Add: Brief description of changes"Commit message prefixes:
Add:New feature or componentFix:Bug fixDocs:Documentation changesRefactor:Code refactoringTest:Test additions or changes
-
Push to your fork:
git push origin feature/your-feature-name
-
Create Pull Request on GitHub:
- Clear title and description
- Reference any related issues
- Describe testing performed
- Include screenshots if UI changes
-
Address review feedback:
- Make requested changes
- Push updates to the same branch
- Respond to reviewer comments
-
Create component directory:
mkdir -p scripts/components/your-component
-
Create installer script:
# scripts/components/your-component/install-your-component.sh #!/bin/bash set -euo pipefail echo "Installing your-component..." # Install dependencies dnf install -y package1 package2 # Install binaries/models cd /opt/safebox # ... installation logic ... # Generate manifest cat > /opt/safebox/manifests/your-component.json << 'EOF' { "component": { "name": "your-component", "version": "1.0.0", "license": ["Apache-2.0"], "disk": "X GB" }, "capabilities": { "Safebox/capability/your/capability": { "provider": "com.safebox.local", "runtime": "your-runtime" } } } EOF echo "✅ your-component installed"
-
Make it executable:
chmod +x scripts/components/your-component/install-your-component.sh
-
Add documentation:
# docs/COMPONENT-YOUR-COMPONENT.md -
Add tests:
# scripts/tests/test-your-component.sh
- ✅ Must generate manifest JSON
- ✅ Must use permissive licenses (Apache 2.0, MIT, BSD)
- ✅ Must be idempotent (can run multiple times safely)
- ✅ Must include error handling
- ✅ Must document disk usage
- ✅ Must validate dependencies
# Run all tests
./scripts/run-tests.sh
# Run specific component test
./scripts/tests/test-llm-medium.sh
# Run integration tests
./scripts/tests/test-integration.shCreate test script in scripts/tests/:
#!/bin/bash
set -euo pipefail
echo "Testing your-component..."
# Test installation
if [[ ! -f /opt/safebox/manifests/your-component.json ]]; then
echo "ERROR: Manifest not found"
exit 1
fi
# Test functionality
if ! your-command --test; then
echo "ERROR: Functionality test failed"
exit 1
fi
echo "✅ your-component tests passed"- All new features require documentation
- Update README.md if adding components
- Create detailed docs in
docs/for complex features - Include examples for all new functionality
- Keep table of contents up to date
docs/
├── COMPONENT-*.md # Component-specific docs
├── ARCHITECTURE-*.md # Architecture specs
├── LICENSE-*.md # License information
└── *.md # Feature-specific docs
- Clear, concise language
- Code examples for all features
- Screenshots/diagrams where helpful
- Links to related documentation
- Version compatibility notes
By contributing to Safebots Infrastructure, you agree that your contributions will be licensed under the Apache 2.0 License.
- 💬 GitHub Discussions
- 📧 Email: developers@safebots.com
- 📖 Documentation: docs/
Thank you for contributing to Safebots Infrastructure! 🎉