# ISMS-DB Project Memory ## Feature-Session Workflow - `zum Feature [topic]` / `Feature [topic]` / `wir arbeiten an [topic]` → immediately read `docs/feature-[topic].md` (case-insensitive), summarize, confirm context - If not found: inform user, suggest creating it - Session end `aktualisiere deine Feature-Beschreibung` → update the doc with decisions/findings - Filename always: `docs/feature-[camelCase].md` (never without `feature-` prefix) - See: [feedback_feature_session_workflow.md](feedback_feature_session_workflow.md) ## Skill Triggers - "aktualisiere unser ISMS", "ISMS aktualisieren", "ISMS updaten" → ALWAYS invoke Skill `isms-update` - This skill runs: Fetch-Data.ps1 → edit JSON → Upload-Data.ps1 - NEVER edit tenant data (Data/default/*.json) without running fetch first - NEVER skip upload after editing ## Auth Stack - Microsoft.Identity.Web 3.x (resolved 3.14.1) - Use `AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme).AddMicrosoftIdentityWebApp(...)` — NOT `services.AddMicrosoftIdentityWebApp(...)` (IServiceCollection overload removed in 3.x) - `using Microsoft.Identity.Web.UI;` required in Program.cs for `AddMicrosoftIdentityUI()` - Use `PostConfigure` to hook `OnTokenValidated` without clobbering MSIW's own handler ## SecurePageModel Pattern - Inherits `PageModel`, uses `override` on `OnPageHandlerSelectionAsync` / `OnPageHandlerExecutionAsync` - Do NOT declare `IAsyncPageFilter` explicitly — `PageModel` already has virtual methods - Resolves `IUserService` + `TenantService` via `ctx.HttpContext.RequestServices` ## Audit Result Writing - NEVER delegate JSON creation to a Task subagent — too slow (33 calls, 17 min) - Build the JSON object in main context, then pipe to `append-audit-result.py`: `python3 append-audit-result.py src/IsmsApp/Data/default/ <<'JSONEOF' ... JSONEOF` - Script validates: .lock, control exists, Id unique, Iteration unique - For the JSON heredoc: use python3 inline to generate UUIDs + timestamps, then echo ## Dark Mode - Project DOES use `data-bs-theme="dark"` — always add dark-mode overrides for 3rd-party CSS (Toast UI, diff2html, etc.) - Pattern: `[data-bs-theme="dark"] .class { ... }` in `site.css` - Use `var(--bs-body-bg)`, `var(--bs-body-color)`, `var(--bs-tertiary-bg)`, `var(--bs-border-color)` ## Razor Gotcha - `RZ1031`: cannot put free-standing `@(expr)` in `