Blazor page view entity

From IntentArchitect/Intent.Modules.NET · View interactive version

Blazor page view entity is an AI agent skill from the GitHub repository IntentArchitect/Intent.Modules.NET. Creates Blazor read-only view entity pages using MudBlazor layout, preserving existing .razor.cs data loading, service, and navigation behavior while rendering a structured non-editable detail view. Use when implementing view, detail, inspect, or read-only display entity pages in Blazor.

How to use this skill

Skill file

MANDATORY: Read Samples Before Implementation

STOP - You MUST read ALL sample files in the SAME folder as this SKILL.md before writing ANY code:

  1. EntityViewTemplate.razor
  2. EntityViewTemplate.cs

Then read the target component .razor, .razor.cs, and related project files such as DTOs, enums, and shared styles.

If any sample file cannot be accessed: stop immediately, confirm the SKILL.md folder location, retry from that location, and if still inaccessible report which file is missing. Do not proceed with partial implementation or approximation.


MANDATORY: Match Sample Layout (Visual Structure)

When a sample exists, you MUST match the sample's visual structure, not only its data-loading behavior.

Required process:

  1. Reuse the sample's top-level component layout (hero header + main card) unless the user explicitly requests otherwise.
  2. If the sample uses shared utility classes (e.g. ux-gradient-primary, ux-fade-in-up), verify they exist in the target app's styles (typically under wwwroot, such as ux-token.css or ux-mudblazor.css) and then reuse them.

Required baseline layout (when supported by the target app):

Forbidden:


Preserve Existing Implementation

Use for: Read-only view or detail entity pages in Blazor with MudBlazor

Do NOT use for: Add or edit forms, search pages, dialogs, or non-Blazor projects

Source of truth: Existing .razor.cs file defines data loading, service calls, navigation, and the DTO structure

You MUST NOT:


1. Data Loading

Load data through existing lifecycle methods and backing methods such as OnInitializedAsync(), OnParametersSetAsync(), or explicit load methods already present in .razor.cs.

Show a loading indicator while the data object is null, using the same pattern as the sample (MudProgressCircular inside a centered MudStack).

Do not display entity content until the data object is non-null.


2. Map DTO Properties to Read-Only Display

Render all scalar DTO properties as labeled read-only fields using MudText:

| Property Type | Display |

|---------------|---------|

| String / number | MudText Typo="Typo.body1" with MudText Typo="Typo.overline" label above |

| Boolean / status | MudChip with conditional Color and Variant |

| Enum | Resolved display label (not raw integer) in MudChip or MudText |

| Nullable object | Conditional section rendered only when non-null |

| Collection | Iterated with @foreach, each item in a MudPaper card |

Chip rules:

Enum rules:


3. Nullable Object Sections

Render optional nested objects inside an @if guard matching the existing null check in the backing class.

Do not render nested fields outside their guard block.


4. Child Collections

Render child collections with @foreach inside a guarded @if block.


5. Navigation Actions

Render navigation buttons at the bottom of the card in a right-aligned MudStack:

Button placement:


6. Styling

Design context (if design.md is present)

If a design.md file exists in the project, read it before choosing MudBlazor component properties. Use it for:

design.md informs prop choices only — it does not override the sample's layout structure.


Definition of Done

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.