Builds and evaluates Orchard Core rules with condition models, evaluators, display drivers, serialization, and Layers integration. Useful when implementing custom conditions, rule services, or condition groups.
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.Rules is the structured condition system used by features such as
Layers. A rule is a model of conditions evaluated against the current request
and context. It is different from OrchardCore.Scripting: scripting can power
a condition, but Rules provides condition models, editors, registration,
serialization, and composable all/any groups.
OrchardCore.Rules feature; it depends on OrchardCore.Scripting.Condition as the base type for a custom condition.IConditionEvaluator with ValueTask<bool> EvaluateAsync(Condition condition), or derive from ConditionEvaluator<TCondition> to get a typed override.IRuleService.EvaluateAsync(rule). A rule, All group, or Any group with no conditions evaluates to false.AddRuleCondition; do not use obsolete AddCondition.AddRule when a condition has a display driver and the default condition factory is sufficient.{
"steps": [
{
"name": "Feature",
"enable": [
"OrchardCore.Rules"
],
"disable": []
}
]
}
The module registers all, any, boolean, home page, URL, culture, role, JavaScript, authenticated, anonymous, and content-type conditions. It also registers string equality, prefix, suffix, and contains operators.
| Type | Purpose |
|---|---|
Rule | Serializable collection of conditions evaluated as a rule. |
Condition | Base model with Name and ConditionId. |
ConditionGroup | Base for nested groups such as all and any. |
IConditionEvaluator | Evaluates a condition instance. |
IConditionFactory | Creates a model for a builder condition. |
IConditionResolver | Resolves evaluators for a condition. |
IConditionOperatorResolver | Resolves configured string operators. |
Keep only serializable values in the condition model:
using OrchardCore.Rules;
namespace MyModule.Rules;
public sealed class RequestHeaderCondition : Condition
{
public string HeaderName { get; set; }
public string ExpectedValue { get; set; }
}
The evaluator validates its expected condition type before using it:
using Microsoft.AspNetCore.Http;
using OrchardCore.Rules;
namespace MyModule.Rules;
public sealed class RequestHeaderConditionEvaluator : IConditionEvaluator
{
private readonly IHttpContextAccessor _httpContextAccessor;
public RequestHeaderConditionEvaluator(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}
public ValueTask<bool> EvaluateAsync(Condition condition)
{
if (condition is not RequestHeaderCondition headerCondition)
{
return ValueTask.FromResult(false);
}
var headers = _httpContextAccessor.HttpContext?.Request.Headers;
var actual = headers?[headerCondition.HeaderName].ToString();
return ValueTask.FromResult(string.Equals(
actual,
headerCondition.ExpectedValue,
StringComparison.OrdinalIgnoreCase));
}
}
AddRuleCondition adds the condition to ConditionOptions, registers the
scoped evaluator and default singleton factory, and registers derived JSON type
metadata. Supply a third generic type argument only when a custom
IConditionFactory is needed:
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Modules;
using OrchardCore.Rules;
namespace MyModule;
public sealed class Startup : StartupBase
{
public override void ConfigureServices(IServiceCollection services)
{
services.AddRuleCondition<
RequestHeaderCondition,
RequestHeaderConditionEvaluator>();
}
}
When the condition needs editor UI, register its DisplayDriver<Condition> in
the same module. Keep view models unsealed because they bind form values.
JavascriptCondition runs its Script through the scripting engine and
converts the result to a Boolean.
ScriptPreparationException and shown as "The script couldn't be parsed",
alongside runtime errors and non-Boolean results.const) never leak into the next.HttpContext.RequestAborted; cancellation surfaces
as OperationCanceledException and propagates like any aborted request.
Time and statement budgets remain configurable through IOptions<Jint.Options>.isHomepage(),
isAnonymous(), isAuthenticated(), isInRole(role), url(pattern) (a
trailing * is a prefix match), and culture(name).isAuthenticated() && url("/account*")
Layers stores a rule to decide whether a layer is active for a request. Prefer the built-in URL, culture, role, and authentication conditions for common targeting. Add a custom rule condition only when the selection is reusable and needs the builder UI; simple one-off dynamic values can instead be handled by the supported scripting condition.
Rules define no recipe step or permissions of their own. Layers stores rules in
its Layers recipe step and protects the editor with ManageLayers; a custom
consumer must define its own permission. Conditions nested in All/Any
groups are deserialized polymorphically, so recipes need their $type as well
as Name (see orchardcore-layers).
Official Orchard Core videos shown on the documentation page:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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:orchardcore-rulesfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcoreOther plugins' skills for the same job