crestapps/crestapps.agentskills/crestapps-core-copilot-orchestrator

Claude Code and agent skill by crestapps/crestapps.agentskills

Trust tier 3
  • community
Source check pending

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

Skill for the GitHub Copilot orchestrator in CrestApps.Core 2.0, a named IOrchestrator ("copilot") built on the GitHub Copilot SDK. Covers AddCopilotOrchestrator and AddCoreAICopilotOrchestrator registration, the automatic Copilot CLI acquisition with its shared cache and npm registry MSBuild properties, binding CopilotOptions yourself, the NotConfigured, GitHubOAuth and ApiKey (BYOK) authentication modes and what each requires, implementing ICopilotCredentialStore or using JsonFileCopilotCredentialStore, GitHubOAuthService authorization, callback state validation, token refresh and model listing, CopilotSessionMetadata model, permission and reasoning-effort overrides, how tools reach the SDK, and its limits around MCP tools, deployments and usage metering. Use it when running profiles on a Copilot subscription or an OpenAI-compatible BYOK endpoint through Copilot, or when Copilot reports it is not configured.

Install

npx vskill@latest install crestapps/crestapps.agentskills/crestapps-core-copilot-orchestrator

SKILL.md

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

CrestApps.Core Copilot Orchestrator

CrestApps.Core.AI.Copilot adds CopilotOrchestrator, an IOrchestrator named "copilot" (title Copilot), which runs a turn through the GitHub Copilot SDK and its CLI instead of the default pipeline.

Guidelines

  • Choose GitHub OAuth when each user brings a Copilot subscription. Choose ApiKey (BYOK) for one shared OpenAI-compatible, Azure or Anthropic endpoint.
  • Treat NotConfigured as intentionally disabled; editors should show a warning instead of Copilot fields while it is selected.
  • Bind CopilotOptions yourself; the package reads no configuration section.
  • GitHub OAuth needs an ICopilotCredentialStore. BYOK does not.
  • Copilot does not use AI connections, deployments, deployment capabilities or deployment model parameters, and its SDK-managed requests are not recorded by usage metering.

Registration

csharp
using CrestApps.Core.AI.Copilot;
using CrestApps.Core.AI.Copilot.Models;
builder.Services.AddCrestAppsCore(crestApps => crestApps
.AddAISuite(ai => ai
.AddCopilotOrchestrator()
)
);
builder.Services.Configure<CopilotOptions>(builder.Configuration.GetSection("Copilot"));

Raw form: builder.Services.AddCoreAICopilotOrchestrator(); after AddCoreAIServices() and AddCoreAIOrchestration(). It registers a named HttpClient with the standard resilience handler, the orchestrator, GitHubOAuthService, CopilotChatInteractionSettingsHandler, CopilotOrchestrationContextHandler and CopilotOptionsValidator.

Referencing the package downloads the Copilot CLI during build into runtimes/<rid>/native/. It caches the CLI machine-wide under the NuGet packages folder and resolves the npm registry from NPM_CONFIG_REGISTRY or npm config get registry. Override only when needed with the MSBuild properties CopilotUseSharedCliCache, CopilotCliCacheDir, CopilotResolveNpmRegistry and CopilotNpmRegistryUrl; the SDK's CopilotCliBinaryPath and CopilotSkipCliDownload still win.

Authentication Modes

CopilotAuthenticationTypeRequired for the orchestrator to run
NotConfiguredNever runs
GitHubOAuthClientId, ClientSecret (Scopes default user:email, read:org) and a signed-in user with a stored credential
ApiKeyProviderType, BaseUrl, DefaultModel; for azure also ApiKey and AzureApiVersion

CopilotOptionsValidator fails when ClientId or ClientSecret is missing in OAuth mode, or ApiKey is missing in BYOK mode. When the runtime check fails, a turn answers "Copilot is not configured and cannot be used until it has been configured."

json
{
"Copilot": {
"AuthenticationType": "ApiKey",
"ProviderType": "openai",
"BaseUrl": "https://api.openai.com/v1",
"ApiKey": "sk-...",
"DefaultModel": "gpt-4o",
"WireApi": "completions"
}
}
json
{
"Copilot": {
"AuthenticationType": "GitHubOAuth",
"ClientId": "Iv1.abc123",
"ClientSecret": "your-client-secret",
"Scopes": [ "user:email", "read:org" ]
}
}

Credential Store

csharp
public interface ICopilotCredentialStore
{
Task<CopilotProtectedCredential> GetProtectedCredentialAsync(string userId, CancellationToken cancellationToken = default);
Task SaveProtectedCredentialAsync(string userId, CopilotProtectedCredential credential, CancellationToken cancellationToken = default);
Task ClearCredentialAsync(string userId, CancellationToken cancellationToken = default);
}

