Creates Orchard Core modules with proper structure, manifest, startup, and 4.0 patterns. Scaffolds content parts, fields, drivers, handlers, settings, admin pages, minimal APIs, and background tasks.
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.
Step-by-step creation of a module for an Orchard Core site built on NuGet packages, with code templates for each kind of component. orchardcore-modules covers module structure, feature design, and installing third-party modules in more depth; a short section at the end lists what differs when contributing to the Orchard Core repository itself.
net11.0 only.OrchardCore.Application.Cms.Targets| Type | Description | Key Components |
|---|---|---|
| Content Part | Adds data/behavior to content items | Part, Driver, Views |
| Content Field | Custom field type | Field, Driver, Views |
| Settings | Site-wide configuration | Settings class, SiteDisplayDriver, options |
| Admin Feature | Admin pages/tools | Controller, Views with <breadcrumb> and <admin-list>, Menu |
| API | JSON endpoints | Minimal API endpoint class + Startup route registration |
| Background Task | Scheduled jobs | IBackgroundTask |
dotnet new install OrchardCore.ProjectTemplates
dotnet new ocmodulecms -n Contoso.YourModule -o src/Modules/Contoso.YourModule
dotnet sln add src/Modules/Contoso.YourModule/Contoso.YourModule.csproj
dotnet add src/Contoso.Web/Contoso.Web.csproj reference src/Modules/Contoso.YourModule/Contoso.YourModule.csproj
--AddPart true --PartName Rating also generates a RatingPart with its driver, handler, settings, migration, and views (Part is appended to the name); -ov picks the Orchard Core package version.dotnet new ocmodulemvc for a plain MVC module without content management. The matching dotnet new ocmvc web template's _Layout.cshtml loads Bootstrap 5.3.8 from a CDN pinned with Subresource Integrity (instead of jQuery 2.1.4 and Bootstrap 3.3.5 in 3.x); update the layout of sites created from the older template the same way.Every module needs:
OrchardCore.Module.TargetsAdd a ConfigurationSchema.json (and the JsonSchemaSegment build item) when the module reads a configuration section; see orchardcore-configuration. See references/module-structure.md for templates.
Content Part modules:
Models/YourPart.cs
ViewModels/YourPartViewModel.cs
Drivers/YourPartDisplayDriver.cs
Views/YourPart.cshtml
Views/YourPart_Edit.cshtml
Admin modules:
Controllers/AdminController.cs
Views/Admin/Index.cshtml
AdminMenu.cs
Permissions.cs (IPermissionProvider)
YourModulePermissions.cs (static permission definitions, usually in a Core/Abstractions project)
Data-storing modules:
Migrations.cs
Indexes/YourIndex.cs
See references/patterns.md for code templates and references/examples.md for complete examples.
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddContentPart<YourPart>()
.UseDisplayDriver<YourPartDisplayDriver>();
services.AddScoped<IYourService, YourService>();
services.AddDataMigration<Migrations>();
services.AddPermissionProvider<Permissions>();
services.AddNavigationProvider<AdminMenu>();
}
}
// Extends another module only when it is enabled; no extra feature to manage.
[RequireFeatures("OrchardCore.Deployment")]
public sealed class DeploymentStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddDeployment<YourDeploymentSource, YourDeploymentStep, YourDeploymentStepDriver>();
}
}
| Attribute | Effect |
|---|---|
[Feature("Id")] | Binds the startup or component to one of the features declared by this module's manifest. |
[RequireFeatures("A", "B")] | Composes the type only when all listed features are enabled. |
[RequiredStartup] (4.0) | Composes the public type for every tenant, even when the feature that defines it is disabled. Its services are attributed to Application.DefaultFeatureId. Combine with [RequireFeatures] to still require other features. |
// Always registered, even when 'Contoso.YourModule' is disabled,
// as long as OrchardCore.Contents is enabled.
[RequiredStartup]
[RequireFeatures("OrchardCore.Contents")]
public sealed class AlwaysOnStartup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddScoped<IContentHandler, YourCleanupHandler>();
}
}
OCSG002 analyzer warns when [Feature("...")] names a feature that is not declared by the current module; such a target is silently ignored at runtime. To depend on another module's feature, use [RequireFeatures("...")] instead of [Feature("...")].[RequireFeatures] are now honored per shell, so their alternates and wrappers no longer leak into tenants that lack the required feature.When a module exposes an endpoint that primarily returns JSON, prefer Minimal APIs over MVC ApiController classes.
public override void Configure(IApplicationBuilder app, IEndpointRouteBuilder routes, IServiceProvider serviceProvider)
{
routes.AddGetWeatherEndpoint();
}
internal static class GetWeatherEndpoint
{
public static IEndpointRouteBuilder AddGetWeatherEndpoint(this IEndpointRouteBuilder builder)
{
builder.MapGet("api/weather", HandleAsync)
.WithName("YourModuleGetWeather")
.AllowAnonymous()
.DisableAntiforgery();
return builder;
}
[Authorize(AuthenticationSchemes = OrchardCoreConstants.AuthenticationSchemes.Api)]
private static async Task<IResult> HandleAsync(
IAuthorizationService authorizationService,
HttpContext httpContext)
{
if (!await authorizationService.AuthorizeAsync(httpContext.User, YourModulePermissions.ViewWeather))
{
return httpContext.ChallengeOrForbid(OrchardCoreConstants.AuthenticationSchemes.Api);
}
return TypedResults.Ok(new { ok = true });
}
}
Api authentication scheme, and responses of endpoints marked [SkipStatusCodePages], now carry an RFC 9457 Problem Details body (application/problem+json). Return TypedResults.Problem(...) / ValidationProblem(...) for your own errors so clients get one format..WithName(...) (one per verb, it becomes the OpenAPI operationId) so the OrchardCore.OpenApi module documents it cleanly; see orchardcore-openapi.Initialize<TModel>() (prefer the typed-state overloads with static lambdas) or Factory(); Shape() is obsolete. Initializer delegates are ValueTask-based. Overrides of the 3-parameter Factory() must move to Factory<TBuilderState, TInitState>().*Permissions class with LocalizationSource.Create("Description", typeof(DeclaringType)) descriptions, and expose them through an IPermissionProvider registered with AddPermissionProvider<T>(). Use the current permission classes (MediaPermissions, SettingsPermissions, UsersPermissions, DeploymentPermissions, GraphQLPermissions, ...); the old *.Permissions.* members and CommonPermissions were removed, and StandardPermissions.SiteOwner is gone (use the Administrator role).Category and Title with untranslated sources marked [JsonIgnore] ([JsonIgnore] public override LocalizationSource Title => ...;); every instance property of type LocalizationSource carries [JsonIgnore]. Step titles are Title Case (All Layers), descriptions sentence case ending with a period.<breadcrumb name="..." title="@T["..."]"> inside the Title zone instead of <h1>; render lists with <admin-list> so List/Grid layouts work (see orchardcore-breadcrumbs and orchardcore-admin-lists)..Location(l => l.Zone("Content", "1").Card(S["General"], "10")), one editor shape per card, with views holding ocat-* rows only. A module page editing a view model renders @await DisplayAsync(Model.Editor) built with IDisplayManager<TViewModel>.BuildEditorAsync/UpdateEditorAsync and a DisplayDriver<TViewModel> (see orchardcore-admin-edit-views). Test views in TheAdmin with the scheme's Horizontal form layout on and off.S["..."], T["..."], H["..."] and LocalizationSource.Create(...) string.AdminNavigationProvider; there is no legacy admin menu layout any more.<script at="Foot" type="module"> and must not wait for DOMContentLoaded. Admin Vue apps use Vue 3.ITempDirectoryProvider instead of Path.GetTempPath().IMediaFileStore.CreateFileFromStreamAsync(path, stream) does not do that (it only runs IMediaCreatingEventHandlers); use the MediaFileStoreExtensions.CreateFileFromStreamAsync(fileCreationService, path, stream, ...) overload, or call FileCreationService.CreateAsync() yourself for other stores and abort when Succeeded is false. See orchardcore-file-upload-security.IOptionsMonitor<T>.CurrentValue; see orchardcore-site-settings.OrchardCore:YourService[:Provider] without an OrchardCore_ prefix.wwwroot files are served from /{ModuleId}/...; the application's own wwwroot is resolved through the web root, so do not build paths from Application.Root.| Use Title Case for | Use sentence case for |
|---|---|
| Admin menu items | Buttons and submit actions (Save, Add widget) |
| Breadcrumb items | Links and dropdown actions (Edit nodes) |
| Page titles and headings, including modal and dialog titles | Field, checkbox and radio labels (Display name) |
| Names acting as titles: workflow activities and events, deployment steps | Select options, tab names and card titles (Sender) |
| Table column headers (Content item ID) | |
| Tooltips, placeholders, hints, descriptions, messages, validation errors | |
| Permission descriptions (Manage admin settings) |
builder.Add(S["Tools"], tools => tools
.Add(S["Remote Clients"], S["Remote Clients"].PrefixPosition(), clients => clients // Menu item: Title Case
.Action("Index", "RemoteClient", "Contoso.Sync")
.Permission(SyncPermissions.ManageRemoteClients)
.LocalNav()));
public static readonly Permission ManageRemoteClients = new("ManageRemoteClients",
LocalizationSource.Create("Manage remote clients", typeof(SyncPermissions))); // Permission: sentence case
await _notifier.SuccessAsync(H["The remote client has been saved."]); // Message: sentence ending with a period
<breadcrumb name="RemoteClientsEdit" title="@T["Edit Remote Client"]"> @* Page title: Title Case *@
<breadcrumb-item id="RemoteClients" action="Index" controller="RemoteClient" area="Contoso.Sync">@T["Remote Clients"]</breadcrumb-item>
</breadcrumb>
<label asp-for="ClientId" class="ocat-label">@T["Client ID"]</label> @* Label: sentence case, acronym kept *@
<button type="submit" class="btn btn-primary save">@T["Add remote client"]</button> @* Button: sentence case *@
| Place | Don't | Do |
|---|---|---|
| Admin menu item | Remote clients | Remote Clients |
| Page heading | Change password | Change Password |
| Button | Add Widget | Add widget |
| Field label | Display All Content Types | Display all content types |
| Column header | Content Item Id | Content item ID |
| Permission | Manage Media Profiles | Manage media profiles |
| Workflow activity | Create content task | Create Content Task |
dotnet build
dotnet run --project src/Contoso.Web
# Enable the feature in Admin → Tools → Features, or with a recipe "feature" step
Use the orchardcore-tester skill to verify the feature in a browser.
| Item | Convention | Example |
|---|---|---|
| Module project and ID | Company.ModuleName | Contoso.Rating |
| Namespace | Company.ModuleName | Contoso.Rating |
| Feature ID | Module ID, or Company.ModuleName.SubFeature | Contoso.Rating, Contoso.Rating.Api |
| Content Part | NamePart | RatingPart |
| Driver | NamePartDisplayDriver | RatingPartDisplayDriver |
| Permissions | NamePermissions (static) | RatingPermissions |
| View | PartName.cshtml | RatingPart.cshtml |
| Edit View | PartName_Edit.cshtml | RatingPart_Edit.cshtml |
| Static files | ~/{ModuleId}/... | ~/Contoso.Rating/js/rating.js |
<!-- Marks the project as a module (required) -->
<PackageReference Include="OrchardCore.Module.Targets" Version="3.*" />
<!-- Content parts, fields, drivers -->
<PackageReference Include="OrchardCore.ContentManagement" Version="3.*" />
<PackageReference Include="OrchardCore.ContentTypes.Abstractions" Version="3.*" />
<PackageReference Include="OrchardCore.DisplayManagement" Version="3.*" />
<!-- Admin UI -->
<PackageReference Include="OrchardCore.Admin.Abstractions" Version="3.*" />
Use in Manifest.cs: Content Management, Content, Navigation, Security, Infrastructure, Theming, Developer.
Only when contributing a module to Orchard Core itself: create it under src/OrchardCore.Modules/OrchardCore.ModuleName, use ProjectReferences to src/OrchardCore/* projects instead of packages, fill the manifest with ManifestConstants.OrchardCoreTeam, OrchardCoreWebsite, and OrchardCoreVersion, run the app from src/OrchardCore.Cms.Web, and follow the repository's AGENTS.md for build and test commands.
references/module-structure.md - Directory layout and file templatesreferences/patterns.md - Code patterns (parts, drivers, handlers, permissions, uploads, temp files)references/examples.md - Complete module examplesWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
orchard-core, module-scaffolding, dotnet-new, cms-development
/orchardcore:orchardcore-module-creatorfrom 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.Other plugins' skills for the same job