v0.1.0 Draft Specification

Typed Markdown
Collections

A specification for treating folders of markdown files as typed, queryable data collections. Define schemas as markdown. Query with expressions. No proprietary formats.

Read the specification GitHub
Design Principles

Built on five commitments

01

Files are the source of truth

Tools read from and write to the filesystem. Indexes and caches are derived and disposable.

02

Human-readable first

No proprietary formats. A user with a text editor can read and modify any file.

03

Progressive strictness

Works with no schema at all. Validation is opt-in and configurable.

04

Portable

Collections work with any conforming tool. No vendor lock-in.

05

Git-friendly

All persistent state is text files suitable for version control.

How it works

Schemas, queries, and expressions — all in plain text

my-project/
├── mdbase.yaml            # marks this folder as a collection
├── _types/                # type definitions (schemas)
│   ├── task.md
│   └── person.md
├── tasks/
│   ├── fix-bug.md         # a record of type "task"
│   └── write-docs.md
└── people/
    └── alice.md           # a record of type "person"
---
name: task
fields:
  title:
    type: string
    required: true
  status:
    type: enum
    values: [open, in_progress, done]
    default: open
  priority:
    type: integer
    min: 1
    max: 5
  assignee:
    type: link
    target: person
---
query:
  types: [task]
  where:
    and:
      - 'status != "done"'
      - "priority >= 3"
  order_by:
    - field: due_date
      direction: asc
  limit: 20
# Filter by status and tags
status == "open" && tags.contains("urgent")

# Date arithmetic
due_date < today() + "7d"

# Link traversal
assignee.asFile().team == "engineering"

# Null coalescing
priority ?? 3
Conformance

Six levels, from basic to full

Implementations claim conformance at the level they support. Each level builds on the last.

1 Core
2 Matching
3 Querying
4 Links
5 References
6 Full
Specification

Read the full spec

00 Overview 01 Terminology 02 Collection Layout 03 Frontmatter 04 Configuration 05 Types 06 Matching 07 Field Types 08 Links 09 Validation 10 Querying 11 Expressions 12 Operations 13 Caching 14 Conformance 15 Watching A Examples B Expression Grammar C Error Codes D Compatibility