Use this template when you're building:
- A Blazor Server application with interactive server-side rendering
- A Blazor WebAssembly (WASM) application running entirely in the browser
- A Blazor Auto application that starts with Server interactivity and transitions to WASM
- A Blazor app that mixes static SSR pages with selectively interactive components
- Copy
CLAUDE.mdinto the root of your Blazor project - Replace
[ProjectName]with your actual project name - Choose your render mode and update the Project Context section:
- Server — All interactivity runs on the server over SignalR
- WebAssembly — Interactivity runs in the browser via WASM
- Auto — Server-rendered initially, transitions to WASM after the runtime downloads
- Update the Tech Stack section to match your dependencies
- If you don't have a separate
.Clientproject (Server-only mode), remove the[ProjectName].Client/section from the Architecture diagram - Remove any skills references that don't apply to your project
This template configures Claude Code to:
- Organize components by feature under
Components/Pages/ - Apply render modes at the component level, not globally
- Use a service layer between components and data access (no DbContext in components)
- Follow .NET 10 / C# 14 modern patterns
- Use ASP.NET Core Identity for authentication
- Write component tests with bUnit and integration tests with WebApplicationFactory
- Avoid common Blazor pitfalls like unnecessary JS interop and render mode confusion
- Use structured logging with Serilog
Server only: Best for intranet apps, admin dashboards, and apps with sensitive data that should stay on the server. Remove the .Client project from the architecture diagram.
WebAssembly only: Best for public-facing apps that need offline support or minimal server load. Note that initial load is slower due to the .NET runtime download.
Auto (recommended default): Best for most apps. Users get immediate interactivity via Server, then seamlessly transition to WASM on subsequent visits. Requires both server and client projects.
If your Blazor app also exposes API endpoints (common for WASM/Auto apps that need server-side data access), add the minimal-api skill to the skills list and create a Controllers/ or Endpoints/ folder in the architecture section.
If your app uses a different data access strategy (Dapper, HTTP APIs, etc.), remove ef-core from the skills list and update the Tech Stack accordingly.
For apps using SignalR hubs beyond Blazor's built-in circuit, add hub classes to a Hubs/ folder and document the hub contracts in the architecture section.