A language for WHAT.
Blueprints for HOW.
ModelHike is a typed application modeling language and compiler. Lightweight, Markdown-inspired syntax defines application structures and supported behavior. The compiler validates models and turns supported declarations into conventional source code through framework-specific blueprints.
Readable enough to discuss. Precise enough to compile.
The syntax at a glance
===
Billing APIs #blueprint(api-nestjs-monorepo)
====
+ Billing
=== Billing ===
Subscription
============
** _id: String
* plan: Plan
* owner: Customer
* startDate: Date
- cancelledAt: Date
~ cancel(): void
~ renew(months): Subscription
**identity — marks the record's key*required property-optional property~method signature===containers and modules+declares a module in a container#blueprint(…)assigns the generation target
Syntax excerpt — Plan and Customer definitions omitted. A runnable model defines every referenced type.
Define. Validate. Inspect. Compile. Extend.
- 01Define
Describe application concepts and supported behaviors in the modeling language.
- 02Validate
Check supported structural and semantic rules with compiler diagnostics.
- 03Inspect
Explore entities, operations, dependencies, and generated artifacts.
- 04Compile
Transform supported definitions into source code using implementation blueprints.
- 05Extend
Write conventional code for algorithms and behavior better expressed imperatively.
The pipeline
Six phases. The model load path is shared by every command.
- Discover — find all
.modelhikefiles - Load — parse into the in-memory model
- Hydrate — post-load refinements and annotation cascade
- Validate — semantic checks with structured diagnostics; never halts
- Render — run the blueprint's templates and scripts
- Persist — write generated files to the output directory
CLI examples
A non-interactive Smart CLI: human-readable by default, --format json for structured output, stdin via --input -, no prompts.
# the model references CustomerProfile, which is never defined
$ printf '===\nAPIs\n====\n+ Billing\n\n=== Billing ===\n\nSubscription\n============\n* _id: String\n* owner: CustomerProfile\n' \
| .build/debug/modelhike validate --input -
→ W301 Type 'CustomerProfile' referenced by property 'owner' in 'Subscription' not found.
# fix the model, or let `modelhike fix` attempt supported corrections first
$ modelhike dry-run --input model.modelhike --blueprint api-nestjs-monorepo --container APIs
# previews the generated file tree and manifest without writing anything
$ modelhike generate --input model.modelhike --blueprint api-nestjs-monorepo --container APIs --output ./generated
# without --output, files are written to ./modelhike-output
# with --blueprint, also pass a target: --container (here) or --system-view
$ modelhike explain --input model.modelhike
# summarizes what the model means: containers, entities, APIs, relationships
$ modelhike what-depends-on Payment --input model.modelhike
# reverse dependencies across model references —
# supports rename/remove impact analysis
$ modelhike fix --input model.modelhike --codes W301
# attempts supported auto-fixes and returns corrected model text with an audit trail
$ modelhike preflight --input model.modelhike --blueprint api-nestjs-monorepo
# generation-readiness checklist: validation state, module references, blueprint assignment
Exit codes: 0 success · 1 warnings · 2 errors · 3 parse failure · 4 generation failure.
Run it yourself: clone github.com/modelhike/modelhike and swift build. Outputs shown here are transcribed from the reference docs unless labeled recorded.
MCP tools for AI agents
The MCP server runs over stdio — no HTTP, no networking config. Agents in Cursor, Windsurf, or Claude Code call structured JSON tools directly.
| Tool | What it does |
|---|---|
modelhike/validate | Parse and validate a model. Structured diagnostics with codes like W301. |
modelhike/generate | Compile the model and persist generated output. Returns the file manifest. |
modelhike/dry-run | Preview generated files and the output tree without writing anything. |
modelhike/inline-generate | Generate from inline model content and an inline blueprint JSON object. |
modelhike/explain | Summarize containers, entities, APIs, relationships. |
modelhike/inspect | Drill into one entity: properties, references, generated artifacts. |
modelhike/what-depends-on | Reverse dependencies, with rename/remove impact analysis. |
modelhike/list-types | List declared model types so agents can resolve unfound-type diagnostics. |
modelhike/fix | Attempt supported auto-fixes; returns corrected text plus an audit trail. |
modelhike/preflight | Generation-readiness checklist across validation, module references, blueprint assignment. |
modelhike/list-blueprints | Show available code-generation blueprints. |
modelhike/dsl-schema-in-markdown | The canonical DSL specification as markdown. |
"mcpServers": {
"modelhike": {
"command": "/path/to/.build/debug/modelhike-mcp",
"transportType": "stdio"
}
}
Blueprints
A blueprint is a folder of templates and scripts that compiles a model into a specific stack. Add your own with --blueprints <path>.
| Blueprint | Stack | Surface |
|---|---|---|
api-nestjs-monorepo | NestJS + TypeScript monorepo | REST APIs, CQRS (@nestjs/cqrs), MongoDB, Yup validation, soft delete + audit, pagination, PlantUML docs |
api-springboot-monorepo | Spring Boot 3.x + Java | GraphQL APIs, reactive WebFlux, MongoDB |
Blueprints have different capabilities and surfaces. A model preserves your definitions; it does not make frameworks identical.
The spec became the source of truth. But the AI still has to guess.
Spec-driven development is an important step forward. It places requirements and design decisions before implementation. But a specification interpreted by an AI and a specification understood by a compiler are not the same thing.
Interpretation leaves implementation decisions open. Probabilistic generation may produce different implementations from the same requirements. And someone must verify not only what changed, but whether the implementation still reflects intent.
Specification
→ AI interpretation
→ Source Code
Typed Source Model
→ Compiler + Blueprints
→ Source Code
Fix the source. Not the symptoms.
AI still finds the right change. Once a decision is in a blueprint, nobody reinvents it.
Update spec
→ AI interpretation
→ Generated changes
→ Review and correct
Update supported Source Model
→ Validate
→ Compile
→ Verify
Model before
The Subscription entity, before the change.
Subscription
============
** _id: String
* plan: Plan
* owner: Customer
* startDate: Date
- cancelledAt: Date
The change
Business wants pausing: one optional date. The entire business-level decision is two lines.
* startDate: Date
+ - pausedAt: Date
- cancelledAt: Date
Validate
Run the compiler's structural and semantic checks.
$ modelhike validate --input billing.modelhike
Example command · the complete fixture defines every referenced type (Plan, Customer)
Compile
Load → Hydrate → Validate → Render → Persist.
$ modelhike generate --input billing.modelhike --blueprint api-nestjs-monorepo --container "Billing APIs"
Example command · with --blueprint, pass a target (--container)
Inspect impact
Inspect the generated entity and validation definitions. Exact changes depend on the blueprint.
$ modelhike inspect Subscription --input billing.modelhike
Example command · recorded before/after diffs are added when available
Still yours
Behavior, tests, and review remain engineering work. Review the decision. Inspect the implementation. Verify the result.
Direction of the project — not yet executable
Richer rule modeling is on the roadmap — e.g. "a refund never exceeds the original charge" as a first-class declaration. Today, such rules live in code and tests.
Prompts propose. Compilers enforce their rules.
AI is good at exploration, interpretation, and proposing solutions. A compiler is good at applying rules that have already been defined. ModelHike brings both into one development workflow.
Agents drive the loop: draft → validate → diagnose → fix → explain → approve → generate.
Every MCP call returns structured JSON. Every diagnostic carries a stable code and a source location. The agent drives validation and error-correction; a developer approves the important decisions.
Use intelligence where judgment is needed. Use determinism where the rules are known.
Deterministic means repeatable output from fixed model, blueprint, toolchain, and configuration inputs. It does not make an incorrect specification correct.
From modeling structure to modeling outcomes.
Application types and relationships are a foundation. But business software ultimately exists to produce meaningful outcomes. A payment is authorized. An order is fulfilled. A reservation is cancelled. A refund respects its limits.
ModelHike is evolving toward richer outcome and constraint modeling — business behavior expressed more directly, without the model prescribing every implementation algorithm.
Not simply more code from fewer lines. More application meaning, expressed before implementation.
Roadmap: outcome/constraint modeling, packaged CLI distribution, VS Code extension, plugin system.
Compile the WHAT. Automate the HOW.
ModelHike — Own the WHAT. Automate the HOW.