Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Markdown Diagram Renderer

markdown.render_diagrams

ProductionEngine wrapper (Class A)verifiablemoderatev1.0.0
File inputNo network

Overview

You send Markdown containing exact ```mermaid fenced blocks. An evidence-backed allowlist of 25 Mermaid families is rendered by an identity-bound isolated worker and sanitized with a closed SVG policy. Unsupported families, caller configuration, HTML labels, scripts, click directives, URLs, CSS, and arbitrary Mermaid options are rejected. Other code fences remain ordinary code. Accepts file input via file_ref — no need to extract file content first.

Mermaid needs an isolated deterministic runtime and a separate closed SVG security boundary; ordinary Markdown rendering cannot safely provide that.

Reliability

STRICT for Mermaid 11.16.0, the pinned light DOM, Noto Sans package, worker identity, parser, theme, and SVG policy. The allowlist is closed and evidence-backed from the full-family spike: 25 SUPPORTED, kanban deferred as SUPPORTED_WITH_LIMITS, and remaining families UNSUPPORTED with proved reasons. Failures include DIAGRAM_SYNTAX_INVALID, DIAGRAM_TYPE_UNSUPPORTED, RENDERER_BUSY, RENDER_TIMEOUT, INTERNAL_RENDERER_UNAVAILABLE, DIAGRAM_SANITIZATION_FAILED, OUTPUT_LIMIT_EXCEEDED, MARKDOWN_INVALID_ENCODING (re-encode the source as UTF-8), and MARKDOWN_COMPLEXITY_LIMIT (split or simplify a document exceeding the fixed node or nesting cap).

Context footprint

At most 50 diagrams, 50000 characters per diagram, 1000000 bytes per SVG, 2000000 aggregate output bytes, and 30000 ms per diagram. A successful call costs 5 execution credits.

When to use it

When a Markdown document contains one of the 25 evidence-backed Mermaid families.

When diagrams need interaction, external resources, caller configuration, or a Mermaid family outside the SUPPORTED allowlist (for example gantt, mindmap, sankey, architecture, kanban, flowchart-elk). Upstream Mermaid support alone does not make a family supported here.

Powered by Mermaid 11.16.0 on pinned jsdom/svgdom and Noto Sans.

Scope

Note
Renders supported Mermaid fenced blocks inside one Markdown document.

Non-goals

  • No arbitrary Mermaid configuration
  • No HTML labels
  • No click handlers
  • No URL loading
  • No caller CSS
  • No diagrams outside exact mermaid fences

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

document-processingformatting

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call5 credits

File handling

Accepts file_refProduces file_refMax input488.3 KBMax file size488.3 KB

File limits

Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.

LimitValueLimited by
Maximum size per input file488.3 KiBSkill maximum

How we handle your data

Sensitive output possible
What this means

This skill may receive sensitive content and may return submitted, transformed, extracted, or reformatted content.

Squillify guarantees
  • Runs inside Squillify using a self-contained open-source component
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Self contained open source component
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response may contain submitted or transformed content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
markdownstringNoInline Markdown up to 200000 characters. Required unless file_ref is present; omit only when file_ref is present. If both are present, file_ref wins and _meta._input_conflict_resolved reports it.
file_refstringNoTenant-scoped strict UTF-8 Markdown file up to 500000 bytes. When omitted, the inline markdown field is used.
profilestringNocommonmark, gfm, or squillify-safe; defaults to squillify-safe.
themestringNosquillify (default) applies the fixed Squillify Design System palette and document chrome; neutral, default, or dark preserve Mermaid's legacy palettes.
includeCssbooleanNoEmbed the scoped Squillify Design System stylesheet when theme is squillify; defaults to true.
includeSourcebooleanNoInclude original Mermaid source in each diagram object; defaults to false.
errorPolicystringNopreserve_source (default) keeps invalid fences with a warning; fail rejects the call.
accessibilityobjectNoOptional bounded plain-text title and description applied to accessible SVG; when omitted, no caller accessibility override is applied.
maxDiagramsintegerNoMaximum accepted diagrams, 1..50; defaults to 50.
timeoutMsintegerNoPer-diagram worker timeout, 1..30000 milliseconds; defaults to 5000.

Output schema

FieldTypeRequiredDescription
htmlstringYesSanitized rendered Markdown HTML.
diagramsarrayYesFrom 0 through 50 closed sanitized diagram result objects in source order.
warningsarrayYesFrom 0 through 50 closed skipped-diagram warning objects in source order.
_metaobjectYesClosed receipt containing parser, renderer, sanitization, and bounded-execution provenance.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"markdown.render_diagrams","input":{"markdown":"```mermaid\nflowchart LR\nA --> B\n```"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("markdown.render_diagrams", {"includeCss":false,"accessibility":{"title":"Flow","description":"A to B"},"markdown":"```mermaid\nflowchart LR\nA --> B\n```"});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
DIAGRAM_SYNTAX_INVALID400NoThe request payload failed this skill's input validation.
DIAGRAM_TYPE_UNSUPPORTED400NoThe request payload failed this skill's input validation.
RENDERER_BUSY429YesA size, quota, rate, or time limit was exceeded.
RENDER_TIMEOUT503YesA dependency required by this skill is unavailable.
INTERNAL_RENDERER_UNAVAILABLE503YesA dependency required by this skill is unavailable.
DIAGRAM_SANITIZATION_FAILED500NoThe skill encountered an unexpected execution failure.
MARKDOWN_INVALID_ENCODING400NoThe request payload failed this skill's input validation.
MARKDOWN_COMPLEXITY_LIMIT429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • No arbitrary Mermaid configuration
  • No HTML labels
  • No click handlers
  • No URL loading
  • No caller CSS
  • No diagrams outside exact mermaid fences
  • Interactive diagrams
  • Custom Mermaid themes
  • Untrusted external resources

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "markdown.render_diagrams",
  "input": {
    "includeCss": false,
    "accessibility": {
      "title": "Flow",
      "description": "A to B"
    },
    "markdown": "```mermaid\nflowchart LR\nA --> B\n```"
  }
}

Examples

Render a flowchart

Inputjson
{
  "includeCss": false,
  "accessibility": {
    "title": "Flow",
    "description": "A to B"
  },
  "markdown": "```mermaid\nflowchart LR\nA --> B\n```"
}
Expected outputjson
{
  "_meta": {
    "themeVersion": "sqfy-markdown-v2",
    "_input_conflict_resolved": false,
    "inputChars": 23,
    "rendererVersion": "11.16.0",
    "parserVersion": "0.24.0",
    "sanitized": true,
    "diagramCount": 1,
    "truncated": false,
    "parser": "commonmark",
    "cssIncluded": false,
    "inputBytes": 23,
    "renderer": "mermaid",
    "profile": "squillify-safe",
    "theme": "squillify",
    "nodeCount": 2,
    "profileVersion": "1"
  },
  "warnings": [],
  "diagrams": [
    {
      "index": 0,
      "type": "flowchart",
      "svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" role=\"img\">...</svg>",
      "sourceRange": {
        "start": {
          "line": 1,
          "offset": 0,
          "column": 1
        },
        "end": {
          "line": 4,
          "offset": 35,
          "column": 4
        }
      },
      "title": "Flow",
      "description": "A to B",
      "error": null
    }
  ],
  "html": "<article class=\"sqfy-markdown sqfy-markdown-v2 sqfy-theme-squillify sqfy-markdown-diagrams\"><div class=\"sqfy-diagram-slot\"><figure>...</figure></div></article>"
}

Preserve source for a rejected diagram

Inputjson
{
  "includeCss": false,
  "errorPolicy": "preserve_source",
  "markdown": "```mermaid\ngantt\ntitle Unsupported\n```"
}
Expected outputjson
{
  "_meta": {
    "themeVersion": "sqfy-markdown-v2",
    "_input_conflict_resolved": false,
    "inputChars": 31,
    "rendererVersion": "11.16.0",
    "parserVersion": "0.24.0",
    "sanitized": true,
    "diagramCount": 1,
    "truncated": false,
    "parser": "commonmark",
    "cssIncluded": false,
    "inputBytes": 31,
    "renderer": "mermaid",
    "profile": "squillify-safe",
    "theme": "squillify",
    "nodeCount": 2,
    "profileVersion": "1"
  },
  "warnings": [
    {
      "index": 0,
      "code": "DIAGRAM_RENDER_SKIPPED"
    }
  ],
  "diagrams": [
    {
      "index": 0,
      "type": "gantt",
      "svg": "",
      "sourceRange": {
        "start": {
          "line": 1,
          "offset": 0,
          "column": 1
        },
        "end": {
          "line": 4,
          "offset": 41,
          "column": 4
        }
      },
      "title": null,
      "description": null,
      "error": {
        "message": "The diagram could not be rendered.",
        "code": "DIAGRAM_TYPE_UNSUPPORTED"
      }
    }
  ],
  "html": "<article class=\"sqfy-markdown sqfy-markdown-v2 sqfy-theme-squillify sqfy-markdown-diagrams\"><pre><code class=\"language-mermaid\">gantt\ntitle Unsupported\n</code></pre></article>"
}
  • Architecture and workflow documentation
  • Accessible SVG diagrams embedded in Markdown

Avoid for

  • Interactive diagrams
  • Custom Mermaid themes
  • Untrusted external resources

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

formattingmarkdowndocument