Moai Domain Svg Infographic 标志

Moai Domain Svg Infographic

组织热门
modu-ai
moai-domain-svg-infographic

通过先以数值方式计算布局、再编写标记,并使用无头 Chromium 渲染为 2 倍尺寸 PNG,制作可编辑的 SVG 技术信息图,包括架构图、流程图、对比图和层级图。内置优先支持中日韩文字的字体栈、确定性的源代码 lint,以及 mermaid 与 SVG 的选择规则。

Add to TypingMind

概览

发布者modu-ai
代码仓库moai-adk
技能名称moai-domain-svg-infographic
星标数
1.2K
复刻数
226
附带文件
8
许可协议Apache-2.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 8 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 modu-ai 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Moai Domain Svg Infographic AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-domain-svg-infographic
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/modu-ai/moai-adk.git /tmp/moai-adk
mkdir -p .claude/skills
cp -r /tmp/moai-adk/.claude/skills/moai-domain-svg-infographic .claude/skills/moai-domain-svg-infographic
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Moai Domain Svg Infographic,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Moai Domain Svg Infographic。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Moai Domain Svg Infographic 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

SVG Technical Infographic

Produce a hand-editable SVG diagram whose geometry was decided by arithmetic rather than by eye, plus a 2x PNG raster of it. The output is one static image: no animation, no scripting, no external asset at view time.

Step 0 — Decide whether this is an SVG job

This skill is additive to the mermaid pipeline, never a replacement for it. Nothing here migrates, rewrites, or deprecates an existing mermaid diagram on its own (the sole exception: a caller-invoked import through the opt-in importer references in the bundled-references table, where the one-home rule below governs and the source is replaced outright in the same change), and no diagram should ever exist in both forms — that is dual maintenance, and it is the one failure this section exists to prevent.

Route the request before drawing anything:

SignalRoute to
The diagram lives inside a markdown documentmermaid
It changes often, alongside the prose around itmermaid
It is a standard type: flow, sequence, ER, state, class, ganttmermaid
Its text labels are kept in sync across localesmermaid
The deliverable is an image file for slides, email, social, or offline readingthis skill
It is a freeform architecture or concept infographic with no standard shapethis skill
Pixel-level control of position, spacing, or layering is requiredthis skill
Korean or other CJK labels must wrap at exact, verified widthsthis skill

When several signals point both ways, mermaid wins: a mermaid block is cheaper to keep correct than an image. Choose this skill only when the routing table gives it an unopposed reason.

One diagram, one home. If a mermaid version already exists, either replace it outright (and delete the mermaid block in the same change) or leave it alone. Never ship both.

Runtime prerequisites and degradation

Node 18 or later and a headless Chromium-family browser are needed only to lint and to render. Neither is needed to install this skill, to discover it, or to author the editable SVG — authoring is always available.

Node 18+Headless ChromiumWhat is delivered
presentpresentEditable SVG, machine lint report, 2x PNG with the browser executable and version disclosed and PNG header dimensions verified
presentabsentEditable SVG plus machine lint report. State plainly that no headless browser was found and no PNG was produced
absenteitherEditable SVG plus the manual checklist result from references/authoring.md. Do not attach a machine-lint label, and do not claim a render

Never fabricate a PNG, a pixel dimension, or a lint verdict for a tool that did not run. Say which step was skipped and why.

The workflow

Six steps, in order. Steps 1 through 3 finish before a single SVG element is written; that ordering is the whole method.

  1. Frame. Write down the message the diagram must land, then set the four output dials below. They change the deliverable, the canvas, the density, and the wording, so they are decided before an archetype is picked, not after.
  2. Pick an archetype. Architecture stack, left-to-right flow, side-by-side comparison, or hierarchy tree. Skeletons are in references/archetypes.md.
  3. Run the numeric layout pass. Produce the box table and pass every containment and text-budget check below. Do not proceed on a failing row.
  4. Author the SVG from the table. Every coordinate is either a table value or a formula over table values.
  5. Lint the source with scripts/check-svg.mjs. Clear every error; triage every warning.
  6. Render and verify with scripts/render.mjs. Confirm the reported PNG dimensions match the requested 2x target, then look at the PNG.

The four output dials

