Production infrastructure for AI agents
Website · Documentation · Guides · Core · Template · Discord
systemprompt-templates
Template registry, loading, and rendering for systemprompt.io config-as-code AI governance deployments. Handlebars-powered template engine for the MCP governance pipeline with plugin architecture, priority resolution, and filesystem discovery.
Layer: Domain — business-logic modules that implement systemprompt.io features. Part of the systemprompt-core workspace.
Overview
Integrations · Extensible Architecture
This crate provides the core template system for discovering, loading, and rendering HTML templates using Handlebars. It supports a plugin architecture with providers, loaders, extenders, and component renderers.
Usage
[]
= "0.2.1"
use Arc;
use ;
async
File Structure
src/
├── lib.rs # Public exports and re-exports from template-provider
├── builder.rs # TemplateRegistryBuilder for fluent construction
├── core_provider.rs # CoreTemplateProvider for filesystem template discovery
├── error.rs # TemplateError enum for error handling
└── registry.rs # TemplateRegistry for managing templates and rendering
tests/
├── core_provider_tests.rs # Tests for CoreTemplateProvider
└── registry_tests.rs # Tests for TemplateRegistry
Modules
builder
Provides TemplateRegistryBuilder for fluent construction of TemplateRegistry instances. Supports chaining with_provider(), with_loader(), with_extender(), with_component(), and with_page_provider() methods.
core_provider
Implements CoreTemplateProvider which discovers HTML templates from a filesystem directory. Reads optional templates.yaml manifests for metadata and infers content types from template name suffixes (-post, -list).
error
Defines TemplateError with variants for common failure modes: NotFound, LoadError, CompileError, RenderError, NoLoader, and NotInitialized.
registry
Core TemplateRegistry struct that coordinates template providers, loaders, extenders, and component renderers. Uses Handlebars for template compilation and rendering. Resolves template conflicts by priority (lower values win).
Priority System
Templates are resolved by priority where lower values take precedence:
| Constant | Value | Use Case |
|---|---|---|
EXTENSION_PRIORITY |
500 | Override default templates |
DEFAULT_PRIORITY |
1000 | Standard templates |
License
BSL-1.1 (Business Source License). Source-available for evaluation, testing, and non-production use. Production use requires a commercial license. Each version converts to Apache 2.0 four years after publication. See LICENSE.
systemprompt.io · Documentation · Guides · Live Demo · Template · crates.io · docs.rs · Discord
Domain layer · Own how your organization uses AI.