Templates Overview¶
This document provides an overview of the ConnectSoft templates available for generating code, infrastructure, and documentation using the AI Software Factory. Templates are the foundation for generating consistent, high-quality, production-ready solutions that follow ConnectSoft's architectural principles and best practices.
Documentation split: Under Templates & Libraries → Backend Templates, each core template has (AI agents) pages—checklists, blueprint hints, and “do / do not” rules for automation. ConnectSoft.Documentation remains the full technical specification for humans and deep dives; link from agent pages when in doubt.
What Are Templates?¶
Templates are pre-configured, reusable solution structures that the AI Software Factory uses to generate code, infrastructure, and documentation. Each template embodies:
- Architectural Patterns - Clean Architecture, DDD, Event-Driven, Cloud-Native
- Best Practices - Security-first, observability-driven, modular design
- Technology Stack - .NET Core, Azure, modern frameworks and tools
- Cross-Cutting Concerns - Logging, metrics, tracing, health checks, resilience
Template Categories¶
Backend Templates¶
Base Template
- Foundation template for all specialized microservice templates
- Domain-agnostic microservice structure
- Clean Architecture layout
- Base bootstrapping and infrastructure
- See: Base Template overview, topic hub
Specialized microservice templates (Microservice, Identity, Authorization Server, API Gateway, Bot Framework, Health Checks Aggregator, Worker, and similar) include ConnectSoft.BaseTemplate as the base-template/ Git submodule and target .NET 10. Web-hosted templates compose DI in three layers (ApplicationModelRegistrationBase → MicroserviceRegistrationBase → template-specific); the Worker Template uses a simpler worker host without that web-oriented stack. Details: Template Architecture.
Microservice Template
- Full-featured microservice with Clean Architecture
- Domain-Driven Design patterns
- Event-driven capabilities
- Multi-tenant support
- See: Microservice Template — hub, agent handbook
Worker Template
- Background jobs, message consumers, scheduled work — not the primary HTTP API surface
- Extends Base with worker host patterns (HangFire / messaging / optional Orleans per scaffold)
- See: Worker — hub, agent handbook
Identity Backend Template
- Identity and user management microservice
- User authentication and authorization
- Profile management
- Multi-tenant identity support
- See: Identity Backend overview, topic hub
Authorization Server Template
- OAuth2/OpenID Connect server
- Token management
- Client management
- Multi-tenant identity
- See: Authorization Server overview, topic hub
API Gateway Template
- Custom .NET Core reverse proxy gateway
- Request routing and aggregation
- Authentication and authorization
- Rate limiting and throttling
- Backend for Frontend (BFF) pattern
- Comprehensive observability
- See: API Gateway overview, topic hub
Health Checks Aggregator Template
- Centralized polling and aggregation of downstream HTTP health endpoints
- Health Checks UI dashboard and historical storage (SQL Server or InMemory)
- Readiness gate strategies for Kubernetes and load balancers
- Webhook notifications (Slack, Teams, custom)
- REST API under
/api/health/*plus standard/health,/alive,/startup - See: Overview · Features · Configuration · Runbook
Library Templates¶
Library Template
- Reusable .NET Core libraries
- NuGet package ready
- CI/CD integration
- Testing framework
- See: Library Template Overview
API Library Template
- Service agent libraries for API integration
- HTTP client management
- Authentication support
- Resiliency patterns
- See: API Library — hub, agent handbook
Platform Templates¶
Platform Template
- Multi-service SaaS platform
- Shared infrastructure
- Platform capabilities
- Tenant management
- Infrastructure as Code using Pulumi (C#) for Azure and AWS
- See: Platform Template
Frontend Templates¶
Frontend Templates
- Angular, React, Blazor applications
- Headless CMS integration
- Modern UI frameworks
- See: Frontend and CMS Templates
Mobile App Templates
ConnectSoft.MauiBaseTemplate— MAUI cross-platform kernel;dotnet newshort nameconnectsoft-maui-base(see repotemplate.json). Not the same asConnectSoft.BaseTemplate(backend microservice kernel). Agent hub: MAUI Base Template, topics under maui-base-template/overview.md. Narrative spec: ConnectSoft.Documentation — MAUI Base.- Flutter / React Native — mentioned in multi-platform agent specs; no ConnectSoft
dotnet newtemplate documented here yet.
See also: Mobile App Templates.
Infrastructure Templates¶
DevOps Templates
- CI/CD pipelines
- Infrastructure as Code (Bicep, Terraform, Pulumi)
- Deployment configurations
- See: DevOps Templates
Observability Templates
- Logging, metrics, tracing
- OpenTelemetry integration
- Monitoring dashboards
- See: Observability Templates
Security and Compliance Templates
- Security configurations
- Compliance policies
- Access control
- See: Security and Compliance Templates
Documentation Templates¶
Documentation Template
- MkDocs-based documentation sites
- Material theme
- CI/CD integration
- See: Documentation Template
Template Architecture¶
Templates follow a layered architecture that enables:
- Composition - Templates can be composed together
- Overlays - Domain-specific overlays extend base templates
- Reusability - Common patterns shared across templates
- Extensibility - Templates can be extended and customized
See: Template Architecture Implementation
Template Selection Guide¶
When to Use Base Template¶
- Creating new specialized template overlays
- Understanding microservice foundation structure
- Building domain-agnostic microservice infrastructure
- Extending base template functionality
When to Use Microservice Template¶
- Building backend services
- Creating domain-specific services
- Implementing business logic
- Building event-driven services
When to Use Identity Backend Template¶
- Building identity and user management services
- Implementing user authentication
- Managing user profiles and accounts
- Creating multi-tenant identity solutions
When to Use Authorization Server Template¶
- Building OAuth2/OpenID Connect servers
- Implementing token-based authentication
- Creating authorization servers for API access
- Building SSO (Single Sign-On) solutions
When to Use API Gateway Template¶
- Aggregating multiple microservices
- Implementing API versioning
- Managing API authentication
- Rate limiting and throttling
When to Use Health Checks Aggregator Template¶
- Operating a platform-wide health hub (dashboard + API) for many services
- Coordinating readiness with rules over multiple dependencies (critical-only, percentage, tag-based)
- Alerting stakeholders when downstream health transitions (webhooks)
- Not for primary business APIs or domain persistence — use Microservice Template for DDD services; this host polls others’ health endpoints rather than replacing them
When to Use Library Template¶
- Creating reusable utilities
- Building domain models
- Developing business logic libraries
- Publishing NuGet packages
When to Use API Library Template¶
- Integrating with external APIs
- Building SDKs for services
- Creating service agent libraries
- Multi-tenant API clients
When to Use Platform Template¶
- Building multi-service platforms
- Creating SaaS platforms
- Implementing platform capabilities
- Managing shared infrastructure
Template DI Alignment Status¶
All web-hosted extended templates have been aligned to the three-layer DI model. Each template provides a single registration coordinator class inheriting from MicroserviceRegistrationBase that overrides only the hooks where template-specific behavior is needed:
| Template | Registration Class | Strategy |
|---|---|---|
| Identity | IdentityMicroserviceRegistration |
Replace + Base+Add for Options/Endpoints |
| Auth Server | AuthServerMicroserviceRegistration |
Replace + Base+Add for Options/Endpoints |
| Bot Framework | BotFrameworkMicroserviceRegistration |
Replace + Base+Add for Options/Endpoints |
| API Gateway | ApiGatewayMicroserviceRegistration |
Replace + Base+Add for Options/Endpoints |
| Health Checks Aggregator | HealthChecksAggregatorRegistration |
Replace for HealthChecks-specific hooks |
| Microservice Template | MicroserviceTemplateRegistration |
Replace + Base+Add for Options/Endpoints |
Key alignment actions completed:
- Duplicate extension removal: Infrastructure-only extension files that duplicated base template functionality were removed from all extended templates.
- OpenTelemetryAttributeName consolidation: Sourced from
ConnectSoft.Extensions.ObservabilityNuGet instead of local copies. - Program.cs Serilog bootstrap: All templates use
SerilogBootstrapExtensions.CreateBootstrapLogger()with#if Serilogguards and.UseSerilogBootstrap(). - Azure App Configuration null-guard: Applied to all
Program.csand testBeforeAfterTestRunHooks.cs. - appsettings alignment: Typos and configuration inconsistencies fixed across all template variants.
- Test infrastructure:
HealthCheckPublisherOptionsspeed-up added to allTestStartup.ConfigureServices. Redundant acceptance tests (RequestTimeout, Compression) removed where covered by shared libraries.
Template Usage in AI Factory¶
Templates are used by the AI Software Factory in the following ways:
- Agent Generation - Agents use templates to generate code
- Blueprint Execution - Blueprints reference templates
- Project Bootstrap - Templates scaffold new projects
- Code Generation - Templates provide structure for generated code
Template Quality Standards¶
All ConnectSoft templates must meet:
- Security Standards - Security-first design, secure defaults
- Architecture Standards - Clean Architecture, DDD, event-driven
- Quality Standards - Comprehensive testing, code quality
- Observability Standards - Logging, metrics, tracing
- Documentation Standards - Comprehensive documentation
Related Documents¶
- Template Catalog - Template catalog domain
- Template Architecture Implementation - Template architecture
- Agent Template Integration Guide - How agents use templates
- Microservice Template - Microservice template details