Provides expert guidance on CrestApps.Core foundation packages including catalog interfaces, lifecycle handlers, store committers, and builder layering. Useful when building custom catalogs, stores, or infrastructure on CrestApps.Core.
Ships in crestapps-core. 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 a CrestApps.Core expert. Build on the framework contracts rather than on a specific store or provider.
| Layer | Package | Contents |
|---|---|---|
| Abstractions | CrestApps.Core.Abstractions | ExtensibleEntity, CatalogItem, SourceCatalogEntry, INameAwareModel, ISourceAwareModel, IDisplayTextAwareModel, catalog and manager interfaces, handler contexts, QueryContext, PageResult<T>, IStoreCommitter, IUserAccessor, UniqueId, the feature builder classes |
| Core | CrestApps.Core | AddCrestAppsCore(...), AddCoreServices(), AddCatalogManagers(), catalog managers, CatalogEntryHandlerBase<T>, multi-source catalogs, store-committer filters, ODataFilterValidator, UserAccessor, JSOptions, DataProtectionHelper |
| Infrastructure | CrestApps.Core.Infrastructure.Abstractions, CrestApps.Core.Infrastructure | indexing contracts (ISearchIndexManager, IIndexProfileHandler), DataSourceConstants, DocumentIndexConstants, RedactedSecret, DictionaryExtensions |
| Utilities | CrestApps.Core.Support | string, enum, date and JSON helpers |
AddCrestAppsCore(...) creates the root CrestAppsCoreBuilder and registers ExtensibleEntityJsonOptions plus the hosted service that applies them. AddIndexingServices(...) on the root creates CrestAppsIndexingBuilder. AddAISuite(...) creates CrestAppsAISuiteBuilder, which hosts the feature builders (CrestAppsChatInteractionsBuilder, CrestAppsDocumentProcessingBuilder, CrestAppsDocumentIngestionBuilder, CrestAppsAIMemoryBuilder, CrestAppsAIPersonasBuilder, CrestAppsAIToolInstancesBuilder, CrestAppsA2AClientBuilder, CrestAppsMcpClientBuilder, CrestAppsMcpServerBuilder). Every builder method maps to an IServiceCollection extension such as AddCoreAIServices(), so a host can still call the lower-level methods directly.
AddCoreServices() registers scoped IODataValidator (ODataFilterValidator), singleton IHttpContextAccessor and singleton IUserAccessor (UserAccessor). AddAISuite(...) calls it for you.
IReadCatalog<T>: FindByIdAsync, GetAllAsync, GetAsync(ids), PageAsync(page, pageSize, queryContext).ICatalog<T>: adds CreateAsync, UpdateAsync, DeleteAsync.INamedCatalog<T>: adds FindByNameAsync. ISourceCatalog<T>: adds GetAsync(source). INamedSourceCatalog<T>: adds GetAsync(name, source).CancellationToken.ICatalogManager<T>, INamedCatalogManager<T>, ISourceCatalogManager<T>, INamedSourceCatalogManager<T>) when handlers must run. AddCatalogManagers() registers the open-generic managers; both store packages call it.NewAsync runs Initializing then Initialized and assigns ItemId with UniqueId.GenerateId(); ValidateAsync runs Validating then Validated; CreateAsync, UpdateAsync and DeleteAsync run their before and after events around the catalog call; reads run Loaded.CreateAsync and UpdateAsync do not validate. Call ValidateAsync first and stop when Succeeded is false.HandlerExtensions.InvokeAsync, so throwing in a handler never blocks a save. Report problems through ValidatingContext<T>.Result.Fail(...).QueryContext has Name, Source and Sorted. PageResult<T> has Count and Entries.using System.ComponentModel.DataAnnotations;
using CrestApps.Core;
using CrestApps.Core.Handlers;
using CrestApps.Core.Models;
using CrestApps.Core.Services;
namespace MyApp.Catalogs;
public sealed class TicketCategory : CatalogItem, INameAwareModel
{
public string Name { get; set; }
public string Description { get; set; }
}
public sealed class TicketCategoryHandler : CatalogEntryHandlerBase<TicketCategory>
{
private readonly INamedCatalog<TicketCategory> _catalog;
public TicketCategoryHandler(INamedCatalog<TicketCategory> catalog)
{
_catalog = catalog;
}
public override async Task ValidatingAsync(
ValidatingContext<TicketCategory> context,
CancellationToken cancellationToken = default)
{
if (string.IsNullOrWhiteSpace(context.Model.Name))
{
context.Result.Fail(new ValidationResult("A name is required.", [nameof(TicketCategory.Name)]));
return;
}
var existing = await _catalog.FindByNameAsync(context.Model.Name, cancellationToken);
if (existing is not null && existing.ItemId != context.Model.ItemId)
{
context.Result.Fail(new ValidationResult("The name is already used.", [nameof(TicketCategory.Name)]));
}
}
}
public sealed class TicketCategoryService
{
private readonly INamedCatalogManager<TicketCategory> _manager;
public TicketCategoryService(INamedCatalogManager<TicketCategory> manager)
{
_manager = manager;
}
public async Task<ValidationResultDetails> CreateAsync(
string name,
string description,
CancellationToken cancellationToken = default)
{
var category = await _manager.NewAsync(name, cancellationToken: cancellationToken);
category.Description = description;
var result = await _manager.ValidateAsync(category, cancellationToken);
if (result.Succeeded)
{
await _manager.CreateAsync(category, cancellationToken);
}
return result;
}
}
Register the catalog with the store package the host uses, then the handler and service:
using CrestApps.Core;
using CrestApps.Core.Data.EntityCore.Services;
// Entity Framework Core (CrestApps.Core.Data.EntityCore)
builder.Services.AddNamedDocumentCatalog<TicketCategory, NamedDocumentCatalog<TicketCategory>>();
// or YesSql (CrestApps.Core.Data.YesSql); also register the index provider and create its table
// builder.Services.AddYesSqlNamedDocumentCatalog<TicketCategory, TicketCategoryIndex>("App");
builder.Services.AddScoped<ICatalogEntryHandler<TicketCategory>, TicketCategoryHandler>();
builder.Services.AddScoped<TicketCategoryService>();
AddDocumentCatalog, AddNamedDocumentCatalog, AddSourceDocumentCatalog and AddNamedSourceDocumentCatalog are defined in CrestApps.Core.Abstractions and take the model and the concrete catalog type. See crestapps-core-entitycore-stores and crestapps-core-yessql-stores for the backend-specific catalog types and indexes.
Connections and deployments merge configuration, database, and custom sources. MultiSourceNamedCatalog<T> and MultiSourceNamedSourceCatalog<T> order the registered INamedCatalogSource<T> or INamedSourceCatalogSource<T> instances by Order, keep the first entry for each name, and send writes to the first writable source (IWritableNamedCatalogSource<T>). Database sources use Order = 0, configuration sources Order = 100.
using CrestApps.Core.AI.Models;
using CrestApps.Core.Services;
namespace MyApp.Deployments;
public sealed class PlatformDeploymentSource : INamedSourceCatalogSource<AIDeployment>
{
private readonly IPlatformDeploymentClient _client;
public PlatformDeploymentSource(IPlatformDeploymentClient client)
{
_client = client;
}
public int Order => 50;
public async ValueTask<IReadOnlyCollection<AIDeployment>> GetEntriesAsync(
IReadOnlyCollection<AIDeployment> knownEntries,
CancellationToken cancellationToken = default)
{
var knownNames = knownEntries
.Select(entry => entry.Name)
.ToHashSet(StringComparer.OrdinalIgnoreCase);
var deployments = await _client.GetDeploymentsAsync(cancellationToken);
return deployments
.Where(deployment => !knownNames.Contains(deployment.Name))
.ToArray();
}
}
builder.Services.TryAddEnumerable(
ServiceDescriptor.Scoped<INamedSourceCatalogSource<AIDeployment>, PlatformDeploymentSource>());
WritableCatalogBindingSource<T> and WritableNamedCatalogBindingSource<T> wrap an existing catalog as an Order = 0 writable source; the store packages use them in AddEntityCoreNamedSourceBindingSource<T>() and AddYesSqlNamedSourceBindingSource<T, TIndex>().
The first-party stores stage writes and flush them through scoped IStoreCommitter.CommitAsync().
AddControllersWithViews().AddCrestAppsStoreCommitterFilter() commits after each action that did not throw..AddEndpointFilter<StoreCommitterEndpointFilter>() (namespace CrestApps.Core.Filters) commits after the handler.AddSignalR().AddCrestAppsStoreCommitterFilter(), or .AddSignalR(addStoreCommitterFilter: true) on the AI suite builder.CommitAsync() on that scope's IStoreCommitter.CookieAuthenticationAntiforgeryEndpointFilter (namespace CrestApps.Core.Filters) validates the antiforgery token (the RequestVerificationToken header or the form field) of a request whose credential the browser attaches by itself: a cookie, or the Authorization header of Negotiate, NTLM and Basic. A request needs no token only when every authenticated identity has an authentication type in AntiforgeryEndpointFilterOptions.NonCookieAuthenticationTypes (Bearer, Api, ApiKey, OpenIddict.Validation.AspNetCore by default; it is the identity's authentication type, not the scheme name), or when it is anonymous and carries none of the AmbientCookieNames. Keep DisableAntiforgery() on the endpoint so the middleware does not validate twice, and register AddAntiforgery().
using CrestApps.Core.Filters;
builder.Services.Configure<AntiforgeryEndpointFilterOptions>(options =>
{
options.NonCookieAuthenticationTypes.Add("MyApiKey"); // ClaimsIdentity.AuthenticationType your API handler sets
});
app.MapPost("/api/my-upload", HandleUploadAsync)
.DisableAntiforgery()
.AddEndpointFilter<CookieAuthenticationAntiforgeryEndpointFilter>();
The chat document upload and remove endpoints use it (see crestapps-core-chat-interactions).
IStoreCommitter from DI. NoOpStoreCommitter is internal and is never registered, so register a store package (or your own scoped committer) before adding a filter.Resolve the caller through IUserAccessor.User, not IHttpContextAccessor. SignalR hub methods run outside the request pipeline, so HttpContext is often null there. The default UserAccessor returns the principal a hub assigned for the current invocation and falls back to the HTTP request principal. A null User means a trusted server-side invocation (for example a background task), not an anonymous caller.
Validate user-supplied filters with IODataValidator.IsValidFilter(filter) before handing them to an IODataFilterTranslator. The validator checks syntax only; the search backend performs full validation. Replace it with services.AddScoped<IODataValidator, MyValidator>() for stricter rules such as a field allow-list.
UniqueId.GenerateId() and UniqueId.IsValid(id) create and check the 26-character item identifiers.JSOptions.Default, JSOptions.CaseInsensitive and JSOptions.Indented are shared read-only JsonSerializerOptions.JsonExtensions.FromObject(...) and the Clone() helpers copy property bags and JsonObject values.DataProtectionHelper.Unprotect(protector, value, logger, message) unprotects a secret and logs instead of throwing.RedactedSecret keeps secrets out of logs and UI output.DataSourceConstants.ColumnNames names the data-source knowledge index fields and DocumentIndexConstants.ColumnNames the uploaded-document chunk fields; they are different index schemas.net10.0 and net11.0. On net11.0 the Microsoft.Extensions.* abstractions they reference resolve to 11.0.0; on net10.0 they stay on 10.0.x.*Index and *IndexProvider). Namespaces and members did not change, so code that compiles against 1.x still compiles.CrestAppsDocumentIngestionBuilder and CrestAppsAIPersonasBuilder.What SKILL.md sets; muted values are Claude Code's defaults
/crestapps-core:crestapps-core-foundationsfrom crestapps-core
npx claudepluginhub crestapps/crestapps.agentskills --plugin crestapps-core51 skills in this plugin
/crestapps-core-a2aSkill for Agent-to-Agent (A2A) protocol support in CrestApps.Core on the A2A 1.0 SDK. Covers AddA2AClient and AddCoreAIA2AClient with Entity Framework Core or YesSql connection stores, A2AConnection and A2AConnectionMetadata authentication, AIProfileA2AMetadata, the agent card cache and A2AToolRegistryProvider, the listAvailableAgents, findAgentForTask and findToolsForTask tools, building an A2A host with IAgentHandler, A2AServer, ITaskStore and MapA2A, A2A 1.0 agent cards with supportedInterfaces published at /.well-known/agent-card.json, A2AHostOptions authentication and ExposeAgentsAsSkill, system agents exposed through the host, and upgrading from the 0.3 SDK./crestapps-core-ag-uiSkill for running the CrestApps.Core 2.0 AI chat as an AG-UI agent. Covers the CrestApps.Core.AI.AGUI package (AGUIRunEventWriter, AGUIRunRequest, AGUIJson), AIChatHubCore.RunAgent over SignalR and MapAGUIChat with Server-Sent Events, the RunAgentInput members and streamed events, tool approvals with RequireApproval or an approval tool kind, ApprovalRequiredAIFunction, interrupts and resume, approvals inside agents, page context with crestAppsAGUI.registerContextProvider, shared state with registerStateProvider and update_shared_state, frontend tools, stored tool calls (ChatTurnToolActivity), runs that continue on the next page, AGUIChatOptions.DisconnectedRunTimeout, the protocol and sendPageContext chat options, and the AICompletionContextKeys and ChatResponseHandlerContext members. Use it when showing tool calls in the chat, asking a person before a tool runs, sharing page state with the agent, connecting CopilotKit or another AG-UI client, or troubleshooting approvals and continued runs.Other plugins' skills for the same job