Skip to content
Claude edited this page Apr 6, 2026 · 5 revisions

Moment — Domain-Driven Design Specification Language

Moment is a specification-first domain modeling tool. Describe your domain in .moment files — bounded contexts, aggregates, commands, events, and temporal flows — and generate testable artifacts before writing a single line of implementation code.

Current version: v1.0.0 — Stable

.moment file → Parse → IR → Generate + Derive + Emit + Simulate + Topology → .ts + .feature + .spec.ts + .md + .yaml + topology.json + scenario.json

One specification. Ten packages. Zero drift.


Quick Navigation

For New Users

Page What You'll Learn
Why Moment Why specification-first matters, the Moment → Facet pipeline
Getting Started Install, initialize, write your first .moment file
Sample Files Minimal ordering example and complex vet clinic scenario

DSL & Architecture

Page What You'll Learn
The Moment DSL Complete DSL reference — all 21 constructs with grammar and examples
Technical Reference Architecture, IR types, code generation, test derivation, sync, auth
Architecture Overview Bounded context map, data flow, design principles
Pipeline Reactive policy chain from .moment files to all outputs

Package Documentation

Package Page Summary
@mmmnt/core @mmmnt/core Parser, IR, validators, manifest, Sift import, file watcher
@mmmnt/derive @mmmnt/derive DerivationEngine, TopologyEmitter, SimulationScenarioGenerator, event catalog, impact analysis, saga state machines
@mmmnt/generate @mmmnt/generate GherkinGenerator, SpecificationDocumentGenerator, CucumberJsonFormatter, AsyncAPI
@mmmnt/emit-ts @mmmnt/emit-ts TypeScriptEmitter, TestScaffoldEmitter
All packages Package Reference Dependency graph, all 10 packages, status overview

CLI Commands

Command Description
moment init Create new project
moment parse <file> Parse and validate
moment generate <file> Full pipeline: TS + Gherkin + docs
moment emit-ts <file> TypeScript only
moment derive <file> Test topology
moment test <file> Run structural validation (payload, saga, policy)
moment simulate <file> Facet-compatible simulation scenarios
moment simulate <file> --all --out-dir <path> Per-flow topology files, scenario files, manifest, artifacts
moment serve <file> [--port 4321] [--all] WebSocket live bridge to Facet — streams topology + scenario updates in real-time
moment cucumber-json <file> Cucumber JSON for Xray import
moment viz <file> Visualization envelope
moment sync status <file> Drift detection
moment lint <file> Governance rule evaluation
moment watch File watcher
moment auth login|status|logout GitHub OAuth

Facet Integration

Method Use Case Latency
moment serve (WebSocket) Local dev — live authoring feedback Real-time (< 500ms)
moment simulate --out-dir (files) Review — upload to Facet Manual
S3 hosting (planned) Team/CI — published artifacts Minutes

Process and Infrastructure

Page What You'll Learn
ADR Index Architecture Decision Records (31 ADRs)
CI/CD GitHub Actions pipeline, quality gates
Contributing Setup, conventions, testing

License

All @mmmnt packages are licensed under FSL-1.1-Apache-2.0 (Functional Source License with Apache 2.0 future grant).

Clone this wiki locally