CopilotProtectedCredential carries GitHubUsername, ProtectedAccessToken, ProtectedRefreshToken, ExpiresAt and UpdatedUtc; the tokens arrive already protected. Scope storage by user (and tenant). For development, the shipped JsonFileCopilotCredentialStore writes one file per user under App_Data/CopilotCredentials:

csharp
builder.Services.AddScoped<ICopilotCredentialStore, JsonFileCopilotCredentialStore>();

Use a database-backed store in production.

OAuth Flow

csharp
using System.Security.Claims;
using CrestApps.Core.AI.Copilot.Services;
using Microsoft.AspNetCore.Mvc;
[Route("copilot")]
public sealed class CopilotAuthController : Controller
{
private readonly GitHubOAuthService _oauthService;
public CopilotAuthController(GitHubOAuthService oauthService)
{
_oauthService = oauthService;
}
[HttpGet("connect")]
public IActionResult Connect(string returnUrl = "/")
{
var callbackUrl = Url.Action(nameof(Callback), null, null, Request.Scheme);
return Redirect(_oauthService.GetAuthorizationUrl(callbackUrl, returnUrl));
}
[HttpGet("callback")]
public async Task<IActionResult> Callback(string code, string state, CancellationToken cancellationToken)
{
if (!_oauthService.TryValidateCallbackState(state, out var returnUrl))
{
return BadRequest();
}
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
await _oauthService.ExchangeCodeForTokenAsync(code, userId, cancellationToken);
return LocalRedirect(returnUrl);
}
}

GetAuthorizationUrl writes a protected, ten-minute state cookie (named __Host-crestapps-gh-oauth-state over HTTPS, so a sibling subdomain cannot plant it) and sends a RandomNumberGenerator nonce as state. The state records the signed-in user, and TryValidateCallbackState succeeds only for that same user, deletes the cookie after it validates (one round trip cannot be replayed), and returns only a local return URL (or __popup__). Both need an HttpContext: GetAuthorizationUrl throws InvalidOperationException without one, and validation fails. Other members: GetCredentialAsync, GetProtectedCredentialsAsync, GetValidAccessTokenAsync (refreshes when expired), IsAuthenticatedAsync, ListModelsAsync and DisconnectAsync, all keyed by user id.

Session Metadata

CopilotSessionMetadata on a profile or chat interaction overrides CopilotModel, IsAllowAll (approve all SDK permission requests, default true), and ReasoningEffort (CopilotReasoningEffort.None, Low, Medium, High), and records GitHubUsername plus protected tokens in OAuth mode.

csharp
profile.OrchestratorName = "copilot";
profile.Put(new CopilotSessionMetadata { CopilotModel = "gpt-4o", ReasoningEffort = CopilotReasoningEffort.Low });

How a Turn Runs

  1. Tools come from IToolRegistry (system, profile, agent and tool instance tools); MCP tools are excluded from it.
  2. Each tool is wrapped so dependency injection works when the SDK invokes it.
  3. A session config is built with streaming, the model (CopilotModel or DefaultModel), the tools and the system message.
  4. BYOK sets the provider type, base URL, key, WireApi and Azure API version; OAuth uses GitHubOAuthService.GetValidAccessTokenAsync.
  5. MCP connections in the context are only described in the system message under [Available MCP Servers]. The current SDK SessionConfig has no MCP server support, and MCP tools are excluded from the tool list, so the model cannot call MCP tools through this orchestrator. Use the default orchestrator for profiles that depend on MCP tools.

Tool access follows the profile's configuration, the same boundary as the default orchestrator. The Copilot orchestrator creates tools straight from the registry entries rather than through IToolMaterializer, so a tool registered with RequireApproval() is not filtered out here the way the default and Claude orchestrators filter it; do not attach approval-required tools to a Copilot profile.

Troubleshooting

  • "Copilot is not configured...": the mode's required values are missing (see the table), usually because nothing bound CopilotOptions.
  • Build fails downloading the CLI behind a proxy: set CopilotNpmRegistryUrl or NPM_CONFIG_REGISTRY, or point CopilotCliCacheDir at a pre-seeded cache.
  • OAuth callback rejected: the state cookie expired, was already used, the callback ran on a different host than the connect request, or a different user (or a signed-out browser) completed the flow.

Upgrading Within 2.0 Previews

  • GitHubOAuthService binds the OAuth state to the user who started the flow, deletes the state cookie once it validates, and throws from GetAuthorizationUrl without an HttpContext.

Upgrading from 1.x

  • Match the current ICopilotCredentialStore signatures, which take a CancellationToken; stores written against older samples without it no longer compile.
  • Validate the OAuth state with TryValidateCallbackState; it is a nonce backed by a protected cookie, not the return URL that older samples redirected to.
  • The removed deployment purpose and the new deployment capabilities do not affect Copilot.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

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

Source

Popularity

7-day trend score
5

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-copilot-orchestrator/badge)](https://verified-skill.com/skills/crestapps/crestapps.agentskills/crestapps-core-copilot-orchestrator)

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