",
- kind: "deterministic",
- done: true,
- },
+const PAGE_CSS = ".release-link{color:inherit;letter-spacing:inherit;}" +
+ ".release-link:hover{color:var(--green);}";
+
+/* ------------------------------------------------------------------ *
+ * Hand-tokenized document source
+ * ------------------------------------------------------------------ */
+
+/**
+ * One run of source text. A bare string is unstyled; a tuple carries the
+ * token class the design system paints it with, and `bold` is the Markdown
+ * structure (headings) that reads at full weight rather than as a token.
+ */
+type Tok = string | ["key" | "str" | "mod" | "dim" | "bold", string];
+
+const key = (text: string): Tok => ["key", text];
+const str = (text: string): Tok => ["str", text];
+const mod = (text: string): Tok => ["mod", text];
+const dim = (text: string): Tok => ["dim", text];
+const bold = (text: string): Tok => ["bold", text];
+
+const TOK_CLASS = {
+ key: "tok-key",
+ str: "tok-str",
+ mod: "tok-mod",
+ dim: "tok-dim",
+} as const;
+
+/** Source lines, joined with newlines so `` lays them out. */
+function Source({ lines }: { lines: Tok[][] }) {
+ return (
+ <>
+ {lines.map((parts, line) => (
+
+ {line > 0 ? "\n" : null}
+ {parts.map((part, i) =>
+ typeof part === "string"
+ ? part
+ : part[0] === "bold"
+ ? {part[1]}
+ : {part[1]}
+ )}
+
+ ))}
+ >
+ );
+}
+
+const RELEASE_MD: Tok[][] = [
+ [bold("# Release")],
+ [],
+ ["Run the tests."],
+ [],
+ ["```bash ", mod("exec")],
+ ["deno task test"],
+ ["```"],
+ [],
+ ["Now decide how these changes should be"],
+ ["versioned."],
+ [],
+ [key("")],
+ [],
+ [
+ key(""),
+ ],
+ [" ", key("")],
+ [" Which version bump do these changes"],
+ [" require? Return JSON matching:"],
+ [],
+ [" ", key("")],
+ [],
+ [" ```bash ", mod("exec")],
+ [" git log --oneline main..HEAD"],
+ [" ```"],
+ [" ", key("")],
+ [key("")],
+ [],
+ [
+ key(""),
+ ],
];
-/** What each step of the "See it" document does, numbered to match. */
-const NOTES: { n: string; body: ComponentChildren; model?: boolean }[] = [
- {
- n: "1",
- body: (
- <>
- {""} deterministically selects the instruction files.
- >
- ),
- },
- {
- n: "2",
- body: (
- <>
- {""}{" "}
- applies the same read procedure to every selected path.
- >
- ),
- },
- {
- n: "3",
- body: (
- <>
- {""}{" "}
- reads through the contextual filesystem capability.
- >
- ),
- },
- {
- n: "4",
- model: true,
- body: (
- <>
- {""}{" "}
- is the one explicitly probabilistic judgment step, and the one step that
- spends model tokens.
- >
- ),
- },
- {
- n: "5",
- body: (
- <>
- The write form of {""}{" "}
- atomically saves the review at a declared path.
- >
- ),
- },
- {
- n: "6",
- body: "The read form renders the saved artifact back into the document.",
- },
+const README_MD: Tok[][] = [
+ [dim("---")],
+ [dim("props:")],
+ [dim(" package:")],
+ [dim(" type:"), " ", str("string")],
+ [dim(" pattern:"), " ", str('"^packages/[a-z0-9._-]+$"')],
+ [dim("---")],
+ [],
+ [bold("## Setup")],
+ [],
+ ["```bash ", mod("exec")],
+ ["deno task setup"],
+ ["```"],
+ [],
+ [bold("## Test")],
+ [],
+ [bold("### Complete")],
+ [],
+ ["```bash ", mod("timeout=30m exec")],
+ ["deno task verify"],
+ ["```"],
+ [],
+ [bold("## Bootstrap")],
+ [],
+ [key("")],
];
-const FITS: { title: string; body: string }[] = [
- {
- title: "Release and repository procedures",
- body:
- "Files, branches, commits, pull requests, tests, and review steps expressed as one readable process.",
- },
- {
- title: "Repeatable AI-assisted work",
- body:
- "Deterministic structure around visible probabilistic steps such as agents and sampling, with inputs and outputs named in the document.",
- },
- {
- title: "Operational runbooks",
- body:
- "Documentation that can collect input, branch, retry, and eventually suspend or continue when those contracts ship.",
- },
+const AGENTS_MD: Tok[][] = [
+ [bold("## Architect")],
+ [key("")],
+ [],
+ [bold("## Implementor")],
+ [
+ key(""),
+ ],
+ [],
+ [bold("## Reviewer")],
+ [key("")],
];
-const AMORTIZATION = [
- "authoring and improving the executable procedure has an up-front reasoning cost;",
- "deterministic steps do not incur repeated LLM interpretation on every run;",
- "per-run token cost is limited to the explicit agent or sampling steps the workflow contains; and",
- "reduced interpretation also reduces latency, variance, retries, and human supervision.",
+const IMPLEMENTOR_MD: Tok[][] = [
+ [key("")],
+ [" ", key("")],
+ [" ", key("")],
+ [" You're an implementor agent."],
+ [
+ " ",
+ key(""),
+ ],
+ [" Implement this ticket:"],
+ [
+ " ",
+ key(""),
+ ],
+ [" ", key("")],
+ [
+ " ",
+ key(""),
+ ],
+ [
+ " ",
+ key(""),
+ ],
+ [" ", key("")],
+ [" ", key("")],
+ [key("")],
];
+const SCOPES_MD: Tok[][] = [
+ [key("")],
+ [" ", key("")],
+ [
+ " ",
+ key(""),
+ ],
+ [" ", key("")],
+ [key("")],
+];
+
+const WRAPPERS_MD: Tok[][] = [
+ [key("")],
+ [
+ " ",
+ key(""),
+ ],
+ [
+ " ",
+ key(""),
+ ],
+ [" ", key("")],
+ [
+ " ",
+ key(""),
+ ],
+ [
+ " ",
+ key(""),
+ ],
+ [" ", key("")],
+ [key("")],
+];
+
+const LOOP_MD: Tok[][] = [
+ [key("")],
+ [" ", key("")],
+ [" ", mod("{proposalCandidate}")],
+ [" ", key("")],
+ [],
+ [
+ " ",
+ key(""),
+ ],
+ [" ", key("")],
+ [" ", key("")],
+ [" ", key("")],
+ [" Correct your previous response"],
+ [" without changing its meaning."],
+ [" Return only corrected JSON matching"],
+ [" the supplied result contract."],
+ [" ", key("")],
+ [" ", key("")],
+ [" ", key("")],
+ [key("")],
+];
+
+const PARSE_MD: Tok[][] = [
+ [key("")],
+ [
+ key(""),
+ ],
+ [
+ " ",
+ key(""),
+ "Which version bump is required?",
+ key(""),
+ ],
+ [key("")],
+];
+
+const ELICIT_MD: Tok[][] = [
+ [
+ key("")],
+ [" Publish this release?"],
+ [key("")],
+];
+
+const HANDOFF_MD: Tok[][] = [
+ [key("")],
+ [
+ key(""),
+ ],
+];
+
+/* ------------------------------------------------------------------ *
+ * Page pieces
+ * ------------------------------------------------------------------ */
+
/** An inline identifier: monospace, at full contrast against body prose. */
-function Term(
- { warn, children }: { warn?: boolean; children: ComponentChildren },
-) {
+function Term({ children }: { children: ComponentChildren }) {
return (
- {children}
+ );
+}
+
+/** The shell prompt that opens each line of a terminal slab. */
+function Prompt() {
+ return (
+ $
+ );
+}
+
+/** A ruled arrow chain, e.g. `Repository → Worktree → Implementor`. */
+function Chain({ steps, boxed }: { steps: string[]; boxed?: boolean }) {
+ return (
+
- {children}
-
+ {steps.map((step, i) => (
+
+ {step}
+ {i < steps.length - 1
+ ? →
+ : null}
+
+ ))}
+
);
}
-/** `review-instructions.md`, hand-tokenized. */
-function ReviewDocument() {
- const tag = "tok-key";
+/** The rule-and-arrow that carries the eye from one durability step to the next. */
+function Descent() {
return (
- <>
- {"# Review repository instructions"}
- {"\n\n"}
- {"
- {" include"}
- =
- {"{["}
- "**/AGENTS.md"
- {"]}"}
- {" as"}
- =
- "instructionPaths"{" "}
- {"/>"}
- {"\n\n"}
- {"
- {" in"}
- =
- {"{instructionPaths}"}
- {" let"}
- =
- "path"
- {" as"}
- =
- "instructions"
- {">"}
- {"\n"}
-
- {" ## "}
- {"{path}"}
+
+
+
+ ↓
- {"\n\n "}
-
{"
- {" path"}
- =
- {"{path}"} {"/>"}
- {"\n"}
- {""}
- {"\n\n"}
- {""}
- {"\n "}
- {"
- {" as"}
- =
- "review"
- {">"}
- {"\n Review these repository instructions for contradictions\n and missing safeguards.\n\n "}
- {"{instructions}"}
- {"\n "}
- {""}
- {"\n"}
- {""}
- {"\n\n"}
- {"
- {" path"}
- =
- "reports/instruction-review.md"
- {">"}
- {"\n"}
- {" # Instruction review"}
- {"\n\n "}
- {"{review}"}
- {"\n"}
- {""}
- {"\n\nThe saved report:\n\n"}
- {"
- {" path"}
- =
- "reports/instruction-review.md"{" "}
- {"/>"}
- >
+
);
}
-/** `hello-world.md`, hand-tokenized. */
-function HelloWorld() {
- const tag = "tok-key";
- const open = (name: string, prop: string, value: string, close: string) => (
- <>
- {`<${name}`}
- {` ${prop}`}
- =
- {`"${value}"`}
- {close}
- >
+/** A numbered durability step. */
+function Step(
+ { n, title, experimental, children }: {
+ n: string;
+ title: string;
+ experimental?: boolean;
+ children: ComponentChildren;
+ },
+) {
+ return (
+
+
+ {n}
+
{title}
+ {experimental
+ ? (
+
+ Experimental
+
+ )
+ : null}
+
+ {children}
+
);
+}
+
+/** One of the three runtimes the same CLI installs under. */
+const RUNTIMES: { name: string; body: string; lines: string[][] }[] = [
+ {
+ name: "Deno",
+ body: "Run the CLI directly from JSR.",
+ lines: [[
+ " deno run -A \\\n jsr:@executablemd/cli \\\n run README.md",
+ ]],
+ },
+ {
+ name: "Node",
+ body: "Install the CLI from npm, then run the same command.",
+ lines: [[" npm install -g \\\n @executablemd/cli"], [
+ " xmd README.md --help",
+ ]],
+ },
+ {
+ name: "Bun",
+ body: "Install the same npm package with Bun.",
+ lines: [[" bun add -g \\\n @executablemd/cli"], [
+ " xmd README.md --help",
+ ]],
+ },
+];
+
+/** A terminal slab whose lines each open with a prompt. */
+function Terminal({ lines }: { lines: string[][] }) {
return (
- <>
- {open("AnthropicProvider", "model", "claude-opus-4-5", ">")}
- {"\n "}
- {open("OllamaProvider", "model", "llama3.2", ">")}
- {"\n "}
- {open("Instruction", "system", "You are a creative comedian.", ">")}
- {"\n "}
- {open("Sample", "model", "llama3.2", ">")}
- {"\n Smart: "}
- {"
- {" prompt"}
- =
- "Say something smart"
- {" model"}
- =
- "claude-opus-4-5"{" "}
- {"/>"}
- {"\n Joke: "}
- {"
- {" prompt"}
- =
- "Tell me a joke"
- {" model"}
- =
- "llama3.2" {"/>"}
- {"\n Combine Smart and Joke into one smart joke\n "}
- {""}
- {"\n "}
- {""}
- {"\n "}
- {""}
- {"\n"}
- {""}
- >
+
+ {lines.map((parts, i) => (
+
+ {i > 0 ? "\n" : null}
+
+ {parts}
+
+ ))}
+
);
}
export default define.page(function Home({ url }) {
- const installCmd = `curl -fsSL ${url.origin}/install.sh | sh`;
+ const installCmd = ` curl -fsSL ${url.origin}/install.sh | sh`;
return (
<>
-
+
{/* Hero */}
-
+
- Open source · Early / experimental
+ Open source ·{" "}
+
+ {VERSION}
+
-
- Turn documentation into repeatable workflows.
+
+ Stop rolling the dice in your workflows.
-
- Executable.md keeps procedures readable as Markdown, then gives
- them reusable components, typed inputs, and executable steps so
- the same process can run consistently.
+
+ Workflows described in prose have to be interpreted before
+ anything happens. Humans skim, often skipping important steps.
+ Agents may simply decide that the entire workflow is not relevant.
+ {" "}
+ xmd{" "}
+ removes the interpretation step by making each document a program
+ that only relies on judgment where needed.
-
+
-
-
- Markdown that runs. Standalone binary (built with{" "}
- deno compile) ·
- also runs from source on Deno · CLI command: xmd
-
-
-
-
+
-
Still just markdown
+
What you read is what runs
-
- Standard renderers only read the first word of a fenced code
- block's info string, so exec,{" "}
- eval, and every modifier stay invisible to
- GitHub, your editor, and any markdown viewer. The procedure
- stays a document your team can read, review in a pull request,
- and diff — maintaining the workflow is the same work as
- maintaining the docs.
+
+ There is no workflow hidden behind the document. The document
+ is the workflow.
-
- reviewable in a PR
- renders anywhere
- no new file format
-
+
+
+
- {/* How it works */}
-
+ {/* The README as a CLI */}
+
-
How it works
-
- A documented procedure becomes named building blocks, then runs
- against the current environment. Detailed mechanics live in the
- {" "}
- docs.
-
+
The README as a CLI.
+
+ Procedure belongs in the document; judgment belongs where the
+ document asks for it. xmd{" "}
+ moves procedure out of probabilistic interpretation and into
+ executable software: tests, file loading, sequencing, retries, and
+ cleanup run as code, while planning, review, interpretation, and
+ design decisions stay with people or agents. Once procedure is
+ executable, documentation does not need a parallel implementation to
+ stay in sync — a README can explain the work to a person and expose
+ the same work as runnable entry points for a CLI or an agent.
+
-
- {STAGES.map((s) => (
-
-
-
{s.step}
- {s.mark === "today"
- ? (
-
- ✓ today
-
- )
- :
→}
+
+
+
+
+
+
+
+
+
-
{s.title}
-
{s.body}
+
Help for the README
+
+ xmd README.md --help{" "}
+ works like help on any other CLI, showing the README's
+ arguments and runnable entrypoints.
+
- ))}
-
-
-
-
- Product direction · not yet shipped
-
-
- Continuation after interruption
-
-
- xmd workflow{" "}
- will execute supported operations in a constrained, retained
- environment so a workflow can reattach and continue. The
- constraint is the point: durable workflows do not require
- arbitrary native command compatibility.
-
-
-
-
-
- xmd run
-
-
- Available now. Ordinary host capabilities. No promise of
- Workspace retention, reattachment, or continuation — a
- successful file write still completes correctly.
-
+
+
+
+
+
Props → CLI arguments
+
+ package becomes{" "}
+ --props-package, with its type and validation
+ coming directly from the README.
+
-
-
- xmd workflow
-
-
- Planned. Durable Workspace-backed capabilities. An unsupported
- imperative operation fails explicitly rather than silently
- falling back to the host.
-
+
+
+
+
+
+
Headings → entrypoints
+
+ Every heading is a runnable entrypoint. Nested headings become
+ nested paths like README.md#Test/Complete.
+
+
+
+ One document serves both audiences: prose explains what is
+ happening, while headings and explicit inputs reveal only the
+ operation needed at the point it is needed.
+
- {/* See it */}
-
+ {/* Agents */}
+
-
See it
-
- This document deterministically discovers and reads every
- repository instruction file, uses an agent only for the judgment
- step, then writes the resulting review. Every structural step
- performs work.
-
+
Stop hoping the agent reads the instructions.
-
- {STEPS.map((s) => (
-
-
-
- {s.title}
-
-
- {s.done ? "✓" : "→"}
-
-
-
- {s.tag}
-
-
- {s.kind}
-
+
+
+
+
+
Run AGENTS.md.
+
+ Run the agent from{" "}
+ AGENTS.md. Do not leave the file as context the
+ agent may or may not discover.
+
- ))}
+
+
+
+
+
Each agent is a Markdown component
+
+ An agent is a Markdown file with agent instructions, and
+ selecting a heading expands that file's component in place.
+
+
+
+
+
+
+
+
+ Architect, Implementor, and Reviewer are semantic roles, not fixed
+ models. Choose the model or provider when you invoke the workflow.
+
+
+
+
+
+
+
+
You control what context the agent gets.
+
+ The previous section made the role explicit; this section
+ makes its prompt explicit. The coding agent will start with
+ the context explicitly declared by its Markdown.{" "}
+ xmd{" "}
+ reads the issue and the files first, then expands{" "}
+ {""}{" "}
+ with them already in hand, instead of the agent guessing what
+ to search for or which tools to call. The agent starts with
+ the intended files already loaded.
+
+
+
+
+
+
+ {/* Runtime */}
+
+
+
The runtime handles the effects.
+
+ Once the prompt is explicit, the runtime can manage the effects
+ safely. You declare the repository, worktree, issue, and prompt
+ inputs; it handles ordering, cancellation, and cleanup.
+
-
-
-
-
+
+
+
+
-
-
- $
- {" "}
- xmd run review-instructions.md --default-agent codex
+
+
Scopes pass context down.
+
+ Repository sets the project.{" "}
+ Worktree sets where the work happens. The nested
+ {" "}
+ Implementor runs there automatically. Its{" "}
+ Session.Launch{" "}
+ names the issue and files that become the prompt. Nothing is
+ discovered from ambient state.
+
+
+
+
+
+
+
Wrappers add context.
+
+ Wrappers add context for everything inside them. The same{" "}
+ Implementor{" "}
+ can run against different repositories, worktrees, or issues
+ without changing its Markdown.
+
+
+
+
+
-
-
What each step does
-
- {NOTES.map((note) => (
-
-
- {note.n}
-
-
{note.body}
-
- ))}
+
+
+
Structured concurrency
+
+
+ Children run with their parent. When the parent ends, the
+ runtime cancels them and clears the values bound inside it.
+
+
+
+
+
Scopes clean up.
+
+ Open a worktree inside a repository and it closes with it. The
+ same is true for scope-bound values. Cleanup happens at the
+ boundary, so context does not leak into the next run.
+
- {/* Economics */}
-
+ {/* Compose */}
+
-
Pay for reasoning once. Run it repeatedly.
-
- Spend tokens defining and improving the workflow—not asking a
- model to reinterpret every deterministic step each time it runs.
-
+
The runtime composes intent.
+
+ When judgment needs another try, a schema, or a handoff, the
+ document says how.
+
-
-
-
Instruction-only document
-
- The entire procedure stays probabilistic on every invocation. A
- model reads it, reconstructs the plan, chooses tools and
- arguments, resolves ambiguities, and often verifies or retries
- the work.
+
+
+
Retries have a limit.
+
+ A loop gives retries a limit. Break when the result is good;
+ otherwise prompt again.
-
-
-
- Executable document
-
-
- A human or AI encodes the stable parts once as a Markdown
- script. File discovery, input validation, control flow,
- filesystem changes, Git effects, and other declared operations
- execute directly. Model calls stay visible in the document and
- are reserved for steps that actually require judgment.
+
+ SafeParse checks the result. If{" "}
+ decides whether it is good enough. Break{" "}
+ stops the loop.
+
+
+ max{" "}
+ is part of the document, so the runtime knows when to stop.
+
+
+
-
-
-
The advantage is amortization
-
- {AMORTIZATION.map((line) => - {line}
)}
-
+
+
+
+
+
+
+
+
-
-
- Not every workflow pays only once
-
-
- A workflow containing {""},{" "}
- {""}, or another probabilistic step still
- spends tokens when that step runs. What stops paying an
- interpretation cost on every execution is the deterministic
- portion.
+
+
Schemas make answers usable.
+
+ Agents often return prose. When the next step needs a value,
+ give it a schema. The runtime checks the answer and passes
+ structured data on.
+
+
+ When a person needs to decide, Elicit{" "}
+ opens the browser form and validates the answer before the
+ workflow continues.
-
- {/* Where it fits */}
-
- Where it fits
-
- {FITS.map((f) => (
-
- ))}
+
+
+
Agents pass values.
+
+ One agent can leave a value in memory for the next. Name it,
+ then pass it as a prop. No hidden conversation and no file
+ needed.
+
+
+ Architect's result is captured as{" "}
+ approvedPlan. Implementor{" "}
+ receives it as{" "}
+ plan. The handoff is explicit and deterministic.
+
+
+ Roles stay the same even when the model changes. Pick the model
+ and provider when you run the workflow.
+
+
+ Memory lives only in this run and its nested scopes.
+
+
+
+
+
- {/* One document, two models */}
-
-
-
- One document, two models.
-
-
- A deeper example of composition.{" "}
- {""} and{" "}
- {""}{" "}
- nest inside a single markdown file. {""}{" "}
- routes prompts to a cloud model and a local model, then combines
- the results — no orchestration code, just markdown.
+ {/* Durability */}
+
+
+
+ A retry must not repeat an external side effect. Once a workflow
+ can act outside the process, it needs a record of what already
+ happened.
-
- Provider docs →
-
-
-
-
-
-
-
- {/* Get started */}
-
- Get started
-
-
-
Install script
-
- Standalone binary, no runtime required.
-
-
- {installCmd}
-
+
+
The run can outlive the process.
-
-
Deno users
-
- Or run it straight from JSR, with no install at all.
-
-
-
- {"deno run -A jsr:@executablemd/cli run doc.md"}
-
-
-
-
-
Prebuilt binary
-
- Download for your platform from{" "}
-
- GitHub Releases
- .
-
-
- {"xmd run path/to/doc.md"}
-
+
+ Once the runtime manages the effects, the workflow can survive the
+ process that started it. A process can stop while work remains, so
+ the run needs a record of what happened.
+
+
+
+
+
+
+ Add --journal{" "}
+ when you want a diagnostic JSONL trace. It shows what ran and
+ where it stopped. It is for this run, not retained workflow
+ history.
+
+
+
+
+
+
+
+
+ Workflow mode is experimental. It keeps its own journal and
+ effect records. That history is separate from{" "}
+ --journal, and replay can reuse completed
+ effects.
+
+
+
+
+
+
+
+
+ "]]}
+ />
+
+
+ Resume reads the workflow history. It recognizes completed
+ work, reuses it, and stops at the first unresolved boundary
+ instead of repeating an external effect.
+
+
+
+
+
+
+
+ If CI fails after some effects finish, those completions stay
+ recorded. Fix the cause and resume. Only the unresolved part
+ needs attention.
+
+
+
+
+ The run is still useful after the process stops. Its journal and
+ effects make it inspectable, replayable, and repairable.
+
- {/* Early, and open */}
-
- Early, and open.
-
- executable.md is a first public release and a draft spec. It's built
- for experimentation with executable markdown workflows,
- Effection-based evaluation, and provider-driven AI documents.
- Feedback, issues, and contributions are very welcome.
+ {/* Install */}
+
+
+
Install once. Run anywhere.
+
+
+ The standalone binary needs no runtime. The same CLI also runs under
+ Deno, Node, and Bun.
-
-
+
+
+
>
);
});