Scaffold new ASP.NET Core web applications using various Blazor render modes including Static SSR, Interactive Server, WebAssembly, and Auto.
- GitHub stars
- 5,942
- Files
- 8
- Last commit
- Nov 11, 2026
- License
- MIT
- Allowed tools
- —
What does the create-blazor-project skill do?
create-blazor-project is an agent skill. Scaffold new ASP.NET Core web applications using various Blazor render modes including Static SSR, Interactive Server, WebAssembly, and Auto.
Summary generated from the skill's SKILL.md.
About the create-blazor-project skill
Scaffolding new ASP.NET Core web applications with specific Blazor render modes is what this skill enables for developers. It automates the execution of dotnet new blazor commands to set up the initial project structure, ensuring the correct configuration for different interactivity requirements. An agent should load this skill when a user needs to start a new web project from scratch rather than modifying an existing one.
The tool handles various configurations including Static SSR, Interactive Server, Interactive WebAssembly, and Interactive Auto modes. It can also include ASP.NET Core Identity by applying the -au Individual flag. Depending on the chosen mode, the skill produces either a single project for server-side rendering or a two-project setup consisting of a server project and a .Client project for WebAssembly or Auto modes. It ensures that Program.cs files and component locations are correctly wired for the selected architecture.
What an agent can do with it
- 1Create a project with user authenticationScaffold a new Blazor web app that includes ASP.NET Core Identity for managing individual user accounts.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the create-blazor-project skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the create-blazor-project skill in Plugin
/plugin marketplace add dotnet/skills /plugin install dotnet-blazor@dotnet-agent-skills
Install the create-blazor-project skill in Claude Code
~/.claude/skills/create-blazor-project/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project ~/.claude/skills/create-blazor-projectInstall the create-blazor-project skill in Claude Code (project)
.claude/skills/create-blazor-project/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project .claude/skills/create-blazor-projectInstall the create-blazor-project skill in Codex
~/.agents/skills/create-blazor-project/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project ~/.agents/skills/create-blazor-projectInstall the create-blazor-project skill in Gemini CLI
~/.gemini/skills/create-blazor-project/SKILL.md
$ npx degit dotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project ~/.gemini/skills/create-blazor-projectInstall the create-blazor-project skill in Claude.ai
npx degit dotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project create-blazor-project && zip -r create-blazor-project.zip create-blazor-project # claude.ai → Customize → Skills → + → Create skill → Upload a skill → create-blazor-project.zip
Automated checks
Ran Nov 15, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work
- Source repository linked and reachabledotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project is public and reachablegithub.com/dotnet/skills/tree/HEAD/plugins/dotnet-blazor/ski ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-11github.com/dotnet/skills/commits ↗Pass
- No download-and-run or credential theft in scriptsNo scripts in the skill folderPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-blazor/ski ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-blazor/ski ↗Pass
- SKILL.md follows the Agent Skills formatValid name and description; says when to use it; 294 linesgithub.com/dotnet/skills/blob/HEAD/plugins/dotnet-blazor/ski ↗Pass
SKILL.md
View on GitHubCreate a Blazor Web App
Before You Start — Gather Requirements
If the user's request doesn't make the following clear, ask before scaffolding:
- What does the app do? List the main screens/features (e.g., "product catalog with search and shopping cart").
- What kind of interactivity is needed? Displaying data and forms? Real-time updates? Offline support? Rich drag-and-drop UI?
- Deployment environment? Internet-facing? Intranet? Mobile users on slow connections?
- Authentication needed? Anonymous? Individual accounts? Organizational (Azure AD)?
Pick the Right Interactivity Level
Blazor render modes are a progression scale. Start at the simplest level that satisfies the requirements and only move up when there's a concrete reason.
Static SSR ──→ SSR + Enhanced Nav ──→ Interactive Server ──→ Interactive WebAssembly
simplest most complex
Decision Rules
| If the app needs... | Use | Why |
|---|---|---|
| Display data, simple forms, links between pages | Static SSR (-int None) |
No JS runtime, no circuit, no WebAssembly download. Forms work via HTML POST. Enhanced navigation makes it feel snappy. |
| Everything above + a few components with client-side behavior (live search, real-time updates, complex form wizards) | Interactive Server, per-page (-int Server) |
Only the components that need interactivity opt in with @rendermode. The rest stays static. Server-side execution, full .NET access, no API layer needed. |
| Most pages need rich interactivity (dashboards, drag-and-drop, chat) | Interactive Server, global (-int Server -ai) |
Every component is interactive by default. Consistent UX, simpler mental model. Trade-off: every user holds a SignalR circuit on the server. |
| Network latency is a problem, users are on mobile/poor connections, or the app must work offline | Interactive WebAssembly (-int WebAssembly) |
Code runs in the browser. Eliminates round-trip latency but requires a .Client project, API layer for data access, and downloads the .NET runtime to the browser on first visit. For offline support, enable PWA: add a service worker and manifest after scaffolding (not included in the template by default). |
| Fast initial load (Server) + low latency after (WebAssembly) | Interactive Auto (-int Auto) |
First visit uses Server; subsequent visits use cached WebAssembly runtime. Most complex setup — see Auto constraints below. Only choose when both Server and WebAssembly constraints apply. |
Default recommendation: Start with -int Server (per-page). It covers the vast majority of apps. Upgrade to global or WebAssembly only when a specific requirement demands it.
Auto Mode Constraints
Auto mode means your component code runs on the server first, then in the browser on subsequent visits. This creates real constraints:
- All interactive components must live in the
.Clientproject — same as WebAssembly. - No direct server access from interactive components — no EF
DbContext, no file system, no server-only services. All data access must go through HTTP APIs. - Both
Program.csfiles must register matching services — the server and client DI containers must both provide implementations for any service an interactive component injects. - Code must not assume its execution environment — no
HttpContextaccess, no browser-only APIs withoutRendererInfoguards. - Test in both modes — a component that works on Server during development may break on WebAssembly in production (second visit). Test both paths.
Don'ts
- Don't pick WebAssembly "because it's cool" — it adds a
.Clientproject, forces API-mediated data access, and downloads ~10MB to the browser on first visit. - Don't pick Auto unless you can articulate why Server alone and WebAssembly alone are both insufficient.
- Don't pick global interactivity for apps where most pages are read-only content — per-page keeps the static pages fast and reduces server memory.
Scaffold the Project
Static SSR Only (display data + simple forms)
dotnet new blazor -o {AppName} -int None
No interactive runtime. Enhanced navigation enabled by default via blazor.web.js.
Interactive Server, Per-Page (recommended default)
dotnet new blazor -o {AppName} -int Server
Pages are static by default. Add @rendermode InteractiveServer to components that need interactivity.
Interactive Server, Global
dotnet new blazor -o {AppName} -int Server -ai
All pages interactive via <Routes @rendermode="InteractiveServer" /> in App.razor.
Interactive WebAssembly, Per-Page
dotnet new blazor -o {AppName} -int WebAssembly
Creates {AppName} (server) and {AppName}.Client (WebAssembly) projects. Interactive components must live in .Client.
Interactive WebAssembly, Global
dotnet new blazor -o {AppName} -int WebAssembly -ai
Interactive Auto, Per-Page
dotnet new blazor -o {AppName} -int Auto
Interactive Auto, Global
dotnet new blazor -o {AppName} -int Auto -ai
With Authentication
Append -au Individual to any command above:
dotnet new blazor -o {AppName} -int Server -au Individual
-au Individual scaffolds ASP.NET Core Identity with SQLite (CLI) or SQL Server (Visual Studio). Identity pages are always static SSR — they do not use interactive render modes.
The blazor template only supports -au Individual. For organizational auth (Microsoft Entra ID, Azure AD B2C), scaffold with -au Individual first, then replace the Identity provider with Microsoft.Identity.Web / OIDC middleware and configure the tenant in appsettings.json.
What the Template Creates
Single project (Static SSR, Server)
{AppName}/
├── Components/
│ ├── App.razor # Root component — sets <HeadOutlet> and <Routes>
│ ├── Routes.razor # Wraps <Router> with route discovery
│ ├── Layout/
│ │ ├── MainLayout.razor # App shell with nav, header, footer
│ │ └── MainLayout.razor.css
│ └── Pages/
│ └── Home.razor # @page "/" — first page
├── Program.cs # Service registration and middleware
├── wwwroot/ # Static files (CSS, images)
└── {AppName}.csproj
Two projects (WebAssembly, Auto)
{AppName}/ # Server project — hosts the app
├── Components/ # Server-only components (static SSR pages, layouts)
│ ├── App.razor
│ ├── Routes.razor
│ └── Layout/
├── Program.cs # Server Program.cs
└── {AppName}.Client/ # Client project — WebAssembly components
├── Pages/ # Interactive components go HERE
├── Program.cs # Client Program.cs
└── _Imports.razor
Rule: Components using InteractiveWebAssembly or InteractiveAuto must live in the .Client project. They can reference shared code but cannot reference server-only types (EF DbContext, server-side services).
Program.cs Wiring
The template generates the correct Program.cs for the chosen mode. Verify these registrations match your intent:
Static SSR Only
// Program.cs
builder.Services.AddRazorComponents();
// ...
app.MapRazorComponents<App>();
Server (per-page or global)
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
// ...
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
WebAssembly (per-page or global)
// Server Program.cs
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents();
// ...
app.MapRazorComponents<App>()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof({AppName}.Client._Imports).Assembly);
// Client Program.cs
builder.Services.AddAuthorizationCore();
// Register HttpClient, other client-side services
Create Project AGENTS.md
After scaffolding, create an AGENTS.md file in the project root (next to the .csproj). For two-project setups, put it in the server project root.
Pick the matching template from assets/agents-md/ based on the chosen mode:
| Mode | Template file |
|---|---|
Static SSR (-int None) |
assets/agents-md/ssr-none.md |
Server, per-page (-int Server) |
assets/agents-md/server-per-page.md |
Server, global (-int Server -ai) |
assets/agents-md/server-global.md |
WebAssembly, per-page (-int WebAssembly) |
assets/agents-md/webassembly-per-page.md |
WebAssembly, global (-int WebAssembly -ai) |
assets/agents-md/webassembly-global.md |
Auto, per-page (-int Auto) |
assets/agents-md/auto-per-page.md |
Auto, global (-int Auto -ai) |
assets/agents-md/auto-global.md |
Copy the template contents into the project's AGENTS.md and replace every {AppName} with the actual project name. If auth was scaffolded (-au Individual), add an ## Authentication section noting that ASP.NET Core Identity is configured and that Identity pages under Components/Account/ are always static SSR — do not add @rendermode to them.
After scaffolding the project and creating AGENTS.md, continue implementing the features the user requested. Remove default template pages (Counter, Weather) and replace them with the actual application pages.
Auto (per-page or global)
// Server Program.cs
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();
// ...
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(typeof({AppName}.Client._Imports).Assembly);
App.razor — Global vs Per-Page
The difference between global and per-page interactivity is entirely in App.razor:
Per-page (default)
<!DOCTYPE html>
<html>
<head>
<HeadOutlet />
</head>
<body>
<Routes />
<script src="_framework/blazor.web.js"></script>
</body>
</html>
No @rendermode on <Routes> or <HeadOutlet>. Individual pages opt in.
Global
<!DOCTYPE html>
<html>
<head>
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes @rendermode="InteractiveServer" />
<script src="_framework/blazor.web.js"></script>
</body>
</html>
Replace InteractiveServer with InteractiveWebAssembly or InteractiveAuto as appropriate.
After Scaffolding
- Verify it builds:
dotnet build - Run it:
dotnet run(in the server project if two-project setup) - Add your first page: Create a
.razorfile inComponents/Pages/(server project) orPages/(.Clientproject for WebAssembly components)
Don'ts
- Don't use
dotnet new blazorwasm— that creates a standalone WebAssembly SPA without server-side rendering. Use theblazortemplate with-int WebAssemblyinstead. - Don't manually add
AddInteractiveServerComponents()to a project created with-int Noneand expect it to work — you also need the@rendermodedirectives and potentiallyApp.razorchanges. Re-scaffold if the mode needs to change fundamentally. - Don't put WebAssembly-targeted components in the server project — they'll work during prerender but fail after handoff.
Files in this skill
8create-blazor-project skill questions
How do I install the create-blazor-project skill in Claude Code?
Run npx degit dotnet/skills/plugins/dotnet-blazor/skills/create-blazor-project ~/.claude/skills/create-blazor-project. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the create-blazor-project skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
Which Blazor render mode should I choose by default?
The recommended default is Interactive Server (per-page), which covers most application needs. You should only upgrade to global interactivity or WebAssembly when specific requirements demand it.
Can I use WebAssembly for offline support?
Yes, but you must manually enable PWA support by adding a service worker and manifest after scaffolding, as it is not included in the template by default.
What are the constraints of using Interactive Auto mode?
All interactive components must reside in the .Client project, data access must go through HTTP APIs rather than direct server access, and both server and client DI containers must register matching services.