Guides setup and extension of the CrestApps OR-Tools add-on for Orchard Core, adding Google OR-Tools CP-SAT shift scheduling and vehicle routing dispatch solvers to Workforce and Dispatch modules.
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.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate accurate setup and extension guidance for the CrestApps OR-Tools add-on, which plugs Google OR-Tools (Apache 2.0) solvers into Workforce shift auto-scheduling and Dispatch day optimization.
CrestApps.OrchardCore.OrTools package to the web/startup project yourself. It is not in CrestApps.OrchardCore.Cms.Core.Targets, because Google.OrTools brings native libraries for each platform (Windows, Linux and macOS, x64 and Arm64).ShiftPlanningOptions.SolverTimeLimitSeconds, the dispatch setting OptimizerSeconds). Thread count (up to eight) and search strategy are fixed in code.orchardcore-workforce; visits and the board by orchardcore-dispatch.{ "steps": [...] }.sealed modifier, except View Models.With central package management (versions in Directory.Packages.props):
<ItemGroup>
<PackageReference Include="CrestApps.OrchardCore.Cms.Core.Targets" />
<PackageReference Include="CrestApps.OrchardCore.OrTools" />
</ItemGroup>
| Feature | ID | Depends on | Category |
|---|---|---|---|
| OR-Tools Shift Scheduling | CrestApps.OrchardCore.OrTools.ShiftScheduling | CrestApps.OrchardCore.Workforce.ShiftPlanning | Workforce |
| OR-Tools Dispatch | CrestApps.OrchardCore.OrTools.Dispatch | CrestApps.OrchardCore.Dispatch | Field Service |
{
"steps": [
{
"name": "Feature",
"enable": [
"CrestApps.OrchardCore.OrTools.ShiftScheduling",
"CrestApps.OrchardCore.OrTools.Dispatch"
],
"disable": []
}
]
}
| Feature | Registration | Effect |
|---|---|---|
| Shift Scheduling | services.AddSingleton<IShiftScheduleSolver, OrToolsShiftScheduleSolver>() and ShiftPlanningOptions.DefaultSolver = "OR-Tools" | Auto-schedule on a shift schedule uses OR-Tools unless the run names another solver. |
| Dispatch | services.AddSingleton<IDispatchOptimizer, OrToolsDispatchOptimizer>() | IDispatchOptimizationService uses the last registered optimizer, so Optimize the day, POST api/dispatch/v1/optimize and the dispatchOptimizeAndExplain AI tool use OR-Tools. |
Both solvers are named OR-Tools (OrToolsConstants.SolverName); the built-in shift solver is Default (WorkforceConstants.DefaultSolver). Results name the solver (always OR-Tools once the feature is on, even when the built-in answer was kept): the auto-schedule message ("The OR-Tools solver made this schedule in 1.3 seconds.") and the board's proposal ("Proposed by the OR-Tools solver."), from ShiftScheduleProposal.Solver and DispatchProposal.Solver.
OrToolsShiftScheduleSolver builds a CP-SAT model:
TimeLimit (from ShiftPlanningOptions.SolverTimeLimitSeconds, 30) less what the built-in solver took, with up to eight threads and the problem's Seed. TimedOut is set when the schedule wasn't proved optimal.OrToolsDispatchOptimizer builds a routing model from the DispatchProblem:
EligibleWorkerIds), fixed visits on their technician at their start, every other visit optional at its UnassignedPenalty (1000 by default).TimeLimit (the dispatch setting OptimizerSeconds, 5) less what the built-in optimizer took.Nothing is changed until the dispatcher applies the proposal; every applied move still goes through the locked IDispatchService.AssignAsync checks.
Each solve is counted on the CrestApps.OrchardCore.Solver meter as crestapps.solver.runs (SolverTelemetry, SolverRun), tagged with:
| Tag | Values |
|---|---|
solver | shift_schedule or dispatch |
size | le_10, le_100, le_1000, le_10000, le_100000 or gt_100000: the size class of the problem (workers x days x templates for shifts, visits for dispatch) |
status | optimal, feasible, timed_out, infeasible, cancelled, skipped (nothing to solve), or error |
result | solver when the OR-Tools answer was kept, builtin when the built-in answer stayed |
outcome | ok, error or cancelled, plus the tenant tag |
The routing search never proves optimality, so a dispatch answer it found is feasible unless the solver reports RoutingOptimal; the shift CP-SAT model reports optimal when proved. A high share of result=builtin or timed_out means the time limit is too short for the problem size. Export the meter with the Orchard Core OpenTelemetry setup (see orchardcore-opentelemetry).
DefaultShiftScheduleSolver (CrestApps.OrchardCore.Workforce.Core) and DefaultDispatchOptimizer (CrestApps.OrchardCore.Dispatch.Core) are public, so a custom solver can start from their answer the way the OR-Tools solvers do.
public sealed class CautiousShiftScheduleSolver : IShiftScheduleSolver
{
private readonly DefaultShiftScheduleSolver _builtIn = new();
public string Name => "Cautious";
public async Task<ShiftScheduleProposal> SolveAsync(ShiftScheduleProblem problem, CancellationToken cancellationToken = default)
{
var proposal = await _builtIn.SolveAsync(problem, cancellationToken);
// Improve proposal.Shifts here, keeping it only when it is better.
proposal.Solver = Name;
return proposal;
}
}
// Startup (in a feature that depends on CrestApps.OrchardCore.Workforce.ShiftPlanning):
// services.TryAddEnumerable(ServiceDescriptor.Singleton<IShiftScheduleSolver, CautiousShiftScheduleSolver>());
// services.Configure<ShiftPlanningOptions>(options => options.DefaultSolver = "Cautious");
public sealed class LoggedDispatchOptimizer : IDispatchOptimizer
{
private readonly DefaultDispatchOptimizer _builtIn = new();
public string Name => "Logged";
public async Task<DispatchPlan> SolveAsync(DispatchProblem problem, CancellationToken cancellationToken = default)
{
var plan = await _builtIn.SolveAsync(problem, cancellationToken);
plan.Solver = Name;
return plan;
}
}
// Startup (in a feature that depends on CrestApps.OrchardCore.Dispatch; the last optimizer registered wins):
// services.AddSingleton<IDispatchOptimizer, LoggedDispatchOptimizer>();
| Symptom | Check |
|---|---|
| The message still names the built-in solver | The feature isn't enabled, or another module set ShiftPlanningOptions.DefaultSolver later. When OR-Tools finds nothing better it keeps the built-in answer but still reports itself as the solver. |
DllNotFoundException or TypeInitializationException on a server | The platform's OR-Tools native library isn't deployed; publish for a supported runtime identifier or disable the feature. |
| Optimize the day takes the full time limit | Expected: guided local search uses the remaining OptimizerSeconds. Lower it in Settings > Dispatch. |
Runs always report result=builtin | OR-Tools found nothing cheaper in the time left; raise the time limit, or check status for infeasible (windows, skills or fixed visits that can't all fit). |
| Package not found after adding the CMS targets | The add-on isn't in the targets; reference CrestApps.OrchardCore.OrTools directly. |
Related skills: orchardcore-dispatch, orchardcore-workforce, orchardcore-scheduling.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-orchardcore:orchardcore-or-toolsfrom 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