Configures Orchard Core diagnostics error handling including custom error pages, status code pages, exception handling, Problem Details for API, and theme overrides for the OrchardCore.Diagnostics module.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
OrchardCore.Diagnostics wires tenant-aware error handling into the Orchard
Core pipeline. Its startup filter uses /Error for unhandled exceptions outside
development and re-executes status code responses at /Error/{status}. The
module maps the Error/{status?} route to DiagnosticsController.Error.
OrchardCore.Diagnostics feature before relying on its error route and shapes.UseExceptionHandler("/Error").UseStatusCodePagesWithReExecute("/Error/{0}") for status responses.IConfigureOptions for your own options registration, not to replace the diagnostic middleware order./Error also handles exceptions.401/403 challenges from the Api authentication scheme and errors from endpoints marked [SkipStatusCodePages] get an RFC 9457 Problem Details JSON body instead (Orchard Core 4.0).429 Too Many Requests from orchardcore-rate-limits renders through HttpError__429 / HttpError__TooManyRequests.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Diagnostics"
],
"disable": []
}
]
}
The module registers DiagnosticsStartupFilter as an IStartupFilter. This
ensures the error handling runs in the correct tenant pipeline without an
application manually adding duplicate middleware.
| Situation | Result |
|---|---|
| Unhandled exception in production | Re-executes /Error. |
| Response with a 4xx or 5xx status | Re-executes /Error/{status}. |
| Development environment exception | The exception handler is not registered by this filter. |
| Missing static asset | Status page rendering is disabled for known file extensions. |
Api scheme 401/403, or endpoint with [SkipStatusCodePages] | No HTML page; an application/problem+json body is written through IProblemDetailsService. |
Avoid calling UseExceptionHandler or UseStatusCodePagesWithReExecute again
for the same tenant unless you deliberately replace this behavior and have
verified pipeline order.
The controller produces an HttpError shape. It supplies alternates in this
order:
HttpError__{numericStatus} such as HttpError__404HttpError__{HttpStatusCodeName} such as HttpError__NotFoundLater alternates win, so a theme's HttpError-NotFound template takes precedence over HttpError-404 when both exist. The module ships templates for 400, 401, 403, 404, and 429 (HttpError-BadRequest, HttpError-Unauthorized, HttpError-Forbidden, HttpError-NotFound, HttpError-TooManyRequests), and HttpError as the fallback for every other status.
Add a default fallback in the active theme:
@* Views/HttpError.cshtml *@
@model OrchardCore.Diagnostics.ViewModels.HttpErrorShapeViewModel
<main class="error-page">
<h1>Something went wrong</h1>
<p>Please return to the home page or try again later.</p>
</main>
Add a more specific 404 template:
@* Views/HttpError-404.cshtml *@
@model OrchardCore.Diagnostics.ViewModels.HttpErrorShapeViewModel
<main class="error-page">
<h1>Page not found</h1>
<p>The requested address is unavailable.</p>
</main>
Liquid works too, for example Views/HttpError-TooManyRequests.liquid:
<h1>{{ "Too many requests. Please wait a moment and try again." | t }}</h1>
With the Templates feature, create a template named HttpError__Forbidden (or another alternate) in the admin to override the page without a theme change. Editing Templates requires ManageTemplates and, in 4.0, ManageLiquidTemplates.
The physical file naming convention is normalized by display management. Use
the documented HttpError__404 alternate when reasoning about selection and
the conventional HttpError-404.cshtml theme file when creating Razor views.
Status code pages turn an empty error response into an HTML page, which breaks JSON clients that authenticate with cookies. Opt such endpoints out:
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace MyModule.Controllers;
[SkipStatusCodePages]
public sealed class WidgetDataController : Controller
{
[HttpGet]
public IActionResult Get()
{
return NotFound();
}
}
The empty 404 then receives a Problem Details body. Responses that already have a body or content type are left untouched, and status codes and headers never change. Register services.AddProblemDetails(options => ...) to customize the payload. AddOrchardCms() registers this behavior through AddApiProblemDetails(); a host built with AddOrchardCore() must call .AddApiProblemDetails() itself.
Diagnostics itself has no public settings class. If a module needs a feature flag or support link for its own error display, model it with options:
using Microsoft.Extensions.Options;
namespace MyModule;
public sealed class ErrorDisplayOptions
{
public string SupportUrl { get; set; }
}
public sealed class ErrorDisplayOptionsConfiguration
: IConfigureOptions<ErrorDisplayOptions>
{
public void Configure(ErrorDisplayOptions options)
{
options.SupportUrl = "/contact";
}
}
Register the configuration in your module startup and consume it only from your own shape or view model. Do not insert exception details into the options or render them to public users.
Test an unknown route, a forbidden route, and a controlled exception in an
environment matching production. Verify the intended HttpError alternate
renders and that requests for missing CSS, JavaScript, and images do not
receive HTML error documents.
An error page is part of the public attack surface. Show a stable support message, preserve correlation identifiers supplied by the host when available, and log exception details only on the server. Do not display stack traces, connection strings, authentication claims, or route values that could contain personal data.
The diagnostics module deliberately separates exception handling from status code rendering. A 404 is a normal request outcome and should normally have a helpful, cache-aware themed response. An exception is an operational failure and should lead users to a generic page while server telemetry retains the diagnostic context.
For that server telemetry, orchardcore-opentelemetry exports traces, metrics
and logs tagged with the tenant name over OTLP: failed requests and the
exceptions they raise show up as spans with an Error status, and logs go to
the same backend. Use orchardcore-logging-serilog for file or console logs.
The built-in area route is Error/{status?}. Avoid defining an application
endpoint that shadows /Error in a tenant using this module. If a site needs a
different public support URL, link to it from the HttpError shape rather than
changing the error handler path.
What SKILL.md sets; muted values are Claude Code's defaults
/orchardcore:orchardcore-diagnosticsfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard./orchardcore-admin-edit-viewsSkill for writing Orchard Core admin editor views with the ocat CSS classes and cards. Covers Edit views for content parts and fields, field editor variants, part, field and site settings editors, Fields.Edit views, admin pages rendering Model.Editor built with IDisplayManager, the ocat classes and their layout rules, label associations and group captions, part and field wrapper classes, validation, hints and the Hint_Admin shape, cards declared in placement and the Card and CardContainer shapes, split editor shapes, tabs and columns, the edit page action bar, the horizontal form layout, and the UI text casing standard. Use this skill when requests mention Orchard Core admin edit views, admin forms, grouping fields in cards, Edit.cshtml, Fields.Edit.cshtml, Settings.Edit.cshtml, ocat classes, label casing, or field hints. Strong matches include ocat-wrapper, ocat-card, Hint_Admin, PlacementLocationBuilder, IDisplayManager, ContentPartDisplayDriver, SiteDisplayDriver./orchardcore-admin-listsSkill for Orchard Core 4.0 admin index views (list pages) rendered with the AdminList shape. Covers the List and Grid layouts, AdminListContext of TModel, the admin-list and admin-list-column tag helpers, column width and alignment, row display drivers placing shapes for SummaryAdmin and SummaryAdminGrid, row templates and zones, AdminListActions Buttons and Menu layouts, AdminListToolbar, AdminListSearch, the list-management script for select-all and bulk actions, IAdminListColumnsProvider, AdminListOptions, user layout selection, per-list alternates, sortable lists, and upgrading overridden list views. Use this skill when requests mention Orchard Core admin index views, an admin index page, admin lists, converting a hand-written admin listing, grid layout, list columns, row actions menu, or adding a column to the content items list. Strong matches include OrchardCore.Admin.Abstractions, AdminListContext, AdminListColumn, IAdminListColumnsProvider, AdminListOptions, AdminListLayout, ContentsAdminList./orchardcore-admin-menuSkill for creating admin menus in Orchard Core. Covers admin menu content, the link, placeholder, content types, and lists admin node types, the AdminMenu recipe and deployment step, ManageAdminMenu, ViewAdminMenuAll and per-menu ViewAdminMenu permissions from AdminMenuPermissions, custom admin nodes with AdminNode, IAdminNodeNavigationBuilder and AddAdminNode, data localization of node text, rendering in the 4.0 TheAdmin menu, and upgrading from the removed legacy admin menu layout. Use this skill when requests mention Orchard Core Admin Menu, Create and Manage Admin Menus, Admin Menu Deployment Recipe Step, Built-In Admin Node Types, Custom Admin Node Class, LegacyAdminMenuNavigation, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminMenu, OrchardCore.AdminMenu.Abstractions, AdminMenuPermissions, LinkAdminNode, PlaceholderAdminNode, OrchardCore.Lists, OrchardCore.Navigation./orchardcore-admin-schemesSkill for the Orchard Core 4.0 TheAdmin redesign and its admin schemes. Covers scheme records with their four colors, typography, density, corners, horizontal form layout and content width, Design > Themes > Schemes, the default scheme, the per-user scheme picker and its cookie, the seven built-in schemes, the AdminSchemes recipe step and Admin Schemes deployment step, the schemes.css stylesheet, the --ta-* design tokens, ta-content-fluid, dark mode utilities and nested color modes, TheOldAdmin and how to switch to it, and the breaking changes for custom admin themes and Layout overrides. Use this skill when requests mention admin schemes, admin colors, rebranding TheAdmin, dark mode of the admin, the admin content width, the horizontal form layout, TheOldAdmin, or upgrading a custom admin theme to the new TheAdmin. Strong matches include AdminScheme, AdminSchemes, DefaultSchemeId, HorizontalFormLayout, ContentWidth, data-ta-scheme, --ta-primary, ta-content-fluid, TheOldAdmin, and OrchardCore.Themes.TheAdmin.Other plugins' skills for the same job