Intercepts Orchard Core content definitions during build using IContentDefinitionHandler. Creates system-defined content types, parts, and fields that users cannot remove or modify via admin UI or recipes.
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.
Read when SKILL.md points to them.
You are an Orchard Core expert. IContentDefinitionHandler lets a module intercept and modify content type, part, and field definitions while they are being built, before they are cached. The primary use is injecting a part into a content type programmatically and marking types, parts, or fields as system-defined so users cannot remove or modify them through the admin UI or recipes. This complements — it does not replace — the IContentDefinitionManager migration APIs (see the orchardcore-content-types skill) used for ordinary, user-manageable definitions.
OrchardCore.ContentTypes.Events.IContentDefinitionHandler and register it with services.AddScoped<IContentDefinitionHandler, T>() in the module's Startup.*BuildingContext exposing the definition record being built and its name:
ContentTypeBuilding(ContentTypeBuildingContext context) — a content type is being built.ContentPartBuilding(ContentPartBuildingContext context) — a content part definition is being built.ContentTypePartBuilding(ContentTypePartBuildingContext context) — a part is being attached to a type.ContentPartFieldBuilding(ContentPartFieldBuildingContext context) — a field is being built on a part.ContentSettings with IsSystemDefined = true into the record's Settings under the nameof(ContentSettings) key.InvalidOperationException if code attempts to remove it through IContentDefinitionService, and the admin type/part editors render the Delete/Remove buttons as disabled.definition.GetSettings<ContentSettings>().IsSystemDefined.This handler attaches an SeoPart to every content type whose stereotype is Page, and marks the part system-defined so users cannot detach it. It mirrors the built-in DashboardPartContentTypeDefinitionHandler.
using System.Text.Json.Nodes;
using OrchardCore.ContentManagement.Metadata.Records;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.ContentTypes.Events;
namespace MyModule;
public sealed class SeoPartContentTypeDefinitionHandler : IContentDefinitionHandler
{
// Attach SeoPart to any type with the `Page` stereotype.
public void ContentTypeBuilding(ContentTypeBuildingContext context)
{
if (context?.Record?.Settings is null ||
!context.Record.Settings.TryGetPropertyValue(nameof(ContentTypeSettings), out var node))
{
return;
}
var settings = node.ToObject<ContentTypeSettings>();
if (!string.Equals(settings.Stereotype, "Page", StringComparison.OrdinalIgnoreCase))
{
return;
}
// Do not add it twice.
if (context.Record.ContentTypePartDefinitionRecords
.Any(x => x.Name.EqualsOrdinalIgnoreCase(nameof(SeoPart))))
{
return;
}
context.Record.ContentTypePartDefinitionRecords.Add(new ContentTypePartDefinitionRecord
{
Name = nameof(SeoPart),
PartName = nameof(SeoPart),
Settings = new JsonObject
{
[nameof(ContentSettings)] = JObject.FromObject(new ContentSettings
{
IsSystemDefined = true,
}),
},
});
}
// Mark the type-part system-defined so it cannot be removed from the type.
public void ContentTypePartBuilding(ContentTypePartBuildingContext context)
{
if (context?.Record?.Settings is null ||
!context.Record.PartName.EqualsOrdinalIgnoreCase(nameof(SeoPart)))
{
return;
}
var settings = context.Record.Settings[nameof(ContentSettings)]?.ToObject<ContentSettings>()
?? new ContentSettings();
settings.IsSystemDefined = true;
context.Record.Settings[nameof(ContentSettings)] = JObject.FromObject(settings);
}
// Create the part definition on the fly if the module does not define it via migration.
public void ContentPartBuilding(ContentPartBuildingContext context)
{
if (context.Record is not null || context.PartName != nameof(SeoPart))
{
return;
}
context.Record = new ContentPartDefinitionRecord
{
Name = context.PartName,
Settings = new JsonObject
{
[nameof(ContentPartSettings)] = JObject.FromObject(new ContentPartSettings
{
Attachable = false,
Reusable = false,
}),
[nameof(ContentSettings)] = JObject.FromObject(new ContentSettings
{
IsSystemDefined = true,
}),
},
};
}
public void ContentPartFieldBuilding(ContentPartFieldBuildingContext context)
{
}
}
Register the handler in Startup:
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.ContentTypes.Events;
using OrchardCore.Modules;
namespace MyModule;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IContentDefinitionHandler, SeoPartContentTypeDefinitionHandler>();
}
}
Setting Attachable = false on the injected part keeps it out of the "add part" list, so the part exists only where the handler places it.
ContentSettings lives in OrchardCore.ContentManagement.Metadata.Settings; the GetSettings<T>() accessor is on the definition models in OrchardCore.ContentManagement.Metadata.Models.
using OrchardCore.ContentManagement.Metadata.Models;
using OrchardCore.ContentManagement.Metadata.Settings;
var isSystem = typeDefinition.GetSettings<ContentSettings>().IsSystemDefined;
The same call works on ContentTypeDefinition, ContentPartDefinition, ContentTypePartDefinition, and ContentPartFieldDefinition.
IContentDefinitionService.RemoveType, RemovePart, RemovePartFromType, and RemoveFieldFromPart throw InvalidOperationException for a system-defined definition — this blocks both admin actions and recipe-driven removals that flow through the service.services.AddScoped<IContentDefinitionHandler, T>() and that the guarding stereotype/name check actually matches.ContentSettings block is written under the nameof(ContentSettings) key with IsSystemDefined = true on the correct record (the type, the type-part, the part, or the field).ContentPartSettings.Attachable = false when building the part definition.JObject.FromObject does not resolve, add using System.Text.Json.Nodes; — JObject is the Orchard Core helper in that namespace, and it returns a JsonObject.LiquidPart, a LiquidField, or a FacebookPluginPart makes editing and publishing every item of that type (and items that embed it) require the ManageLiquidTemplates permission (see orchardcore-liquid).IContentDefinitionManager migrations instead; reach for a handler only when the definition must be injected or protected.See references/content-definition-handler-examples.md for a system-defined field example.
What SKILL.md sets; muted values are Claude Code's defaults
140 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./orchardcore:orchardcore-content-definition-handlersfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcoreOther plugins' skills for the same job