Files
Javier Calvarro Nelson 198e58c983 Add blazor skills to dotnet-blazor plugin (#357)
* Add dotnet-blazor plugin and convert-blazor-server-to-webapp skill

Add the dotnet-blazor plugin with 9 skills covering Blazor Web App development:
- plan-ui-change: Plan and scaffold UI features in Blazor Web Apps
- create-blazor-project: Create new Blazor projects with proper render mode setup
- author-component: Author Razor components with parameters, events, lifecycle
- coordinate-components: Share state across components using CascadingValueSource/scoped services
- use-js-interop: Call JavaScript from Blazor and vice versa
- fetch-and-send-data: HTTP data access with proper service patterns
- configure-auth: Set up ASP.NET Core Identity and authorization in Blazor
- collect-user-input: Build forms with EditForm, validation, and file uploads
- support-prerendering: Handle prerendering lifecycle and state persistence

Add convert-blazor-server-to-webapp skill to the dotnet-aspnet plugin for
migrating .NET 7 Blazor Server apps to .NET 8+ Blazor Web App architecture.

All 10 skills pass evaluation with quality improvements ranging from 12-50%
and overfitting scores within acceptable thresholds.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Update eng/allowed-external-deps.txt

* Update .gitignore

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-25 16:25:27 +00:00

95 lines
5.3 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
scenarios:
- name: "University course catalog with enrollment form"
prompt: |
Create a Blazor Web App for a university course catalog.
Requirements:
- Browse departments and courses in a searchable, filterable list
- View course detail pages (description, schedule, credits, instructor bio)
- Students submit an enrollment request form (name, student ID, course selection) — standard HTML form, no wizards or real-time validation
- Homepage shows featured courses and department links
- No authentication — open to all students and visitors
- Hosted on the university intranet with fast, reliable connectivity
assertions:
- type: "output_contains"
value: "dotnet new blazor"
- type: "output_matches"
pattern: "-int(eractivity)? None"
- type: "output_not_contains"
value: "blazorwasm"
- type: "output_not_contains"
value: "blazorserver"
- type: "output_matches"
pattern: "(Static SSR|no.interactive|None.*interactivity)"
rubric:
- "Correct template and configuration — single-project structure (no .Client project), Program.cs calls AddRazorComponents() without any AddInteractive* chains, App.razor does NOT set @rendermode on Routes or HeadOutlet"
- "Recognizes that Static SSR uses standard HTML POST forms and enhanced navigation — no interactivity needed for a course catalog with enrollment"
- "Documents the static rendering choice — explains why the app uses no interactive render mode"
- "Plans the domain features — identifies the pages/components needed for browsing courses and submitting enrollments"
timeout: 600
- name: "Recipe community with interactive ratings on static pages"
prompt: |
Create a new Blazor Web App project for a recipe sharing community.
Run `dotnet new blazor` with the appropriate options, create the project structure,
and implement the pages.
Requirements:
- Browse recipes by category — read-only content pages
- Each recipe page has a star-rating widget (click to rate 1–5 stars)
- A "Submit Recipe" page with a form (title, ingredients, steps)
- Homepage displays recipe categories (static content)
- Most pages are read-only; only the rating widget and submit form need interactivity
assertions:
- type: "output_contains"
value: "dotnet new blazor"
- type: "output_matches"
pattern: "-int(eractivity)? Server"
- type: "output_not_matches"
pattern: "dotnet new blazor[^\\n]*-ai"
- type: "output_not_contains"
value: "blazorwasm"
- type: "output_not_contains"
value: "blazorserver"
- type: "output_matches"
pattern: "(per.page|per-page|opt.in)"
rubric:
- "Correct template and configuration — Program.cs registers AddInteractiveServerComponents() and AddInteractiveServerRenderMode(), App.razor does NOT set @rendermode on Routes so interactivity is per-page opt-in"
- "Static pages (browse, homepage, recipe content) remain SSR for performance while interactive components (rating widget, comments) opt in with @rendermode InteractiveServer"
- "Documents the per-page strategy — explains why most pages are static and only specific features opt in to interactivity"
- "Differentiates which features need interactivity (rating widget, form submission) vs which can be static (content browsing)"
timeout: 600
- name: "Global logistics tracking for worldwide users"
prompt: |
Create a Blazor Web App for a logistics company that tracks shipments.
Requirements:
- Dispatchers view a list of shipments with status and destination
- Customers check their shipment status and estimated delivery
- Users are worldwide — round-trip latency to a single server is noticeable
- The app must load fast on first visit, then feel snappy without server round-trips
- Every page involves interactive controls
- Staff and customers authenticate with individual accounts
assertions:
- type: "output_contains"
value: "dotnet new blazor"
- type: "output_matches"
pattern: "-int(eractivity)? Auto"
- type: "output_matches"
pattern: "(-ai|--all-interactive)"
- type: "output_not_contains"
value: "blazorwasm"
- type: "output_not_contains"
value: "blazorserver"
- type: "output_matches"
pattern: "(-au|--auth) Individual"
- type: "output_matches"
pattern: "(\\.Client|Auto.*mode|dual.*execution)"
rubric:
- "Correct template and configuration — two-project structure with .Client project, Server Program.cs registers both AddInteractiveServerComponents() and AddInteractiveWebAssemblyComponents(), interactive components live in .Client"
- "Components cannot directly access server resources — all data through HTTP APIs, both server and client Program.cs register matching services, component code must not assume execution environment"
- "Documents the Auto mode trade-offs — explains why this rendering strategy suits the requirements"
- "Addresses the latency requirement — explains why Auto mode solves worldwide latency (Server first, then switches to WebAssembly for client-side speed)"
timeout: 1200