feat: Update AI rule files

This commit is contained in:
2025-12-21 08:34:08 +01:00
parent 079765a591
commit 54570fae4f
3 changed files with 20 additions and 16 deletions

View File

@@ -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.
---