diff --git a/.clinerules/thrillwiki-context.xml b/.clinerules/thrillwiki-context.xml new file mode 100644 index 00000000..685ef1bb --- /dev/null +++ b/.clinerules/thrillwiki-context.xml @@ -0,0 +1,212 @@ + + + + ThrillWiki + Comprehensive theme park database platform with user-generated content, expert moderation, and rich media support + Django REST Framework + 120+ + + Parks + Rides + Companies + Users + + + + + + + Django 5.0+ + Django REST Framework + PostgreSQL with PostGIS + Redis + Celery + + + NO React/Vue/Angular allowed + + + + + + + + + Cloudflare Images + Direct Upload with variants and transformations + + + pghistory for all model changes + TrackedModel + + + + + + + parks/ + + + OPERATOR + PROPERTY_OWNER + + + + + rides/ + + + MANUFACTURER + DESIGNER + + + + + accounts/ + media/ + moderation/ + core/ + + + NEVER mix park/ride company roles - fundamental business rule + + + + + + + TrackedModel (all models inherit) + SluggedModel for slugs with history + + + Nested URLs (/parks/{slug}/rides/{slug}/) + Mandatory trailing slashes + + + RichChoiceField with metadata + color, icon, description, css_class + NEVER use Django tuple choices + + + CloudflareImagesField + photo types and attribution + + + PostGIS for geographic data + separate location models + + + + + + + uv run manage.py runserver_plus + python manage.py + + + uv run manage.py makemigrations + uv run manage.py migrate + + + uv add <package> + pip install + + + Always use `uv run manage.py <command>` + + + + + + + Token-based + + USER + MODERATOR + ADMIN + SUPERUSER + + + + 25+ parameters + 15+ parameters + + + Standard DRF pagination + Rich error responses with details + + + Multi-level (Redis, CDN, browser) + Signal-based invalidation + + + NEVER MOCK DATA - All responses must use real database queries + + + + + + + RichChoiceField(choice_group="group_name", domain="domain_name") + domain-specific choices.py using RichChoice dataclass + register_choices() function in domain __init__.py + + + color + icon + description + css_class + + + NO tuple-based choices allowed anywhere in codebase + + + + + + + Dynamic updates + Client state management + Styling framework + + Progressive enhancement required + Latest 2 versions of major browsers + + First Contentful Paint < 1.5s + Time to Interactive < 2s + Core Web Vitals compliance + + + + + + All models must inherit from TrackedModel + Use SluggedModel for entities with slugs and history tracking + Always use RichChoiceField instead of Django choices + Must include trailing slashes and follow nested pattern + Use CloudflareImagesField for all image handling + Use PostGIS fields and separate location models + + + + + + Parks domain: Only OPERATOR and PROPERTY_OWNER roles + Rides domain: Only MANUFACTURER and DESIGNER roles + CRITICAL: Never allow cross-domain company roles + + + All model changes must be tracked via pghistory + All API responses must use real database data + Geographic data must use PostGIS for accuracy + + + + + + Use uv for all Python package operations + Use runserver_plus for enhanced development server + Always use uv run for Django management commands + All functionality must work with progressive enhancement + + \ No newline at end of file