# Contributing to Agent Patterns Thank you for your interest in contributing to Agent Patterns! This guide will help you get started. ## Table of Contents - [Code of Conduct](#code-of-conduct) - [Getting Started](#getting-started) - [Development Setup](#development-setup) - [Making Changes](#making-changes) - [Testing](#testing) - [Code Style](#code-style) - [Submitting Changes](#submitting-changes) - [Types of Contributions](#types-of-contributions) --- ## Code of Conduct ### Our Pledge We pledge to make participation in Agent Patterns a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ### Our Standards **Positive behavior includes:** - Using welcoming and inclusive language - Being respectful of differing viewpoints - Gracefully accepting constructive criticism - Focusing on what's best for the community - Showing empathy towards other community members **Unacceptable behavior includes:** - Trolling, insulting/derogatory comments, and personal attacks - Public or private harassment - Publishing others' private information without permission - Other conduct which could reasonably be considered inappropriate ### Enforcement Report unacceptable behavior to [osok@users.noreply.github.com](mailto:osok@users.noreply.github.com). All complaints will be reviewed and investigated promptly and fairly. --- ## Getting Started ### Prerequisites - Python 3.10 or higher - Git - GitHub account - OpenAI or Anthropic API key (for testing) ### Fork and Clone 1. **Fork the repository** on GitHub 2. **Clone your fork**: ```bash git clone https://github.com/YOUR-USERNAME/agent-patterns.git cd agent-patterns ``` 3. **Add upstream remote**: ```bash git remote add upstream https://github.com/osok/agent-patterns.git ``` --- ## Development Setup ### 1. Create Virtual Environment ```bash python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate ``` ### 2. Install Development Dependencies ```bash pip install -e ".[dev]" ``` This installs: - Agent Patterns in editable mode - pytest, pytest-cov, pytest-mock - black, ruff, mypy - All core dependencies ### 3. Set Up Environment ```bash cp .env.example .env # Edit .env and add your API keys ``` ### 4. Verify Setup ```bash # Run tests pytest # Check formatting black --check agent_patterns tests examples # Check linting ruff check agent_patterns tests examples # Check types mypy agent_patterns ``` All checks should pass. --- ## Making Changes ### Branch Strategy 1. **Keep main branch synced**: ```bash git checkout main git pull upstream main ``` 2. **Create feature branch**: ```bash git checkout -b feature/your-feature-name # or git checkout -b fix/your-bugfix-name ``` Branch naming: - `feature/` - New features - `fix/` - Bug fixes - `docs/` - Documentation changes - `refactor/` - Code refactoring - `test/` - Test additions/improvements ### Making Code Changes 1. **Edit code** in your feature branch 2. **Add tests** for new functionality 3. **Update documentation** if needed 4. **Run tests** frequently: ```bash pytest tests/test_your_changes.py -v ``` ### Commit Messages Write clear, descriptive commit messages: ```bash # Good git commit -m "Add STORM pattern implementation" git commit -m "Fix ReAct infinite loop on empty tool results" git commit -m "Update README with new pattern examples" # Bad git commit -m "fix bug" git commit -m "updates" git commit -m "WIP" ``` **Format:** ``` :