Thank you for your interest in contributing to Aegra! This guide will help you get started.
git clone https://github.com/YOUR_USERNAME/aegra.git
cd aegraOption 1: Using Make (Recommended)
make dev-install # Installs dependencies + git hooksOption 2: Using uv directly
uv sync --all-packages
uv run pre-commit install
uv run pre-commit install --hook-type commit-msgGit hooks will run before every commit and check:
- ✅ Code formatting (Ruff)
- ✅ Linting issues
- ✅ Type checking (mypy)
- ✅ Commit message format
- ✅ Security issues (Bandit)
We use Conventional Commits for clear and structured commit history.
<type>(<scope>): <description>
[optional body]
[optional footer]
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, no logic change)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testschore: Maintenance tasks (dependencies, build, etc.)ci: CI/CD changesbuild: Build system changes
Use scope to specify which part of the codebase is affected:
api,auth,graph,db,middleware,tests,docs,ci
# Good commits ✅
git commit -m "feat: add user authentication endpoint"
git commit -m "feat(api): implement rate limiting for threads"
git commit -m "fix: resolve database connection pool exhaustion"
git commit -m "fix(auth): handle expired JWT tokens correctly"
git commit -m "docs: update API documentation for assistants"
git commit -m "refactor(graph): simplify state management logic"
git commit -m "test(e2e): add integration tests for streaming"
git commit -m "chore: upgrade langchain to v0.3.1"
# Bad commits ❌
git commit -m "fixed stuff"
git commit -m "WIP"
git commit -m "Updated files"
git commit -m "Fix bug"If your change breaks backward compatibility, add BREAKING CHANGE: in the footer:
git commit -m "feat(api): redesign authentication flow
BREAKING CHANGE: The authentication endpoint now requires a different payload structure."Run these commands to ensure your code meets our standards:
# Format and fix auto-fixable issues
make format
# Check for remaining issues
make lint
# Run type checking
make type-check
# Run tests
make test
# Or run all checks at once
make ci-checkThe pre-commit hooks will automatically run when you commit. If they fail:
- Review the errors - The hooks will show what needs to be fixed
- Fix the issues - Most formatting issues are auto-fixed
- Stage the changes -
git add . - Commit again -
git commit -m "your message"
Only in emergencies:
git commit --no-verify -m "emergency fix"# Run all tests
make test
# Run with coverage
make test-cov
# Run specific test file
uv run --package aegra-api pytest libs/aegra-api/tests/e2e/test_assistants/test_assistant_graph.py
# Run specific test
uv run --package aegra-api pytest libs/aegra-api/tests/e2e/test_assistants/test_assistant_graph.py::test_create_assistant- Place unit tests in
tests/unit/ - Place integration tests in
tests/integration/ - Place end-to-end tests in
tests/e2e/ - Use descriptive test names:
test_should_return_error_when_invalid_input - Aim for 80%+ code coverage
- Never commit secrets, API keys, or credentials
- Use environment variables for sensitive data
- Run
make securityto check for security issues - Report security vulnerabilities privately to the maintainers
git checkout -b feat/your-feature-name
# or
git checkout -b fix/your-bug-fix- Write clean, readable code
- Follow existing code style
- Add tests for new features
- Update documentation if needed
git add .
git commit -m "feat: add amazing feature"The pre-commit hooks will run automatically.
git push origin feat/your-feature-name- Use a clear, descriptive title following Conventional Commits format
- Describe what changes you made and why
- Reference any related issues
- Ensure all CI checks pass
Your PR title must follow Conventional Commits:
feat: add user profile endpoint
fix(auth): resolve token expiration bug
docs: update installation guide
Your PR must pass:
- ✅ Code formatting (Ruff)
- ✅ Linting (Ruff)
- ✅ Type checking (mypy)
- ✅ Security checks (Bandit)
- ✅ Tests (pytest)
- ✅ Conventional Commits validation
# 1. Pull latest changes
git pull origin main
# 2. Create feature branch
git checkout -b feat/my-feature
# 3. Make changes and test
make format
make test
# 4. Commit (hooks run automatically)
git commit -m "feat: add my feature"
# 5. Push
git push origin feat/my-feature
# 6. Open PR on GitHub# Add upstream remote (once)
git remote add upstream https://github.com/ibbybuilds/aegra.git
# Update your fork
git fetch upstream
git checkout main
git merge upstream/main
git push origin main- Follow PEP 8 (enforced by Ruff)
- Use type hints for all functions
- Keep functions small and focused
- Use descriptive variable names
- Avoid comments unless necessary (code should be self-documenting)
- Update README.md for user-facing changes
- Add docstrings for public APIs
- Use Google-style docstrings
- Keep documentation up-to-date
- Check existing issues
- Try the latest version
- Reproduce the bug consistently
**Describe the bug**
A clear description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...
**Expected behavior**
What you expected to happen.
**Environment**
- OS: [e.g., Ubuntu 22.04]
- Python version: [e.g., 3.11]
- Aegra version: [e.g., 0.1.0]
**Additional context**
Any other relevant information.We welcome feature requests! Please:
- Check if it's already requested
- Describe the use case
- Explain why it would be valuable
- Consider contributing the implementation
- Be respectful and inclusive
- Provide constructive feedback
- Focus on what is best for the community
- Show empathy towards others
- Issues: For bugs and feature requests
- Discussions: For questions and general discussion
- Discord: [Join our community] (if available)
Contributors will be:
- Listed in our README
- Mentioned in release notes
- Part of our growing community
Thank you for contributing to Aegra! 🚀