Token导航 LogoToken导航TokenDH.com
图像处理需要联网github未标认证来源可访问许可证需确认审计通过

diagram-to-image图表到图像

Agent Skill

用于辅助图像生成、图片编辑、视觉素材处理或图像模型工作流。它适合让 Agent 根据文本生成图片、处理背景、整理视觉提示词或调用相关图像工具。使用时需要确认输入图片、版权来源、输出格式和模型限制;涉及人物、品牌、商品或公开展示素材时,应额外核对授权、真实性和内容合规边界。

总安装

3,238

周安装

131

GitHub Stars

90

下载量

1,017
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:diagram-to-image(图表到图像)
来源仓库:https://github.com/sugarforever/01coder-agent-skills
仓库路径:skills/diagram-to-image
安装命令:
npx skills add https://github.com/sugarforever/01coder-agent-skills --skill diagram-to-image
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/sugarforever/01coder-agent-skills --skill diagram-to-image

简介

diagram-to-image 将 Mermaid 图表和 Markdown 表格转换为 PNG 图片,通过 diagramless API 实现轻量化图像导出。

  • 适用于内容创作者需要将文本图表用于 X/Twitter 或其他平台的视觉输出场景。
  • 支持自定义主题样式,无需本地依赖即可生成高质量图像文件。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Diagram to Image

Convert Mermaid diagrams and Markdown tables to PNG images via the mermaid-red API (diagramless.xyz). Produces high-quality, styled output with custom themes — no heavy local dependencies needed.

When to Use

Use this skill when:

  • User has a Mermaid diagram that needs to be converted to an image
  • User has a Markdown table that needs to be converted to an image
  • User is writing content for X/Twitter and needs visual exports
  • User asks to "convert to image", "export as PNG", "make this an image", or similar

Prerequisites

The bundled script uses Node.js built-in fetch (Node 18+). No npm install needed.

# The render script is bundled with this skill:
SKILL_DIR=~/.claude/skills/diagram-to-image/scripts
ls $SKILL_DIR/diagram-to-image.mjs

Smart Output Location

IMPORTANT: Determine the best output location based on context. Follow this decision tree:

1. User Specifies Path

If user explicitly mentions a path or filename, use that.

2. Project Context Detection

Check for common image/asset directories in the current project:

# Check for existing image directories (in order of preference)
ls -d ./images ./assets ./img ./static ./public/images ./assets/images 2>/dev/null | head -1

Use the first existing directory found. Common patterns:

  • ./images/ - General projects
  • ./assets/ - Web projects
  • ./assets/images/ - Structured web projects
  • ./public/images/ - Next.js, React projects
  • ./static/ - Hugo, other static site generators
  • ./img/ - Short form convention

3. Article/Document Context

If user is writing an article or document:

  • Look for the document's directory
  • Create images/ subdirectory if appropriate
  • Name the image based on the document name + descriptor

4. Conversation Context

Analyze the conversation to determine:

  • What the diagram represents → Use for filename (e.g., auth-flow.png, user-journey.png)
  • Related file being discussed → Place image near that file
  • Topic being discussed → Use for naming

5. Default Fallback

If no context clues:

  • Use current working directory
  • Generate descriptive filename from diagram content

Filename Generation

Create meaningful filenames based on content analysis:

Content PatternExample Filename
flowchart with auth/loginauth-flow.png
sequenceDiagram with APIapi-sequence.png
erDiagramentity-relationship.png
pie chart about Xx-distribution.png
gantt chartproject-timeline.png
Table with comparisoncomparison-table.png
Table with datadata-table.png

Rules:

  • Use kebab-case (lowercase with hyphens)
  • Keep names concise but descriptive (2-4 words)
  • Avoid generic names like diagram.png or image.png
  • Include topic/subject when identifiable

Conversion Process

Step 1: Analyze Context

