Agent skill

Blazor

by managedcode in managedcode/dotnet-skills

Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices.

MITAuto-check passedAgent Workflows

Install Blazor

skills CLI
$ npx skills add managedcode/dotnet-skills --skill blazor -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install managedcode/dotnet-skills blazor --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/managedcode/dotnet-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/catalog/Frameworks/Blazor/skills/blazor .claude/skills/blazor && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
blazor
GitHub stars
486
Token cost
~2.1k tokens
SKILL.md length
457 words
Files
4 (incl. references)
Skills in repo
81
Repo updated
First seen
Licence
MIT

At a glance

Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices.

  • Works in 4 steps: Choose render mode based on requirements → Design components for reusability → Handle state correctly → …
  • : building interactive web UIs with C instead of JavaScript
  • SKILL.md covers Trigger On, Documentation, References and Render Modes (.NET 8+), plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Blazor is an agent skill from managedcode/dotnet-skills. Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices. USE FOR: building interactive web UIs with C instead of JavaScript; choosing between Server, WebAssembly, or Auto render modes; designing component hierarchies and state. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build…

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `manifest.json`, `references/anti-patterns.md` and `references/patterns.md`). Compatibility notes: Requires Blazor project (.NET 6+, preferably .NET 8+ for unified model).

It sits in Agent Workflows, covering Codebase knowledge for agents. It works with Blazor, JavaScript, WebAssembly and C#. The repository describes itself as: Installable .NET skill catalog and CLI for Codex, Claude Code, GitHub Copilot, and Gemini. The licence is MIT.

When your agent uses it

  • : building interactive web UIs with C instead of JavaScript
  • Choosing between Server
  • Auto render modes
  • Designing component hierarchies and state

Example prompts

  • “/blazor”

Requirements

  • Compatibility (from SKILL.md): Requires Blazor project (.NET 6+, preferably .NET 8+ for unified model).

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Choose render mode based on requirements
  2. Design components for reusability
  3. Handle state correctly
  4. Validate in both environments (for Auto mode)

What it can do on your machine

Read from SKILL.md and the folder at commit 535dd55. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are razor, csharp and javascript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • learn.microsoft.com
    • managed-code.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Blazor project (.NET 6+, preferably .NET 8+ for unified model).

    From compatibility in the SKILL.md frontmatter.

Context cost

Blazor loads about 2.1k tokens when it runs, and up to ~9.6k if it reads all its reference files. Until then it costs about 145 tokens; SKILL.md has 457 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~145
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from managedcode/dotnet-skills at commit 535dd55, republished under its MIT licence (© managedcode). 457 words, ~2,099 tokens.

Download SKILL.mdSave it as .claude/skills/blazor/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
blazor
description
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices. USE FOR: building interactive web UIs with C# instead of JavaScript; choosing between Server, WebAssembly, or Auto render modes; designing component hierarchies and state. DO NOT USE FOR: unrelated stacks; generic tasks that do not need this specific guidance. INVOKES: inspect the repository context, edit targeted files, and run relevant build, test, lint, or validation commands when changes are made.
compatibility
Requires Blazor project (.NET 6+, preferably .NET 8+ for unified model).

Blazor

Trigger On

  • building interactive web UIs with C# instead of JavaScript
  • choosing between Server, WebAssembly, or Auto render modes
  • designing component hierarchies and state management
  • handling prerendering and hydration
  • integrating with JavaScript when necessary
  • connecting Blazor UI with AI backends and building AI agents with .NET

Documentation

References

Render Modes (.NET 8+)

ModeWhere It RunsBest For
StaticServer (no interactivity)SEO pages, marketing content
InteractiveServerServer via SignalRReal-time apps, thin clients
InteractiveWebAssemblyBrowser via WASMOffline-capable, client-heavy
InteractiveAutoServer first, then WASMBest of both worlds
Applying Render Modes
razor
@* Per-component *@
@rendermode InteractiveServer

@* Or in App.razor for global *@
<Routes @rendermode="InteractiveAuto" />
InteractiveAuto Architecture
First Request:
  Browser → Server (Interactive Server) → Fast response

Subsequent Requests:
  Browser → WASM (downloaded in background) → No server needed

Workflow

  1. Choose render mode based on requirements:

    • Need SEO? Start with Static or prerendering
    • Need real-time? Use InteractiveServer
    • Need offline? Use InteractiveWebAssembly
    • Want both? Use InteractiveAuto
  2. Design components for reusability:

    • Small, focused components
    • Parameters for customization
    • Events for communication
  3. Handle state correctly:

    • Component state lives in component
    • Shared state via services (DI)
    • Persist state across prerender with [PersistentState]
  4. Validate in both environments (for Auto mode)

Current Upstream Notes

  • Treat dotnet/aspnetcore v10.0.11 as servicing. It fixes restoration of expired client-persisted circuit state; re-run reconnect, persisted-state expiry, render-mode, and interactive-auto client/server split tests when upgrading.
  • The August 2026 ASP.NET Core overview still positions Blazor as the component UI path. A servicing update does not change the component or render-mode architecture by itself.

Component Patterns

