Agent skill · Frontend

author-component

Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable, CancellationToken, CSS isolation, code-behind. DO NOT USE FOR: creating new projects (use create-blazor-project), JavaScript interop or calling browser APIs from Blazor (use use-js-interop), forms and validation (use collect-user-input), prerendering issues (use support-prerendering),

dotnetgithub.com/dotnetGitHub ↗
claude-codeMIT
Install
npx skills add dotnet/skills --skill author-component --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 4
SKILL.md size: 3 KB
Bundled scripts: none
Path: plugins/dotnet-blazor/skills/author-component/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 4,927
Language: C#
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Author Blazor Component ## Core Rules - Data flows **down** via `[Parameter]`. Events flow **up** via `EventCallback<T>` (never `Action`/`Func`). - Never mutate `[Parameter]` properties. Copy to a private field in `OnParametersSet`. - Use `[Parameter] public T Prop { get; set; }` — never `required` or `init` (causes BL0007). - Use `[EditorRequired]` for required parameters. - Handle all states: loading, empty, loaded, error — each with `@if`/`@else`. - Use `@key` on repeated elements in loops for efficient diffing. - Use `IReadOnlyList<T>` (not `IEnumerable<T>`) for collection parameters. ## RenderFragment & Generics ```csharp [Parameter] public RenderFragment? ChildContent { get; set; } [Parameter] public RenderFragment<TItem>? RowTemplate { get; set; } // generic template ``` Use `@typeparam TItem` for generic components. ## File Patterns - **Single-file:** `.razor` with `@code` block when logic < ~50 lines. - **Code-behind:** `.razor` + `.razor.cs` with `partial class` when logic > ~50 lines. ## Disposal Implement `IAsyncDisposable` (not `IDisposable`) when the component owns subscriptions, timers, or CTS. In `DisposeAsync`: unsubscribe (`-=`), cancel CTS, dispose resources. N

What's inside
Steps it walks through
  1. Core Rules
  2. RenderFragment & Generics
  3. File Patterns
  4. Disposal
  5. Async Patterns
  6. Don'ts
Ships with 3 files
  • references/async-programming-rules.md
  • references/breaking-down-components.md
  • references/component-disposal.md
More from skills
All skills →
About this skill
What does the author-component skill do?

Create or review Blazor components (.razor files) with correct architecture. USE FOR: writing new Blazor components that do NOT involve JavaScript interop, implementing parameters and EventCallback, RenderFragment slots, component lifecycle (OnInitializedAsync, OnParametersSet), async patterns, IAsyncDisposable, CancellationToken, CSS isolation, code-behind. DO NOT USE FOR: creating new projects (use create-blazor-project), JavaScript interop or calling browser APIs from Blazor (use use-js-interop), forms and validation (use collect-user-input), prerendering issues (use support-prerendering),

How do I install it?

Run `npx skills add dotnet/skills --skill author-component --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From dotnet/skills, a repository with 4,927 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going