Thank you for your interest in contributing to AGON! This document provides guidelines and instructions for contributing to the project.
AGON uses uv for dependency management and development workflows.
- Python 3.11 or higher
- uv installed (
curl -LsSf https://astral.sh/uv/install.sh | sh) - Git
# Clone the repository
git clone https://github.com/Verdenroz/agon-python.git
cd agon-python
# Install dependencies (including dev dependencies)
uv sync --dev
# Install pre-commit hooks
uv run pre-commit install# Shortcut
make test
# Run all tests
uv run pytest
# Run tests with coverage report
uv run pytest --cov=agon --cov-report=html --cov-report=term
# Run specific test file
uv run pytest tests/test_core.py -v
# Run tests matching a pattern
uv run pytest -k "test_encode" -vThe project uses several tools to maintain code quality:
# Lint + format + fix
make fix
# Run linter (ruff)
uv run ruff check src tests
# Auto-fix linting issues
uv run ruff check --fix src tests
# Format code
uv run ruff format src tests
# Type checking (basedpyright)
uv run basedpyright src tests
# Run all quality checks (pre-commit)
uv run pre-commit run --all-files# Serve documentation locally
make docs
# Build documentation
uv run mkdocs build- Follow PEP 8 style guidelines (enforced by ruff)
- Use type hints for all function signatures
- Write descriptive variable and function names
- Keep functions focused and concise (prefer single responsibility)
- All new features must include tests
- Maintain or improve code coverage (currently >95%)
- Tests should cover:
- Happy path functionality
- Edge cases
- Error conditions
- Round-trip encoding/decoding
Example test structure:
def test_feature_name() -> None:
"""Brief description of what this test validates."""
# Arrange
data = {"key": "value"}
# Act
result = AGON.encode(data, format="auto")
# Assert
assert result.format == "json"
assert AGON.decode(result) == dataFollow conventional commits format:
feat: add new format detection heuristicfix: handle empty arrays in struct encoderdocs: update API reference for project_datatest: add edge cases for columnar encodingrefactor: simplify auto-selection logicperf: optimize token counting for large datasets
-
Create a feature branch from
master:git checkout -b feat/your-feature-name
-
Make your changes following the guidelines above
-
Run all quality checks:
uv run pytest uv run ruff check src tests uv run basedpyright src tests
-
Commit your changes with descriptive messages
-
Push to your fork and create a pull request
-
Describe your changes in the PR:
- What problem does this solve?
- What approach did you take?
- Are there any breaking changes?
- Have you added tests?
-
Wait for review - maintainers will review and provide feedback
Before submitting a PR, ensure:
- All tests pass (
uv run pytest) - Code coverage is maintained or improved
- Linting passes (
uv run ruff check) - Type checking passes (
uv run basedpyright) - Documentation is updated (if applicable)
- Commit messages follow conventional commits format
We welcome contributions in these areas:
- New encoding formats: Implement additional specialized formats (e.g., markdown tables, CSV variants)
- Format optimizations: Improve token efficiency of existing formats
- Format detection: Enhance heuristics for auto-selection
- Large dataset optimization: Improve encoding/decoding speed for datasets >1MB
- Memory efficiency: Reduce memory footprint during processing
- Streaming support: Add support for streaming large datasets
- LLM parsing tests: Validate that LLMs can reliably parse AGON formats
- Fuzzing: Add property-based testing for edge cases
- Error handling: Improve error messages and recovery
- Go implementation: Port AGON to Go
- Rust implementation: Port AGON to Rust
- TypeScript/JavaScript: Port AGON to Node.js/Deno/Bun
- Language interop: Ensure format compatibility across implementations
- VS Code extension: Syntax highlighting and format preview
- CLI tool: Standalone command-line encoder/decoder
- Web playground: Interactive demo site for testing encodings
- CI/CD improvements: Enhance automated testing and release workflows
- Additional examples: Real-world use cases and patterns
- Performance guides: Best practices for different data shapes
- Video tutorials: Walkthrough of key features
- Blog posts: Deep dives into format design decisions
Pull requests are reviewed by project maintainers. We aim to:
- Provide initial feedback within 48 hours
- Complete reviews within 1 week for standard PRs
- Merge approved PRs promptly
During review, we evaluate:
- Correctness: Does the code work as intended?
- Tests: Are edge cases covered?
- Performance: Does this introduce performance regressions?
- Maintainability: Is the code clear and well-documented?
- Compatibility: Are there breaking changes?
When reporting bugs or requesting features:
Include:
- AGON version (
python -c "import agon; print(agon.__version__)") - Python version (
python --version) - Minimal reproduction code
- Expected vs actual behavior
- Error messages or stack traces
Include:
- Use case description
- Proposed API (if applicable)
- Alternative solutions considered
- Willingness to implement (if you plan to contribute)
- Documentation: Check docs/ for detailed guides
- Issues: Search existing issues
- Discussions: Start a discussion
By contributing to AGON, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to AGON! Your contributions help make LLM prompt optimization more accessible and reliable.