Skip to main content

Ariadne.NET

A pluggable, pattern-agnostic architecture governance engine that enforces structural rules for AI code generation via declarative YAML rule packs.

Core Principle: AI generates behavior. The engine governs structure.

Why​

AI coding agents generate behavior effectively but are unreliable at structural decisions — they invent folder structures, improvise namespaces, and silently violate dependency rules. This engine separates structural governance from AI code generation: the AI declares intent, the engine enforces structure.

Quick Start​

To use the library from your own project, see Getting started.

CLI​

These commands assume the installed ariadne tool; see Install the tool. From a clone of the repository, run them as dotnet run --project src/Ariadne.NET.Cli -- <command>.

# Initialize a project with clean architecture rules
ariadne init --template clean-architecture

# Compose multiple patterns
ariadne init --template clean-architecture+cqrs

# List available component roles
ariadne roles

# Generate a component
ariadne generate --role Entity --name Order --solution MyApp --feature Orders

MCP Server​

The engine runs as an MCP server for AI agent integration (Claude Code, Cursor, etc.):

Stdio (local) — add to your .mcp.json:

{
"mcpServers": {
"ariadne": {
"command": "dotnet",
"args": ["run", "--project", "path/to/src/Ariadne.NET.Mcp"]
}
}
}

HTTP (remote/team) — start the API server, MCP endpoint at /mcp:

dotnet run --project src/Ariadne.NET.Mcp.Http

MCP Tools​

ToolDescription
list_templatesList available architecture templates
get_layersGet layers with their id, selectors, allowed dependencies and because
get_component_rolesGet available component roles
get_rulesGet the forbid and allowOnly rules
generate_componentGenerate a C# component
generate_workspaceScaffold project structure
validate_sourceValidate a solution or project against rules

Tech Stack​

  • .NET 10 — Runtime
  • YamlDotNet — YAML parsing
  • Roslyn — Code generation and semantic validation
  • System.CommandLine — CLI framework
  • ModelContextProtocol — MCP server SDK (stdio + HTTP)
  • ZeroAlloc.Inject — Compile-time DI registration
  • xUnit + FluentAssertions — Testing