Basic Component
razor
@* Counter.razor *@
<button @onclick="IncrementCount">
    Clicked @count times
</button>

@code {
    private int count = 0;

    [Parameter]
    public int InitialCount { get; set; } = 0;

    protected override void OnInitialized()
    {
        count = InitialCount;
    }

    private void IncrementCount() => count++;
}
Parameter and Event Callbacks
razor
@* Parent.razor *@
<ChildComponent Value="@value" ValueChanged="@OnValueChanged" />

@* ChildComponent.razor *@
@code {
    [Parameter] public string Value { get; set; } = "";
    [Parameter] public EventCallback<string> ValueChanged { get; set; }

    private async Task UpdateValue(string newValue)
    {
        await ValueChanged.InvokeAsync(newValue);
    }
}
State Persistence (.NET 8+)
razor
@* Prevents double-fetch during prerender + hydration *@
@code {
    [PersistentState]
    public List<Product> Products { get; set; } = [];

    protected override async Task OnInitializedAsync()
    {
        // Only fetches once, persisted across prerender
        Products ??= await Http.GetFromJsonAsync<List<Product>>("api/products");
    }
}

Data Access Pattern for Auto Mode

csharp
// Shared interface
public interface IProductService
{
    Task<List<Product>> GetProductsAsync();
}

// Server implementation (direct DB access)
public class ServerProductService : IProductService
{
    private readonly AppDbContext _db;
    public async Task<List<Product>> GetProductsAsync()
        => await _db.Products.ToListAsync();
}

// Client implementation (HTTP call)
public class ClientProductService : IProductService
{
    private readonly HttpClient _http;
    public async Task<List<Product>> GetProductsAsync()
        => await _http.GetFromJsonAsync<List<Product>>("api/products");
}

// Registration
// Server: builder.Services.AddScoped<IProductService, ServerProductService>();
// Client: builder.Services.AddScoped<IProductService, ClientProductService>();
Show full SKILL.md (199 more words)Show less

Anti-Patterns to Avoid

Anti-PatternWhy It's BadBetter Approach
Large componentsHard to maintain, slow rendersSplit into smaller components
Direct DB access in WASMNo DB in browserUse HTTP API
Ignoring ShouldRenderUnnecessary re-rendersOverride when needed
Sync JS interop in ServerBlocks SignalR circuitUse IJSRuntime async
No error boundariesOne error crashes appUse <ErrorBoundary>
Forgetting prerender stateDouble API callsUse [PersistentState]

Performance Best Practices

  1. Virtualize large lists:

    razor
    <Virtualize Items="@products" Context="product">
        <ProductCard Product="@product" />
    </Virtualize>
  2. Use @key for list diffing:

    razor
    @foreach (var item in items)
    {
        <ItemComponent @key="item.Id" Item="@item" />
    }
  3. Debounce rapid events:

    csharp
    private Timer? _debounceTimer;
    
    private void OnInput(ChangeEventArgs e)
    {
        _debounceTimer?.Dispose();
        _debounceTimer = new Timer(_ => InvokeAsync(DoSearch), null, 300, Timeout.Infinite);
    }
  4. Lazy load assemblies (WASM):

    csharp
    var assemblies = await LazyAssemblyLoader
        .LoadAssembliesAsync(["MyHeavyFeature.wasm"]);

JS Interop

Calling JavaScript from C#
csharp
@inject IJSRuntime JS

await JS.InvokeVoidAsync("alert", "Hello from Blazor!");
var result = await JS.InvokeAsync<string>("prompt", "Enter name:");
Calling C# from JavaScript
csharp
[JSInvokable]
public static string GetMessage() => "Hello from C#!";
javascript
DotNet.invokeMethodAsync('MyAssembly', 'GetMessage')
    .then(result => console.log(result));

Deliver

  • interactive Blazor components with appropriate render mode
  • efficient state management and data flow
  • proper handling of prerendering scenarios
  • performant list rendering with virtualization

Validate

  • components render correctly in chosen mode
  • state persists correctly across prerender/hydration
  • no unnecessary re-renders (check with browser tools)
  • JS interop works in both Server and WASM
  • error boundaries catch component failures
  • Auto mode works in both environments

© managedcode, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in catalog/Frameworks/Blazor/skills/blazor of managedcode/dotnet-skills.

  • SKILL.md
  • manifest.json
  • references/anti-patterns.md
  • references/patterns.md

Open the folder on GitHubat commit 535dd55

Compare with similar skills

Blazor next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Blazor compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Blazor this skillmanagedcode/dotnet-skills486—~2.1kAutomated safety check: PassMIT
Use JS Interopdotnet/skills5.6k1 repos~2.7kAutomated safety check: PassMIT
Use Igniteui Blazordotnet/skills5.6k1 repos~1.4kAutomated safety check: PassMIT
Test Firstdeanhume/html-minifier142—~876Automated safety check: PassMIT
Okojo Node Ink Debugakeit0/okojo160—~798Automated safety check: PassMIT
Maui Hot Reload Diagnosticsdavidortinau/maui-skills174—~1.3kAutomated safety check: PassMIT

