Open-source diagrams as code · Mermaid-style, with motion

Animated architecture diagrams from plain text.

Write architecture flows, sequence diagrams, infrastructure explainers, and product walkthroughs in MarkdyScript. Markdy renders browser-native motion graphics that stay reviewable, versioned, and AI-friendly.

Try the PlaygroundLearn the Syntax
architecture.markdy
// architecture.markdy
scene "Checkout Request" theme=paper
layout LR

browser WebApp
service CheckoutApi
database OrdersDb

beat main:
  show $nodes stagger=80ms
  WebApp -> CheckoutApi "GET /orders" -> OrdersDb "query"
  WebApp <- CheckoutApi "200 OK"
pnpm add -D @markdy/cli
# validate, format, and preview a scene
markdy lint trailer.markdy
markdy fmt trailer.markdy --write
markdy render trailer.markdy --out dist/trailer.html
markdy check-all examples
pnpm add @markdy/astro
---
import { Markdy } from "@markdy/astro";

const code = `
  scene "Request" theme=paper width=800 height=400
  browser WebApp
  service CheckoutApi
  beat main:
    show $nodes
    WebApp -> CheckoutApi "GET /users"
`;
---

<Markdy {code} width={800} height={400} bg="#07111f" autoplay />
pnpm add @markdy/mdx react react-dom
// mdx.config.mjs — one-time setup
import { remarkMarkdy } from "@markdy/mdx";

export default {
  remarkPlugins: [remarkMarkdy],
};

// content.mdx — no imports, just write markdown
```markdy
scene "Request" theme=paper
browser WebApp
service CheckoutApi
beat main:
  show $nodes
  WebApp -> CheckoutApi "GET /users"
```

Key Features

🧭

Animated diagrams as code

Script system architecture diagrams, sequence flows, and product walkthroughs in reviewable text.

🌐

Browser-native motion

Web Animations API + CSS transforms. No Canvas, video export pipeline, GSAP, or heavy runtime.

🤖

AI-agent friendly

Constrained MarkdyScript is easier for LLMs to generate, validate, diff, and revise than raw JavaScript.

🧩

Docs-first integrations

Use it in Astro, MDX, content sites, docs portals, and internal developer education.

Lightweight Packages for Docs-as-Code Animation

Write portable .markdy scenes first. Use packages for validation, docs embeds, editor tooling, previews, and custom playback.

Animated Architecture Playground

Start from a real shipped architecture-as-code example, tweak the script, and preview the motion instantly.

Editor
Ctrl+Space autocomplete · Cmd+Enter run
Embedded Preview
0:00 / 0:00

Learn MarkdyScript

Follow a progressive learning path from the smallest runnable scene to production-grade architecture choreography. Each level teaches one practical skill, includes a runnable example, and ends with a task that proves you are ready for the next concept.

1

Level 1: Scene Shell

Objective: create the smallest complete MarkdyScript scene: a title, a layout direction, declared nodes, and one reveal beat.

scene "Request Path" theme=paper
layout LR

browser WebApp
service ApiServer

beat reveal:
  show $nodes stagger=60ms
StepActionWhy it matters
1Add sceneNames the diagram and picks the semantic palette.
2Add layout LRLets Markdy place nodes left-to-right without coordinates.
3Declare every nodeFlow lines can only reference ids that already exist.
4Add a beatBeats are the timeline sections that contain animation cues.

Ready task: Add database Postgres to the scene. If show $nodes reveals all three nodes, move to Level 2.

2

Level 2: Semantic Nodes

Objective: choose node kinds that explain the architecture, then use readable ids so labels can be generated automatically.

user Customer
browser WebApp
gateway ApiGateway
service CheckoutApi
database OrdersDb
queue OrderEvents
Kind familyCommon kindsUse when you mean
Clientuser, browser, clientHumans, apps, and entry points.
Computeservice, api, workerCode that handles requests or jobs.
Datadatabase, cache, bucketState, files, and fast lookup layers.
Messagingqueue, topic, streamAsync events and background work.

Prefer ids like CheckoutApi and OrdersDb. Markdy renders them as Checkout API and Orders DB, so quoted labels are only needed for unusual display text.

Ready task: Add cache RedisCache. If the rendered card has the cache role and a readable label, move to Level 3.

3

Level 3: Request Flow

