# Contributing to YTPipe
Thank you for your interest in contributing to YTPipe! π
## π Quick Start for Contributors
1. **Fork the repository**
2. **Clone your fork**:
```bash
git clone https://github.com/YOUR_USERNAME/ytpipe.git
cd ytpipe
```
3. **Set up development environment**:
```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -e .
```
---
## π― Ways to Contribute
### 1. Report Bugs
Open an issue with:
- Clear description of the bug
- Steps to reproduce
- Expected vs actual behavior
- Your environment (Python version, OS, etc.)
### 2. Suggest Features
Open an issue with:
- Clear description of the feature
- Use case and benefits
- Proposed implementation (optional)
### 3. Submit Code
- Fix bugs
- Add features
- Improve documentation
- Write tests
- Optimize performance
---
## π Development Guidelines
### Code Style
- **Type hints** on all functions
- **Docstrings** (Google-style) on all public methods
- **Pydantic models** for data structures
- **Async/await** for I/O operations
- **Domain exceptions** from `ytpipe.core.exceptions`
### Service Pattern
```python
class NewService:
"""Service description."""
def __init__(self, config_params):
"""Initialize with configuration."""
self.model = None # Lazy load
async def process(self, input: PydanticModel) -> PydanticModel:
"""Process with type-safe contracts."""
# Implementation
return OutputModel(...)
```
### Testing
- Write unit tests for new services
- Add integration tests for pipeline changes
- Ensure tests pass: `pytest tests/`
- Target: 80%+ code coverage
---
## π Pull Request Process
1. **Create a branch**:
```bash
git checkout -b feature/your-feature-name
```
2. **Make your changes**:
- Follow code style guidelines
- Add tests for new functionality
- Update documentation
3. **Test your changes**:
```bash
pytest tests/
python -m ytpipe.mcp.server # Test MCP server starts
ytpipe "https://youtube.com/watch?v=dQw4w9WgXcQ" # Test pipeline
```
4. **Commit your changes**:
```bash
git commit -m "feat: Add amazing feature"
```
Use conventional commits:
- `feat:` - New feature
- `fix:` - Bug fix
- `docs:` - Documentation
- `test:` - Tests
- `refactor:` - Code refactoring
- `perf:` - Performance improvement
5. **Push and create PR**:
```bash
git push origin feature/your-feature-name
```
Then open a Pull Request on GitHub.
---
## π Architecture Principles
### Service Isolation
- Each service does ONE thing well
- No direct dependencies between services
- Communication via Pydantic models only
### Type Safety
- All data uses Pydantic models
- No raw dicts for structured data
- Validation at runtime
### Error Handling
- Use domain-specific exceptions
- Provide actionable error messages
- Graceful degradation
### Performance
- Lazy model loading
- Async/await for I/O
- Batch processing where possible
---
## π Resources
- [Architecture Overview](docs/ARCHITECTURE.md)
- [Development Guide](AGENT_KERNEL.md)
- [API Reference](CLAUDE.md)
- [MCP Protocol](https://modelcontextprotocol.io/)
---
## π€ Questions?
- Open an issue for questions
- Check existing issues first
- Tag with `question` label
---
Thank you for contributing to YTPipe! π