From 54570fae4f0c7c57f73276052f0fa70291998d94 Mon Sep 17 00:00:00 2001 From: Denis Lugowski Date: Sun, 21 Dec 2025 08:34:08 +0100 Subject: [PATCH] feat: Update AI rule files --- .cursor/rules/rules.mdc | 9 --------- CLAUDE.md | 20 +++++++++++++++++++ .../.cursor/rules/rules.mdc | 7 ------- 3 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 .cursor/rules/rules.mdc delete mode 100644 legalconsenthub-backend/.cursor/rules/rules.mdc diff --git a/.cursor/rules/rules.mdc b/.cursor/rules/rules.mdc deleted file mode 100644 index c0c433f..0000000 --- a/.cursor/rules/rules.mdc +++ /dev/null @@ -1,9 +0,0 @@ ---- -description: -globs: -alwaysApply: true ---- -- This project consists of a Nuxt 3 frontend (legalconsenthub), a spring boot 3 server backend (legalconsenthub-backend) -- Don't add comments about the things that have changed compared to the previous version or that just are redundant to the code below -- Prefer using existing types -- Update the documentation if necessary diff --git a/CLAUDE.md b/CLAUDE.md index aed1ec8..5a7c3b7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -737,6 +737,26 @@ act -n 6. **Form structure is three-level** - Section → SubSection → Element (not two-level) 7. **API generation is automatic** - After modifying OpenAPI spec, run generation commands 8. **Roles are managed in Keycloak** - Not in the application database +9. **PDF/HTML export must be re-validated when form elements change** + - Any change that touches form element types, options/value storage, visibility conditions, or section spawning can break PDF output. + - Always validate **both** HTML and PDF export for a real form instance (including newly spawned sections and newly added text fields with values): + - `GET /application-forms/{id}/html` + - `GET /application-forms/{id}/pdf` + - Verify these render correctly (with saved values): + - `TEXTFIELD`, `TEXTAREA`, `DATE`, `TITLE_BODY_TEXTFIELDS` + - `SELECT`, `RADIOBUTTON`, `CHECKBOX`, `SWITCH` + - If you changed backend filtering or templating, ensure: + - Template sections (`isTemplate=true`) remain excluded from export + - Spawned sections (`isTemplate=false`, `spawnedFromElementReference` set) are included + - Visibility filtering does not drop elements unintentionally (e.g. missing `reference` must not hide elements by default) + - Hotspots: + - `legalconsenthub-backend/src/main/kotlin/com/betriebsratkanzlei/legalconsenthub/application_form/ApplicationFormFormatService.kt` + - `legalconsenthub-backend/src/main/resources/templates/application_form_template.html` +10. **Keep `CLAUDE.md` current** + - If you introduce a change that is worth being documented for future AI prompts (architecture, domain rules, workflows, endpoints, config, auth, generation steps, export logic, multi-tenancy constraints, etc.), update `CLAUDE.md` in the same change set. +11. **Clean Code: order functions by abstraction (top-down, like a book)** + - Put the highest-level, most readable entry points first (public API / primary flows), then progressively lower-level helpers below. + - Keep functions at the same level of abstraction grouped together; details should live “later” (below) so the file reads top-to-bottom without jumping around. --- diff --git a/legalconsenthub-backend/.cursor/rules/rules.mdc b/legalconsenthub-backend/.cursor/rules/rules.mdc deleted file mode 100644 index b7b2eee..0000000 --- a/legalconsenthub-backend/.cursor/rules/rules.mdc +++ /dev/null @@ -1,7 +0,0 @@ ---- -description: -globs: -alwaysApply: true ---- -- Don't create any SQL migrations, I do that by myself -- Mapping between DTOs and entities should be done in separate mapper classes