Objective: describe what happens between nodes using directed flow lines inside a beat. Labels belong after the target they describe.

WebApp -> CheckoutApi "POST /checkout"
CheckoutApi ~> OrderEvents "order.created"
WebApp <- CheckoutApi "201 Created"
OperatorUse it forRendered intent
->Calls, writes, readsSolid request edge.
<-Returns and acknowledgementsDashed response edge back to the caller.
~>Publishes and async jobsDotted event edge.
--Static dependencyThin relationship edge.

Keep labels short and action-oriented: persist, enqueue, cache hit. Long prose belongs in surrounding docs, not edge labels.

Ready task: Add a RedisCache node and one CheckoutApi -> RedisCache "cache write" edge. If every id is declared and the flow renders, move to Level 4.

4

Level 4: Beats & Cues

Objective: split a diagram into narrative beats so viewers can follow setup, traffic, async work, and emphasis in sequence.

beat highlight:
  glow data color=#22c55e & focus CheckoutApi zoom=1.1
CueUse it whenCommon options
showIntroducing nodes or groups.stagger, dur
glowMarking the important path.color, strength
focusCalling attention to one node.zoom, dur
&Running two cues together.Place it between cues on one line.

Name beats after the story moment: intro, traffic, publish, finish. This makes generated scenes easier for people and LLMs to revise.

Ready task: Add a finish beat that glows CheckoutApi and OrdersDb together. If the story still reads in order, move to Level 5.

5

Level 5: Subsystem Groups

Objective: organize real systems into named tiers, then target each tier with one cue instead of repeating node ids everywhere.

group ingress: WebApp ApiGateway
group data: RedisCache OrdersDb

beat layout:
  show ingress & show data stagger=70ms
PatternWhy it scales
group ingress: ...Names an architectural tier.
show ingressReveals the whole tier without repeating ids.
glow dataHighlights all related stateful components at once.

Groups are especially useful in AI-generated diagrams because they give the model reusable targets and reduce typo-prone repeated node lists.

Ready task: Add an async group with a queue and worker, reveal it in layout, and send one ~> event into it. Then move to Level 6.

6

Level 6: Reusable Patterns

Objective: remove repeated flow choreography by defining a pattern once and applying it to different node pairs.

pattern lookup(client, store):
  $client -> $store "lookup"
  $client <- $store "result"
PartWhat to writeWhat happens
Definitionpattern lookup(client, store):Declares reusable cue lines.
Placeholder$client, $storeMarks values to substitute later.
Call siteuse lookup(Api, Db)Expands the pattern with concrete ids.

Patterns should be small and meaningful. If the repeated action has a name people use in architecture reviews, it is a good pattern candidate.

Ready task: Add a second pattern called publish(app, queue) with one ~> event edge, then use it from CheckoutApi to the declared OrderEvents queue. Then move to Level 7.

7

Level 7: Styling & Emphasis

Objective: tune visual meaning without changing the architecture: choose a theme, set direction, and style the path the viewer should remember.

style hot = fill=#f59e0b

service CheckoutApi style=hot
ControlUse it forExample
themeOverall palette.paper, midnight
layoutScene reading direction.LR, TB
stylePersistent node styling.style hot = fill=#f59e0b
glowTimeline emphasis.glow CheckoutApi

Use styles sparingly. One persistent highlight plus one final glow usually reads cleaner than styling every node.

Ready task: Switch the scene between paper/midnight/blueprint/graphite and TB/LR. If the story still reads clearly in both layouts, move to Level 8.

8

Level 8: Production Scene

Objective: combine semantic nodes, groups, beats, flows, patterns, and emphasis into a real architecture explainer that can survive review.

scene "URL Shortener Production Flow" theme=paper width=1280 height=760
layout LR

group ingress: Visitor WebClient ApiGateway
group app: UrlShortener RedirectService
group data: HotUrlCache UrlMappingDb
Production habitWhy it matters
Declare nodes firstMakes every later flow, group, and cue easy to validate.
Group by subsystemLets readers see ingress, app, data, and async tiers before traffic starts.
Use beats as story chaptersKeeps create, redirect, telemetry, and finish concerns separate.
End with emphasisConfirms the main path and persistent state after the animation completes.

When prompting an LLM, ask for this same order: scene metadata, nodes, groups, patterns, beats, then validation against declared ids.

