Thank you for your interest in contributing to the Official Document AI Assistant.
- Clone the repository
- Install Python 3.12+ and Node.js 20+
- Set up backend:
cd backend && pip install -r requirements.txt - Set up frontend:
cd frontend && npm install
- Python: Follow PEP 8. Use type hints. Run
ruffbefore committing. - TypeScript: Follow ESLint config. Use strict types.
- Variables: English names. Comments in Chinese where necessary.
feat:new featurefix:bug fixdocs:documentationrefactor:code refactortest:adding testschore:maintenance
The following file types and paths must never be committed to the repository.
They are excluded by .gitignore and checked by the pre-commit hook:
| Category | Examples | Why |
|---|---|---|
| Office lock files | ~$*.docx, ~$*.dotx |
Temporary files created by Office when a document is open |
| Old docs / reports | docs/archive/, docs/reports/ |
Phase reports, one-time analysis docs (outdated) |
| Utility scripts | frontend/build_electron.py, packaging/build_release.py, generate_icon.py, scripts/generate_missing_templates.py, tests/fixtures/create_test_doc.py |
One-time build helpers / template generators, run locally |
| Chinese-named files at root | 启动应用.bat, 公文模板/ |
Cross-platform path encoding issues |
| Build outputs | *.exe, *.msi, *.deb, *.AppImage, *.dmg |
Generated by CI, not tracked in source |
| Node/Python caches | node_modules/, __pycache__/, .venv/ |
Dependency caches, platform-specific |
| Runtime data | data/, output/, *.db, *.log |
User data, database, encryption keys |
| IDE files | .vscode/, .idea/, *.swp, *.swo |
Editor-specific config |
| OS metadata | .DS_Store, Thumbs.db |
OS-generated hidden files |
| Temp/backup files | *.bak, *.tmp, *.pid |
Temporary artifacts |
- All file/directory paths must use English characters (A-Z, a-z, 0-9,
-,_,.).- ❌
公文模板/,启动应用.bat,API测试指南.md - ✅
dotx_templates/,startup.bat,api-test-guide.md
- ❌
- Binary files (fonts, images, test fixtures) should be kept small and only committed if essential.
- Source code files must have correct extensions (
.py,.ts,.tsx,.yaml,.json, etc.).
To prevent accidental commits of unwanted files, install the pre-commit hook:
# From project root, run:
git config core.hooksPath .githooksAfter running this, Git will automatically check every commit for forbidden files.
- Create a feature branch from
main - Make your changes with tests
- Run all tests locally:
pytest tests/ - Ensure no forbidden files are included (run
git statusto check) - Submit a PR with a clear description