Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dotnet/support-prerendering
Make interactive Blazor components work correctly with prerendering. USE FOR fixing duplicate data loads, UI flicker during prerender-to-interactive handoff, null references during prerender, persisting state across prerender, disabling prerendering, excluding pages from interactive routing, or detecting whether a component is currently prerendering. DO NOT USE for choosing which render mode to use (see create-blazor-project) or general component authoring (see author-component).
Passed 22 of 22 test cases with the skill, and 18 of 22 without it.
and 3 more in the full report
4 fixed18 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 4 test cases the skill fixed. Same model, same prompt, with and without the skill.
We have a shared component in the `.Client` project that uses `ILocalStorageService`. During initial static HTML generation on the server, the server DI container throws `InvalidOperationException` because `ILocalStorageService` is only registered in the WebAssembly `Program.cs`. Without modifying the server's `Program.cs`, show how to handle this DI injection in the component code so it does not fail on the server.
| Checked | Without skill | With skill |
|---|---|---|
| Injects the service with a nullable type or optional constructor parameter. | Missed | Passed |
The instructions your model reads when the skill loads.
Prerendering is on by default for all interactive render modes. The server renders the component as static HTML and ships it to the browser immediately. Then the interactive runtime (Server/WebAssembly) loads and re-renders the component with full interactivity.
This means:
OnInitializedAsync runs twice — once during prerender (static), once when the interactive runtime attaches.OnAfterRenderAsync is NOT called during prerender — only after the interactive render.Check the project's AGENTS.md for the Interactivity Mode and Interactivity Scope:
| Mode | Prerendering applies? |
|---|---|
| None (Static SSR) | No — there's no interactive handoff |
| Server | Yes |
| WebAssembly | Yes |
| Auto | Yes |
If the mode is None, this skill doesn't apply.
The most common prerendering problem: data loaded in OnInitializedAsync during prerender is thrown away and re-fetched when the interactive runtime attaches. This causes flicker and duplicate API/DB calls.
[PersistentState] attributeAnnotate properties to automatically serialize during prerender and restore on interactive activation:
@page "/forecasts"
@rendermode InteractiveServer
<h1>Weather</h1>
@if (Forecasts is null)
{
test cases passed, vs 18 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.