author-component

Enforce Blazor component best practices for architecture, async programming, and disposal.

Updated May 28, 2026
One-click install
npx skills add https://github.com/ojrojas/AgentsInstructions --skill author-component-ojrojas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: author-component
Source: https://github.com/ojrojas/AgentsInstructions/tree/main/.claude/skills/dotnet-blazor/skills/author-component
Command: npx skills add https://github.com/ojrojas/AgentsInstructions --skill author-component-ojrojas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenges of writing efficient and maintainable Blazor components, providing guidelines and best practices for architecture and code quality.

Core Features & Use Cases

  • Component Architecture: Offers guidelines for structuring Blazor components to ensure they are robust and maintainable.
  • Async Programming: Delivers rules for implementing asynchronous operations in Blazor components, ensuring responsiveness and thread safety.
  • RenderFragment & Generics: Provides instructions for using RenderFragment and generics effectively in Blazor components.
  • File Patterns: Defines when to use single-file .razor components versus .razor + .razor.cs for more complex logic.
  • Disposal: Outlines best practices for disposing of Blazor components properly to avoid memory leaks.
  • Use Case: Ideal for developers who want to improve their Blazor coding skills and ensure that their components are following best practices.

Quick Start

Run the 'author-component' skill to get started with creating a new Blazor component that adheres to best practices.

Frequently Asked Questions about author-component

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

FAQPage Schema
What are the best practices for Blazor component architecture and async programming?

Blazor component architecture best practices involve structuring components for maintainability, enforcing asynchronous programming rules for responsiveness, and using RenderFragment effectively to ensure robust and thread-safe UI rendering.

How do I properly implement async disposal in Blazor components to prevent memory leaks?

Async disposal in Blazor components requires following specific disposal patterns to release resources properly. This ensures efficient resource management and prevents memory leaks during component teardown.

When should I use a single-file .razor component versus splitting .razor and .razor.cs files?

Single-file .razor components suit simple UI logic, while splitting into .razor and .razor.cs files is recommended for components with complex logic, separating markup from code-behind to enhance maintainability.

How do I use RenderFragment and generics effectively in Blazor component development?

RenderFragment and generics in Blazor component development allow you to build flexible, reusable UI fragments. Effective use involves following specific instructions to dynamically render content while maintaining type safety.

Does this Blazor component development approach work for both simple and complex component structures?

Yes, this Blazor component development approach scales across complexity levels by providing distinct file pattern guidelines, ensuring simple components remain lightweight while complex logic is properly encapsulated.