Provides guidance on registering, rendering, composing, and storing Liquid templates using CrestApps.Core.Templates. Covers ITemplateService, ITemplateEngine, FluidTemplateEngine, template discovery, and custom providers.
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. Generate code for CrestApps.Core.Templates discovery, Liquid rendering and composition.
CrestApps.Core.Templates is standalone. services.AddTemplating(...) registers ITemplateEngine (FluidTemplateEngine, singleton), ITemplateService (DefaultTemplateService, scoped), the Markdown ITemplateParser, and the code, file-system and prompt file-system providers. It also adds the include_prompt Liquid filter.CrestApps.Core.AI already calls AddTemplating() through AddCoreAITemplating(), which adds AI template sources and the system-prompt profile template provider. Use crestapps-core-ai-templates for that layer.ITemplateService.RenderAsync(id, arguments) renders a registered template; ITemplateEngine.RenderAsync(text, arguments) renders an in-memory Liquid string.FluidTemplateEngine runs on Fluid 3 and takes IOptions<Fluid.TemplateOptionsBuilder>. Templates can read every public member of the objects passed to them, so no type registration is needed; pass only data a template may read, especially when users write templates.builder.Services.Configure<Fluid.TemplateOptionsBuilder>(options => options
.ConfigureFilters(filters => filters.AddFilter("shout", (input, arguments, context) =>
Fluid.Values.StringValue.Create(input.ToStringValue(context).ToUpperInvariant()))));
Use ConfigureMemberAccess(strategy => ...) only for custom member accessors.
TryValidate before saving them.Id, the first one read wins.ITemplateService, ITemplateEngine and ITemplateProvider members take an optional CancellationToken; pass it through custom providers.using CrestApps.Core.Templates.Extensions;
builder.Services
.AddTemplating(options => options
.AddDiscoveryPath(builder.Environment.ContentRootPath)
.AddTemplate(
"welcome",
"Hello {{ customer }}!",
metadata => metadata.Title = "Welcome"))
.AddTemplatesFromAssembly(typeof(Program).Assembly, source: "MyApp");
| Source | Template id | Kind |
|---|---|---|
AddTemplate(id, content, ...) | the given id | set Template.Kind yourself |
{discovery path}/Templates/*.md (not recursive) | file name without extension | from Kind front matter |
{discovery path}/Templates/Prompts/*.md and one level of subfolders | file name; a subfolder name becomes FeatureId | SystemPrompt unless front matter sets it |
Embedded resources under Templates/ via AddTemplatesFromAssembly(...) | path after Templates.; a Prompts. prefix is dropped | SystemPrompt for Prompts/, otherwise front matter |
Mark the Markdown files as EmbeddedResource in the .csproj for AddTemplatesFromAssembly(...).
---
Title: Order Follow-up
Description: Asks a customer to confirm a delivery window.
Category: Support
IsListable: true
Kind: SystemPrompt
Parameters:
- customer_name: The customer's display name
- order_number: The order being discussed
---
You are writing to {{ customer_name | default: "the customer" }} about order {{ order_number }}.
{% if delivery_window %}
Offer the delivery window {{ delivery_window }}.
{% endif %}
Title, Description, Category, IsListable (default true) and Parameters map to TemplateMetadata; Kind maps to Template.Kind; any other key lands in TemplateMetadata.AdditionalProperties. A missing Title is derived from the id.
using CrestApps.Core.Templates;
using CrestApps.Core.Templates.Services;
namespace MyApp.Messaging;
public sealed class FollowUpMessageService
{
private readonly ITemplateService _templates;
public FollowUpMessageService(ITemplateService templates)
{
_templates = templates;
}
public Task<string> RenderAsync(string customer, string order, CancellationToken cancellationToken = default)
{
return new TemplateBuilder()
.WithSeparator("\n\n")
.Append("Keep the reply under 120 words.")
.AppendTemplate("order-follow-up", new Dictionary<string, object>
{
["customer_name"] = customer,
["order_number"] = order,
})
.BuildAsync(_templates, cancellationToken);
}
}
MergeAsync(ids, arguments, separator) renders several templates with the same arguments and skips any that render to null.GetByKindAsync(kind) (in TemplateServiceExtensions) lists templates of one kind, for example SystemPrompt.RenderAsync throws KeyNotFoundException for an unknown id.{{ "safety-rules" | include_prompt }} renders another template without arguments, and {% render_ai_template "safety-rules" %} renders it in a child scope that sees the caller's variables. Both guard against recursion: include_prompt returns nothing for a template that is already rendering, and render_ai_template stops at a depth of ten.A provider whose templates change at runtime implements IDynamicTemplateProvider (a marker over ITemplateProvider). DefaultTemplateService reads static providers first, so a stored template never replaces a shipped template with the same id. Use Aliases to keep old identifiers resolvable; GetAsync matches an id first and an alias second.
using CrestApps.Core.Services;
using CrestApps.Core.Templates.Models;
using CrestApps.Core.Templates.Parsing;
using CrestApps.Core.Templates.Providers;
namespace MyApp.Templates;
public sealed class StoredTemplateProvider : IDynamicTemplateProvider
{
private readonly ICatalog<StoredTemplate> _catalog;
private readonly ITemplateParser _parser;
public StoredTemplateProvider(ICatalog<StoredTemplate> catalog, IEnumerable<ITemplateParser> parsers)
{
_catalog = catalog;
_parser = parsers.First(parser => parser.SupportedExtensions.Contains(".md"));
}
public async Task<IReadOnlyList<Template>> GetTemplatesAsync(CancellationToken cancellationToken = default)
{
var records = await _catalog.GetAllAsync(cancellationToken);
return records
.Select(record =>
{
var parsed = _parser.Parse(record.Markdown);
return new Template
{
Id = record.Name,
Aliases = [$"stored:{record.ItemId}"],
Metadata = parsed.Metadata,
Content = parsed.Body,
Source = "Database",
};
})
.ToArray();
}
}
builder.Services.AddScoped<ITemplateProvider, StoredTemplateProvider>();
StoredTemplate is any CatalogItem with Name and Markdown properties registered through a store package. Register dynamic providers as scoped, since ITemplateService is scoped and reads them in every scope. A custom template service that caches for longer than a scope should override GetStaticTemplatesAsync and cache only what it returns.
Fluid.TemplateOptions is immutable with no public constructor, so services.Configure<Fluid.TemplateOptions>(...) no longer has any effect. Configure filters and accessors on Fluid.TemplateOptionsBuilder with ConfigureFilters and ConfigureMemberAccess.MemberAccessStrategy.Register<MyType>() calls: the one-argument overload is gone and registration is no longer needed.FluidValue.ToStringValue(context) and StringValue.Create(...).IDynamicTemplateProvider, Template.Aliases, and DefaultTemplateService.GetStaticTemplatesAsync. Implement IDynamicTemplateProvider on providers backed by editable storage so edits apply on the next request.CrestApps.Core.AI and is registered by AddCoreAITemplating(); template ids are now the template name, with the old ai-profile: ids kept as aliases.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/crestapps-core:crestapps-core-templatesfrom 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./crestapps-core-ai-agentsSkill for AI agents in CrestApps.Core 2.0, specialized AIProfile records of type Agent that the primary model invokes as tools. Covers creating agent profiles with AgentMetadata availability (OnDemand or AlwaysAvailable), linking them with AgentInvocationMetadata, how AgentProxyTool runs an agent with tools disabled or through the orchestrator when AllowToolInvocation is set, the AgentInvocationDepth recursion guard, never offering an agent to itself (RunningAgentName), tools of an agent that require an approval and pause the agent, deployment inheritance and the chat slot, code-defined and system agents through IAIProfileProvider including the Tabular Data, PDF, Presentation and Word agents, chat-specific agents that read AIInvocationScope, exposing agents to MCP clients with McpServerOptions Agents and ExposeAllAgents, and SubAgent usage labels. Use it when delegating work to sub-agents, adding a framework-managed agent, publishing an agent over MCP, or troubleshooting an agent the model does not call./crestapps-core-ai-markdownSkill for Markdig-backed Markdown normalization in CrestApps.Core 2.0 AI document, data source and RAG flows. Covers the CrestApps.Core.AI.Markdown package, AddMarkdown on the AI suite builder and AddCoreAIMarkdown on IServiceCollection, MarkdownAITextNormalizer replacing the default IAITextNormalizer, RagTextNormalizer content, chunk and title normalization with HTML stripping and Microsoft.Extensions.DataIngestion.Markdig parsing, the gpt-4o tokenizer chunker with 500 tokens per chunk and 50 tokens of overlap, the plain-text fallback for unsupported inline types, where the normalizer is used (data source indexing, preemptive retrieval, reference titles), and pairing it with document processing. Use it when indexing Markdown-heavy content for retrieval, replacing the text normalizer, or troubleshooting chunk sizes and leftover markup in retrieved text./crestapps-core-ai-memorySkill for AI memory in CrestApps.Core. Covers AddAIMemory, AddCoreAIMemory and AddCoreAIMemoryIndexing, Entity Framework Core and YesSql memory stores, the AIMemory index profile on the Elasticsearch, Azure AI Search and PostgreSQL backends, AIMemoryOptions, the store fallback when no index is usable, background memory indexing, the three kinds of memory (session memory with AIConversationMemory summaries and search_conversation, past conversations with search_past_conversations and list_recent_conversations, durable user memory) switched by MemoryMetadata and ChatInteractionMemoryOptions, preemptive memory retrieval and RunsWhenPreemptiveRagIsDisabled, owner-only chat sessions, the user memory tools, IAIMemorySafetyService validation, and custom IMemoryVectorSearchService implementations./crestapps-core-ai-model-capabilitiesSkill for metadata-driven deployment capabilities in CrestApps.Core 2.0. Covers trained model features such as textGeneration, toolCalling, streaming, reasoning, realtime, textEmbedding, speechToText and textToSpeech, model parameters such as reasoningEffort, declaring them with AIDeploymentMetadata or the Features and Parameters configuration shorthand for Azure App Service settings, registering custom features, parameters and slots with AddAIDeploymentFeature, AddAIDeploymentParameter, AddAIDeploymentSlot and AIDeploymentCapabilityOptions, IAIDeploymentCapabilityService, deployment slots and their resolution chain, AIDeploymentParametersMetadata chat and utility values, IAIDeploymentParameterBinder, UseModelParameters, capability enforcement, the ChatApi Responses routing for reasoning with tools, capability-aware chat UIs, and migrating from AIDeploymentPurpose. Use it when declaring what a model supports, adding a new knob, or fixing stripped tools, missing pickers, or reasoning-effort errors.Other plugins' skills for the same job