Skip to content

Add convert-blazor-server-to-webapp skill#207

Open
halter73 wants to merge 4 commits intodotnet:mainfrom
halter73:blazor-modernization
Open

Add convert-blazor-server-to-webapp skill#207
halter73 wants to merge 4 commits intodotnet:mainfrom
halter73:blazor-modernization

Conversation

@halter73
Copy link
Member

@halter73 halter73 commented Mar 4, 2026

Add a new skill to guide agents through converting pre-.NET 8 (and later) Blazor Server apps to the .NET 8+ Blazor Web App model. The skill covers:

  • Replacing AddServerSideBlazor/MapBlazorHub with AddRazorComponents/MapRazorComponents
  • Converting _Host.cshtml to an App.razor root component
  • Creating Routes.razor from the old App.razor
  • Replacing blazor.server.js with blazor.web.js
  • Adding UseAntiforgery middleware
  • Migrating CascadingAuthenticationState to a service
  • Optional improvements like MapStaticAssets

Includes 4 eval scenarios: basic conversion, auth state migration, prerendering-disabled case, and a negative test for already-converted apps.

This was helpful when working on bartonjs/apireview.net#4

Add a new skill to guide agents through converting pre-.NET 8 Blazor Server
apps to the .NET 8+ Blazor Web App model. The skill covers:

- Replacing AddServerSideBlazor/MapBlazorHub with AddRazorComponents/MapRazorComponents
- Converting _Host.cshtml to an App.razor root component
- Creating Routes.razor from the old App.razor
- Replacing blazor.server.js with blazor.web.js
- Adding UseAntiforgery middleware
- Migrating CascadingAuthenticationState to a service
- Optional improvements like MapStaticAssets

Includes 4 eval scenarios: basic conversion, auth state migration,
prerendering-disabled case, and a negative test for already-converted apps.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new .NET skill and accompanying eval coverage to help agents migrate pre-.NET 8 Blazor Server apps to the .NET 8+ Blazor Web App hosting model (AddRazorComponents/MapRazorComponents, App.razor root, Routes.razor, blazor.web.js, antiforgery, auth state migration).

Changes:

  • Introduces the convert-blazor-server-to-webapp skill documentation with a step-by-step migration workflow and pitfalls.
  • Adds 4 eval scenarios covering: basic conversion, CascadingAuthenticationState migration, prerendering-disabled preservation, and an “already converted” case.
  • Updates CODEOWNERS to assign ownership for the new skill and tests (and fixes indentation on two existing entries).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
tests/dotnet/convert-blazor-server-to-webapp/eval.yaml Adds eval scenarios/assertions/rubrics for the new migration skill.
plugins/dotnet/skills/convert-blazor-server-to-webapp/SKILL.md Adds the skill guidance for performing the Blazor Server → Blazor Web App conversion.
.github/CODEOWNERS Adds owners for the new skill/test directories; normalizes two existing lines’ indentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ViktorHofer
Copy link
Member

/evaluate

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Skill Validation Results

Skill Scenario Baseline With Skill Δ Skills Loaded Overfit Verdict
convert-blazor-server-to-webapp Basic Blazor Server app conversion to Blazor Web App 3.0/5 5.0/5 +2.0 ✅ convert-blazor-server-to-webapp; tools: skill ✅ 0.04
convert-blazor-server-to-webapp Blazor Server app with CascadingAuthenticationState 3.0/5 5.0/5 +2.0 ✅ convert-blazor-server-to-webapp; tools: skill, bash, create ✅ 0.04
convert-blazor-server-to-webapp Blazor Server app with prerendering disabled 5.0/5 5.0/5 0.0 ✅ convert-blazor-server-to-webapp; tools: skill, bash ✅ 0.04
convert-blazor-server-to-webapp App already using Blazor Web App model — no migration needed 5.0/5 5.0/5 0.0 ℹ️ not activated (expected) ✅ 0.04

Model: claude-opus-4.6 | Judge: claude-opus-4.6

Full results

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@halter73
Copy link
Member Author

halter73 commented Mar 4, 2026

/evaluate

@timheuer
Copy link
Member

timheuer commented Mar 4, 2026

@halter73 We should move this OUT of dotnet plugin and establish dotnet-aspnet plugin structure and root this there. (see MAUI PR for example)

@ViktorHofer
Copy link
Member

/evaluate

@mattleibow
Copy link
Member

Should this be in a aspnetcore plugin set vs plain dotnet?

@ViktorHofer
Copy link
Member

dotnet-aspnet plugin 👍

Move the Blazor Server migration skill out of the generic dotnet plugin
and into a dedicated dotnet-aspnet plugin, per review feedback.

- Create plugins/dotnet-aspnet/ with plugin.json
- Move SKILL.md and eval.yaml to the new plugin structure
- Register dotnet-aspnet in marketplace.json
- Update CODEOWNERS with dotnet-aspnet section
- Add dotnet-aspnet to README.md plugins table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@halter73
Copy link
Member Author

halter73 commented Mar 6, 2026

I moved it into a new dotnet-aspnet plugin directory similar to #199. Should we call it dotnet-aspnetcore? ducks (I prefer the current dotnet-aspnet naming to be clear)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants