Template & Library Platform — Overview¶
Target Architecture — Final-State Design
This page describes the final-state target architecture of the Template & Library Platform. The microservices, APIs, workers, and aggregate roots named here are the planned decomposition of the ConnectSoft.Factory.Templates.* bounded contexts. The templates and libraries the platform governs are real, implemented assets of the ConnectSoft stack — those are marked with an Implemented callout where they appear.
The Template & Library Platform is the factory machinery of the ConnectSoft AI Software Factory: template-first, agent-enriched. It owns the catalog of code generators (templates) and the catalog of reusable building blocks (libraries) from which every generated SaaS product is assembled. When the Agent Mesh decides what to build, this platform supplies the how — the canonical, versioned, compatibility-checked templates and packages that turn a plan into a buildable, deployable solution.
This is not a chatbot or a code-snippet generator. It is the deterministic, governed supply chain of reusable engineering assets that makes the factory's output consistent, traceable, and reusable at multi-tenant scale.
Purpose¶
The platform exists to guarantee that every artifact the factory produces is built from a known, versioned, vetted source. It answers four questions for every generation request:
- Which template produces this kind of artifact, and at which version?
- Which parameters does that template require, and are the supplied values valid?
- Which libraries must the generated code depend on, and are those versions mutually compatible?
- What did we actually generate, and how is that output traced back to its template, parameters, and the agent task that requested it?
By centralizing these answers, the platform makes generation repeatable — the same template, version, and parameters always produce an equivalent solution — and auditable — every ScaffoldOutput carries the full provenance needed by governance and the Knowledge Platform.
Role in the factory¶
flowchart LR
AgentMesh["Agent Mesh"] -->|requests generation| TemplatePlatform["Template & Library Platform"]
Knowledge["Knowledge Platform"] -->|capability and context queries| TemplatePlatform
TemplatePlatform -->|scaffold output| DevOps["DevOps & GitOps"]
TemplatePlatform -->|publishes assets| Marketplace["Marketplace"]
DevOps -->|builds and deploys| GeneratedSaaS["Generated SaaS Product"]
TemplatePlatform -.->|events| Observability["Observability & Feedback"]
The platform sits between intent and delivery. The Agent Mesh and human authors in the Factory Studio drive it; the DevOps & GitOps platform consumes its output; the Marketplace exposes its catalog; and every action it takes emits events into the factory's shared event envelope so that the Knowledge and Observability platforms can correlate generation back to a single traceId.
Core responsibilities¶
- Template registry & versioning — maintain the authoritative catalog of
ConnectSoft.Template.*generators, their semantic versions, and their parameter schemas. See Template Registry. - Library registry & dependency intelligence — maintain the catalog of reusable
ConnectSoft.Extensions.*packages and other shared libraries, the capabilities they expose, and the dependency graph between them. See Library Registry. - Scaffolding & generation — execute templates with validated parameters and produce a fully traced
ScaffoldOutput. See Scaffold Engine. - Compatibility governance — evaluate template/library/runtime compatibility before generation and surface upgrade paths. See Compatibility Model.
- Validation & publishing — lint and verify templates and packages, then publish them to Azure Artifacts (NuGet) and the source registry. See Workers and APIs.
- Upgrade advisory — compute upgrade plans when a template or library version changes so downstream products can be re-scaffolded safely.
Key capabilities¶
| Capability | What it delivers | Primary services |
|---|---|---|
| Template catalog | Discoverable, versioned generators with typed parameter schemas | TemplateRegistryService, TemplateVersionService, TemplateParameterService |
| Library catalog | Reusable packages with declared capabilities and dependency graphs | LibraryRegistryService, LibraryVersionService, ApiClientCatalogService |
| Deterministic scaffolding | Reproducible generation with full provenance | ScaffoldEngineService |
| Compatibility evaluation | Pre-generation safety checks across templates, libraries, runtime | TemplateCompatibilityService, CompatibilityMatrixService, DependencyAnalyzerService |
| Validation | Static and structural verification of templates and packages | TemplateValidationService |
| Publishing | Promotion to Azure Artifacts and the source registry | TemplatePublishingService, PackagePublisherService |
| Upgrade intelligence | Safe migration plans across versions | TemplateUpgradeService, PackageUpgradeAdvisorService |
| Usage analytics | Adoption and reuse telemetry feeding governance | TemplateAnalyticsService |
Component diagram¶
flowchart TB
subgraph TemplateDomain["Template Domain"]
TRS["TemplateRegistryService"]
TVS["TemplateVersionService"]
TPS["TemplateParameterService"]
TCS["TemplateCompatibilityService"]
TVAL["TemplateValidationService"]
TPUB["TemplatePublishingService"]
TUS["TemplateUpgradeService"]
TAS["TemplateAnalyticsService"]
end
subgraph Engine["Generation"]
SES["ScaffoldEngineService"]
end
subgraph LibraryDomain["Library Domain"]
LRS["LibraryRegistryService"]
LVS["LibraryVersionService"]
DAS["DependencyAnalyzerService"]
CMS["CompatibilityMatrixService"]
PPS["PackagePublisherService"]
PUA["PackageUpgradeAdvisorService"]
ACC["ApiClientCatalogService"]
end
subgraph Stores["State"]
SQL["Azure SQL / PostgreSQL"]
Blob["Azure Blob"]
Artifacts["Azure Artifacts (NuGet)"]
Git["Git source registry"]
Redis["Redis cache"]
end
TRS --> SQL
TVS --> SQL
TVS --> Blob
SES --> Blob
SES --> Git
LRS --> SQL
PPS --> Artifacts
CMS --> SQL
TRS --> Redis
LRS --> Redis
TCS --> CMS
SES --> TPS
SES --> TCS
Real assets managed by the platform¶
Implemented
The templates and libraries below exist in the ConnectSoft codebase today as dotnet new templates with base-template folders and as NuGet packages published to Azure Artifacts. They target .NET 10. The Template & Library Platform is the final-state control plane that registers, versions, and governs them.
Templates (ConnectSoft.Template.* and related) include the service generators — MicroserviceTemplate, BaseTemplate, WorkerTemplate, ApiGatewayTemplate, AuthorizationServerTemplate, IdentityTemplate, HealthChecksAggregatorTemplate — the reusable-asset generators — LibraryTemplate, ApiLibraryTemplate, PlatformTemplate, DocumentationTemplate, MarketingSiteTemplate, AISkillsLibraryTemplate — the client/agent generators — MauiBaseTemplate, AI.SoftwareFactory.AgentTemplate — the Blazor MFE family — Blazor.ShellTemplate, Blazor.ComponentLibraryTemplate, Blazor.MicrofrontendLibraryTemplate, and the Blazor.Mfe.* micro-frontends (AIChat, Identity.Admin, Identity.SelfService, AuthorizationServer.Admin, Logistics) — and the multi-tenant SaaS family — Saas.TenantsTemplate, Saas.EntitlementsTemplate, Saas.BillingTemplate, Saas.MeteringTemplate, Saas.ProductsCatalogTemplate.
Libraries include the persistence flavors ConnectSoft.Extensions.PersistenceModel.* (NHibernate, EntityFramework, Dapper, MongoDb, Redis, ElasticSearch, PostgreSQL), the messaging stacks ConnectSoft.Extensions.MessagingModel.* (MassTransit, NServiceBus), the SaaS foundations ConnectSoft.Extensions.Saas.* (Abstractions, AspNetCore, Billing, Metering, Options, Orleans, NHibernate), the cross-cutting libraries Observability, Telemetry, Logging.Serilog, DomainModel, Validation.FluentValidation, ObjectMapping.*, Http.OAuth2, WebSecurity, the AI stack ConnectSoft.Extensions.AI.* and ConnectSoft.Extensions.ModelContextProtocol, plus integration API clients (Deputy, Braze, Bill) and Sms.Providers.*.
See the implementation references: Templates Overview, Template Architecture, Template Catalog (platform-architecture), Template Catalog, and Library Catalog.
Integration with other platforms¶
Agent Mesh¶
The Agent Mesh is the primary consumer. Builder and architect agents query the template and library registries to choose generators, then call the Scaffold Engine through the platform's APIs. Generation is agent-enriched: agents supply context-derived parameter values (from the Knowledge Platform) and may request multiple templates as part of one solution plan. Each TemplateExecution is correlated to the originating agent task- id via the event envelope's correlationId.
Knowledge Platform¶
The Knowledge Platform both feeds and consumes this platform. It supplies the context packages and capability lookups that inform template selection and parameter filling, and it ingests every TemplatePublished, LibraryPublished, and ScaffoldGenerated event to keep the knowledge graph's view of "what can be built" and "what was built" current. Library capabilities (LibraryCapability) are indexed so agents can search by capability rather than package name.
Marketplace¶
The Marketplace is the discovery and distribution surface. Published templates and libraries surface as marketplace assets with their versions, parameter schemas, and compatibility metadata, allowing internal teams and (in the final state) external partners to discover and reuse them. Adoption telemetry from TemplateAnalyticsService informs marketplace ranking.
DevOps & GitOps¶
The DevOps & GitOps platform is the primary downstream. A ScaffoldOutput is committed to a Git repository and handed to the GitOps pipelines, which build, test, and deploy it. Template-published pipeline definitions (from ApiGatewayTemplate, MicroserviceTemplate, and friends) carry the Pulumi infrastructure-as-code and Azure Pipelines YAML that DevOps executes.
Generated SaaS Product¶
The Generated SaaS Product platform is the result. Every microservice, worker, gateway, identity server, Blazor shell, and MFE in a generated product traces to a template version and a set of library versions recorded here. When a template or library is upgraded, TemplateUpgradeService and PackageUpgradeAdvisorService compute the plan to re-scaffold or patch affected products.
Final-state summary¶
The Template & Library Platform turns ConnectSoft's hard-won engineering assets into a governed, versioned, machine-consumable supply chain. It is decomposed into 16 ConnectSoft.Factory.Templates.* microservices, 15 aggregate roots, 10 public APIs, and 7 background workers, all communicating through the canonical event envelope. It delivers the factory's promises directly:
- Traceability — every generation produces a
ScaffoldOutputlinked to template version, parameters, libraries, and the originating agent task. - Reusability — templates and libraries are the unit of reuse; the catalog and capability index make them discoverable.
- Autonomy — agents can select, parameterize, validate, and execute templates without human intervention, within guardrails.
- Governance — validation, compatibility evaluation, and publishing approvals gate what enters the catalog.
- Observability — every lifecycle action emits a canonical event consumed by the Observability & Feedback platform.
- Multi-tenant scale — catalog metadata, executions, and analytics are tenant-scoped, and packages are distributed through Azure Artifacts for parallel, isolated consumption.
Continue to Template Registry, Library Registry, Scaffold Engine, and Compatibility Model.