Skip to main content

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:
<?xml version="1.0" encoding="utf-8"?>
<package>
  <id>Intent.Application.MediatR</id>
  <version>4.5.4</version>
  <supportedClientVersions>[4.5.0-a, 5.0.0-a)</supportedClientVersions>
  <summary>Provides the MediatR middleware</summary>
  <description>Provides the MediatR middleware</description>
  <authors>Intent Architect</authors>
  <tags>csharp dotnet mediatr</tags>
  <projectUrl>https://docs.intentarchitect.com/...</projectUrl>
  <releaseNotes>release-notes.md</releaseNotes>
  
  <templates>
    <!-- Template definitions -->
  </templates>
  
  <dependencies>
    <!-- Module dependencies -->
  </dependencies>
  
  <interoperability>
    <!-- Auto-install rules -->
  </interoperability>
  
  <moduleSettings>
    <!-- Configurable settings -->
  </moduleSettings>
</package>

Key Components

Package Metadata

The package metadata section defines the module’s identity and compatibility:
id
string
required
Unique identifier for the module (e.g., Intent.Application.MediatR)
version
string
required
Semantic version number following SemVer
supportedClientVersions
string
required
Version range of Intent Architect that supports this module
tags
string
Space-separated tags for categorization (e.g., csharp dotnet mediatr)

Files Section

Modules are distributed as compiled assemblies:
<files>
  <file src="$outDir$/$id$.dll" />
  <file src="$outDir$/$id$.pdb" />
</files>
The $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.EntityFrameworkCore

Application Pattern Modules

Implement architectural patterns like CQRS, MediatR, or Repository patternsExamples: Intent.Application.MediatR, Intent.Application.Dtos

Integration Modules

Connect to external services and technologiesExamples: Intent.Eventing.MassTransit, Intent.AmazonS3.ObjectStorage

Domain Modules

Generate domain entities, value objects, and domain servicesExamples: Intent.Entities, Intent.ValueObjects

Module Versioning

Modules follow semantic versioning with three components:
1

Major Version

Breaking changes that require migration or manual intervention
2

Minor Version

New features and functionality added in a backward-compatible manner
3

Patch Version

Bug fixes and minor improvements
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:
<moduleSettings>
  <group id="2392c046-0aa7-4ee5-a77a-e954c4a7aab5" 
         title="CQRS Settings" 
         externalReference="2392c046-0aa7-4ee5-a77a-e954c4a7aab5">
    <settings>
      <setting id="02413035-08e9-47b2-8b89-798f38388243" 
               title="Consolidate Command/Query associated files into single file" 
               type="switch">
        <hint>Generate Commands and Queries' associated files into the Command/Query file itself.</hint>
      </setting>
    </settings>
  </group>
</moduleSettings>

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:
<interoperability>
  <detect id="Intent.AzureFunctions">
    <install>
      <package id="Intent.AzureFunctions.Dispatch.MediatR" version="2.0.0" />
    </install>
  </detect>
</interoperability>
When a user installs a module that has interoperability rules, Intent Architect will suggest or automatically install the related modules.
This feature helps ensure that modules work together correctly and reduces manual configuration.

Module Discovery

Intent Architect discovers modules through:
  1. Official Repository - Modules published to the Intent Architect module repository
  2. Local Folders - Custom modules built locally during development
  3. NuGet Packages - Modules can be distributed via NuGet for private repositories

Best Practices

Always increment versions appropriately:
  • Patch for bug fixes
  • Minor for new features
  • Major for breaking changes
Clearly specify all module dependencies with minimum required versions
Use descriptive titles and helpful hints for all module settings
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

Build docs developers (and LLMs) love