Thank you for your interest in contributing to KubeAgentic! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR_USERNAME/kubeagentic.git
cd kubeagentic# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install development dependencies
pip install -e ".[dev]"
# Or use requirements-dev.txt
pip install -r requirements-dev.txt
# Install pre-commit hooks
pre-commit installgit checkout -b feature/your-feature-name
# Or for bug fixes:
git checkout -b fix/bug-descriptionWe use:
- Black for code formatting (line length: 100)
- Ruff for linting
- MyPy for type checking
Run formatters and linters:
# Format code
black kubeagentic tests
# Lint code
ruff check kubeagentic tests
# Type check
mypy kubeagenticWrite tests for all new features and bug fixes.
# Run all tests
pytest
# Run with coverage
pytest --cov=kubeagentic --cov-report=html
# Run specific test file
pytest tests/test_agent.py -v
# Run tests with logging output
pytest -v -s- Place tests in the
tests/directory - Mirror the structure of
kubeagentic/ - Use descriptive test names:
test_should_do_something_when_condition() - Mock external dependencies (LLMs, databases, etc.)
- Aim for >80% code coverage
Example test structure:
import pytest
from kubeagentic import Agent
def test_agent_creation_from_config():
"""Test that agent can be created from configuration."""
config = {...}
agent = Agent.from_dict(config)
assert agent.name == "test_agent"
@pytest.mark.asyncio
async def test_agent_async_invoke():
"""Test async agent invocation."""
agent = Agent.from_dict(config)
response = await agent.ainvoke("Hello")
assert "content" in response- Add docstrings to all public functions and classes
- Use Google-style docstrings
- Update README.md if adding new features
- Add examples for new functionality
Example docstring:
def parse_config(file_path: str) -> AgentConfig:
"""
Parse configuration from YAML file.
Args:
file_path: Path to the YAML configuration file
Returns:
Parsed and validated agent configuration
Raises:
ConfigurationError: If file is invalid or cannot be parsed
Example:
>>> config = parse_config("agent.yaml")
>>> print(config.agent.name)
'my_agent'
"""- Code follows style guidelines (Black, Ruff, MyPy pass)
- Tests are added and passing
- Documentation is updated
- Commits are clean and well-described
- Branch is up to date with main
# Update your branch
git fetch upstream
git rebase upstream/mainFollow conventional commits format:
feat: add support for Cohere LLM provider
fix: resolve session management bug
docs: update API documentation
test: add tests for config parser
refactor: simplify agent initialization
- Fill out the pull request template
- Link related issues
- Add clear description of changes
- Request review from maintainers
- Address review comments
- Keep discussion respectful and constructive
- Update code as needed
- Once approved, a maintainer will merge
kubeagentic/
├── kubeagentic/ # Main package
│ ├── config/ # Configuration parsing
│ ├── core/ # Core agent implementation
│ ├── llm/ # LLM provider integrations
│ ├── api/ # REST API endpoints
│ ├── utils/ # Utilities
│ └── cli.py # CLI interface
├── tests/ # Test suite
├── examples/ # Example configurations
├── docs/ # Documentation
└── scripts/ # Development scripts
- Add provider enum to
kubeagentic/config/schema.py - Implement factory method in
kubeagentic/llm/factory.py - Add tests in
tests/test_llm_factory.py - Update documentation
- Create tool class in
kubeagentic/tools/ - Register in tool loader
- Add example configuration
- Write tests
- Update documentation
(For maintainers)
- Update version in
pyproject.toml - Update CHANGELOG.md
- Create release tag
- Build and publish to PyPI
- Create GitHub release
- 🌐 Website: https://kubeagentic.com
- 📧 Email: contact@kubeagentic.com
- 🐛 GitHub Issues
- 💬 GitHub Discussions
Contributors will be:
- Listed in CONTRIBUTORS.md
- Mentioned in release notes
- Credited in the documentation
Thank you for contributing to KubeAgentic! 🎉