postpartum-genushyacinthus29/dotnet-skills/dotnet-blazor
Claude Code and agent skill by postpartum-genushyacinthus29/dotnet-skills
- community
Checking that the SKILL.md file is still in the repository.
Build and review Blazor applications across server, WebAssembly, web app, and hybrid scenarios with correct component design, state flow, rendering, and hosting choices.
Install
npx vskill@latest install postpartum-genushyacinthus29/dotnet-skills/dotnet-blazorSKILL.md
The same SKILL.md was published earlier as postpartum-genushyacinthus29/dotnet-skills/dotnet-blazor.
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
Documentation
References
- patterns.md - Detailed component patterns, state management strategies, and JS interop techniques
- anti-patterns.md - Common Blazor mistakes and how to avoid them
Render Modes (.NET 8+)
| Mode | Where It Runs | Best For | |
|---|---|---|---|
Static | Server (no interactivity) | SEO pages, marketing content | |
InteractiveServer | Server via SignalR | Real-time apps, thin clients | |
InteractiveWebAssembly | Browser via WASM | Offline-capable, client-heavy | |
InteractiveAuto | Server first, then WASM | Best of both worlds |
Applying Render Modes
InteractiveAuto Architecture
Workflow
- 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
- Design components for reusability:
- Small, focused components
- Parameters for customization
- Events for communication
- Handle state correctly:
- Component state lives in component
- Shared state via services (DI)
- Persist state across prerender with
[PersistentState]
- Validate in both environments (for Auto mode)
Component Patterns
Basic Component
Parameter and Event Callbacks
State Persistence (.NET 8+)
Data Access Pattern for Auto Mode
Anti-Patterns to Avoid
| Anti-Pattern | Why It's Bad | Better Approach | |
|---|---|---|---|
| Large components | Hard to maintain, slow renders | Split into smaller components | |
| Direct DB access in WASM | No DB in browser | Use HTTP API | |
Ignoring ShouldRender | Unnecessary re-renders | Override when needed | |
| Sync JS interop in Server | Blocks SignalR circuit | Use IJSRuntime async | |
| No error boundaries | One error crashes app | Use <ErrorBoundary> | |
| Forgetting prerender state | Double API calls | Use [PersistentState] |
Performance Best Practices
- Virtualize large lists:
``razor <Virtualize Items="@products" Context="product"> <ProductCard Product="@product" /> </Virtualize> ``
- Use `@key` for list diffing:
``razor @foreach (var item in items) { <ItemComponent @key="item.Id" Item="@item" /> } ``
- Debounce rapid events:
```csharp private Timer? _debounceTimer;
private void OnInput(ChangeEventArgs e) { _debounceTimer?.Dispose(); _debounceTimer = new Timer(_ => InvokeAsync(DoSearch), null, 300, Timeout.Infinite); } ```
- Lazy load assemblies (WASM):
``csharp var assemblies = await LazyAssemblyLoader .LoadAssembliesAsync(["MyHeavyFeature.wasm"]); ``
JS Interop
Calling JavaScript from C#
Calling C# from JavaScript
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
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/dotnet-blazor/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/postpartum-genushyacinthus29/dotnet-skills/dotnet-blazor)