Thank you for your interest in contributing to AgentEnvironment! This document provides guidelines and instructions for contributing.
Please be respectful and constructive in all interactions within this project.
- Python 3.10 or higher
- pip or your preferred Python package manager
-
Clone the repository:
git clone https://github.com/Git-Hub-Chris/AgentEnvironment.git cd AgentEnvironment -
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Install pre-commit hooks:
pre-commit install
Run the full test suite:
pytestRun tests with coverage:
pytest --cov=src --cov-report=htmlRun specific test file:
pytest tests/test_agents.py -vBefore submitting changes, ensure:
-
Pre-commit checks pass:
pre-commit run --all-files
-
Tests pass:
pytest
-
No security issues:
gitleaks detect
Create a branch for your changes:
git checkout -b feature/your-feature-nameUse descriptive branch names:
feature/for new featuresfix/for bug fixesdocs/for documentation updatesrefactor/for refactoring
Write clear, concise commit messages:
- Use imperative mood ("add feature" not "added feature")
- Reference issues when applicable: "fix: resolve issue #123"
- Keep the first line under 50 characters
Examples:
feat: add agent timeout configurationfix: handle agent error states correctlydocs: update setup instructionstest: add fixture for mock agents
- All new features must include tests
- Maintain or improve code coverage (aim for >80%)
- Tests should be in the
tests/directory - Use pytest fixtures from
tests/conftest.pywhen possible
src/
agents/ # Agent implementation modules
__init__.py
base_agent.py # Base Agent class
tests/
__init__.py
conftest.py # Pytest fixtures
test_agents.py # Agent tests
docs/ # Documentation
architecture.md # Architecture overview
pyproject.toml # Project metadata and pytest config
requirements.txt # Development dependencies
Extend the Agent base class in src/agents/:
from src.agents import Agent, AgentConfig
class MyAgent(Agent):
def _process_task(self, task: str) -> Any:
# Implement custom task processing
return resultAdd tests in tests/test_agents.py or create a new test file:
def test_my_agent_feature(agent_config):
agent = MyAgent(agent_config)
result = agent.execute("test_task")
assert result == expected_valueUpdate README.md and docs/ as needed.
-
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Write a clear PR title and description
- Reference related issues
- Ensure CI/CD checks pass
- Request review from maintainers
-
Address Review Feedback:
- Make requested changes
- Re-run tests
- Push updates (no need to close and reopen)
Report bugs or suggest features using GitHub Issues:
- Check existing issues first to avoid duplicates
- Provide clear reproduction steps for bugs
- Include your environment (OS, Python version, etc.)
- Use descriptive titles and labels
By contributing, you agree that your contributions will be licensed under the MIT License.
Feel free to open an issue or reach out to the maintainers with questions about contributing.
Thank you for helping improve AgentEnvironment! 🚀