Contributing to PrompTrek
Thank you for your interest in contributing to PrompTrek! This guide will help you get started with contributing to the project.
π Quick Start for Contributors
Prerequisites
- Python 3.9 or higher
- Git
- A GitHub account
Development Setup
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/promptrek.git cd promptrek - Install development dependencies:
# Using uv (recommended) uv sync # Or using pip pip install -e ".[dev]" - Install pre-commit hooks:
pre-commit install - Run tests to verify setup:
# Using uv uv run pytest # Or using pytest directly pytest
π― Ways to Contribute
π Bug Reports
Found a bug? Help us fix it!
- Search existing issues to avoid duplicates
- Create a new issue using our bug report template
- Include detailed information:
- PrompTrek version
- Python version
- Operating system
- Steps to reproduce
- Expected vs actual behavior
- Any error messages
π‘ Feature Requests
Have an idea for a new feature?
- Search existing issues for similar requests
- Create a feature request using our template
- Describe the use case and expected benefits
π§ Code Contributions
Ready to write some code? Hereβs how:
1. Choose an Issue
- Look for issues labeled
good first issuefor beginners - Check issues labeled
help wantedfor areas needing assistance - Comment on the issue to express interest
2. Create a Branch
git checkout -b feature/your-feature-name
# or
git checkout -b fix/bug-description
3. Make Your Changes
- Follow our coding standards
- Write or update tests as needed
- Update documentation if necessary
4. Test Your Changes
# Run all tests
uv run pytest
# Run tests with coverage
uv run pytest --cov=promptrek --cov-report=html
# Run linting
uv run black src/ tests/
uv run flake8 src/ tests/
uv run mypy src/
5. Commit Your Changes
We use Conventional Commits:
# Format: type(scope): description
git commit -m "feat(adapters): add support for new editor"
git commit -m "fix(parser): handle edge case in YAML parsing"
git commit -m "docs(readme): update installation instructions"
Commit types:
feat: New featuresfix: Bug fixesdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasksci: CI/CD changes
6. Push and Create Pull Request
git push origin your-branch-name
Then create a pull request on GitHub using our PR template.
π Documentation
Documentation improvements are always welcome!
- Fix typos or unclear explanations
- Add examples and use cases
- Improve API documentation
- Create tutorials or guides
- Update this website
π¨ New Editor Support
Want to add support for a new AI editor?
- Research the editorβs prompt format
- Create an issue to discuss the implementation
- Follow our adapter pattern (see
src/promptrek/adapters/) - Add comprehensive tests
- Update documentation
π Development Guidelines
Coding Standards
Code Quality
- Type Hints: All public functions must have type hints
- Docstrings: All public classes and functions need docstrings
- Error Handling: Use proper exception handling with custom exceptions
- Logging: Use structured logging throughout the application
Code Style
We use automated tools to maintain consistent code style:
# Format code
black src/ tests/
# Sort imports
isort src/ tests/
# Lint code
flake8 src/ tests/ --max-line-length=88
# Type checking
mypy src/
Testing Standards
- Coverage: Maintain minimum 90% test coverage
- Unit Tests: Test individual functions and classes
- Integration Tests: Test complete workflows
- Fixtures: Use reusable test data and configurations
# Run tests with coverage
pytest --cov=promptrek --cov-report=html --cov-fail-under=90
Project Structure
promptrek/
βββ src/
β βββ promptrek/
β βββ cli/ # Command-line interface
β βββ core/ # Core functionality
β βββ adapters/ # Editor-specific adapters
β βββ templates/ # Jinja2 templates
β βββ utils/ # Utility functions
βββ tests/
β βββ unit/ # Unit tests
β βββ integration/ # Integration tests
β βββ fixtures/ # Test data
βββ examples/ # Example configurations
βββ scripts/ # Development scripts
Adding a New Editor Adapter
- Create the adapter class in
src/promptrek/adapters/:from .base import EditorAdapter class NewEditorAdapter(EditorAdapter): def generate(self, prompt, output_dir, **kwargs): # Implementation here pass -
Register the adapter in
src/promptrek/core/registry.py -
Add comprehensive tests in
tests/unit/adapters/ - Update documentation and examples
Testing Your Contributions
Local Testing
# Run specific test file
pytest tests/unit/test_cli.py
# Run tests with verbose output
pytest -v
# Run tests for specific functionality
pytest -k "test_generate"
Integration Testing
# Test CLI commands
promptrek init --output test.promptrek.yaml
promptrek validate test.promptrek.yaml
promptrek generate --all --input test.promptrek.yaml --dry-run
Manual Testing
Test your changes with real-world scenarios:
- Create a test project
- Generate prompts for multiple editors
- Verify the generated files work in actual editors
- Test edge cases and error conditions
π Pull Request Process
Before Submitting
- All tests pass locally
- Code follows style guidelines
- Documentation is updated
- Commit messages follow conventional format
- Changes are focused and atomic
PR Requirements
- Clear title and description
- Link to related issues
- Include testing instructions
- Add screenshots for UI changes
- Request appropriate reviewers
Review Process
- Automated checks must pass (CI/CD)
- Code review by maintainers
- Testing on multiple platforms
- Documentation review if applicable
- Approval and merge
π· Release Process
PrompTrek uses semantic versioning and automated releases:
- Patch (1.0.1): Bug fixes
- Minor (1.1.0): New features, backward compatible
- Major (2.0.0): Breaking changes
Releases are automated based on conventional commits.
π€ Community Guidelines
Code of Conduct
- Be respectful and inclusive
- Welcome newcomers and help them learn
- Focus on constructive feedback
- Maintain professional communication
Getting Help
- Documentation: Start with this guide and the user documentation
- Issues: Search existing issues before creating new ones
- Discussions: Use GitHub Discussions for questions and ideas
- Reviews: Be patient and provide constructive feedback
Recognition
Contributors are recognized in:
- Release notes and changelogs
- Repository contributors list
- Documentation acknowledgments
π― Contribution Ideas
Good First Issues
- Fix typos in documentation
- Add examples for existing features
- Improve error messages
- Add unit tests for existing functionality
Advanced Contributions
- Add support for new AI editors
- Implement advanced template features
- Optimize performance for large configurations
- Add new CLI commands or options
Documentation
- Create video tutorials
- Write blog posts about use cases
- Translate documentation
- Improve API documentation
π Useful Resources
π Contact
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Repository: GitHub Repository
Thank you for contributing to PrompTrek! Your efforts help make AI-assisted development more accessible and consistent for developers everywhere. π