# Contributing to Marcus Welcome to the Marcus contributor guide! This page provides an overview of how to contribute to Marcus, with links to detailed guides for specific topics. ```{note} This is the Sphinx documentation version of our contributing guide. For the complete markdown version, see [CONTRIBUTING.md](https://github.com/lwgray/marcus/blob/develop/CONTRIBUTING.md) in the repository root. ``` ## Quick Links ::::{grid} 2 :gutter: 3 :::{grid-item-card} ๐Ÿš€ First Time Contributing? :link: #first-time-contributors Jump to our beginner-friendly guide ::: :::{grid-item-card} ๐Ÿ’ป Setup Development Environment :link: local-development :link-type: doc Complete local development setup guide ::: :::{grid-item-card} ๐Ÿ”„ Development Workflow :link: development-workflow :link-type: doc Git workflow and best practices ::: :::{grid-item-card} โš™๏ธ Configuration :link: configuration :link-type: doc Environment and service configuration ::: :::: ## Ways to Contribute Marcus welcomes contributions beyond just code! Here are the many ways you can help: ### Code Contributions - **Bug Fixes**: Fix issues and improve stability - **New Features**: Implement new functionality - **Performance**: Optimize existing code - **Refactoring**: Improve code quality and maintainability ### Non-Code Contributions - **Documentation**: Write guides, fix typos, add examples - **Testing**: Write tests, improve coverage, find bugs - **Design**: Create diagrams, improve UX, design assets - **Community**: Answer questions, write tutorials, give talks - **Translation**: Help make Marcus accessible globally - **Ideas**: Suggest features, improvements, use cases ## First Time Contributors New to open source? Marcus is a great place to start! ### Find Your First Issue 1. **Look for beginner-friendly issues**: - Browse issues labeled [`good first issue`](https://github.com/lwgray/marcus/labels/good%20first%20issue) - These are specifically chosen for newcomers - Usually involve small, focused changes 2. **Areas needing help**: - ๐Ÿงช Test coverage (especially integration tests) - ๐Ÿ“š Documentation and tutorials - ๐Ÿ› Bug fixes - ๐Ÿ”ง Provider support (Jira, Trello, Linear) 3. **Don't see something you like?** - Ask in [GitHub Discussions](https://github.com/lwgray/marcus/discussions) - We'll help you find a suitable task! ### First Pull Request Checklist Before submitting your first PR, make sure you've: - [ ] Read the [Local Development Setup](local-development.md) guide - [ ] Set up your development environment - [ ] Found an issue to work on (or created one) - [ ] Made your changes in a new branch from `develop` - [ ] Tested your changes locally - [ ] All pre-commit hooks pass - [ ] Opened a Pull Request targeting `develop` ```{tip} Your first PR doesn't need to be perfect! Start small (fix a typo, improve an error message) and learn from feedback. ``` ## Development Prerequisites ### Required Software - **Python 3.11+**: Core runtime - **Docker & Docker Compose**: For running Planka - **Git**: Version control - **Node.js 16+**: For kanban-mcp ### AI Model (Choose One) ::::{grid} 2 :gutter: 3 :::{grid-item-card} ๐Ÿ†“ Free Option (Recommended) **Ollama with Qwen2.5-Coder** ```bash # Install Ollama curl -fsSL https://ollama.com/install.sh | sh # Pull model ollama pull qwen2.5-coder:7b # Use free config cp .env.dev.example .env ``` โœ… No cost, runs locally, excellent code quality ::: :::{grid-item-card} ๐Ÿ’ณ Paid Options **Cloud AI Providers** - Anthropic (Claude) - OpenAI (GPT-4) - Google (Gemini) Requires API keys and usage fees ::: :::: See [Setup Local LLM Guide](../getting-started/setup-local-llm.md) for complete free setup instructions. ## Branching Strategy Marcus uses a **develop branch workflow** to manage contributions efficiently: ```{important} All pull requests must target the `develop` branch, not `main`. ``` ### Branch Overview - **`main`**: Production-ready code (protected, no direct pushes) - **`develop`**: Primary development branch (all PRs target here) - **Feature branches**: Created in your fork from `develop` ### Why This Approach? โœ… Reduces merge conflicts by keeping development synchronized โœ… Allows testing before production release โœ… Keeps your fork clean and organized โœ… Easy to stay up-to-date with latest changes ### Quick Workflow ```bash # 1. Fork the repository on GitHub # 2. Clone your fork git clone https://github.com/YOUR_USERNAME/marcus.git cd marcus # 3. Add upstream remote git remote add upstream https://github.com/lwgray/marcus.git # 4. Always branch from develop git checkout develop git pull upstream develop # 5. Create feature branch git checkout -b feature/your-feature-name # 6. Make changes and submit PR targeting develop ``` See [Development Workflow](development-workflow.md) for the complete guide. ## Code Quality Standards All contributions must meet our quality standards: ### Pre-Commit Hooks We use [pre-commit](https://pre-commit.com/) hooks that run automatically: - **MyPy**: Static type checking - **Black**: Code formatting - **Ruff**: Fast linting - **isort**: Import organization - **detect-secrets**: Prevent committing secrets ```bash # Install hooks (one-time) pre-commit install # Run manually on all files pre-commit run --all-files # Run on staged files pre-commit run ``` ### Quality Checklist Before submitting a PR: - [ ] All pre-commit hooks pass - [ ] Tests pass locally (`pytest`) - [ ] MyPy type checking passes (`mypy src/`) - [ ] Code is formatted with Black - [ ] Imports organized with isort - [ ] No secrets detected - [ ] Documentation updated - [ ] Commit messages follow convention ## Coding Standards ### Python Style We follow [PEP 8](https://peps.python.org/pep-0008/) with these requirements: 1. **Type Hints**: Always use for function arguments and returns 2. **Docstrings**: NumPy-style for all public functions/classes 3. **Error Handling**: Use Marcus Error Framework for user-facing errors 4. **Logging**: Use structured logging, not print statements 5. **Constants**: Define at module level in UPPER_CASE 6. **Tests**: Aim for 80% coverage, test edge cases ### Example ```python def assign_task(agent_id: str, task_id: str, priority: int = 1) -> TaskAssignment: """ Assign a task to an agent with optional priority. Parameters ---------- agent_id : str Unique identifier of the agent task_id : str Unique identifier of the task priority : int, optional Task priority (1-5), by default 1 Returns ------- TaskAssignment Assignment details including agent, task, and timestamp Raises ------ AgentNotFoundError If agent doesn't exist TaskNotFoundError If task doesn't exist """ # Implementation here pass ``` ### Commit Message Convention We use [Conventional Commits](https://www.conventionalcommits.org/): ``` ():