crestapps/crestapps.agentskills/crestapps-core-orchestration

Claude Code and agent skill by crestapps/crestapps.agentskills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Skill for the default CrestApps.Core 2.0 orchestration pipeline. Covers AddCoreAIOrchestration and AddAISuite registration, IOrchestrator ExecuteStreamingAsync, IOrchestratorResolver and OrchestratorOptions DefaultOrchestratorName, building an OrchestrationContext with IOrchestrationContextBuilder, the tool registry and its providers (system, profile, agent and tool instance tools), progressive tool scoping with DefaultOrchestratorOptions ScopingThreshold and PlanningThreshold, the utility-depl…

Install

npx vskill@latest install crestapps/crestapps.agentskills/crestapps-core-orchestration

SKILL.md

The same SKILL.md was published earlier as crestapps/crestapps.agentskills/crestapps-core-orchestration.

CrestApps.Core Orchestration

The orchestrator is the agentic loop: it builds context from the profile, scopes tools, runs preemptive retrieval, calls the model with function invocation, and streams the answer. DefaultOrchestrator (name "default") is registered by AddCoreAIOrchestration(); Claude ("anthropic") and Copilot ("copilot") are alternatives.

Guidelines

  • Register orchestration through AddAISuite(...) or AddCoreAIOrchestration().
  • Build the context with IOrchestrationContextBuilder.BuildAsync(resource, configure, cancellationToken) instead of filling OrchestrationContext by hand; the handlers add the system message, tools, documents, RAG and security preamble.
  • Resolve orchestrators with IOrchestratorResolver.Resolve(name). An empty or unknown name falls back to OrchestratorOptions.DefaultOrchestratorName.
  • Let the orchestrator scope large tool sets; do not hand-pick tools per request.
  • The chat deployment is resolved through the chat slot and planning runs on the utility deployment (falling back to chat). See crestapps-core-ai-runtime.

Registration

csharp
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddOpenAI()
)
);

Raw form:

csharp
builder.Services
.AddCoreAIServices()
.AddCoreAIOrchestration()
.AddCoreAIOpenAI();

Run an Orchestrated Turn

csharp
using CrestApps.Core.AI.Models;
using CrestApps.Core.AI.Orchestration;
using Microsoft.Extensions.AI;
public sealed class ProfileChatService
{
private readonly IOrchestrationContextBuilder _contextBuilder;
private readonly IOrchestratorResolver _orchestratorResolver;
public ProfileChatService(
IOrchestrationContextBuilder contextBuilder,
IOrchestratorResolver orchestratorResolver)
{
_contextBuilder = contextBuilder;
_orchestratorResolver = orchestratorResolver;
}
public async IAsyncEnumerable<string> StreamAsync(
AIProfile profile,
string userMessage,
IList<ChatMessage> history,
[System.Runtime.CompilerServices.EnumeratorCancellation] CancellationToken cancellationToken = default)
{
var context = await _contextBuilder.BuildAsync(
profile,
ctx =>
{
ctx.UserMessage = userMessage;
ctx.ConversationHistory = history;
},
cancellationToken);
var orchestrator = _orchestratorResolver.Resolve(profile.OrchestratorName);
await foreach (var update in orchestrator.ExecuteStreamingAsync(context, cancellationToken))
{
if (!string.IsNullOrEmpty(update.Text))
{
yield return update.Text;
}
}
}
}

There is no separate non-streaming API; collect the updates when you need the full text. The built-in chat hubs go through IChatResponseHandler (see crestapps-core-response-handlers), which also sets AIInvocationScope for tools and agents; code that calls the orchestrator directly should wrap the call in using var scope = AIInvocationScope.Begin(); when it uses tool-capable agents or citation tools.

Key Services

ServicePurpose
IOrchestratorName and ExecuteStreamingAsync(OrchestrationContext, CancellationToken) returning IAsyncEnumerable<ChatResponseUpdate>
IOrchestratorResolverResolve(orchestratorName) with fallback to the default
IOrchestrationContextBuilderRuns IOrchestrationContextBuilderHandlers
IToolRegistryGetAllAsync(AICompletionContext, CancellationToken) merges every IToolRegistryProvider
IAIToolsServiceResolve a registered keyed AITool by name
IChatResponseHandlerResolverPick the response handler for a session or interaction

