Contributing Guidelines¶
Thank you for your interest in contributing to ModelDock!
Getting Started¶
- Fork and clone the repo
- Create a virtual environment — never install globally
- Install dependencies with dev extras
- Create a branch from
main
git clone https://github.com/your-username/modeldock.git
cd modeldock
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev,ollama]"
pre-commit install
git checkout -b feature/my-change
Workflow¶
- Branch first — never work on
main - Discover — read relevant files (QUICKSTART.md, AGENT.md, Architecture.md)
- Plan — create concrete execution plan
- Propose & approve — get user sign-off before coding
- Execute — one step at a time, validate after each
- Validate — run full test suite
- PR — commit, push, open PR for review
Branch Naming¶
| Type | Format | Example |
|---|---|---|
| Feature | feature/{desc} | feature/ollama-progress |
| Bug Fix | fix/{desc} | fix/cache-manifest |
| Documentation | docs/{desc} | docs/update-readme |
| Refactor | refactor/{desc} | refactor/extract-runtime-base |
| Test | test/{desc} | test/add-contract-suite |
| Chore | chore/{desc} | chore/bump-deps |
Coding Standards¶
- Python 3.10+, type hints on all public functions;
mypy --strictclean - Pydantic v2 for all data models
snake_casefunctions,PascalCaseclasses,UPPER_SNAKE_CASEconstants- Functions under 50 lines; one responsibility per module
- No global variables; pass dependencies via constructors (Dependency Inversion)
- No business logic in CLI — CLI only calls
core - Never raise generic
Exception— useModelDockErrorsubclasses with context - Keep
domain/andports/pure (no I/O, no framework imports) - Communicate through
ports/interfaces, not concrete adapters
Commit Guidelines¶
Format¶
Types¶
| Type | Example |
|---|---|
feat | feat(registry): add remote catalog refresh |
fix | fix(cache): handle partial download cleanup |
docs | docs(readme): add configuration table |
refactor | refactor(runtime): extract BaseRuntime |
test | test(downloader): add resume tests |
chore | chore: bump pydantic to 2.5 |
Rules¶
- Imperative mood ("add" not "added")
- Subject under 72 characters
- Reference issues when applicable
Pull Request Process¶
Before Submitting¶
- Rebase on upstream
main - Run all quality gates:
- Update docs if behavior changed
Review Process¶
- Maintainers review your PR
- Address feedback on the same branch
- Once approved, a maintainer merges (never self-merge)
Quality Gates¶
ruff check src tests # lint
ruff format src tests # format
mypy src # type check
bandit -r src # security
pytest --cov=modeldock # tests + coverage
pre-commit run --all-files # all-in-one
Targets: ruff clean, mypy --strict clean, bandit clean, ≥80% coverage.
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.