Contributing to Cursor-Utils¶
Thank you for your interest in contributing to Cursor-Utils! This guide will help you get started with the development process and outline our standards and expectations.
Development Setup¶
Prerequisites¶
Before you begin, ensure you have the following installed:
- Python 3.8 or newer
- Git
- A text editor or IDE (VS Code, PyCharm, etc.)
- UV package manager (recommended)
Setting Up the Development Environment¶
- Fork the repository
Start by forking the Cursor-Utils repository on GitHub.
- Clone your fork
- Create a virtual environment
Using UV (recommended):
Using standard venv:
- Install development dependencies
Using UV:
Using pip:
- Install pre-commit hooks
Development Workflow¶
Creating a New Feature¶
- Create a new branch
- Implement your changes
Follow the coding standards and ensure your code is well-tested.
- Run the tests
- Update documentation
If your changes affect the user interface or behavior, update the relevant documentation.
- Commit your changes
- Push your changes
- Create a pull request
Go to the GitHub repository and create a pull request from your branch to the main branch.
Fixing a Bug¶
- Create a new branch
- Implement your fix
Ensure you include tests that reproduce the bug and verify your fix.
- Run the tests
- Commit your changes
- Push your changes
- Create a pull request
Go to the GitHub repository and create a pull request from your branch to the main branch.
Coding Standards¶
Python Style¶
- Follow PEP 8 style guidelines
- Use Black for code formatting
- Use isort for import sorting
- Use Ruff for linting
Type Annotations¶
- Use type annotations for all function parameters and return values
- Follow PEP 484 for type hints
- Use PyRight for type checking
Documentation¶
- Document all public functions, classes, and methods
- Follow Google style docstrings
- Keep documentation up to date with code changes
- Include examples where appropriate
Testing¶
- Write unit tests for all new functionality
- Aim for high test coverage, especially for core functionality
- Use pytest as the testing framework
- Mock external services in tests
Commits¶
- Use conventional commit messages:
Feature:
for new featuresFix:
for bug fixesDocs:
for documentation changesTest:
for testsRefactor:
for code refactoringChore:
for maintenance tasks- Keep commits focused and atomic
- Reference issue numbers in commit messages where applicable
Pull Request Process¶
- Fill in the pull request template with all relevant information
- Ensure all checks pass (tests, linting, etc.)
- Request a review from a maintainer
- Address review feedback promptly
- Update documentation if necessary
- Squash commits if requested by the reviewer
Adding a New Command¶
To add a new command to Cursor-Utils:
- Create a new command file in
src/cursor_utils/cli/commands/
- Implement the command following the existing command pattern
- Register the command in
src/cursor_utils/cli/parser.py
- Add tests for the new command
- Document the command in the appropriate documentation files
Integrating with External Services¶
When adding a new service integration:
- Create a service client in
src/cursor_utils/services/
- Implement authentication using Configuration for API keys
- Handle errors appropriately using the error handling system
- Add tests with mocked API responses
- Document the service in the appropriate documentation files
Release Process¶
Cursor-Utils follows Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for new functionality in a backward-compatible manner
- PATCH version for backward-compatible bug fixes
The release process is as follows:
- Update version in
pyproject.toml
- Update CHANGELOG.md with the changes in the new version
- Create a pull request for the version bump
- Merge the pull request once approved
- Create a tag for the new version
- Build and publish the package to PyPI
Getting Help¶
If you need help with the development process:
- Check the documentation in the
docs/
directory - Open an issue with a question or discussion topic
- Reach out to the maintainers directly
Code of Conduct¶
Please be respectful and constructive in your interactions with other contributors. We aim to foster an inclusive and welcoming community for all developers.