Before converting, gather context:

  1. Check current working directory
  2. Look for existing image directories
  3. Analyze diagram/table content for naming
  4. Consider any files or topics mentioned in conversation

Step 2: Determine Output Path

# Example logic (implement mentally, not as literal script)
if user_specified_path:
    output_path = user_specified_path
elif exists("./images"):
    output_path = "./images/{generated_name}.png"
elif exists("./assets"):
    output_path = "./assets/{generated_name}.png"
elif exists("./public/images"):
    output_path = "./public/images/{generated_name}.png"
else:
    output_path = "./{generated_name}.png"

Step 3: Create Temporary Input File

# For Mermaid diagrams
cat > /tmp/diagram.mmd << 'DIAGRAM_EOF'
<mermaid content>
DIAGRAM_EOF

# For Markdown tables
cat > /tmp/table.md << 'TABLE_EOF'
<table content>
TABLE_EOF

Step 4: Convert via mermaid-red API

The API auto-detects content type (mermaid vs table). Both use the same command.

Using the bundled script:

# Mermaid diagram
node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/diagram.mmd -o <output_path>.png

# Markdown table
node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/table.md -o <output_path>.png

# With custom theme
node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/diagram.mmd -o <output_path>.png --theme ocean

# Force content type (if auto-detect gets it wrong)
node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/table.md -o <output_path>.png --type table

Available options:

  • --theme <name> — default, dark, forest, neutral, ocean, emerald, midnight, slate, lavender, blueprint
  • --type <type> — auto (default), mermaid, table
  • --scale <n> — 1-4 (default: 2, for 2x DPI)
  • --bg <color> — Background color (default: white, use "transparent" for no bg)
  • --server <url> — Override server (default: https://diagramless.xyz)

Piping from stdin also works:

echo "graph TD; A-->B" | node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs -o out.png
cat /tmp/table.md | node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs --type table -o table.png

Step 5: Report Result

After conversion, tell the user:

  1. Full path where image was saved
  2. Why that location was chosen (briefly)
  3. File size in bytes (printed by the script)
  4. Suggest they can specify a different location if needed

Examples

Example 1: Project with images/ directory

Context: User is in a project that has ./images/ directory, discussing authentication.

User: "Convert this to an image"

flowchart TD
    A[Login] --> B{Valid?}
    B -->|Yes| C[Dashboard]
    B -->|No| D[Error]

Action:

  1. Detect ./images/ exists
  2. Analyze content → authentication flow
  3. Generate filename: login-flow.png
  4. Save content to /tmp/diagram.mmd
  5. Run: node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/diagram.mmd -o./images/login-flow.png

Example 2: Writing X article about AI with ocean theme

Context: User mentioned writing an article about AI agents for X.

User: "Make this a PNG with ocean theme"

flowchart LR
    User --> Agent --> Tools --> Response

Action:

  1. Save content to /tmp/diagram.mmd
  2. Run: node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/diagram.mmd -o./ai-agent-flow.png --theme ocean

Example 3: Data comparison table

User: "Export this table as image"

| Model | Speed | Accuracy |
|-------|-------|----------|
| GPT-4 | Slow | High |
| Claude | Fast | High |

Action:

  1. Save content to /tmp/table.md
  2. Run: node ~/.claude/skills/diagram-to-image/scripts/diagram-to-image.mjs /tmp/table.md -o./model-comparison.png (auto-detects as table)

Example 4: User specifies location

User: "Save this diagram to ~/Desktop/my-chart.png"

Action: Use exactly ~/Desktop/my-chart.png as output path.

Error Handling

  • If the API server is unreachable, the script prints a clear error message
  • If content type auto-detection fails, use --type mermaid or --type table explicitly
  • For local development/testing, use --server http://localhost:3000

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

32.07%
按下载量换算326

Claude

31.87%
按下载量换算324

Cursor

19.18%
按下载量换算195

Gemini CLI

8.61%
按下载量换算88

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills