Delegate independent tasks to specialized agents working concurrently with isolated context.
Mermaid 图生成 SKILL
draw-diagram-skill
Expert guidance for creating syntactically correct and well-structured Mermaid diagrams following best practices. Use when creating flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts, ER diagrams, data lineage visualizations, or any other Mermaid visualization.
SKILL.md
Full skill instructions
Mermaid 图生成 SKILL
本技能沉淀了在本仓库使用 Mermaid CLI(mmdc)将 .mmd 文本转为高分辨率 PNG 的标准流程。
适用场景
- 基于 Mermaid 流程/时序等图快速出图,随代码或脚本说明发布。
- 需要可重复、可修改的图源文件,避免手工绘制。
前置要求
- 已安装
@mermaid-js/mermaid-cli并可调用mmdc(本仓库曾使用nvm安装,路径通常在~/.nvm/.../bin/mmdc)。 - 能够启动无沙箱的 Chromium(沙箱环境可能需要额外权限;在本仓库中使用过
require_escalated执行)。
输入
input.mmd:Mermaid 源文件,UTF-8 文本。- 可选:缩放参数
-s控制分辨率,默认示例用2.5。
标准步骤
-
准备源文件(示例)
flowchart TD start([示例开始]) --> step1[步骤 1] step1 --> done([结束])保存为
your-diagram.mmd。 -
本地生成 PNG
mmdc -i your-diagram.mmd -o your-diagram.png -s 2.5-s越大,导出的图片越清晰;按需调整。- 如需 SVG,可将输出改为
.svg。
-
版本化管理
- 将
.mmd与生成的产物(如需要)一并入库,保持可追溯。 - 更新图时先改
.mmd,再重新导出。
- 将
故障排查
- 报错 “Failed to launch the browser process”:
- 在受限环境中尝试关闭沙箱:
mmdc ... -p <config>,其中配置可传{"args":["--no-sandbox","--disable-setuid-sandbox"]}。 - 若仍失败,需在有权限的环境执行,或使用 Kroki 等无头渲染服务。
- 在受限环境中尝试关闭沙箱:
- 找不到
mmdc:重新安装@mermaid-js/mermaid-cli或确保 PATH 包含其安装位置。
产出检查
- 确认节点/箭头与脚本逻辑一致。
- 放大查看 PNG 保证文字清晰;必要时增加
-s或切换 SVG。
More Other skills
brand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
Fundamental design principles for writing maintainable, testable Python code.
responsive-design
Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.
Generate Playwright tests from scenarios using interactive browser exploration and validation.
Automated website exploration and test case generation using Playwright.
Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.
gdpr-data-handling
GDPR-compliant data handling with consent management, data subject rights, and privacy controls.
Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.
refactor-plan
Detailed multi-file refactor planning with safety checks and rollback guidance.
