v0.8.0 — enforceable models and interfaces

Higher-level tooling for understandable software

M21 is an experiment in higher-level software tooling: tools that help people build systems that stay maintainable, extensible, reliable, professional, clean, and understandable as they grow.

Get started Read the vision View project graph See how it works
$ npx @moejay/m21 ./spec/
Vision

Higher-level tooling for understandable software

◆

Models define meaning

Declare entities, fields, relationships, states, and constraints in enforceable, language-neutral contract blocks.

→

Interfaces define the surface

Make operations, inputs, outputs, failures, effects, and events explicit before behavior or implementation.

↻

Living documentation

Models, interfaces, specs, Gherkin scenarios, test results, and the graph reinforce each other so contracts do not drift from code.

Read the full vision
Features

Everything you need

◇

Interactive graph

D3-powered dependency visualization with zoom, pan, and drag. Click any node to explore its details.

☷

Tree-and-groups layout

The default view combines dependency depth with group clustering. Drag nodes or group labels to rearrange, lock nodes for a stable map, or reverse the tree direction.

✎

Inline editing

Edit spec bodies and feature files directly in the browser. Changes save back to disk instantly.

↻

Live reload

Dev server watches your files and pushes changes via SSE. Edit in your editor, see it update in real time.

☑

Enforceable contracts

Validate model blocks and references, inspect contracts in graph tabs, export the registry, and generate JSON Schema for runtime or CI enforcement.

⚙

Group clustering

Organize specs into groups. Modules in the same group are visually clustered with colored hulls in the graph.

✓

Test results overlay

Feed M21 a Cucumber JSON or Jest/vitest report and every node is ringed green/red/amber with a passed/total count. Click scenarios in the side panel to inspect step status and source-backed Given/When/Then definition snippets.

How it works

Four layers to a living contract graph

Define models

Declare owned entities and structural constraints in m21-model YAML blocks.

Define interfaces

Declare semantic operations, inputs, outputs, failures, and effects in m21-interface blocks.

Specify behavior

Capture architecture in the Contract section and demonstrate observable outcomes with Gherkin scenarios.

Validate and visualize

Run m21 validate ./spec/, export JSON Schema when needed, then explore models, interfaces, prose, features, and dependencies in the graph.

---
name: persistence
description: SQLite database layer
group: infrastructure
tags: [database, storage]
depends_on:
  - name: bootstrap
    uses: [project-scaffolding]
features: features/persistence/
---

# Persistence

## Data model
```m21-model
entities: { Record: { fields: { id: { type: string, required: true } } } }
```
## Interfaces
```m21-interface
operations: { store-record: { input: Record, output: Record } }
```
## Contract
Provides durable local storage.