Tool registry providers: SystemToolRegistryProvider, ProfileToolRegistryProvider, AgentToolRegistryProvider, SharedStateToolRegistryProvider (update_shared_state when an AG-UI run shares state), ClientToolRegistryProvider (an AG-UI client's frontend tools), and ToolInstanceRegistryProvider when tool instances are enabled. Built-in orchestration handlers: CompletionContextOrchestrationHandler, PreemptiveRagOrchestrationHandler, RealtimeRagGuidanceHandler, AIToolExecutionContextOrchestrationHandler, SecurityPromptOrchestrationHandler, ClientContextOrchestrationHandler (AG-UI page context and shared state in the system message, as data), plus data source, memory and document handlers from their features.

IToolMaterializer (DefaultToolMaterializer) turns registry entries into AITool instances with ToolMaterializationOptions: EnforceListableAccess and User for the Chat Interaction access check, and SupportsToolApproval, set from AICompletionContextKeys.ToolApprovalSupported. With it, entries whose RequiresApproval is set are wrapped in ApprovalRequiredAIFunction; without it they are left out, so agents (AgentProxyTool builds a new context without the key), realtime sessions, the Claude orchestrator and background work never run them unasked. See crestapps-core-ag-ui.

Built-in system tools: GenerateImageTool and GenerateChartTool (purpose content_generation) and CurrentDateTimeTool (selectable, category Utilities).

Progressive Tool Scoping

Tool countBehavior
At or below ScopingThreshold (30)All tools are passed through
Above that, at or below PlanningThreshold (100), no MCP toolsToken relevance scoring against the latest user and assistant messages; top InitialToolCount (20) plus must-include tools
Above PlanningThreshold, or any MCP toolsA planning call on the utility deployment, then relevance scoring

If planning fails, the orchestrator logs a warning and still scopes by the user message and recent conversation. Planning resolves the utility deployment with ResolveUtilityOrDefaultAsync, applies UseDefaultResilience() and the utility model parameters (UseModelParameters(..., AIDeploymentParameterScope.Utility)), and is labeled AIUsagePurposes.Planning in usage records.

csharp
builder.Services.Configure<DefaultOrchestratorOptions>(options =>
{
options.InitialToolCount = 20;
options.ScopingThreshold = 30;
options.PlanningThreshold = 100;
options.MaxExpansionRounds = 3;
options.MaxToolCount = 30;
options.PlanningHistoryMessageCount = 10;
});
builder.Services.Configure<DefaultOrchestratorSettings>(settings =>
{
settings.EnablePreemptiveRag = true;
});

The tool-calling loop iteration cap comes from DefaultAIOptions.MaximumIterationsPerRequest (default 30, absolute cap AbsoluteMaximumIterationsPerRequest 100), which a site can override through GeneralAIOptions (OverrideMaximumIterationsPerRequest, MaximumIterationsPerRequest, also default 30).

DefaultAIOptions.TopP, FrequencyPenalty and PresencePenalty default to null, like Temperature and MaxOutputTokens; a null value is not sent, so the model uses its own default. A profile's past-messages count keeps that many of the most recent messages; blank, 0 or negative keeps them all. With session memory on, the messages that fall out are summarized instead of dropped (see crestapps-core-ai-memory).

Site-wide DefaultOrchestratorSettings.EnablePreemptiveRag = false hands data-source and document retrieval to the search tools, but preemptive memory retrieval follows its own GeneralAIOptions.EnablePreemptiveMemoryRetrieval switch. An IPreemptiveRagHandler with its own switch returns true from RunsWhenPreemptiveRagIsDisabled. Data-source search instructions are no longer added to a prompt with no data source or document to search.

Custom Orchestrator

csharp
using System.Runtime.CompilerServices;
using CrestApps.Core.AI.Completions;
using CrestApps.Core.AI.Deployments;
using CrestApps.Core.AI.Models;
using CrestApps.Core.AI.Orchestration;
using Microsoft.Extensions.AI;
public sealed class SingleShotOrchestrator : IOrchestrator
{
public const string OrchestratorName = "single-shot";
private readonly IAICompletionService _completionService;
private readonly IAIDeploymentManager _deploymentManager;
public SingleShotOrchestrator(
IAICompletionService completionService,
IAIDeploymentManager deploymentManager)
{
_completionService = completionService;
_deploymentManager = deploymentManager;
}
public string Name => OrchestratorName;
public async IAsyncEnumerable<ChatResponseUpdate> ExecuteStreamingAsync(
OrchestrationContext context,
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
ArgumentNullException.ThrowIfNull(context);
var deployment = await _deploymentManager.ResolveSlotAsync(
AIDeploymentSlotNames.Chat,
deploymentName: context.CompletionContext?.ChatDeploymentName,
cancellationToken: cancellationToken)
?? throw new InvalidOperationException("Unable to resolve a chat deployment.");
var messages = new List<ChatMessage>(context.ConversationHistory)
{
new(ChatRole.User, context.UserMessage),
};
await foreach (var update in _completionService.CompleteStreamingAsync(
deployment, messages, context.CompletionContext, cancellationToken))
{
yield return update;
}
}
}
csharp
builder.Services.AddOrchestrator<SingleShotOrchestrator>(SingleShotOrchestrator.OrchestratorName)
.WithTitle("Single shot");

The completion context already carries the system message the handlers built, so a custom orchestrator does not add it again. Set AIProfile.OrchestratorName to route a profile to it.

Errors

SituationBehavior
Planning failureLogged; falls back to relevance scoring
No chat deployment resolvesInvalidOperationException
OperationCanceledExceptionAlways rethrown
Provider error after retriesPropagates to the caller
Tool errorReturned to the model as the tool result
Approval-required tool, caller cannot askLeft out of the request; crestapps.core.ai.tool.denied with reason=approval

Upgrading Within 2.0 Previews

  • TopP, FrequencyPenalty and PresencePenalty no longer default to 1, 0 and 0. Reasoning models (gpt-5.x and later) rejected a saved TopP = 1 with HTTP 400. A host that set "TopP": null in configuration to work around it can remove that.
  • MaximumIterationsPerRequest defaults to 30 (was 10) in DefaultAIOptions, GeneralAIOptions and GeneralAISettings.
  • A past-messages count of 1 now keeps one message; it used to send the whole conversation, like a blank count.
  • Turning off site-wide preemptive RAG no longer turns off preemptive memory retrieval.
  • A tool marked RequireApproval() is no longer passed unwrapped to requests that cannot ask for approval; it is left out of them.
  • A tool can end the turn after its round of tool calls: when the completion context carries AICompletionContextKeys.ContinuesOnNextPage, it sets AICompletionContextKeys.EndTurnAfterToolCalls in AIInvocationScope.Current.Items and terminates the function invocation loop, as WebMcpPageToolFunction does for page_navigate. A run that resumes after a tool approval (the history ends with ToolApprovalResponseContent) goes to the model as it is.

Upgrading from 1.x

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
13
Repository forks
4
7-day trend score
5

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/crestapps/crestapps.agentskills/crestapps-core-orchestration/badge)](https://verified-skill.com/skills/crestapps/crestapps.agentskills/crestapps-core-orchestration)

Something wrong with this skill or its page? Tell us.