plugins/dotnet-blazor/skills/blazor-performance/SKILL.md
Blazor rendering optimization, virtualization, lazy loading, caching, and memory management
npx skillsauth add markus41/claude blazor-performanceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@foreach (var item in Items)
{
<ItemCard @key="item.Id" Item="@item" />
}
private bool _shouldRender = true;
protected override bool ShouldRender() => _shouldRender;
<Virtualize Items="@_allItems" Context="item" ItemSize="50">
<ItemRow Item="@item" />
</Virtualize>
@* With item provider for server-side paging *@
<Virtualize ItemsProvider="LoadItems" Context="item">
<ItemRow Item="@item" />
</Virtualize>
@code {
private async ValueTask<ItemsProviderResult<ItemDto>> LoadItems(
ItemsProviderRequest request)
{
var result = await Service.GetPagedAsync(request.StartIndex, request.Count);
return new ItemsProviderResult<ItemDto>(result.Items, result.TotalCount);
}
}
@attribute [StreamRendering]
@if (_data is null)
{
<LoadingSpinner />
}
else
{
<DataDisplay Data="@_data" />
}
app.MapGet("/api/products", async (AppDbContext db) =>
await db.Products.AsNoTracking().ToListAsync())
.CacheOutput(policy => policy.Expire(TimeSpan.FromMinutes(5)).Tag("products"));
public sealed class CachedProductService(
IProductRepository repo,
IDistributedCache cache) : IProductService
{
public async Task<ProductDto?> GetByIdAsync(int id, CancellationToken ct)
{
var cacheKey = $"product:{id}";
var cached = await cache.GetStringAsync(cacheKey, ct);
if (cached is not null)
return JsonSerializer.Deserialize<ProductDto>(cached);
var product = await repo.GetByIdAsync(id, ct);
if (product is not null)
{
await cache.SetStringAsync(cacheKey,
JsonSerializer.Serialize(product),
new DistributedCacheEntryOptions { AbsoluteExpirationRelativeToNow = TimeSpan.FromMinutes(10) },
ct);
}
return product;
}
}
@inject IMemoryCache Cache
@code {
protected override async Task OnInitializedAsync()
{
_categories = await Cache.GetOrCreateAsync("categories", async entry =>
{
entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromHours(1);
return await CategoryService.GetAllAsync();
});
}
}
<PublishTrimmed>true</PublishTrimmed><RunAOTCompilation>true</RunAOTCompilation>CircuitOptions.DisconnectedCircuitRetentionPeriod@rendermode InteractiveAuto for high-traffic pages to offload to WASMtools
Build Teams-native agents with the Teams SDK (formerly Teams AI Library v2) — App class, activity routing, adaptive cards, streaming, AI-generated labels, feedback, message extensions, Teams-as-MCP-server, and the bring-your-own-AI pattern with Agent Framework.
tools
Run agents on Microsoft Foundry (formerly Azure AI Foundry) Agent Service — prompt agents vs hosted agents, threads/runs and the Responses API, built-in tools (Bing grounding, code interpreter, file search, MCP, OpenAPI, A2A), connected agents, Entra agent identity, SDKs, and observability/evaluations.
tools
Build and host custom engine agents with the Microsoft 365 Agents SDK — AgentApplication, the Activity protocol, channel reach via Azure Bot Service, hosting Agent Framework or Semantic Kernel engines, and the Agents Toolkit/Playground workflow. Successor to the Bot Framework SDK.
tools
Design, govern, and extend Microsoft Copilot Studio agents — topics, generative orchestration, knowledge, tools and MCP, agent flows, autonomous triggers, publishing channels, Copilot Credits pricing, and solution-based ALM on Power Platform.