Modules
Modules are the building blocks of Intent Architect’s code generation capabilities. A module is a self-contained package that contains templates, metadata, dependencies, and configuration for generating specific aspects of your application.What is a Module?
An Intent Architect module is a compiled .NET assembly (.dll) distributed as a package with a .imodspec specification file. Modules encapsulate:
- Templates - Code generation templates that produce actual source code
- Metadata - Designer configurations and stereotypes for modeling
- Dependencies - References to other required modules
- Settings - Configurable options for module behavior
- Interoperability Rules - Automatic installation of compatible modules
Module Structure
Every module follows a consistent structure defined in its.imodspec file:
Key Components
Package Metadata
The package metadata section defines the module’s identity and compatibility:Unique identifier for the module (e.g.,
Intent.Application.MediatR)Version range of Intent Architect that supports this module
Space-separated tags for categorization (e.g.,
csharp dotnet mediatr)Files Section
Modules are distributed as compiled assemblies:$outDir$ and $id$ variables are replaced during the module build process.
Module Types
Intent Architect modules typically fall into several categories:Infrastructure Modules
Generate infrastructure code like dependency injection, database contexts, and API controllersExamples:
Intent.AspNetCore.Controllers, Intent.EntityFrameworkCoreApplication Pattern Modules
Implement architectural patterns like CQRS, MediatR, or Repository patternsExamples:
Intent.Application.MediatR, Intent.Application.DtosIntegration Modules
Connect to external services and technologiesExamples:
Intent.Eventing.MassTransit, Intent.AmazonS3.ObjectStorageDomain Modules
Generate domain entities, value objects, and domain servicesExamples:
Intent.Entities, Intent.ValueObjectsModule Versioning
Modules follow semantic versioning with three components:The
supportedClientVersions range uses interval notation: [4.5.0-a, 5.0.0-a) means versions from 4.5.0 (inclusive) to 5.0.0 (exclusive).Module Settings
Modules can expose configurable settings that users can adjust in the Intent Architect UI:Setting Types
- switch - Boolean on/off toggle
- select - Dropdown with predefined options
- text - Free-form text input
Interoperability
Modules can automatically detect and install compatible modules:Module Discovery
Intent Architect discovers modules through:- Official Repository - Modules published to the Intent Architect module repository
- Local Folders - Custom modules built locally during development
- NuGet Packages - Modules can be distributed via NuGet for private repositories
Best Practices
Follow Semantic Versioning
Follow Semantic Versioning
Always increment versions appropriately:
- Patch for bug fixes
- Minor for new features
- Major for breaking changes
Document Dependencies
Document Dependencies
Clearly specify all module dependencies with minimum required versions
Provide Clear Settings
Provide Clear Settings
Use descriptive titles and helpful hints for all module settings
Use Interoperability Rules
Use Interoperability Rules
Define interoperability rules to help users discover complementary modules
Next Steps
Templates
Learn how templates generate code from metadata
Metadata
Understand how metadata drives code generation
Dependencies
Explore module dependencies and version management
