The Architecture DSL Designed for LLMs
Express complex software architectures in a concise, LLM-friendly syntax with bidirectional validation
# Longform syntax is for humans
program TodoApp {
entry: api
version: "1.0.0"
}
file api {
path: "api.ts"
imports: [CreateTodoDto, Todo]
exports: [TodoService]
}
class TodoService {
extends: BaseService
methods: [createTodo, getTodos]
}
function createTodo {
signature: "(input: CreateTodoDto) => Todo"
description: "Creates a new todo item"
input: CreateTodoDto
output: Todo
}
function getTodos {
signature: "() => Todo[]"
description: "Retrieves all todo items"
output: Todo
}
dto CreateTodoDto {
description: "Input for creating todos"
fields: {
title: {
type: "string"
description: "Todo title"
}
completed: {
type: "boolean"
description: "Completion status"
}
}
}
dto Todo {
description: "Todo entity"
fields: {
id: {
type: "string"
description: "Unique identifier"
}
title: {
type: "string"
description: "Todo title"
}
completed: {
type: "boolean"
description: "Completion status"
}
createdAt: {
type: "Date"
description: "Creation timestamp"
}
}
}
Designed specifically for LLMs to understand and generate software architecture efficiently
Validates references in both directions, ensuring architectural consistency
Powerful import system with aliasing support for modular architecture definitions
Express complex architectures with minimal, readable syntax
Full IDE support with syntax highlighting, hover tooltips, and validation
New #:
operator combines file and class definitions, eliminating naming conflicts and boilerplate
Supports classes, DTOs, UI components, assets, dependencies, and runtime parameters
The root entity that contains all other entities in your architecture.
# Longform syntax is for humans
program MyApplication {
entry: main
version: "1.0.0"
}
# Import other TypedMind files
import "./shared/models.tmd" as models
import "./shared/services.tmd" as services
Represents a source code file in your architecture.
# Longform syntax is for humans
file UserController {
path: "controllers/user.controller.ts"
imports: [User, CreateUserDto, UserService]
exports: [UserController]
}
class UserController {
extends: BaseController
methods: [getUser, createUser]
}
Define classes with methods and relationships.
# Longform syntax is for humans
class UserService {
extends: BaseService
implements: [IUserService]
methods: [findById, create, update, delete]
}
# Class methods are defined as functions
function findById {
signature: "(id: string) => User"
description: "Finds a user by ID"
calls: [validateId, queryDatabase]
}
function create {
signature: "(data: CreateUserDto) => User"
description: "Creates a new user"
input: CreateUserDto
output: User
calls: [validate, save]
}
Combines file and class definition using the fusion operator #:
to prevent naming conflicts and reduce boilerplate.
# Longform syntax is for humans
# ClassFile combines file and class definition
UserService #: src/services/user.ts {
extends: BaseService
implements: [IUserService]
methods: [findById, create, update, delete]
imports: [User, CreateUserDto, Database, Logger]
}
# Eliminates the need for separate file definition
# Compare with traditional approach:
# file UserService { path: "src/services/user.ts", ... }
# class UserService { extends: BaseService, ... }
# Another example
NotificationService #: src/services/notification.ts {
extends: BaseService
methods: [sendEmail, sendSms, markAsRead]
imports: [EmailProvider, SmsProvider, Notification]
}
Standalone functions or class methods with parameters and return types.
# Longform syntax is for humans
function validateEmail {
signature: "(email: string) => boolean"
description: "Validates email format"
}
# Function with DTO references
function login {
signature: "(credentials: LoginDto) => AuthToken"
description: "Authenticates user and returns token"
input: LoginDto
output: AuthToken
calls: [validateCredentials, generateToken]
consumes: [JWT_SECRET]
}
# Function affecting UI
function updateUserProfile {
signature: "(data: ProfileDto) => User"
description: "Updates user profile"
input: ProfileDto
output: User
affects: [ProfileComponent, HeaderComponent]
}
Define data structures with field descriptions.
# Longform syntax is for humans
dto BaseEntity {
description: "Base entity with common fields"
fields: {
id: {
type: "string"
description: "Unique identifier"
}
createdAt: {
type: "Date"
description: "Creation timestamp"
}
updatedAt: {
type: "Date"
description: "Last update timestamp"
}
}
}
# DTO with optional fields
dto User {
description: "User entity"
fields: {
id: {
type: "string"
description: "User ID"
}
email: {
type: "string"
description: "Email address"
}
name: {
type: "string"
description: "Full name"
}
role: {
type: "UserRole"
description: "User role"
optional: true
}
avatar: {
type: "string"
description: "Avatar URL"
optional: true
}
}
}
Define UI components with containment relationships.
# Longform syntax is for humans
component App {
root: true
description: "Main application component"
contains: [Header, MainContent, Footer]
}
# Child components
component Header {
description: "Application header"
containedBy: [App]
contains: [Logo, Navigation, UserMenu]
affectedBy: [login, logout]
}
component MainContent {
description: "Main content area"
containedBy: [App]
contains: [Sidebar, ContentArea]
}
# Component affected by functions
component UserProfile {
description: "User profile display"
containedBy: [ContentArea]
affectedBy: [updateUserProfile, deleteUser]
}
Define deployable assets like containers, packages, or applications.
# Longform syntax is for humans
asset UserServiceContainer {
description: "Docker container for user service"
}
# Asset containing a program
asset APIGateway {
description: "API Gateway application"
contains: [GatewayProgram]
}
# Multiple assets
asset WebApp {
description: "Frontend React application"
contains: [ReactApp]
}
asset MobileApp {
description: "React Native mobile app"
contains: [MobileProgram]
}
asset WorkerService {
description: "Background job processor"
contains: [WorkerProgram]
}
Define constant values with file location and type.
# Longform syntax is for humans
constants API_VERSION {
file: "config.ts"
type: "string"
}
constants MAX_RETRIES {
file: "config.ts"
type: "number"
}
constants DEFAULT_TIMEOUT {
file: "config.ts"
type: "number"
}
# Object constants with schema
constants DATABASE_CONFIG {
file: "database/config.ts"
type: "DatabaseConfig"
}
constants FEATURE_FLAGS {
file: "features.ts"
type: "FeatureFlags"
}
# Array constants
constants ALLOWED_ORIGINS {
file: "cors.config.ts"
type: "string[]"
}
constants SUPPORTED_LOCALES {
file: "i18n/config.ts"
type: "Locale[]"
}
Define runtime parameters from different sources.
# Longform syntax is for humans
runparam DATABASE_URL {
source: "env"
description: "Database connection string"
required: true
}
runparam PORT {
source: "env"
description: "Server port"
default: "3000"
}
runparam NODE_ENV {
source: "env"
description: "Environment mode"
default: "development"
}
# IAM/Security parameters
runparam AWS_ROLE_ARN {
source: "iam"
description: "AWS role for service"
required: true
}
runparam SERVICE_ACCOUNT {
source: "iam"
description: "GCP service account"
}
# Runtime configuration
runparam MAX_WORKERS {
source: "runtime"
description: "Maximum worker threads"
default: "4"
}
runparam MEMORY_LIMIT {
source: "runtime"
description: "Memory limit in MB"
}
# Config file parameters
runparam FEATURE_FLAGS {
source: "config"
description: "Feature toggle configuration"
}
runparam API_RATE_LIMITS {
source: "config"
description: "Rate limiting rules"
}
Define external dependencies like npm packages with versions.
# Longform syntax is for humans
dependency axios {
description: "HTTP client library"
version: "3.0.0"
}
dependency express {
description: "Web framework"
version: "4.18.0"
}
dependency lodash {
description: "Utility library"
}
# Scoped packages
dependency "@types/node" {
description: "Node.js type definitions"
version: "20.0.0"
}
dependency "@aws-sdk/client-s3" {
description: "AWS S3 client"
version: "3.400.0"
}
# Referenced in files
file ServerMain {
path: "src/server.ts"
imports: [express, axios]
exports: [startServer]
}
# Dependencies are referenced in function calls
function start {
signature: "() => void"
description: "Starts the server"
calls: ["express.listen"]
}
Import entities from other TypedMind files with aliasing.
# Longform syntax is for humans
import "./shared/models.tmd" {
alias: "models"
}
import "./shared/services.tmd" {
alias: "services"
}
import "./auth/auth.tmd" {
alias: "auth"
}
program MyApp {
entry: api
version: "1.0.0"
}
# Reference imported entities
file UserAPI {
path: "api.ts"
imports: ["models.User", "services.UserService"]
exports: [UserAPI]
}
function getUser {
signature: "(id: string) => models.User"
description: "Retrieves user by ID"
calls: ["services.findUser", "auth.checkPermissions"]
}
Try TypedMind syntax with full IDE support
Experience TypedMind with:
Get the TypedMind command-line interface for validating and rendering your architecture files
npm install -g @sammons/typed-mind-cli
# Or with pnpm, yarn, or bun:
pnpm add -g @sammons/typed-mind-cli
yarn global add @sammons/typed-mind-cli
bun add -g @sammons/typed-mind-cli
TypedMind files use the .tmd
extension. Start with a simple program structure:
# Longform syntax is for humans
program MyFirstApp {
entryPoint: main
version: "1.0.0"
}
file main {
path: "main.ts"
exports: [App]
}
class App {
extends: Application
methods: [start, stop]
}
function start {
signature: () => void
description: "Starts the application"
calls: [initialize, listen]
consumes: [PORT, NODE_ENV]
}
Validate your TypedMind files and visualize them with the CLI:
# Check for validation errors
typed-mind -c my-app.tmd
# Or use the short alias
tmd -c my-app.tmd
# Example output:
✅ my-app.tmd - Valid
Program: MyFirstApp v1.0.0
Files: 1, Classes: 1, Functions: 2
# View your architecture as a diagram
typed-mind --render my-app.tmd
# For more options
typed-mind --help
Share your .tmd files with LLMs for architecture discussions and code generation
Get full IDE support with syntax highlighting, validation, and IntelliSense
# Longform syntax is for humans
# Define your data models
dto User {
description: "User entity"
fields: [
{ name: "id", type: "string", description: "Unique identifier" },
{ name: "name", type: "string", description: "Full name" },
{ name: "email", type: "string", description: "Email address" }
]
}
# Add service classes
class UserService {
extends: BaseService
methods: [getUser, createUser, updateUser]
}
function getUser {
signature: (id: string) => User
description: "Retrieves a user by ID"
output: User
calls: [validateId, queryDatabase]
}