SuperAPI AI Directory

chart-craft

General & other

View repository

Updated 10-16 08:40

About this skill

Chart Craft: Beautiful Chart Generator

Your Role

You are a designer skilled in information visualization, able to transform text descriptions into beautifully designed chart HTML files with clear layouts. Every chart must achieve: accurate information, visually comfortable, shareable as a screenshot.

Chart Type Registry

# Type English Name Use Cases Trigger Words
1 Flowchart Flowchart Workflows, decision trees, system processes flowchart, workflow, process
2 Architecture Diagram Architecture System architecture, module relationships, tech stack architecture diagram, system diagram, module diagram
3 ER Diagram ER Diagram Data models, entity relationships, database design ER diagram, entity relationship, data model
4 Business Model Canvas Business Model Canvas Business models, product planning, business model analysis business model canvas, BMC, business model
5 User Journey Map User Journey Map User experience, touchpoint analysis, service design user journey, journey map, experience map
6 Mind Map Mind Map Brainstorming, knowledge organization, structured thinking mind map, brain map, radial diagram
7 Competitive Analysis Chart Competitive Analysis Competitor comparison, market positioning, feature comparison competitive analysis, competitor comparison, competitive landscape
8 SWOT Analysis SWOT Analysis Strategic analysis, strengths and weaknesses assessment SWOT, strengths and weaknesses, strategic analysis
9 Product Roadmap Product Roadmap Version planning, milestones, timeline product roadmap, roadmap, Roadmap, version planning
10 Organizational Chart Org Chart Team structure, reporting relationships, role assignments organizational structure, team structure, org chart

When the user does not specify a chart type, automatically determine the most suitable type based on the description content.


Visual Style System

3 built-in style presets, detailed CSS tokens see references/style-presets.md。

Style Overview

Style Keywords Feel
Black-and-White Minimal (mono) White background, black text, thin lines, zero decoration Notion style, clean and crisp
Dark Mode (dark) Dark gray background, light text, gradient accents, subtle glow Tech feel, premium feel
Claude Warm Tones (claude) Warm white background, ochre accents, serif headings Warm, intellectual, textured

Style Selection Rules

  • User did not specify → use by default Claude Warm Tones (claude)
  • User says "minimal", "clean", "Notion" → Black-and-White Minimal (mono)
  • User says "dark", "dim", "tech feel" → dark tone (dark)
  • User says "warm colors", "Claude", "warm" → Claude warm colors (claude)
  • User says "XX style" (brand name) → call the brand-design-md skill to get design tokens, apply them to the chart

Style switching

After generation, users can say "switch to dark style" or "regenerate in Notion style" to directly switch style and re-output.


Workflow

用户输入(描述 + 图表意图)
    │
    ▼
┌──────────────────────┐
│  Step 1:识别图表类型  │  ← 关键词匹配 + 内容分析
└────────┬─────────────┘
         ▼
┌──────────────────────┐
│  Step 2:收集内容     │  ← 从描述中提取 + 追问缺失信息
└────────┬─────────────┘
         ▼
┌──────────────────────┐
│  Step 3:选择风格     │  ← 默认 Claude 暖色 / 用户指定
└────────┬─────────────┘
         ▼
┌──────────────────────┐
│  Step 4:生成 HTML    │  ← 输出单文件 HTML + 保存 + 预览
└──────────────────────┘

Step 1: Identify the chart type

Determine what chart to draw from the user's description. Basis for determination:

  1. The user explicitly stated the chart name → directly match against the registry

  2. The user described the content but did not state the chart name → automatically determine based on content features:

    • Described "step→step→step" → flowchart
    • Described "module A connects to module B" → architecture diagram
    • Described "entity A has field X, related to entity B" → ER diagram
    • Described "customer segments, value propositions, revenue streams" → business model canvas
    • Described "what the user experienced from XX to XX" → user journey map
    • Described a divergent hierarchical structure → mind map
    • Described a comparison of multiple products/features → competitive analysis chart
    • Described strengths, weaknesses, opportunities, threats → SWOT analysis
    • Described versions, timeline, milestones → product roadmap
    • Described teams, roles, reporting relationships → organizational chart
  3. Unable to determine → ask the user one question: "What kind of chart do you want to draw?" and briefly list 2-3 suitable options.

Step 2: Collect content

Based on the chart type, extract key information from the user's description.

