We welcome contributions to make Ultimate Focus Timer even better! This document provides guidelines for contributing to the project.
- Python 3.8+ (Python 3.10+ recommended)
- Git for version control
- Basic understanding of the Pomodoro Technique
- Familiarity with Python development
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/your-username/ultimate-focus-timer.git cd ultimate-focus-timer -
Set up virtual environment:
python -m venv .venv # Windows .venv\Scripts\activate # macOS/Linux source .venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt pip install -r requirements-dev.txt # If available -
Run the application to ensure everything works:
python main.py --check-deps python main.py
- Follow PEP 8 - Use tools like
flake8orblackfor code formatting - Type hints - Include type hints for function parameters and return values
- Docstrings - Document all public methods and classes using Google-style docstrings
- Comments - Write clear, concise comments for complex logic
def start_session(self, duration: int, session_type: str) -> bool:
"""Start a new focus session.
Args:
duration: Session duration in minutes
session_type: Type of session ('work', 'short_break', 'long_break')
Returns:
bool: True if session started successfully, False otherwise
Raises:
ValueError: If duration is not positive or session_type is invalid
"""
if duration <= 0:
raise ValueError("Duration must be positive")
# Implementation here
return True- Test on multiple platforms when possible (Windows, macOS, Linux)
- Use
pathlib.Pathinstead of string paths - Handle platform-specific features gracefully with fallbacks
- Avoid hardcoded paths - use configuration or platform detection
import platform
from pathlib import Path
def get_config_dir() -> Path:
"""Get platform-appropriate configuration directory."""
system = platform.system()
if system == "Windows":
return Path.home() / "AppData" / "Local" / "focus"
elif system == "Darwin": # macOS
return Path.home() / "Library" / "Application Support" / "focus"
else: # Linux
return Path.home() / ".config" / "focus"- Test your changes before submitting
- Include test cases for new functionality
- Verify cross-platform compatibility when possible
- Test with different Python versions if available
Use clear, descriptive commit messages:
feat: Add support for custom notification sounds
fix: Resolve MPV path detection on macOS
docs: Update installation instructions
refactor: Simplify music controller initialization
test: Add unit tests for session manager
- Check existing issues to avoid duplicates
- Update to the latest version and test again
- Try basic troubleshooting:
python main.py --check-deps python main.py --info
When reporting bugs, please include:
-
Environment information:
- Operating System and version
- Python version
- Application version
-
Steps to reproduce the issue
-
Expected vs actual behavior
-
Error messages or logs (if any)
-
Screenshots (if relevant)
We welcome feature suggestions! When requesting features:
- Check existing issues and discussions
- Describe the use case - why is this feature needed?
- Provide detailed specifications - how should it work?
- Consider implementation complexity - is it feasible?
We're particularly interested in:
- New interface modes (web interface, mobile companion, etc.)
- Additional music sources (Spotify integration, local music, etc.)
- Enhanced analytics (machine learning insights, productivity patterns)
- Integrations (task managers, calendar apps, etc.)
- Accessibility improvements
- Performance optimizations
- Bug fixes - Fix existing issues
- New features - Implement requested functionality
- Performance improvements - Optimize existing code
- Cross-platform support - Improve compatibility
- Code refactoring - Improve code structure and maintainability
- README improvements - Clarify instructions
- Code documentation - Add docstrings and comments
- User guides - Create tutorials and how-to guides
- API documentation - Document public interfaces
- Unit tests - Test individual components
- Integration tests - Test component interactions
- Platform testing - Verify cross-platform compatibility
- User acceptance testing - Test real-world usage scenarios
- UI/UX improvements - Enhance user interfaces
- Theme contributions - Create new color schemes
- Icon design - Improve visual elements
- Accessibility - Make the app more accessible
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes following the guidelines above
-
Test thoroughly:
python main.py --check-deps # Test different interfaces python main.py --gui python main.py --console python main.py --dashboard -
Update documentation if needed
-
Commit your changes:
git add . git commit -m "feat: Add your feature description"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create Pull Request on GitHub
-
Fill out the PR template with:
- Description of changes
- Testing performed
- Screenshots (if UI changes)
- Breaking changes (if any)
- Be responsive to feedback and questions
- Make requested changes promptly
- Keep PR focused - one feature/fix per PR
- Squash commits if requested
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes for significant contributions
- README acknowledgments section
- Use inclusive language
- Be constructive in feedback
- Respect different perspectives
- Help newcomers get started
- Use GitHub Issues for bug reports and feature requests
- Use GitHub Discussions for questions and general discussion
- Be clear and concise in communication
- Provide context when asking questions
- Code Editors: VS Code, PyCharm, Sublime Text
- Linting: flake8, pylint, black
- Testing: pytest, unittest
- Documentation: Sphinx, MkDocs
If you have questions about contributing:
- Check the GitHub Discussions
- Open a new discussion with the "Q&A" category
- Tag your question appropriately
Thank you for contributing to Ultimate Focus Timer! Together, we can build an amazing productivity tool for everyone. 🎯