mdv
CLAUDE.md510 starsChanged 21 days agoMITView on GitHub
MDV is a Markdown-superset format for authoring documents, dashboards, and slides with embedded data and visualizations. v0.2.0 ships @mdv/core, @mdv/cli, and a VS Code extension. This project follows spec-driven development (the DeepLearning.AI / JetBrains Spec-Driven Development with Coding Agents workflow). Specs come before code. specs/ is maintainer-local and gitignored; it is not in the published repo. Read the constitution before any non-trivial change: Each roadmap phase gets specs/YYYY-MM-DD-<feature-name>/: specs/2026-04-18-mdv-v1/ is the retroactive spec for the original v1 build. Without the…
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 69
Spec first: If a request conflicts with the constitution or a feature spec, flag it rather than silently diverging.
- Distinctive: line 84
Never dismiss a code-scanning or Dependabot alert, and never bypass secret push protection.
- Distinctive: line 85
Never commit credentials, tokens, or absolute local paths.
- Distinctive: line 86
Never discuss an unfixed vulnerability in a public issue, PR, or commit message.
- Very specific: line 88
Treat .mdv content, front-matter, data files, and CLI arguments as untrusted.
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project
MDV is a Markdown-superset format for authoring documents, dashboards, and slides with embedded data and visualizations. v0.2.0 ships @mdv/core, @mdv/cli, and a VS Code extension.
Spec-driven development
This project follows spec-driven development (the DeepLearning.AI / JetBrains Spec-Driven Development with Coding Agents workflow). Specs come before code.
The constitution
specs/ is maintainer-local and gitignored; it is not in the published repo. Read the constitution before any non-trivial change:
specs/mission.md: purpose, audiences in priority order, immutable principles, and non-goalsspecs/tech-stack.md: stack, dependency policy, and known gapsspecs/roadmap.md: small phases, in order. The next phase is the first one not marked complete.
Feature specs
Each roadmap phase gets specs/YYYY-MM-DD-<feature-name>/:
requirements.md: scope, decisions, and contextplan.md: numbered task groupsvalidation.md: how we know it's done and mergeable
specs/2026-04-18-mdv-v1/ is the retroactive spec for the original v1 build.
The loop (one phase per branch: phase-<N>-<kebab-name>, cut from dev)
- Spec: the
/feature-specskill (.claude/skills/feature-spec/) creates the branch, interviews the user, and writes the three files. Don't write files before the interview. - Implement: work through
plan.mdgroup by group. Keep the spec in sync if the plan changes. - Validate and ship: the
/feature-shipskill runs thevalidation.mdchecks and reconciles the specs with reality (replanning). It then ticks the roadmap, runs/changelog, and opens a PR intodev. - Replan whenever implementation contradicts the constitution: update
mission.md/tech-stack.md/roadmap.mdfirst, then code. Crossing a non-goal requires the owner's explicit approval.
Without the specs (for example, an external contributor), the core decisions below are the contract.
Core Product Decisions (locked 2026-04-18)
These are non-negotiable constraints agreed with the owner. Do not revisit them without explicit approval. They are elaborated in specs/mission.md.
- Audience: non-technical authors (analysts, writers) come first. No selectors, classes, expressions, or code in the authoring surface. Secondary audiences: developers embedding
@mdv/core, and docs-as-code/CI teams. - Format: a strict superset of CommonMark. Every valid
.mdis a valid.mdv. Only additions, never changes to core Markdown syntax. Graceful degradation in plain MD viewers is a first-class requirement. - Syntax additions (only these):
- YAML front-matter for document-level config (
theme,data:,styles:,locale). - Fenced code blocks with info-string options for data and charts:
```chart type=bar x=col y=col. :::container directives for styled regions and layout (::: callout,::: columns/::: col,::: toc).- Info strings use
key=value(quoted strings allowed). No JSON, no JS in options.
- YAML front-matter for document-level config (
- Styling model: built-in themes plus named styles that authors define in front-matter. Flat vocabulary only: color, spacing, typography, layout. No per-element overrides.
- Data: inline CSV (the default), inline JSON (opt-in via
format=json), or a named dataset referencing a local file (./data/sales.csv). No URLs and no transformations. - Visualizations:
table,stat(KPI cards), andchart type=bar|line|pieas inline SVG. Bar and line charts acceptyFormat=currency|percent|thousands. - Exports: self-contained HTML (
mdv render) and PDF (mdv export --pdf, via puppeteer).
Architecture
Monorepo using npm workspaces:
packages/mdv-core: the parser (markdown-it base,html: false), AST, and HTML/SVG renderer. Pure TypeScript with no DOM dependencies. It has an in-house SVG chart renderer, with no Chart.js or D3.packages/mdv-cli: themdv render | export | preview | versioncommands.packages/mdv-vscode: a VS Code extension providing side-by-side webview preview. It loads core through dynamicimport("@mdv/core")(a CJS-to-ESM bridge).@types/vscodeis pinned toengines.vscode.scripts/build-site.mjs: builds the GitHub Pages landing site and gallery.
Pipeline: .mdv → fence-aware ::: pre-pass → markdown-it → mdv extension pass (front-matter, fenced blocks, containers, data resolution) → mdv AST → HTML renderer → self-contained HTML.
Working Conventions
- Spec first. If a request conflicts with the constitution or a feature spec, flag it rather than silently diverging.
- YAGNI is enforced. New chart types, style keys, or data sources each need a roadmap phase.
- Deterministic output. Renderer output (HTML, SVG) must be byte-stable for identical input.
- Errors never crash the document. Block-level errors render an inline red banner and sibling blocks continue. Fatal errors render a top-of-document banner. Warnings render a yellow banner while the block renders with a fallback.
- No new runtime dependencies without the owner's approval.
- Never push to
devormaindirectly, and never merge PRs yourself. Both are protected by rulesets. See "Branching & security" below.
Branching & security
Full detail is in CONTRIBUTING.md and SECURITY.md.
devis the default branch and the integration branch. Every branch is cut fromdev, and every PR targetsdev, which uses squash merge. The one exception ishotfix/*, which is cut frommainand targetsmain.mainholds released code only. It receives release PRs (dev→main, titledrelease: vX.Y.Z) and hotfixes, both merged with a merge commit, never a squash. After a hotfix, back-mergemain→devwith a merge commit.- Required checks on both branches:
Build & test (Node 20/22),Analyze (javascript-typescript),Analyze (actions), andDependency review. There is also a CodeQL merge gate: new high- or critical-severity alerts block the PR.mainadditionally requires 1 approving review. The owner bypasses that only through a PR. - Security rules for agents:
- Never dismiss a code-scanning or Dependabot alert, and never bypass secret push protection. Fix the problem, or report it to the owner.
- Never commit credentials, tokens, or absolute local paths.
- Never discuss an unfixed vulnerability in a public issue, PR, or commit message. Those go through private advisories (SECURITY.md).
- A failing CodeQL or dependency-review check is a blocker, not noise. Fix it on the same branch.
- Treat
.mdvcontent, front-matter, data files, and CLI arguments as untrusted. Escape output (escapeHtml), keep regexes linear-time, and keep data paths inside the document directory.
Commands
npm ci # install (Node ≥ 20)
npm run build # core → cli → vscode, in dependency order
npm test # node:test via tsx (packages/mdv-core/test)
node packages/mdv-cli/dist/index.js render <file.mdv> [--out <path>] [--strict]
node packages/mdv-cli/dist/index.js preview <file.mdv> [--port <n>]
node packages/mdv-cli/dist/index.js export <file.mdv> --pdf [--out <path>] [--page-size letter|a4]
npm run build:site # GitHub Pages site → site/
cd packages/mdv-vscode && npx vsce package --no-dependencies # build the .vsixDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

