ada-dotnet-blazor-library

Structure, build, and package .NET Blazor component libraries as Razor Class Libraries.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/wubing7755/Ada --skill ada-dotnet-blazor-library-wubing7755
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ada-dotnet-blazor-library
Source: https://github.com/wubing7755/Ada/tree/main/skills/software-development/ada-dotnet-blazor-library
Command: npx skills add https://github.com/wubing7755/Ada --skill ada-dotnet-blazor-library-wubing7755

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building a Blazor component library involves many non-obvious pitfalls: RCL project structure, demo app separation, public API naming collisions, static asset 404s from missing _content/{AssemblyName}/ prefixes, scoped CSS confusion, and deprecated tooling that breaks CI. This Skill encodes the full lifecycle and the hard-won fixes so the library builds, tests, and packages correctly the first time. ## Core Features & Use Cases - RCL Scaffolding & Structure: Sets up the Razor Class Library (Domain, Services, Interop, Components, wwwroot) alongside a separate Blazor WebAssembly demo app and xUnit test project, inspecting the active SDK templates instead of assuming old layouts. - Public API Naming Convention: Applies a prefix+suffix scheme (e.g., LibDockPanel component vs LibDockPanelModel domain type) to prevent component/domain name clashes, including a regex that fixes component tags without touching generic type parameters. - Pitfall Diagnosis & Packaging: Resolves RCL static asset 404s, scoped CSS project-locality issues, ContentRegistry ownership bugs, and deprecated dotnet-format global tool CI failures, plus NuGet packaging guidance. - Use Case: Split an existing Blazor app into a reusable library plus demo app, rename all public types with a common prefix, verify with dotnet build, dotnet test, and dotnet format, then pack for NuGet. ## Quick Start Ask the agent to split your Blazor app into a Razor Class Library with a separate WebAssembly demo app and prepare it for NuGet packaging.

Frequently Asked Questions about ada-dotnet-blazor-library

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Blazor component library as a Razor Class Library?

Create a project with Sdk="Microsoft.NET.Sdk.Razor" containing Domain, Services, Interop, Components, and wwwroot folders, plus a separate Blazor WebAssembly demo app referencing it. Inspect the active SDK with dotnet new razorclasslib --help rather than assuming older template layouts.

Why do Blazor RCL static assets return 404 errors?

RCL wwwroot assets are served under the _content/{AssemblyName}/ prefix, so every external reference to JS, CSS, or images must include it. Check IJSRuntime import calls, link tags in index.html, and any other static file paths for the missing prefix.

How do I avoid name clashes between Blazor components and domain models?

Apply a common prefix to all public types, then add a Model suffix to domain types so they differ from component names, e.g. LibDockPanel component versus LibDockPanelModel. Component tags stay clean while domain references use the suffixed name.

Can a demo app use scoped CSS from a Razor Class Library?

No. Scoped CSS bundles ({ProjectName}.styles.css) are generated per project from .razor.css sidecar files. Referencing _content/Lib/Lib.styles.css from a demo app returns 404 unless the RCL itself owns .razor.css files.

Why does dotnet format fail on CI with false positives?

The deprecated dotnet-format global tool conflicts with the SDK built-in dotnet format command in .NET 6+. Remove the global tool install step and run dotnet format style --verify-no-changes, with .editorconfig and .gitattributes enforcing consistent indentation and LF line endings.

When should I not use this Blazor library workflow?

Do not use it for writing individual Blazor components, general non-Blazor .NET library design, or ASP.NET Core server-side services without Razor components. Verification-only changes and broad UI audits belong to separate workflows.