# mustache/spec architecture

> Architecture diagram of the GitHub repository mustache/spec, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mustache/spec
- Repository: https://github.com/mustache/spec

## Overview

This repository is the formal Mustache specification, not a template engine or test runner. Implementors consult its core behavior specifications, with optional modules covering extensions; YAML is the primary format and JSON is documented as an alternate representation. The README establishes those relationships, but no source excerpts were provided, so the graph does not infer execution or test-runner behavior.

Main entry points: [`specs/comments.yml`](https://github.com/mustache/spec/blob/master/specs/comments.yml) (Comments YAML), [`specs/delimiters.yml`](https://github.com/mustache/spec/blob/master/specs/delimiters.yml) (Delimiters YAML), [`specs/interpolation.yml`](https://github.com/mustache/spec/blob/master/specs/interpolation.yml) (Interpolation YAML), [`specs/inverted.yml`](https://github.com/mustache/spec/blob/master/specs/inverted.yml) (Inverted sections YAML)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Core specifications"]
  node_comments_yml["Comments YAML<br/>[comments.yml]"]
  node_delimiters_yml["Delimiters YAML<br/>[delimiters.yml]"]
  node_interpolation_yml["Interpolation YAML<br/>[interpolation.yml]"]
  node_inverted_yml["Inverted sections YAML<br/>[inverted.yml]"]
  node_partials_yml["Partials YAML<br/>[partials.yml]"]
  node_sections_yml["Sections YAML<br/>[sections.yml]"]
end

subgraph group_optional["Optional modules"]
  node_dynamic_yml["Dynamic names YAML<br/>[~dynamic-names.yml]"]
  node_inheritance_yml["Inheritance YAML<br/>[~inheritance.yml]"]
  node_lambdas_yml["Lambdas YAML<br/>[~lambdas.yml]"]
end

subgraph group_formats["Alternate formats"]
  node_comments_json["Comments JSON<br/>[comments.json]"]
  node_delimiters_json["Delimiters JSON<br/>[delimiters.json]"]
  node_interpolation_json["Interpolation JSON<br/>[interpolation.json]"]
  node_inverted_json["Inverted sections JSON<br/>[inverted.json]"]
  node_partials_json["Partials JSON<br/>[partials.json]"]
  node_sections_json["Sections JSON<br/>[sections.json]"]
  node_dynamic_json["Dynamic names JSON"]
  node_inheritance_json["Inheritance JSON<br/>[~inheritance.json]"]
  node_lambdas_json["Lambdas JSON<br/>[~lambdas.json]"]
end

node_implementors(("Mustache implementors"))

node_implementors -->|"consults"| node_comments_yml
node_implementors -->|"consults"| node_delimiters_yml
node_implementors -->|"consults"| node_interpolation_yml
node_implementors -->|"consults"| node_inverted_yml
node_implementors -->|"consults"| node_partials_yml
node_implementors -->|"consults"| node_sections_yml
node_implementors -->|"may support"| node_dynamic_yml
node_implementors -->|"may support"| node_inheritance_yml
node_implementors -->|"may support"| node_lambdas_yml
node_comments_yml -->|"alternate format"| node_comments_json
node_delimiters_yml -->|"alternate format"| node_delimiters_json
node_interpolation_yml -->|"alternate format"| node_interpolation_json
node_inverted_yml -->|"alternate format"| node_inverted_json
node_partials_yml -->|"alternate format"| node_partials_json
node_sections_yml -->|"alternate format"| node_sections_json
node_dynamic_yml -->|"alternate format"| node_dynamic_json
node_inheritance_yml -->|"alternate format"| node_inheritance_json
node_lambdas_yml -->|"alternate format"| node_lambdas_json

click node_comments_yml "https://github.com/mustache/spec/blob/master/specs/comments.yml"
click node_delimiters_yml "https://github.com/mustache/spec/blob/master/specs/delimiters.yml"
click node_interpolation_yml "https://github.com/mustache/spec/blob/master/specs/interpolation.yml"
click node_inverted_yml "https://github.com/mustache/spec/blob/master/specs/inverted.yml"
click node_partials_yml "https://github.com/mustache/spec/blob/master/specs/partials.yml"
click node_sections_yml "https://github.com/mustache/spec/blob/master/specs/sections.yml"
click node_dynamic_yml "https://github.com/mustache/spec/blob/master/specs/~dynamic-names.yml"
click node_inheritance_yml "https://github.com/mustache/spec/blob/master/specs/~inheritance.yml"
click node_lambdas_yml "https://github.com/mustache/spec/blob/master/specs/~lambdas.yml"
click node_comments_json "https://github.com/mustache/spec/blob/master/specs/comments.json"
click node_delimiters_json "https://github.com/mustache/spec/blob/master/specs/delimiters.json"
click node_interpolation_json "https://github.com/mustache/spec/blob/master/specs/interpolation.json"
click node_inverted_json "https://github.com/mustache/spec/blob/master/specs/inverted.json"
click node_partials_json "https://github.com/mustache/spec/blob/master/specs/partials.json"
click node_sections_json "https://github.com/mustache/spec/blob/master/specs/sections.json"
click node_dynamic_json "https://github.com/mustache/spec/blob/master/specs/~dynamic-names.json"
click node_inheritance_json "https://github.com/mustache/spec/blob/master/specs/~inheritance.json"
click node_lambdas_json "https://github.com/mustache/spec/blob/master/specs/~lambdas.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_comments_yml,node_delimiters_yml,node_interpolation_yml,node_inverted_yml,node_partials_yml,node_sections_yml toneBlue
class node_dynamic_yml,node_inheritance_yml,node_lambdas_yml toneAmber
class node_comments_json,node_delimiters_json,node_interpolation_json,node_inverted_json,node_partials_json,node_sections_json,node_dynamic_json,node_inheritance_json,node_lambdas_json toneMint
class node_implementors toneIndigo
```

## Components

### Core specifications

- [Comments YAML](https://github.com/mustache/spec/blob/master/specs/comments.yml): `specs/comments.yml`
- [Delimiters YAML](https://github.com/mustache/spec/blob/master/specs/delimiters.yml): `specs/delimiters.yml`
- [Interpolation YAML](https://github.com/mustache/spec/blob/master/specs/interpolation.yml): `specs/interpolation.yml`
- [Inverted sections YAML](https://github.com/mustache/spec/blob/master/specs/inverted.yml): `specs/inverted.yml`
- [Partials YAML](https://github.com/mustache/spec/blob/master/specs/partials.yml): `specs/partials.yml`
- [Sections YAML](https://github.com/mustache/spec/blob/master/specs/sections.yml): `specs/sections.yml`

### Optional modules

- [Dynamic names YAML](https://github.com/mustache/spec/blob/master/specs/~dynamic-names.yml): `specs/~dynamic-names.yml`
- [Inheritance YAML](https://github.com/mustache/spec/blob/master/specs/~inheritance.yml): `specs/~inheritance.yml`
- [Lambdas YAML](https://github.com/mustache/spec/blob/master/specs/~lambdas.yml): `specs/~lambdas.yml`

### Alternate formats

- [Comments JSON](https://github.com/mustache/spec/blob/master/specs/comments.json): `specs/comments.json`
- [Delimiters JSON](https://github.com/mustache/spec/blob/master/specs/delimiters.json): `specs/delimiters.json`
- [Interpolation JSON](https://github.com/mustache/spec/blob/master/specs/interpolation.json): `specs/interpolation.json`
- [Inverted sections JSON](https://github.com/mustache/spec/blob/master/specs/inverted.json): `specs/inverted.json`
- [Partials JSON](https://github.com/mustache/spec/blob/master/specs/partials.json): `specs/partials.json`
- [Sections JSON](https://github.com/mustache/spec/blob/master/specs/sections.json): `specs/sections.json`
- [Dynamic names JSON](https://github.com/mustache/spec/blob/master/specs/~dynamic-names.json): `specs/~dynamic-names.json`
- [Inheritance JSON](https://github.com/mustache/spec/blob/master/specs/~inheritance.json): `specs/~inheritance.json`
- [Lambdas JSON](https://github.com/mustache/spec/blob/master/specs/~lambdas.json): `specs/~lambdas.json`

### Other components

- **Mustache implementors**

## Connections

- Mustache implementors → Comments YAML: consults (evidence: `README.md`)
- Mustache implementors → Delimiters YAML: consults (evidence: `README.md`)
- Mustache implementors → Interpolation YAML: consults (evidence: `README.md`)
- Mustache implementors → Inverted sections YAML: consults (evidence: `README.md`)
- Mustache implementors → Partials YAML: consults (evidence: `README.md`)
- Mustache implementors → Sections YAML: consults (evidence: `README.md`)
- Mustache implementors → Dynamic names YAML: may support (evidence: `README.md`)
- Mustache implementors → Inheritance YAML: may support (evidence: `README.md`)
- Mustache implementors → Lambdas YAML: may support (evidence: `README.md`)
- Comments YAML → Comments JSON: alternate format (evidence: `README.md`)
- Delimiters YAML → Delimiters JSON: alternate format (evidence: `README.md`)
- Interpolation YAML → Interpolation JSON: alternate format (evidence: `README.md`)
- Inverted sections YAML → Inverted sections JSON: alternate format (evidence: `README.md`)
- Partials YAML → Partials JSON: alternate format (evidence: `README.md`)
- Sections YAML → Sections JSON: alternate format (evidence: `README.md`)
- Dynamic names YAML → Dynamic names JSON: alternate format (evidence: `README.md`)
- Inheritance YAML → Inheritance JSON: alternate format (evidence: `README.md`)
- Lambdas YAML → Lambdas JSON: alternate format (evidence: `README.md`)