DialValuesDefault
formatsvg · svg+pngsvg+png
sizedoc-inline (1200 wide) · slide-16x9 (1600x900) · social-og (1200x630) · print-a4-landscape (1754x1240) · fit (the archetype's own preset)doc-inline
detailfaithful (<=24 nodes, banded) · balanced (<=12) · simplified (<=7)balanced
audienceengineer · mixed · executivemixed

Every dial has a default, because a dial without one turns a four-part contract into four questions on every invocation. State the four settled values beside the deliverable so a later regeneration reproduces the same artifact. size sets the type ramp as well as the viewBox, and audience governs wording rather than node count — both are detailed in references/archetypes.md.

Complexity budget

Every type has a node ceiling, and exceeding it means split or simplify — never shrink the boxes. The ceiling is the detail dial's: 12 nodes at balanced, 7 at simplified, 24 at faithful and only inside labelled bands. In every mode: at most 12 connectors and at most 2 accent elements. faithful exempts the node count and nothing else. Per-archetype ceilings are in references/archetypes.md.

The numeric layout pass

Build one table before authoring. Five owned columns per box — id, x, y, w, h — and nothing else is typed by hand. Every other number in the file is derived from those.

Grid. For canvas width W, n columns, outer margin M, gutter G:

colW    = (W - 2*M - (n-1)*G) / n
colX(i) = M + i * (colW + G)

If colW falls below the archetype's minimum card width, reduce n or widen W. Do not shrink the margin to rescue a column count.

Containment. Check every row, and stop if any fails:

M <= x            and  x + w <= W - M
M <= y            and  y + h <= H - M
parent.x + pad <= child.x   and  child.x + child.w <= parent.x + parent.w - pad

Derived geometry. Centers and anchors come from the box, never from a per-language nudge:

cx            = x + w/2
cy            = y + h/2
iconCenter    = (x + pad + iconR, y + h/2)
titleBaseline = y + pad + titleSize
lineBaseline(k) = titleBaseline + titleGap + k*lineHeight

If you find yourself moving an icon down three units "because the Korean text sits low", the formula is wrong. Fix the formula, not the instance. Hand-tuned per-language offsets are exactly the render-fix loop this method removes.

Connectors. Endpoints are derived too; the arrowhead length is subtracted from the terminal end so the marker tip lands on the border, not inside it:

horizontal A->B: (A.x + A.w, A.cy) -> (B.x - markerLen, B.cy)
vertical   A->B: (A.cx, A.y + A.h) -> (B.cx, B.y - markerLen)
elbow      A->B: midX = (A.x + A.w + B.x) / 2
                 path: M A.x+A.w A.cy  H midX  V B.cy  H B.x-markerLen

Full formula set, including radial and multi-lane fan-out, is in references/authoring.md.

Text budget — CJK first

Set a CJK-first font stack on the root so Hangul, Kana, and Han glyphs resolve before any Latin fallback is consulted. A Latin-first stack makes CJK glyphs fall through to an arbitrary system font and silently changes every measured width:

font-family="Pretendard, 'Noto Sans KR', 'Noto Sans JP', 'Noto Sans SC',
             'Apple SD Gothic Neo', 'Hiragino Sans', 'Microsoft YaHei',
             system-ui, sans-serif"

Capacity per line, for usable width u = w - 2*pad at font size s:

Latin: capacity = u / (0.60 * s)     average Latin advance is about 0.60em
CJK:   capacity = u / (1.00 * s)     full-width advance is 1.00em

The ratio between them is the working rule: a Korean, Japanese, or Chinese line holds roughly 60% of the character count a Latin line holds in the same box at the same size. Budget the copy against that number and edit the wording to fit before authoring. A line that mixes scripts is budgeted at the CJK rate for its whole length.

Two things are forbidden here because both hide the problem instead of solving it: truncating a label after the fact, and shrinking the font size for one language only. Rewrite the label.

Accessible SVG output

An SVG has no accessible name of its own. Without one it is announced as an unlabelled graphic, and none of the <text> inside it is read — so an unlabelled diagram is not a degraded diagram, it is an absent one. Every SVG this skill emits carries four things:

  • role="img" on the root <svg>.
  • aria-labelledby naming the <title> and <desc> ids.
  • <title> as the first child, before <defs>, holding the diagram's name.
  • <desc> describing the content — what a reader takes away — never narrating the geometry box by box.

IDs are prefixed per diagram (<slug>-title, <slug>-desc): bare title / desc collide when two diagrams are inlined into one page, and the second is then announced with the first one's name. A genuinely decorative graphic carries aria-hidden="true" and no title instead — a diagram never is.

check-svg.mjs enforces this as errors SVG060-SVG064. The copyable skeleton and the two-direction fixture check are in references/authoring.md section 8.

Linting the source

bash
node ~/.claude/skills/moai-domain-svg-infographic/scripts/check-svg.mjs diagram.svg          # human-readable diagnostics
node ~/.claude/skills/moai-domain-svg-infographic/scripts/check-svg.mjs diagram.svg --json   # machine-readable
node ~/.claude/skills/moai-domain-svg-infographic/scripts/check-svg.mjs diagram.svg --strict # warnings also fail

Every diagnostic carries file:line:column, a stable code, and a message. The two tiers are not interchangeable:

Errors — deterministic, always fix. Unbalanced tags; missing or malformed viewBox; a width/height pair whose aspect ratio contradicts the viewBox; duplicate id; a local reference (url(#id), href="#id") with no matching id; a <marker> missing required geometry; a <marker> that leans on the implicit markerUnits default, which rescales arrowheads with stroke width and is the usual cause of arrowheads that look right in one diagram and wrong in the next; a missing piece of the accessible-SVG contract (SVG060-SVG064) — no role, no aria-labelledby, a <title> that is not the first child, a missing <desc>, or a bare title / desc id.

Warnings — heuristic, triage individually. Estimated text overflow of its container rect; a pill too narrow for its label once the round-cap inset is applied; an element extending past the viewBox. These use character-advance estimation, so they are advisory: confirm in the rendered PNG rather than reflowing the layout on the warning alone. A warning that survives visual inspection is a real defect; one that does not is noise.

Exit status is 0 when no error was found, 1 on any error (or on any warning under --strict), 2 on a usage or read failure.

Without Node, walk the manual checklist in references/authoring.md instead and report it as a manual check — never as a lint result.

Rendering and verifying the PNG

bash
node ~/.claude/skills/moai-domain-svg-infographic/scripts/render.mjs diagram.svg --out diagram.png            # 2x default
node ~/.claude/skills/moai-domain-svg-infographic/scripts/render.mjs diagram.svg --out diagram.png --scale 3

The renderer resolves a Chromium-family executable from CHROME_PATH, then from the well-known install locations for the platform, then from PATH. It reports the exact executable it used and that browser's version string — always include both in the deliverable, because a diagram rendered by a different browser build is a different artifact.

It computes the target as round(viewBox_w * scale) x round(viewBox_h * scale), screenshots at that window size, then reads the PNG's own IHDR header and compares the stored dimensions against the target. A mismatch is a failure, not a rounding note.

Exit status: 0 verified, 1 render or verification failed, 2 no headless browser found, 3 usage error. Exit 2 is the degradation signal — deliver the SVG alone and state the limitation.

Bundled references

FileContents
references/archetypes.mdThe four archetype skeletons with their canvas presets, grid parameters, and per-archetype containment rules
references/authoring.mdFull geometry and connector formula set, the icon set, palette and type scale, and the manual no-Node checklist
references/import-drawio.mdOpt-in migration path for an existing draw.io source: decode the container (four shapes) first, then IR to a numeric-layout re-author, with one-home replacement in the same change
references/import-mermaid.mdOpt-in migration path for an existing mermaid source: IR to a numeric-layout re-author, with one-home replacement in the same change
references/sketch.mdOpt-in hand-drawn preset layered over the same computed layout
ScriptPurpose
scripts/check-svg.mjsDeterministic source lint, errors and warnings, file:line:column diagnostics
scripts/render.mjsHeadless-Chromium 2x PNG render with browser disclosure and PNG header verification
scripts/test-check-svg.mjsRuns every fixture through the lint and asserts each one's exact diagnostic code set; exits non-zero on the first mismatch
scripts/fixtures/42 SVGs pinning the lint in both directions — the accessible-name contract (a11y-present.svg must lint clean, a11y-missing.svg must fail) and the connector-geometry checks, each fixture declaring the codes it must produce

Every script runs on the Node 18 standard library alone. There is no package to install and no browser bundled.

Attribution

The six connector rules, the complexity budget, the accessible-SVG contract, the four output dials, the slop-symptom list, and the semantic-role skin with its inversion rule were adapted from cathrynlavery/diagram-design v2.6.1 (MIT) — restated rather than copied, because that skill permits external font loading and HTML output variants which this one forbids.

Relationship to the report renderer

moai-domain-html-report renders a markdown report into one self-contained HTML file and may embed mermaid inside it. That skill owns reports; this one owns standalone diagram images. They compose — a report may link or embed a PNG this skill produced — and neither replaces the other.

Common Rationalizations

RationalizationReality
"I will sketch the SVG first and fix the coordinates once I see it"That is the render-fix loop. Each visual fix invalidates a neighbour and the diagram never converges. Compute the table first.
"The Korean label is only slightly too long, it will fit"It will not: CJK glyphs are full-width, so the line holds about 60% of the Latin count. Rewrite the label before authoring.
"I nudged the icon down 3 units and it looks right now"A per-instance nudge means the center formula is wrong. Derive from box geometry and the nudge disappears everywhere.
"No browser here, but the PNG would have been 2400x1600"An unrendered size is a guess. Deliver the SVG and state that no PNG was produced.
"The lint only reported warnings, so the file is clean"Warnings are heuristic, not absent. Triage each against the rendered PNG before dismissing it.
"This flowchart would look nicer as an SVG"A markdown-embedded, frequently-changing standard diagram stays mermaid. Nicer is not a routing reason.
"I will keep the mermaid block and add the SVG for slides"Two sources for one diagram drift apart. Pick one home.

Red Flags

  • SVG elements were written before the box table existed.
  • A coordinate in the file cannot be traced to a table value or a formula.
  • The same diagram exists as both a mermaid block and an SVG.
  • A font stack lists a Latin family before any CJK family.
  • A label was truncated, or a font size was reduced for one language only.
  • A PNG dimension, browser version, or lint verdict is reported for a command that was never run.
  • Lint errors were downgraded to warnings to get to a render.
  • A <marker> has no explicit markerUnits.

Slop symptoms — fourteen things to look for in the rendered image

These are the marks of a generated-looking schematic. Each is something to check against the picture, not a matter of taste.

#Symptom in the output
1Dark ground with cyan or purple glow strokes
2The mono family carrying a human-readable name (mono is for ports, paths, types)
3Every node the same width and fill, so nothing reads as more important
4A legend inside the diagram area, overlapping nodes
5A connector label with no mask, the stroke running through the glyphs
6Vertical writing-mode text on a connector
7Three summary cards of exactly equal width
8A filter or drop shadow on any element
9rx above 12 on a card or above 8 on a chip
10accent on three or more nodes, leaving no focal point
11Spacing and routing carried over from a mermaid render
12Any breach of the six connector rules of authoring.md section 2.5 — a diagonal between boxes sharing neither axis, a mask touching its stroke, a mask clipped by a later node, two connectors on one path, two on one attach point, an undashed transit behind a non-endpoint box. Three of the six are machine-checked by check-svg.mjs, each within a stated bound: C2 as SVG070 (clearance under 6 units) and SVG073 (over 10), but only for a mask lying within 16 units of a connector, so a label placed further out — archetype A2's branch labels among them — is not checked; C6 as SVG071; C4 as SVG072, but on arrival points only, so crowding on the departure side, and any connector carrying neither marker-end nor marker-start, go unreported. C1, C3, and C5 stay eye-only. SVG074 is not one of these checks but their coverage note: it warns once per file that a transform — transitively, so one wrapping <g> carries everything inside it — kept N of M candidates out of the geometry checks, leaving them unverified.
13A gradient fill standing in for a hierarchy decision
14An emoji or pictograph used as an icon instead of an icon-set path

Verification

  • Routing table consulted and the SVG choice has an unopposed reason.
  • No mermaid version of this diagram remains alongside the SVG.
  • Four output dials stated: format, size, detail, audience.
  • Node count within the detail ceiling; connectors <= 12; accent on <= 2.
  • Box table complete before authoring; every coordinate traces to it.
  • All containment checks pass for boxes and for children inside boxes.
  • Centers, baselines, and connector endpoints are derived, not hand-tuned.
  • Font stack is CJK-first; every line fits its computed capacity.
  • All six connector rules hold (references/authoring.md section 2.5).
  • Accessible contract present: role, aria-labelledby, <title> first, <desc> describing the content, IDs prefixed per diagram.
  • check-svg.mjs reports zero errors; each warning triaged and recorded.
  • render.mjs verified the PNG header against the 2x target.
  • Browser executable and version disclosed with the PNG.
  • Any skipped step named explicitly, with no substitute claim.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Moai Domain Svg Infographic AI 技能有什么作用?

通过先以数值方式计算布局、再编写标记,并使用无头 Chromium 渲染为 2 倍尺寸 PNG,制作可编辑的 SVG 技术信息图,包括架构图、流程图、对比图和层级图。内置优先支持中日韩文字的字体栈、确定性的源代码 lint,以及 mermaid 与 SVG 的选择规则。

为什么在 TypingMind 中使用 Moai Domain Svg Infographic?

因为您只需安装一次,就能搭配任何模型使用。Moai Domain Svg Infographic 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Moai Domain Svg Infographic?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-domain-svg-infographic。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Moai Domain Svg Infographic?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Moai Domain Svg Infographic 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Moai Domain Svg Infographic 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Moai Domain Svg Infographic AI 技能免费吗?

是的。modu-ai 已在 GitHub 上根据 Apache-2.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