Provides setup, recipes, and extension code for the CrestApps Orchard Core Service Levels SLA engine. Covers policies, timers, business-hour schedules, warnings, breaches, and observers for tickets, work orders, or custom records.
Ships in crestapps-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. Generate accurate setup, recipes and extension code for the CrestApps Service Levels module. A policy says how long a first response, next response or resolution may take at each priority, counted on a business hours schedule or around the clock. The module that owns a record (Tickets, Work Orders, your own) starts and stops a stored timer per record and metric; a monitor raises warnings and breaches and tells the owner through observers.
CrestApps.OrchardCore.ServiceLevels in the web/startup project. It depends on Business Hours (orchardcore-business-hours).CrestApps.OrchardCore.ServiceLevels.Abstractions (models, IServiceLevelTracker, scopes, observers, ServiceLevelsConstants, ServiceLevelsPermissions, registration helpers) or CrestApps.OrchardCore.ServiceLevels.Core (AddServiceLevelsCore(), stores, DefaultServiceLevelTracker, ServiceLevelMonitor) from your module, never the module project.IServiceLevelTracker while holding your record's own lock, from the code path that changes the record, so a timer always matches the record.IServiceLevelObserver; the monitor calls observers only after its save commits.{ "steps": [...] }.sealed modifier, except View Models.| Feature | ID | Depends on |
|---|---|---|
| Service Levels | CrestApps.OrchardCore.ServiceLevels | CrestApps.OrchardCore.BusinessHours, CrestApps.OrchardCore.Resources |
Category Organization. Tickets (CrestApps.OrchardCore.Tickets) depends on it; Work Orders registers its WorkOrders scope when both are on.
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.ServiceLevels"
],
"disable": []
}
]
}
| Project | Holds |
|---|---|
CrestApps.OrchardCore.ServiceLevels.Abstractions | ServiceLevelPolicy, ServiceLevelTarget, ServiceLevelTimer, ServiceLevelTimerState, ServiceLevelMetrics, ServiceLevelStart, ServiceLevelOption, IServiceLevelTracker, IServiceLevelObserver, IServiceLevelScopeProvider, IServiceLevelPolicyManager, IServiceLevelPolicyUsageProvider, IServiceLevelTimerAccessProvider, registration helpers |
CrestApps.OrchardCore.ServiceLevels.Core | YesSql stores and indexes (collection ServiceLevels), DefaultServiceLevelTracker, ServiceLevelClock, ServiceLevelMonitor, ServiceLevelTargetGrid, ServiceLevelPriorityKeys, ServiceLevelScheduleObserver, AddServiceLevelsCore() |
CrestApps.OrchardCore.ServiceLevels (module) | Content > Service Levels, policy editor, monitor background task, migration, recipe and deployment step, data set |
| Menu | Controller | Permission |
|---|---|---|
| Content > Service Levels | PoliciesController (shared admin list) | ManageServiceLevelPolicies |
| Permission | Display name | Default role |
|---|---|---|
ManageServiceLevelPolicies | Manage service level policies | Administrator |
Add policy opens the editor of the only registered scope, or lists the scopes when there are several. The editor (IDisplayManager<ServiceLevelPolicy>) shows a grid of minutes per metric and priority plus an Any other priority row (targets with an empty Priority). The scope is fixed once the policy exists.
| Member | Meaning |
|---|---|
Name, Description | Name up to 255 characters, unique per scope |
Scope | Name of a registered IServiceLevelScopeProvider (Tickets, WorkOrders, yours) |
Targets | ServiceLevelTarget { Metric, Priority, Minutes }. FindTarget(metric, priority) returns the priority's target, else the metric's target for every priority |
HoursScheduleId | A schedule from any Business Hours source; empty counts around the clock |
WarningPercent | 1 to 99, default 80 (ServiceLevelsConstants.DefaultWarningPercent) |
Properties | Settings other modules keep on the policy (Work Orders keeps WorkOrderServiceLevelSettings with its pause statuses) |
FirstResponse, NextResponse and Resolution (ServiceLevelMetrics); a scope may add its own.Priority is the scope's key (ServiceLevelOption.Key): Tickets uses the ticket priority's ItemId, Work Orders the WorkOrderPriority name. A target written with a priority's name (as a recipe that can't know a site's ids writes it) is rekeyed by ServiceLevelPriorityKeys on save, so renaming a priority keeps its targets.IServiceLevelPolicyUsageProvider), can't be deleted.The ServiceLevelPolicies step (ServiceLevelsConstants.RecipeStepName, needs OrchardCore.Recipes.Core) creates or updates policies, matched by ItemId, then by Scope and Name. Put the BusinessHoursSchedules step first when the policy names a schedule.
{
"steps": [
{
"name": "ServiceLevelPolicies",
"Policies": [
{
"ItemId": "47bpbxt94eb7qbn8wjb9rg9eb3",
"Name": "Standard help desk",
"Scope": "Tickets",
"HoursScheduleId": "44fy8z1wfv91trshefx9dqcsyj",
"WarningPercent": 75,
"Targets": [
{ "Metric": "FirstResponse", "Priority": "Urgent", "Minutes": 60 },
{ "Metric": "Resolution", "Priority": "Urgent", "Minutes": 480 },
{ "Metric": "FirstResponse", "Priority": "Normal", "Minutes": 240 },
{ "Metric": "Resolution", "Priority": "Normal", "Minutes": 1920 },
{ "Metric": "FirstResponse", "Minutes": 480 }
]
},
{
"Name": "Standard service",
"Scope": "WorkOrders",
"HoursScheduleId": "",
"Targets": [
{ "Metric": "FirstResponse", "Priority": "Urgent", "Minutes": 120 },
{ "Metric": "Resolution", "Priority": "Urgent", "Minutes": 480 }
],
"Properties": {
"WorkOrderServiceLevelSettings": { "PauseStatuses": [ "OnHold" ] }
}
}
]
}
]
}
The Service level policies deployment step exports every policy in the same shape. With CrestApps Recipes on, both steps publish a JSON schema.
Each record and metric has a ServiceLevelTimer (collection ServiceLevels) with Subject (RecordRef), Metric, PolicyId, Priority, TargetSeconds, HoursScheduleId, State (Running, Paused, Completed, Cancelled), StartedUtc, DueUtc, WarnAtUtc, PausedSinceUtc, UsedSeconds, WarnedUtc, BreachedUtc, EndedUtc, ElapsedSeconds and NoBusinessHours.
IServiceLevelTracker method | Call it when |
|---|---|
StartAsync(ServiceLevelStart) | The record is created or a repeating metric starts a new cycle (a customer replies). Cancels an active timer of the same metric first. Paused, AlreadyWarned, AlreadyBreached, DueUtc, PausedSinceUtc and CompletedUtc bring state from another system. Starting never calls observers. |
PauseAsync(subject, metric = null) / ResumeAsync | The record waits (on hold, waiting for the customer) and stops waiting |
CompleteAsync(subject, metric, atUtc = null) | The work was done; business time used goes to ElapsedSeconds. A cycle completed after its due time is announced as breached first |
ReopenAsync(subject, metric) | Reopened after being answered; the newest completed cycle counts on from the time it used |
CancelAsync(subject, metric = null) | No longer measured (spam, deleted) |
RetargetAsync(subject, policyId, priority) | Priority or policy changed; time already used counts against the new target |
GetTimersAsync(subject, activeOnly = false) | The record's timers, newest first |
A timer keeps the business seconds it used, so pauses and retargets never add wall-clock time to a deadline.
ServiceLevelMonitorBackgroundTask, every minute) runs ServiceLevelMonitor: it pages the running timers that are due, marks each warning and breach in its own concurrency-checked transaction (an owner's change always wins), then calls IServiceLevelObserver.WarningAsync and BreachedAsync. Completing a timer calls CompletedAsync. A failing observer is logged and the others still run.ServiceLevelScheduleObserver (an IBusinessHoursScheduleObserver) keeps the old hours and a resumable step counts each running timer up to the change on the old hours and the rest on the new ones, a batch at a time.ServiceLevelClock counts them around the clock, sets NoBusinessHours and calls IServiceLevelObserver.NoBusinessHoursAsync once (Tickets notes it on the ticket's history and shows No business hours by the target).With OrchardCore.DataPipelines.Core on, the Service levels data source (ServiceLevels) has the ServiceLevelTimers data set: one row per timer with its record, metric, policy, priority, state, target, start, warning and due times, end, met/warned/breached and the business minutes used. Policy managers see every timer; others see the timers of records an IServiceLevelTimerAccessProvider for that record kind lets them see (Tickets and Work Orders register one). Kinds without a provider are left to policy managers.
| Seam | Register with | Use it to |
|---|---|---|
IServiceLevelScopeProvider | services.AddServiceLevelScope<T>() | Name a scope with its metrics and priorities (Name, DisplayName, optional Description, GetMetricsAsync, GetPrioritiesAsync) |
IServiceLevelObserver | services.AddServiceLevelObserver<T>() | Act on WarningAsync, BreachedAsync, CompletedAsync, NoBusinessHoursAsync |
IServiceLevelPolicyUsageProvider | services.AddServiceLevelPolicyUsage<T>() | Return what still uses a policy, so it can't be deleted |
IServiceLevelTimerAccessProvider | services.AddServiceLevelTimerAccessProvider<T>() | Return which record ids of your kind a user may see in the data set |
DisplayDriver<ServiceLevelPolicy> | services.AddDisplayDriver<ServiceLevelPolicy, T>() | Add a card for your scope (return null for other scopes) and keep its values in Properties |
IServiceLevelPolicyManager | (injected) | ICatalogManager<ServiceLevelPolicy> plus ListByScopeAsync(scope) and FindByNameAsync(scope, name) |
A complete scope, observer, usage provider, timer access provider and tracker calls for a custom record kind are in references/service-levels-extensions.md.
| Module | Scope | Notes |
|---|---|---|
| Tickets | Tickets | Metrics First response, Next response, Resolution; priorities are the ticket priorities (keys are their ids). Policy from the agreement, account, category, type, then desk. See orchardcore-tickets. |
| Work Orders | WorkOrders | Metrics Response (FirstResponse) and Resolution; priorities Urgent, High, Normal, Low; a Work orders card with the statuses that pause timers; raises Work Order Service Level Warning and Breached events. Its migration copied old work-order policies to shared policies with the same ids. See orchardcore-work-orders. |
| Symptom | Check |
|---|---|
| Policy refused on save or import | Unknown Scope (feature that registers it is off), HoursScheduleId names no schedule or one never open, invalid ItemId, name over 255 characters. |
| Targets missing after import | Priority must be the scope's key or a priority's exact name; an unknown name is not rekeyed. |
| No warnings or breaches fire | The Service levels background task is disabled under Tools > Background Tasks, or no observer is registered for your scope. |
| Due time ignores nights and weekends | The policy has no HoursScheduleId, or the schedule is disabled (unknown schedules count around the clock). |
| Can't delete a policy | It has running or paused timers, or a usage provider reports it (a ticket desk, ticket type or work order type names it). |
| No business hours shown on a record | The schedule was changed to never open; the timer counts around the clock until it opens again. |
Related skills: orchardcore-business-hours, orchardcore-tickets, orchardcore-work-orders, orchardcore-report-builder, orchardcore-background-tasks.
What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-orchardcore:orchardcore-service-levelsfrom crestapps-orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-orchardcore137 skills in this plugin
/orchardcore-accountsSkill for the CrestApps Orchard Core Accounts module (CrestApps.OrchardCore.Accounts) with its Account Members, Account Team, Account E-mail Domains and Account Locations features. Covers the Account type and AccountPart, the account picker and search, IAccountChildTypeRule, account page sections (AccountPageTabs, AddPageSection, Notes), members and IAccountMemberService, account invitations, the account owner and team picked from staff, e-mail domains, locations with a billing location, the account's billing profile and party members, the Accounts recipe and deployment steps, and the admin menu. Use this skill when requests mention accounts, the businesses or households records belong to, an account page tab, members, invitations, owners, domains or locations. Strong matches include AccountPart, AccountPageTabs, IAccountMemberService, IAccountInvitationService, AccountInvitation, AccountTeamPart, AccountEmailDomainsPart, IAccountEmailDomains, AccountLocationsPart and ManageAccountMembers./orchardcore-accounts-b2bSkill for the CrestApps Orchard Core Accounts B2B module (CrestApps.OrchardCore.Accounts.B2B), business selling on an Account content item. Covers B2BAccountPart and B2BAccount, buyers as account members and ship-to addresses as account locations, terms (deposit, net days, credit limit) through the account-terms tender billed to the account, the account's billing profile, purchase order numbers, quotes, price lists through IBuyerPriceProvider, order limits, approvals and budgets, OCI punchout, the account/business page and API, the PriceLists recipe and deployment steps, the B2BAccounts report source, and the move from the removed Companies module. Use this skill when requests mention B2B, wholesale or business buyers, net terms, purchase orders, price lists, order approvals or punchout. Strong matches include B2BAccountPart, B2BAccount, AccountTerms, AccountTermsTenderProvider, B2BAccountBillingProfileSource, IB2BAccountStore, PriceList, B2BPriceProvider, B2BApprovalService and ManageB2BAccounts.Other plugins' skills for the same job