-
Notifications
You must be signed in to change notification settings - Fork 3
Contributing
Thank you for your interest in contributing to MomShell! This guide covers the collaboration standards and development workflow for contributors.
For environment setup and running the project, see:
- Getting Started - Prerequisites, installation, and running
- Development Guide - Development environment setup
We recommend VS Code for development. Configure it as follows:
-
Select Python Interpreter:
- Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) - Type and select
Python: Select Interpreter - Choose the option containing
backend/.venv
- Open Command Palette (
-
Install Recommended Extensions:
- Python (Microsoft)
- Ruff (Astral Software) - Code formatting and linting
- Mypy (Microsoft) - Static type checking
Before writing code, update your local branch and sync dependencies:
git checkout dev
git pull --rebase origin dev
cd backend && uv sync && cd ..
cd frontend && npm install && cd ..Before committing, run these checks locally:
# Using Make (recommended)
make lint # Run all linters
make format # Format all code
make typecheck # Run type checkers
make check # Run lint + typecheckOr manually:
# Backend
cd backend
uv run ruff format .
uv run ruff check . --fix
uv run mypy app/
# Frontend
cd frontend
npm run lint
npm run buildBackend (Python) - Do not use pip directly:
cd backend
uv add numpy # Production dependency
uv add --dev ruff # Development dependencyFrontend (Node.js):
cd frontend
npm install axios # Production dependency
npm install -D @types/node # Development dependencyBackend (backend/ directory):
-
uv.lock- Auto-generated. Do not edit manually. Must be committed. -
requirements.txt- Auto-generated byuv export. Do not edit manually. -
Conflict Resolution: Run
cd backend && uv lock && uv export > requirements.txt
Frontend:
-
package-lock.json- Auto-generated. Do not edit manually. Must be committed. -
Conflict Resolution: Delete
package-lock.json, runnpm install
- Verify large binary files (.pt, .parquet, .db) are listed in
.gitattributesfor LFS - Never commit files larger than 10MB without LFS
Never commit:
-
.env- Use.env.exampleas template - Credential files (
credentials.json,*.pem,*.key) -
__pycache__/,node_modules/,.next/,out/
Backend (Python) - Enforced by Ruff and Mypy:
- PEP 8 + Black formatting (double quotes, 88-char lines, 4-space indent)
- Imports ordered: standard library → third-party → local
- Type hints required, must pass Mypy
Frontend (TypeScript) - Enforced by ESLint:
- Prettier defaults (single quotes, 2-space indent, semicolons)
- Strict TypeScript, no unjustified
anytypes - Follow React hooks rules
All commits must follow Conventional Commits: type: description
| Type | Description | CI Behavior |
|---|---|---|
| feat | New feature | Triggers build/test |
| fix | Bug fix | Triggers build/test |
| refactor | Code refactoring | Triggers build/test |
| perf | Performance improvement | Triggers build/test |
| test | Add or update tests | Triggers build/test |
| style | Code style changes | Skips CI build |
| docs | Documentation only | Skips CI build |
| chore | Build config or tooling | Skips CI build |
| ci | CI/CD configuration | Skips CI build |
| build | Build system changes | Skips CI build |
| revert | Revert a previous commit | Triggers build/test |
This project uses a dual main branch strategy (main for production, dev for development).
-
Branch Naming:
-
dev- Main development branch. Create feature branches from here. -
main- Production releases only. Direct pushes prohibited. - Feature branches:
feat/feature-nameorfix/issue-description
-
-
Before Pull Request:
git fetch origin git rebase origin/dev
-
Submission:
- Ensure all quality checks pass locally
- Push branch (
git push --force-with-leaseafter rebase) - Create PR with target branch set to
dev
-
Merge Criteria:
- All CI checks must pass
- Code review approval from a CODEOWNER required
Q: uv/nvm command not found?
- Restart terminal after installation. Windows: try running PowerShell as administrator.
Q: VS Code showing errors?
- Verify Python interpreter is set to
backend/.venv, not system Python.
Q: Git rejecting commits?
- Pre-commit checks failed. Run
uv run ruff format .anduv run ruff check . --fix, then commit again.
Q: Frontend build failing?
- Run
cd frontend && npm install. If errors persist, deletenode_modulesandpackage-lock.json, thennpm install.
Q: Port already in use?
lsof -i :8000 # Find process on port
kill -9 <PID> # Kill by PID