# AGENTS.md: Blazor Web App

## Commands
`dotnet watch` · `dotnet build -warnaserror` · `dotnet test` (bUnit + xUnit)

## Render modes
- Static SSR by default. Opt in per component/page with `@rendermode InteractiveServer`, `InteractiveWebAssembly`, or `InteractiveAuto` only where interactivity is needed. Don't make the whole app interactive by default.
- Components used in WebAssembly mode live in the client project and must not reference server-only services.

## Components
- Small components with `[Parameter]` inputs and `EventCallback<T>` outputs; `[EditorRequired]` for mandatory parameters.
- Don't mutate parameters inside the child; raise an event instead.
- Lists render with `@key` on stable ids. Use `Virtualize` for long lists.
- Load data in `OnInitializedAsync`; with prerendering, avoid double loading (use `PersistentComponentState`/`[PersistentState]`).
- Dispose subscriptions and timers (`@implements IAsyncDisposable`).
- JS interop through a small module per feature (`IJSRuntime.InvokeAsync<IJSObjectReference>("import", ...)`), only after first render.

## Forms
`EditForm` with `Model`, `DataAnnotationsValidator`, `ValidationMessage`; static SSR forms use `[SupplyParameterFromForm]` and `FormName`. Antiforgery stays enabled.

## Security
Authorization with `[Authorize]`/`AuthorizeView` in the UI and again in the services/APIs it calls.

## Done
Build with no warnings, bUnit tests for new components, and the page works with JavaScript-heavy features tested in the browser.
