Thank you for your interest in contributing to the Computer Use Demo quickstart! This document outlines the process and guidelines for contributing to this project.
Please be respectful and constructive in all interactions. We aim to maintain a welcoming and inclusive environment for all contributors.
- Bugfixes and updates to our documentation that address correctness issues are always welcome
- Feature additions, refactors, and documentation updates beyond the scope of correctness (major changes) are accepted at the sole determination of the maintainers. We require each major change to be submitted in a separate Pull Request. We will assess new features under the following criteria:
- Adherence to coding standards
- Ease of use as a reference implementation
- User experience
- Applicability to a wide audience of developers
- Minimization of third-party dependencies
- Does not promote a product or service
Please open a github issue if you are need clarification on this policy or you want to discuss a new feature addition.
-
Create and activate a Python virtual environment:
python -m venv .venv source .venv/bin/activate # On Unix # or .venv\Scripts\activate # On Windows
-
Install development dependencies:
pip install -r dev-requirements.txt
-
Install pre-commit hooks:
pre-commit install
- Fork the repository and create a branch for your changes
- Make your changes following our coding standards
- Submit a pull request with a clear description of the changes
- Use clear, descriptive variable and function names
- Follow PEP 8 style guidelines for Python code
- Keep functions focused and single-purpose
- Avoid inline comments - code should be self-documenting
- Use type hints for all Python functions
- Use dataclasses for structured data (see
tools/base.py
for examples) - All tools must inherit from
BaseAnthropicTool
and implement required methods - Use abstract base classes (ABC) for defining interfaces
- Handle errors using
ToolError
andToolFailure
classes
We use several tools to maintain code quality:
- Ruff: For linting and formatting
- Run
ruff check .
for linting - Run
ruff format .
for formatting - See
ruff.toml
for enabled rules
- Run
- Pyright: For type checking
- Configuration in
pyproject.toml
- Configuration in
- Pre-commit: For automated checks before commits
- Add tests for new functionality in the
tests/
directory - Follow existing test patterns (see
tests/tools/
for examples) - Use pytest fixtures where appropriate
- Run tests with:
pytest
- Tests must pass in async mode (configured in pyproject.toml)
- All commits MUST be signed (use
git commit -S
) - Write clear, descriptive commit messages
- Use present tense ("Add feature" not "Added feature")
- Reference issue numbers when applicable
- Update documentation as needed
- Add tests for new functionality
- Ensure all checks pass:
- All tests pass
- Ruff linting passes
- Type checking passes
- Pre-commit hooks pass
- Request review from maintainers
- Address review feedback
When creating new tools:
- Inherit from
BaseAnthropicTool
- Implement
__call__
andto_params
methods - Use appropriate result types (
ToolResult
,CLIResult
, orToolFailure
) - Add comprehensive tests
- Document parameters and return types
- Keep README.md up to date
- Document new features and changes
- Use clear, concise language
- Include docstrings for all public classes and methods
- Use concise, single-line docstrings for simple functions
- For complex functions, include:
- A brief description
- Args/parameters if not obvious
- Return value if not obvious
- Any important notes about behavior
If you have questions, please open an issue for discussion.