Modeller
ArchitectureLegacy Design Drafts

Implementation Status

Implementation Status

This document tracks the current implementation status of the Modeller domain definition system.

Last updated: 22 May 2026


Overview

ComponentStatusLocation
DSL Parser✅ Completesrc/Modeller.Parser/
Domain Models✅ Completesrc/Modeller.Domain/
Configuration System✅ Completesrc/Modeller.Generator/Configuration/
Code Generation Engine✅ Completesrc/Modeller.Generator/
CLI Tool✅ Completesrc/Modeller.Cli/
Template Packs (C#)✅ Completetemplates/csharp/
VS Code Extension✅ Completeeditors/vscode-modeller/
Sample Definitions✅ Completesamples/
Integration Tests✅ Completetests/Modeller.Integration.Tests/
CI Pipeline✅ Complete.github/workflows/
NuGet Publish⏳ Not StartedPackage configured; not yet published
VS Code Marketplace Publish⏳ Not StartedExtension packaged; publisher account needed
Workflow DSL Support⏳ Not Started

DSL Parser

Technology: Pidgin v3.5.1 parser combinators

Supported File Types:

ExtensionParserDescription
.defDslParser.ParseDomain()Domain definition
.entityDslParser.ParseEntity()Entity definitions
.valueDslParser.ParseValue()Value objects
.sharedDslParser.ParseShared()Lookup/reference data
.enumDslParser.ParseEnum()Enumerations
.flagsDslParser.ParseEnum()Flag enumerations
.commandDslParser.ParseCommand()Commands (write ops)
.queryDslParser.ParseQuery()Queries (read ops)
.eventDslParser.ParseEvent()Domain events
.keyDslParser.ParseKey()Key definitions
.serviceDslParser.ParseService()Service/bounded context
.projectionDslParser.ParseProjection()Read model projections

Domain Models

Pattern: Immutable records with factory method validation

Key Design Decisions:

  1. Internal constructors prevent invalid object creation
  2. Factory methods (New, CreateValid) validate before construction
  3. { get; } properties ensure true immutability
  4. Guid.IsVersion7() extension validates public IDs

Core Types:

TypeDescription
DomainTop-level container for entire domain
ServiceBounded context grouping
EntityDomain object with identity
AttributeProperty/field on an entity
RelationshipLink between entities
EnumerationEnum type definition
CommandWrite operation
QueryRead operation

Builder: DomainBuilder converts parsed AST nodes into semantic domain model.


Configuration System

Technology: YamlDotNet v17.1.0

Structure:

.modeller/
├── config.yaml          # Project-wide config (domain path, output root, variables)
└── profiles/
    ├── default.yaml     # Default generation profile
    ├── infrastructure.yaml
    └── plugin.yaml

Key Classes:

  • ConfigLoader — loads config.yaml and profile YAMLs
  • ManifestLoader — loads pack.yaml and template.yaml manifests
  • VariableMerger — resolves {variables.x} substitutions in output paths
  • ProjectConfig, ProfileConfig — typed configuration records

Code Generation Engine

Technology: Scriban v7.2.0

Generation Cardinality (set in template.yaml):

  • per: domain — one output file for the entire domain
  • per: entity — one output file per entity in the domain

Key Classes:

  • GenerationPlanner — reads profiles and builds a GenerationPlan
  • GenerationExecutor — executes the plan, calls TemplateEngine per file
  • TemplateEngine — wraps Scriban, passes domain model as context
  • DomainTemplateFunctions — custom functions available inside templates (pascal_case, etc.)
  • ScribanDomainGenerator — high-level facade used by the CLI

CLI Tool

Technology: System.CommandLine v2.0.8
Distribution: .NET global tool (dotnet tool install --global Modeller.Cli)

CommandDescription
initScaffold a .modeller/ folder, copy sample definitions and LLM context
generateRun the full generation pipeline from domain definitions to output files
validateParse and validate domain definitions without generating output
templatesList available template packs
snippetWork with reusable code snippets

Template Packs

All packs live under templates/csharp/.

domain

Generates bare C# records for entities, enums, commands, and queries.

clean-architecture

Multi-template pack organised by clean architecture layers.

plugin

Newest pack — generates a full plugin-architecture application:

Sub-packKey outputs
apiProgram.g.cs, DI extensions, endpoint extensions, per-entity Minimal API endpoints, .csproj
infrastructureDbContext, entity configurations, mapping extensions
sdkApiResult, CreateRequest, UpdateRequest, and other client types
uiUI layer scaffolding

VS Code Extension

Location: editors/vscode-modeller/

Features:

  • ✅ Syntax highlighting (TextMate grammar)
  • ✅ Custom file icons for all 12 definition types
  • ✅ Language configuration (comments, brackets, auto-close pairs)
  • ✅ Auto-prompt to activate icon theme on first install

Installation: See editors/vscode-modeller/INSTALL.md

Status: Built and installable locally; not yet published to the VS Code Marketplace.


Sample Definitions

samples/modeller/ — The Modeller tool's own domain, demonstrating all definition types.

samples/child-care/ — Canonical reference project with a comprehensive Child Care domain and complete .modeller/ configuration.


Tests

ProjectTestsCoverage
Modeller.Parser.Tests43Unit tests for all 12 DSL parsers
Modeller.Generator.Tests42Unit tests for config loading, manifest loading, variable merging, template discovery, snippet loading
Modeller.Integration.Tests84End-to-end generation (all plugin layers), domain assembly, DSL parsing for both sample domains

Known Gaps

  1. Workflow DSLworkflow is described in architecture docs but has no parser or generator support.
  2. NuGet publish — the global tool package is not yet published to NuGet.org.
  3. VS Code Marketplace — the extension is packaged and ready; a publisher account (catalyst) is needed to publish.
  4. Non-C# templates — only C# template packs exist; the engine is language-agnostic.

On this page