Final task: Build a scene for one real system with at least eight nodes, three groups, four beats, one request, one response, one async event, one pattern, and one final glow. If it validates and a teammate can explain the architecture from the animation, you are ready for independent use.

AI-Friendly Diagram Generation

MarkdyScript is a structured visual DSL that AI agents can generate, validate, diff, and iterate on. Describe the system; get a runnable animated diagram.

How it works

  1. Point your AI to the docs

    Share the AGENT.md — a single all-in-one reference with grammar, actions, patterns and examples.

  2. Describe your scene in plain English

    Tell the AI what you want to visualize: architecture flows, product steps, training scenarios, or tutorial sequences.

  3. Get valid MarkdyScript back

    The AI generates syntactically correct code. Paste it into the playground or your app.

Example prompt

You → Claude / ChatGPT / Copilot
Use https://github.com/HoangYell/markdy-com/blob/main/docs/AGENT.md as a complete reference (grammar, actions, patterns, examples), then write a Markdy scene:

"Create a presentation-quality 1280x720, 60fps system architecture diagram for a URL shortener. Use systems nodes like client, api_gateway, service, cache, and database; set layout LR so auto-layout spreads them left→right; reveal them with show $nodes stagger=60ms; then narrate the write path and read/redirect path across named beat blocks using labeled ->, <-, and ~> flow edges; finish with a glow on the hot path and a focus on the cache."

The AI reads the docs, understands the grammar, and outputs a complete .markdy scene with nodes, groups, routed flow edges, and beat-by-beat choreography — ready to render.

Works with any AI that accepts URL context

ClaudeChatGPTGitHub CopilotCursorWindsurf

Where Markdy Fits

Markdy is built for developer animation workflows where text, version control, docs, and AI generation matter more than timeline-heavy creative tools.

Animated developer documentation

Turn docs-as-code tutorials, onboarding flows, and release notes into compact architecture scenes that stay readable in source control.

Architecture visualization

Show APIs, queues, databases, caches, Kubernetes services, and infrastructure diagrams as animated architecture-as-code.

Mermaid-style text diagrams with motion

Use a text DSL when Mermaid, D2, PlantUML, Graphviz, Excalidraw, or draw.io are too static for a product or systems story.

AI-generated explainer scenes

Give an AI coding agent a plain-English brief and get deterministic MarkdyScript back instead of brittle generated JavaScript.

Diagramming, Animation, and AI Questions

Direct answers for developers comparing Markdy with Mermaid, PlantUML, D2, Graphviz, JavaScript animation libraries, Canvas renderers, and AI-generated code.

What is Markdy?

Markdy is an open-source animation DSL and animated diagram scripting language. You declare architecture nodes, groups, and flow edges in MarkdyScript and sequence them with beats, then render the result in the browser.

Is Markdy a Mermaid alternative?

Markdy overlaps with Mermaid when you want text-based diagrams, but it focuses on animated diagrams, cinematic data flows, and timeline-driven technical explainers. Use Mermaid for static charts; use Markdy when motion and sequence matter.

How is Markdy different from PlantUML, D2, Graphviz, Excalidraw, or draw.io?

Those tools are excellent for static UML, graphs, whiteboards, or architecture diagrams. Markdy is designed for browser-rendered motion: labeled requests, responses, emits, camera direction, glow, reveal, and timed choreography in a text file.

Is Markdy an alternative to GSAP or Framer Motion?

Markdy is not a general UI animation framework replacement. It is focused on declarative, scriptable 2D scenes for documentation, explainers, animated architecture diagrams, demos, and AI-generated animation snippets.

Does Markdy require Canvas or a video renderer?

No. The DOM renderer uses web-native elements, CSS transforms, and the Web Animations API. Scenes can be embedded in normal web pages and Astro projects.

Can AI tools generate MarkdyScript?

Yes. MarkdyScript is intentionally line-based and constrained so tools like Claude, ChatGPT, GitHub Copilot, Cursor, and Windsurf can generate, validate, and revise diagrams from natural-language prompts.

Which packages do I need to render a scene?

Start by writing a .markdy scene. Use @markdy/cli to validate or preview files, @markdy/astro or @markdy/mdx for documentation sites, and @markdy/renderer-dom only when you need a custom browser embed.

Share the Project

Consistent links and descriptions help developers, search engines, and AI tools understand what Markdy is.