The markdown alternative that agents (and humans) love.
Lessmark is readable markup with typed blocks, canonical formatting, safe rendering, and a stable JSON AST across JavaScript, Python, and Rust.
Markdown is good when a human is the only reader. Lessmark is for documents that humans edit and AI agents need to trust.
In Markdown, the same-looking document can parse differently across engines, raw HTML can change the output, and malformed structure often gets accepted silently. That is fine for notes and comments, but painful for AI agent context files, docs pipelines, renderers, and import/export paths that need one predictable tree.
Lessmark keeps the readable parts and removes the guesswork:
Use Markdown for casual prose. Use Lessmark when the file is part of a build, a parser, a validator, a site, or an agent workflow.
npm install lessmarkpip install lessmarkcargo add lessmark
CLI
lessmark parse file.lmk
lessmark parse --positions file.lmk
lessmark parse -
lessmark check file.lmk
lessmark check docs
lessmark check --json file.lmk
lessmark format file.lmk
lessmark format --check file.lmk
lessmark format --check --json docs
lessmark fix --write file.lmk
lessmark fix --write docs
lessmark from-markdown README.md
lessmark from-markdown -
lessmark to-markdown file.lmk
lessmark to-markdown -
lessmark init docs
lessmark skill init code-review
lessmark skill check code-review
lessmark skill build code-review --target both
lessmark skill import code-review/SKILL.md --out code-review/skill.lmk
lessmark skill install code-review --target codex
lessmark skill dev code-review
lessmark render --document file.lmk
lessmark build --strict input public
lessmark info --jsonUse - to read from stdin. check, format --check, and fix --write can also walk a directory recursively. parse --positions includes source ranges for tooling. init creates a starter docs/index.lmk without overwriting. parse, check, format, fix, from-markdown, to-markdown, init, and info are shared by the JavaScript, Python, and Rust packages. HTML rendering, static-site builds, and skill bundle commands are npm CLI features.
API
import { parseLessmark, validateSource, formatLessmark, renderHtml } from "lessmark";
const source = "# Notes\n\nPlain prose becomes a paragraph.\n";
const ast = parseLessmark(source);
const errors = validateSource(source);
const formatted = formatLessmark(source);
const html = renderHtml(ast, { document: true });from lessmark import parse_lessmark, validate_source, format_lessmarkuse lessmark::{parse_lessmark, validate_source, format_lessmark};
Language
Lessmark source files use .lmk; .lessmark is a readable alias. The language includes plain top-level paragraphs, headings, inline functions, typed context blocks, skill metadata, lists, tables, callouts, code, math, diagrams, links, footnotes, and page/navigation metadata.
Conformance is checked across JavaScript, Python, Rust, docs, Markdown conversion, fixtures, schemas, VS Code syntax, and the Tree-sitter starter grammar. See lessmark.org/docs/conformance.
MIT
