rm-guide-blazor

Enforce Blazor component best practices for lifecycle and render correctness.

Updated Nov 11, 2023
One-click install
npx skills add https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb --skill rm-guide-blazor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rm-guide-blazor
Source: https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb/tree/main/.opencode/skills/redmuffin-standards/rm-guide-blazor
Command: npx skills add https://github.com/michaelvolz/redmuffin.Blazor.StaticWeb --skill rm-guide-blazor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Ensures teams avoid lifecycle, render, and injection anti-patterns when building or reviewing Blazor components.

Core Features & Use Cases

  • Critical Rules: Encourages composition over inheritance, required injected properties, and minimal intentional state to keep components predictable.
  • Lifecycle Focus: Covers when to use OnInitializedAsync, OnParametersSetAsync, and ShouldRender to balance performance with correctness.
  • Use Case: While refactoring an existing .razor page you can rely on this guidance to keep event callbacks, state updates, and DI patterns consistent before merging.

Quick Start

Ask for rm-guide-blazor advice whenever you need to refactor a .razor component or adjust its lifecycle, state, or render behavior.

Frequently Asked Questions about rm-guide-blazor

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

FAQPage Schema
What are Blazor component best practices for managing lifecycle and render bugs?

Blazor component best practices encourage composition over inheritance, required injected properties, and minimal intentional state to keep components predictable and reduce lifecycle and render bugs.

How do I refactor a .razor component to fix dependency injection and render issues?

Refactoring a .razor component requires keeping event callbacks, state updates, and dependency injection patterns consistent to avoid anti-patterns before merging.

When should I use OnParametersSetAsync and ShouldRender in Blazor components?

Use OnParametersSetAsync and ShouldRender in Blazor components to balance rendering performance with correctness when handling parameter updates and controlling render behavior.

What is the best way to structure Blazor component composition and required injections?

The best way to structure Blazor component composition is enforcing required injected properties and intentional state over inheritance to ensure predictable component behavior.

Can I use this guidance for reviewing Blazor event callbacks and state updates?

Yes, you can rely on this guidance while reviewing or creating .razor components to ensure event callbacks, state updates, and DI patterns remain consistent.

Why does my Blazor component have unpredictable render behavior and state?

Unpredictable Blazor component render behavior often stems from anti-patterns in lifecycle logic, lacking required injections, or unintentional state management during component composition.