Similar skills

  • Use JS Interop

    dotnet/skills

    Official

    Add, review, or fix JavaScript interop in Blazor components.

    5.6k GitHub starsUsed in 1 repo~2.7k tokens
    Backend & APIsAuto-check passed
  • Use Igniteui Blazor

    dotnet/skills

    Official

    Add, configure, or review Ignite UI for Blazor Lite component support in Blazor applications.

    5.6k GitHub starsUsed in 1 repo~1.4k tokens
    Frontend & DesignAuto-check passed
  • Test First

    deanhume/html-minifier

    Enforces a strict test-driven development (TDD) workflow for the HTML Minifier repo.

    142 GitHub stars~876 tokensUpdated 20 days ago
    Testing & QAAuto-check passed
  • Debug Okojo.Node large-app failures through sandbox/OkojoInkProbe and sandbox/OkojoNodeDebugSandbox.

    160 GitHub stars~798 tokensUpdated 16 days ago
    DevelopmentAuto-check passed
  • Maui Hot Reload Diagnostics

    davidortinau/maui-skills

    Diagnose and troubleshoot .NET MAUI Hot Reload issues (C Hot Reload, XAML Hot Reload, Blazor Hybrid).

    174 GitHub stars~1.3k tokensUpdated 3 mo ago
    MobileAuto-check passed
  • Okojo Test262

    akeit0/okojo

    Run and continue Okojo Test262 compliance work. An agent skill from akeit0/okojo.

    160 GitHub stars~742 tokensUpdated 16 days ago
    DevelopmentAuto-check passed

More from managedcode/dotnet-skills

All 81 skills in this repo
  • Analyzer Config

    managedcode/dotnet-skills

    Use a repo-root .editorconfig to configure free .NET analyzer and style rules.

    486 GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Archunitnet

    managedcode/dotnet-skills

    Use the open-source free ArchUnitNET library for architecture rules in .NET tests.

    486 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Aspire

    managedcode/dotnet-skills

    Build, upgrade, and operate Aspire 13.5.x C or TypeScript application hosts with the current CLI, AppHost, ServiceDefaults, integrations, dashboard, testing, MCP, and deployment patterns for…

    486 GitHub stars~3.6k tokensUpdated today
    Auto-check passed
  • Aspnet Core

    managedcode/dotnet-skills

    Build, debug, modernize, or review ASP.NET Core applications with correct hosting, middleware, security, configuration, logging, and deployment patterns on current .NET.

    486 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Asynkron Profiler

    managedcode/dotnet-skills

    Use the open-source free Asynkron.Profiler dotnet tool for CLI-first CPU, allocation, exception, contention, and heap profiling of .NET commands or existing trace artifacts.

    486 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Azure Functions

    managedcode/dotnet-skills

    Build, review, or migrate Azure Functions in .NET with correct execution model, isolated worker setup, bindings, DI, and Durable Functions patterns.

    486 GitHub stars~2.6k tokensUpdated today
    Auto-check passed

Categories

Questions about Blazor

What does Blazor do?

Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices. Blazor is an agent skill from managedcode/dotnet-skills. Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices.

When should I use Blazor?

Blazor fits situations like: : building interactive web UIs with C instead of JavaScript; choosing between Server; auto render modes; designing component hierarchies and state.

How do I install Blazor in Claude Code?

Run `npx skills add managedcode/dotnet-skills --skill blazor -a claude-code`. Or copy the skill folder (catalog/Frameworks/Blazor/skills/blazor in managedcode/dotnet-skills) into .claude/skills/blazor in your project. Claude Code loads it when a task matches its description.

How do I install Blazor in Codex?

Run `npx skills add managedcode/dotnet-skills --skill blazor -a codex`. Or copy the skill folder (catalog/Frameworks/Blazor/skills/blazor in managedcode/dotnet-skills) into .agents/skills/blazor in your project. Codex loads it when a task matches its description.

Can I use Blazor in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add managedcode/dotnet-skills --skill blazor -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/blazor, .gemini/skills/blazor, .github/skills/blazor and .opencode/skills/blazor in your project.

What does Blazor need to run?

SKILL.md names no scripts, command-line tools or credentials: Blazor is instructions for the agent only. Compatibility (from SKILL.md): Requires Blazor project (.NET 6+, preferably .NET 8+ for unified model)..

Does Blazor access the network?

SKILL.md names 2 domains. As links in the text: learn.microsoft.com and managed-code.com. This is read from the text; nothing was executed.

Is Blazor safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Blazor use?

Blazor is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Blazor use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.5k tokens, read only when the agent opens those files.

What are the alternatives to Blazor?

Skills that share tags, products or a category with Blazor: Use JS Interop (dotnet/skills, 5.6k stars), Use Igniteui Blazor (dotnet/skills, 5.6k stars), Test First (deanhume/html-minifier, 142 stars) and Okojo Node Ink Debug (akeit0/okojo, 160 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Blazor?

managedcode (a GitHub organization) maintains it in managedcode/dotnet-skills, which has 486 GitHub stars. The repository holds 81 skills in this directory. The repository was last updated on October 7, 2026.

Source: managedcode/dotnet-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.