Generates OpenAPI/Swagger configuration, recipes, and code for Orchard Core 4.0. Covers schema generation, Swagger UI, ReDoc, Scalar, PKCE auth, NSwag client generation, and custom API endpoint documentation.
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.
You are an Orchard Core expert. Generate configuration, recipes, and code for the OrchardCore.OpenApi module, which ships with Orchard Core 4.0.
OrchardCore.OpenApi generates the OpenAPI document (Swashbuckle at /swagger/v1/swagger.json, plus the ASP.NET Core /openapi/*.json document) for every enabled API endpoint.OrchardCore.OpenApi. A disabled UI returns 404./swagger, /redoc, /scalar, /openapi) requires an authenticated user with ViewOpenApiContent. Anonymous users are redirected to the admin login; authenticated users without the permission get 403.ViewOpenApiContent (cookie or Api bearer token) unless Allow anonymous access to the API schema (AllowAnonymousSchemaAccess) is enabled. Unauthenticated schema requests get a 401 with a WWW-Authenticate header and a Problem Details body.ManageOpenApi implies ViewOpenApiContent. Grant only ViewOpenApiContent to roles that should read the docs without changing settings. Both are granted to Administrator by default.Api scheme, which accepts bearer tokens only. Swagger UI and Scalar acquire a token silently (authorization code + PKCE, prompt=none in a hidden iframe) from the tenant's own OpenID server, using the admin cookie session. ReDoc is read-only and needs no token.OpenApiPkce recipe once per tenant to provision that silent sign-in. Client credentials and password grants are intentionally not supported by the browser UIs./api/, and a rejected token triggers one silent re-sign-in and retry.{ "steps": [...] } format.sealed modifier, except View Models.The module is part of the OrchardCore.Application.Cms.Targets bundle. For a custom host, reference it in the web (startup) project:
<PackageReference Include="OrchardCore.OpenApi" Version="4.*" />
| Feature | ID | URL |
|---|---|---|
| OpenApi | OrchardCore.OpenApi | /swagger/v1/swagger.json, /openapi/v1.json |
| OpenApi Swagger UI | OrchardCore.OpenApi.SwaggerUI | /swagger |
| OpenApi ReDoc UI | OrchardCore.OpenApi.ReDocUI | /redoc |
| OpenApi Scalar UI | OrchardCore.OpenApi.ScalarUI | /scalar/v1 |
All URLs are relative to the tenant, so a tenant with the customer-a prefix serves /customer-a/swagger.
{
"steps": [
{
"name": "feature",
"enable": [
"OrchardCore.OpenApi",
"OrchardCore.OpenApi.SwaggerUI",
"OrchardCore.OpenApi.ScalarUI"
]
}
]
}
Settings → OpenApi shows which UIs are enabled and exposes one setting, OpenApiSettings.AllowAnonymousSchemaAccess (default false):
{
"steps": [
{
"name": "settings",
"OpenApiSettings": {
"AllowAnonymousSchemaAccess": true
}
}
]
}
Enable anonymous schema access only on tenants used for client generation. The schema lists every API route and its parameters.
Run OpenAPI Documentation — Bearer/PKCE (OpenApiPkce) from Tools → Recipes. It enables OrchardCore.OpenApi, OrchardCore.OpenId.Server, OrchardCore.OpenId.Validation, and OrchardCore.OpenId.Management, turns on the authorization code flow with PKCE required, configures local token validation, and registers a public openapi client. The equivalent custom recipe looks like this:
{
"steps": [
{
"name": "feature",
"enable": [
"OrchardCore.OpenApi",
"OrchardCore.OpenId.Management",
"OrchardCore.OpenId.Server",
"OrchardCore.OpenId.Validation"
]
},
{
"name": "OpenIdServerSettings",
"EnableTokenEndpoint": true,
"EnableAuthorizationEndpoint": true,
"EnableLogoutEndpoint": true,
"EnableUserInfoEndpoint": true,
"AllowAuthorizationCodeFlow": true,
"RequireProofKeyForCodeExchange": true
},
{
"name": "OpenIdValidationSettings",
"Tenant": "Default"
},
{
"name": "OpenIdApplication",
"ClientId": "openapi",
"DisplayName": "OpenAPI Interactive UI",
"Type": "public",
"ConsentType": "implicit",
"AllowAuthorizationCodeFlow": true,
"AllowLogoutEndpoint": true,
"RequireProofKeyForCodeExchange": true,
"RedirectUris": "https://cms.example.com/OrchardCore.OpenApi/openapi-oidc-silent.html",
"PostLogoutRedirectUris": "https://cms.example.com/",
"ScopeEntries": [
{ "Name": "email" },
{ "Name": "profile" },
{ "Name": "roles" }
]
}
]
}
Adjust before running:
openapi; the UIs request openid email profile roles.RedirectUris must be the tenant origin plus any tenant prefix plus /OrchardCore.OpenApi/openapi-oidc-silent.html, exactly.OpenIdValidationSettings.Tenant must name the tenant running the recipe. Leaving both Tenant and Authority empty makes validation invalid and every bearer call returns 401.OpenIdServerSettings step replaces the server settings; every flow or endpoint left out is turned off. Merge it with the flows the tenant already uses.roles scope carries them into the token.The OpenApiGeneration recipe enables the API features (Contents, Media, Media TUS, Queries, Tenants, Lucene, Elasticsearch, OpenApi) and turns on AllowAnonymousSchemaAccess. Its settings step replaces the stored OpenApi settings, so run it on a throwaway generation tenant.
dotnet tool install -g NSwag.ConsoleCore
# Against a running site with anonymous schema access enabled
nswag openapi2csclient /input:https://localhost:5001/swagger/v1/swagger.json /output:OrchardClient.cs /namespace:MyApp.OrchardClient
In the Orchard Core repository, dotnet run --project tools/OpenApiClientGenerator -c Release boots the CMS in-process with the OpenApiGenerationSetup recipe and regenerates the bundled clients headlessly. Operations are sorted by route and verb, so unchanged APIs regenerate byte-identical clients.
Without anonymous access, fetch the schema with an Authorization: Bearer <token> header for a user that has ViewOpenApiContent.
Endpoints appear in the document when they are API controllers or minimal APIs with an HTTP method. Secure them with the Api scheme and describe every response:
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using OrchardCore;
namespace MyModule.Controllers;
[ApiController]
[Route("api/inventory")]
[Authorize(AuthenticationSchemes = OrchardCoreConstants.AuthenticationSchemes.Api)]
public sealed class InventoryController : ControllerBase
{
/// <summary>
/// Gets the stock level of a product.
/// </summary>
[HttpGet("{sku}", Name = "ApiGetInventory")]
[ProducesResponseType(typeof(InventoryDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
public IActionResult Get(string sku)
{
return Ok(new InventoryDto { Sku = sku, Quantity = 10 });
}
}
public sealed class InventoryDto
{
public string Sku { get; set; }
public int Quantity { get; set; }
}
operationId across verbs.this.ApiNotFoundProblem(), this.ApiBadRequestProblem(), this.ApiForbidProblem() on controllers, or TypedResults.Problem() in minimal APIs) so generated clients can parse failures.OrchardCore.OpenApi is new in 4.0. Remove community Swagger modules that also call AddSwaggerGen for the same tenant.api/queries/{name} was split into two operations, ApiExecuteQueryGet and ApiExecuteQueryPost (same route, verbs, and parameters). NSwag-generated method names change on the next regeneration.| Symptom | Check |
|---|---|
401 on Try it out | Run OpenApiPkce, confirm OrchardCore.OpenId.Validation is enabled and OpenIdValidationSettings.Tenant is set. |
| Silent sign-in fails | The redirect URI must match origin, tenant prefix, and /OrchardCore.OpenApi/openapi-oidc-silent.html; check the browser console for [openapi-ui] errors. |
Token acquired but 401/403 from the API | The signed-in user's roles lack the endpoint permission. |
NSwag gets 401 for swagger.json | Enable AllowAnonymousSchemaAccess on a generation tenant or send a bearer token. |
/swagger returns 404 | Enable OrchardCore.OpenApi.SwaggerUI. |
| Endpoint missing from the document | Its feature is disabled, it lacks an HTTP method attribute, or the app was not restarted. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-openapifrom 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