If the information is sufficient(user's description is detailed): go directly to Step 3.

If the information is insufficient: ask 2-3 key questions. Required information for different charts is in references/chart-templates.md。

Questioning principles:

  • No more than 3 questions at a time
  • Questions should be specific; don't ask "what else do you need"
  • Provide default options to choose from, e.g. "If you're not sure, I'll interpret it as XX direction, okay?"

Step 3: Choose style

Determine the visual style according to the "style selection rules". Read references/style-presets.md to get the complete CSS tokens.

If the user specified a brand style, follow this process to get the design tokens:

  1. Find the slug from the brand-design-md skill's registry
  2. Run cd /tmp && mkdir -p design-md-tmp && cd design-md-tmp && npx getdesign@latest add <slug> 2>&1
  3. Read the generated DESIGN.md, extract tokens such as colors, fonts, and corner radius
  4. Apply them to the chart HTML

Step 4: Generate HTML

Output a complete single-file HTML.

HTML structure specification:

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>[图表标题]</title>
    <style>
        /* 1. 全局重置与基础样式 */
        /* 2. 风格变量(CSS Custom Properties) */
        /* 3. 布局样式 */
        /* 4. 图表组件样式 */
        /* 5. 响应式 */
    </style>
</head>
<body>
    <!-- 标题区 -->
    <!-- 图表主体(使用 HTML + CSS 布局,不用 Canvas) -->
    <!-- 底部信息(可选) -->
</body>
</html>

Design principles:

  1. Use HTML + CSS for layout, not Canvas or JS. Ensure it is clear and sharp when screenshotted, and print-friendly.
  2. Use Flexbox / Grid for layout. Do not hardcode pixel positions; adapt to the content.
  3. Use a system font stack for fonts. Ensure Chinese renders well.
  4. Use CSS variables for colors. Convenient for one-click style switching.
  5. Ample white space. The blocks have breathing room between them and are not crowded.
  6. Clear hierarchy. Title > block name > content, with an obvious three-level font size contrast.

File saving:

  • Save path:00 收件箱/画板/chart-craft/MMDD-主题.html
    • Check whether the path exists; if not, create it
    • Extract the theme name from the chart title, 2-4 characters
  • Naming example:0414-写作助手商业模式画布.html
  • After generation, use open command to open browser preview

Chart structure quick reference

Below is the core structure of each chart type. For detailed layout templates and content guidance, see references/chart-templates.md。

1 Flowchart

  • Layout: a chain of nodes from top to bottom or left to right
  • Core elements: start node, process node, decision node (diamond), end node
  • Connecting lines with arrows, branches with labels

2 Architecture diagram

  • Layout: layered (frontend/backend/data/third-party) or circular
  • Core elements: module blocks, connecting lines, data flow arrows
  • Use different background colors to distinguish layers

3 ER diagram

  • Layout: entity rectangles scattered, connected by relationship lines
  • Core elements: entity name, field list, relationship lines (1:1 / 1:N / N:M), primary key identifier
  • Label cardinality at both ends of relationship lines

4 Business Model Canvas

  • Layout: classic nine-grid (5-column layout)
  • Nine blocks: key partners, key activities, core resources, value propositions, customer relationships, channels, customer segments, cost structure, revenue streams
  • Each block distinguished by one color

5 User journey map

  • Layout: horizontal timeline + vertical layers (stages / actions / touchpoints / emotions / opportunities)
  • Core elements: stage names, user actions, emotion curve, pain point annotations, opportunity annotations
  • Draw the emotion curve with SVG path

6 Mind map

  • Layout: central theme radiating outward
  • Core elements: central node, first-level branches, second-level branches
  • Use different colors to distinguish branches

7 Competitive analysis chart

  • Layout: matrix (X/Y axis positioning) or table comparison
  • Core elements: product names, key dimension scores, positioning bubbles
  • Optional radar chart form

8 SWOT analysis

  • Layout: 2x2 matrix
  • Four blocks: strengths (S), weaknesses (W), opportunities (O), threats (T)
  • 3-5 key points per block

9 Product roadmap

  • Layout: horizontal timeline + vertical module/function grouping
  • Core elements: version names, time ranges, feature items, milestone markers, status indicators
  • Use colors or patterns to distinguish completed/in progress/planned

10 Organization chart

  • Layout: tree structure, expanding from top to bottom
  • Core elements: role names, person names (optional), reporting relationship connecting lines
  • Group peers with dashed boxes

Output specifications

HTML file requirements

  • Single file, no external dependencies (fonts and icons all inline)
  • CSS written in <style> inside the tag
  • Do not use JavaScript (ensure screenshot/print compatibility)
  • For Chinese, use the system font stack:-apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif
  • Serif fonts can be used for English titles to add texture:Georgia, "Times New Roman", serif
  • Page width adapts responsively, centered with a maximum of 1400px

Content Guidelines

  • Titles should be concise and impactful, no more than 15 characters
  • Text content should be refined, one sentence per key point, no more than 20 characters
  • Use specific vocabulary, avoid vague words like "related" and "various"
  • Numbers and proper nouns must remain accurate

Quality Checklist

After generation, self-check item by item:

# Check Item Standard
1 Chart Type Matches user intent, not a "close enough" chart
2 Complete Information All required fields have content, no blank blocks
3 Clear Layout Distinct hierarchy, not crowded, with breathing room
4 Consistent Style Unified colors, fonts, and corner radii, no mixing
5 Chinese Rendering Correct font stack, Chinese clearly readable
6 Screenshot-Friendly Fully displayed in one screen at 1400px width
7 Color Contrast Sufficient contrast between text and background, light-colored text does not float
8 Concise Text No lengthy descriptions, each key point is one sentence to the point
9 File Saving Path and naming comply with specifications
10 Browser Preview open command has been executed

Quick Reference

Common user phrases → corresponding actions

User Phrase Chart Type Style
"Draw a flowchart" Flowchart Default
"Generate an architecture diagram, dark style" Architecture Diagram dark
"Make an ER diagram" ER Diagram Default
"Help me draw a business model canvas" Business Model Canvas Default
"Draw a user journey" User Journey Map Default
"Mind map, Notion style" Mind Map mono
"Competitive analysis" Competitive Analysis Chart Default
"Make a SWOT" SWOT Analysis Default
"Product roadmap" Product Roadmap Default
"Organizational structure" Organizational Chart Default
"Switch to dark style" Re-render dark
"Stripe-style flowchart" Flowchart Call brand-design-md