|
| 1 | +# Agent Guidelines for DocHub |
| 2 | + |
| 3 | +This codebase is destined to live for a long time, |
| 4 | +with minimal maintenance and to be accessible to junior newcomers. |
| 5 | +We minimize the number of dependencies. |
| 6 | +We prefer simple patterns over clever ones. |
| 7 | +JavaScript is kept to a minimum, we do not use build steps. |
| 8 | +We prefer plain HTML first, hotwire turbo second, hotwire stimulus third and other |
| 9 | +JS libs only when necessary |
| 10 | + |
| 11 | +## Commands |
| 12 | +- **Run tests**: `uv run pytest` (all tests) or `uv run pytest path/to/test_file.py::TestClass::test_method` (single test) |
| 13 | +- **Lint**: `uv run ruff check --fix` |
| 14 | +- **Format**: `uv run black .` and `uv run isort .` |
| 15 | +- **Type check**: `uv run mypy` |
| 16 | +- **Pre-commit**: `uv run pre-commit run --all-files` |
| 17 | +- **Database setup**: `make database` (creates test users and sample data) |
| 18 | +- **Run server**: `uv run manage.py runserver` |
| 19 | + |
| 20 | +## Code Style |
| 21 | +- Use **Black** formatting with **isort** for imports (profile=black) |
| 22 | +- Use **Django 6.0** patterns and **Python 3.13** features |
| 23 | +- Type hints required (mypy enabled for main modules) |
| 24 | +- Use Django's TextChoices for model choices |
| 25 | +- Prefer `models.CASCADE` for foreign key deletions |
| 26 | +- Use `verbose_name` for user-facing model fields |
| 27 | +- Follow Django naming: models in PascalCase, fields/methods in snake_case |
| 28 | +- Use `blank=True, default=""` for optional text fields |
| 29 | + |
| 30 | +## Text Tone & User-Facing Content |
| 31 | +The application uses a **friendly, informal, student-to-student tone** in all user-facing text: |
| 32 | + |
| 33 | +- **Always use "tu" form** (informal you), never "vous" (formal you) |
| 34 | +- **Conversational and approachable** - write like a helpful fellow student |
| 35 | +- **Encouraging and supportive** - use phrases like "N'hésite pas" (Don't hesitate) |
| 36 | +- **Reassuring in errors** - emphasize it's not the user's fault, we're here to help |
| 37 | +- **Community-oriented** - emphasize peer-to-peer sharing and mutual help |
| 38 | +- **Positive framing** - even for empty states or errors, maintain warmth |
| 39 | +- **Simple, clear language** - avoid technical jargon where possible |
| 40 | + |
| 41 | +Examples: |
| 42 | +- "DocHub te permet" not "DocHub vous permet" |
| 43 | +- "N'oublie pas" not formal imperatives |
| 44 | +- "Ne t'inquiètes pas, le problème vient de notre côté" for errors |
| 45 | +- "C'est grâce à des gens comme toi que DocHub est si bien fourni" |
0 commit comments