Important
All output is self-contained inline SVG — no external fonts, no CDN dependencies, no JavaScript.
The SVG must render correctly when pasted directly into an HTML file or viewed standalone in a browser.
Use system-safe fonts only (-apple-system, Helvetica Neue, Arial, sans-serif). Limit palette
to 5-6 colors maximum per chart. Never fabricate data — only visualize numbers the user provides.
Instructions
Identify chart type and data. Determine what the user wants to visualize. If the chart type
is not specified, infer the best type from the data shape:
- Categorical comparisons → horizontal or vertical bar chart
- Part-of-whole (proportions that sum to 100%) → donut chart
- Single KPI or completion percentage → progress ring or stat card
- Two items being compared side-by-side → comparison graphic (split bar or versus card)
- Time series trend (5+ points) → sparkline or area chart
If the data is ambiguous or missing, ask for it before proceeding.
Confirm data and labels. Echo back the data you plan to visualize and ask for confirmation
if any values seem inconsistent (e.g., percentages that don't sum to 100%, negative values in a
donut, empty series).
Determine dimensions. Default canvas sizes:
- Bar chart: 600 × 380px
- Donut chart: 400 × 400px
- Progress ring / stat card: 300 × 300px
- Comparison graphic: 600 × 280px
- Sparkline: 300 × 100px
User may specify a custom size — honor it exactly.
Choose a color palette. Default palette (accessible, print-safe):
- Primary:
#3B82F6 (blue)
- Secondary:
#10B981 (green)
- Accent:
#F59E0B (amber)
- Danger:
#EF4444 (red)
- Neutral:
#6B7280 (gray)
- Background:
#F9FAFB or white
If the user specifies brand colors, use those instead.
Generate the SVG. Build the SVG from scratch using only SVG primitives (rect, circle,
path, text, line, polyline, g). Include:
- A
viewBox attribute so the chart scales correctly
- Axis labels and value labels directly on the SVG (no legend box unless >4 series)
- A chart title at the top if the user provides one
- Clean whitespace/padding (at least 40px on all sides)
- Rounded corners (
rx) on bar chart bars for a modern look
- Percentage labels inside or adjacent to donut segments
Output the SVG block. Wrap the SVG in a fenced code block labeled svg for easy copying:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 380" ...>
...
</svg>
After the code block, include a one-line description of what was generated and how to embed it:
"Paste this SVG directly into your HTML. No dependencies required."
Offer variants. After delivering the primary chart, offer 1-2 quick alternatives:
- "Want this as a horizontal bar chart instead?"
- "Want a donut version showing the same data?"
Do not generate variants unless the user asks.
Error Handling
- No data provided: Ask the user to supply the data values and labels. Do not generate placeholder
or example data unless explicitly requested.
- Data does not match chart type (e.g., non-percentage values for a donut): Warn the user and
suggest a more appropriate chart type. Offer to normalize if appropriate.
- Too many data points for the chart type (>12 bars, >8 donut segments): Warn that the chart
will be cluttered. Suggest grouping smaller values into an "Other" category or switching to a
table-plus-sparkline format.
- Custom colors fail contrast check (light text on light background or vice versa): Flag the
contrast issue and substitute a safe default while noting the change.
- User requests JavaScript or animation: Explain that the output is static SVG only. CSS
animations within SVG are acceptable if the user explicitly requests them — but no
<script> tags.
Examples
Example 1 — Bar chart for a report
User: "Chart forge: monthly revenue. Jan $12k, Feb $18k, Mar $15k, Apr $22k, May $19k, Jun $27k"
Skill generates a 600×380 vertical bar chart with 6 bars, value labels on top of each bar, month
labels on the x-axis, and a y-axis scaled to $30k. Title: "Monthly Revenue".
Example 2 — Donut chart for a one-pager
User: "Make a donut chart: Backend 45%, Frontend 30%, Infrastructure 25%"
Skill generates a 400×400 donut chart with three segments in blue/green/amber, percentage labels
on each segment, and a centered total label.
Example 3 — Stat card / KPI
User: "Progress ring showing 73% completion for Q2 goal"
Skill generates a 300×300 SVG with a thick ring arc filled to 73%, the percentage displayed large
in the center, and "Q2 Goal" as a subtitle below the number.
1---2name: chart-forge3description: Generates professional inline SVG data visualizations — bar charts, donut charts, progress rings, stat cards, comparison tables, and sparklines — from user-supplied data. Output is clean, print-ready SVG embeddable in HTML documents, reports, and one-pagers without external dependencies. Trigger phrases: "chart forge", "make a chart", "generate a bar chart", "create a donut chart", "visualize this data", "add a chart to my report", "SVG chart", "data visualization", "make this visual", "progress ring", "stat card", "inline chart", "embed a chart", "chart from this data", "turn this into a chart". Do NOT use for: code analysis, architecture diagrams, flowcharts or system diagrams (use /plan-directions), data analysis or statistics (use exploratory-data-analysis), writing or editing document prose, generating images via external APIs, or any task that does not involve rendering data as SVG.4---56## Important78All output is self-contained inline SVG — no external fonts, no CDN dependencies, no JavaScript.9The SVG must render correctly when pasted directly into an HTML file or viewed standalone in a browser.10Use system-safe fonts only (`-apple-system`, `Helvetica Neue`, `Arial`, `sans-serif`). Limit palette11to 5-6 colors maximum per chart. Never fabricate data — only visualize numbers the user provides.1213## Instructions14151. **Identify chart type and data.** Determine what the user wants to visualize. If the chart type16 is not specified, infer the best type from the data shape:17 - Categorical comparisons → horizontal or vertical bar chart18 - Part-of-whole (proportions that sum to 100%) → donut chart19 - Single KPI or completion percentage → progress ring or stat card20 - Two items being compared side-by-side → comparison graphic (split bar or versus card)21 - Time series trend (5+ points) → sparkline or area chart22 If the data is ambiguous or missing, ask for it before proceeding.23242. **Confirm data and labels.** Echo back the data you plan to visualize and ask for confirmation25 if any values seem inconsistent (e.g., percentages that don't sum to 100%, negative values in a26 donut, empty series).27283. **Determine dimensions.** Default canvas sizes:29 - Bar chart: 600 × 380px30 - Donut chart: 400 × 400px31 - Progress ring / stat card: 300 × 300px32 - Comparison graphic: 600 × 280px33 - Sparkline: 300 × 100px34 User may specify a custom size — honor it exactly.35364. **Choose a color palette.** Default palette (accessible, print-safe):37 - Primary: `#3B82F6` (blue)38 - Secondary: `#10B981` (green)39 - Accent: `#F59E0B` (amber)40 - Danger: `#EF4444` (red)41 - Neutral: `#6B7280` (gray)42 - Background: `#F9FAFB` or white43 If the user specifies brand colors, use those instead.44455. **Generate the SVG.** Build the SVG from scratch using only SVG primitives (`rect`, `circle`,46 `path`, `text`, `line`, `polyline`, `g`). Include:47 - A `viewBox` attribute so the chart scales correctly48 - Axis labels and value labels directly on the SVG (no legend box unless >4 series)49 - A chart title at the top if the user provides one50 - Clean whitespace/padding (at least 40px on all sides)51 - Rounded corners (`rx`) on bar chart bars for a modern look52 - Percentage labels inside or adjacent to donut segments53546. **Output the SVG block.** Wrap the SVG in a fenced code block labeled `svg` for easy copying:55 ````svg56 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 380" ...>57 ...58 </svg>59 ````60 After the code block, include a one-line description of what was generated and how to embed it:61 "Paste this SVG directly into your HTML. No dependencies required."62637. **Offer variants.** After delivering the primary chart, offer 1-2 quick alternatives:64 - "Want this as a horizontal bar chart instead?"65 - "Want a donut version showing the same data?"66 Do not generate variants unless the user asks.6768## Error Handling6970- **No data provided:** Ask the user to supply the data values and labels. Do not generate placeholder71 or example data unless explicitly requested.72- **Data does not match chart type** (e.g., non-percentage values for a donut): Warn the user and73 suggest a more appropriate chart type. Offer to normalize if appropriate.74- **Too many data points for the chart type** (>12 bars, >8 donut segments): Warn that the chart75 will be cluttered. Suggest grouping smaller values into an "Other" category or switching to a76 table-plus-sparkline format.77- **Custom colors fail contrast check** (light text on light background or vice versa): Flag the78 contrast issue and substitute a safe default while noting the change.79- **User requests JavaScript or animation:** Explain that the output is static SVG only. CSS80 animations within SVG are acceptable if the user explicitly requests them — but no `<script>` tags.8182## Examples8384**Example 1 — Bar chart for a report**85User: "Chart forge: monthly revenue. Jan $12k, Feb $18k, Mar $15k, Apr $22k, May $19k, Jun $27k"86Skill generates a 600×380 vertical bar chart with 6 bars, value labels on top of each bar, month87labels on the x-axis, and a y-axis scaled to $30k. Title: "Monthly Revenue".8889**Example 2 — Donut chart for a one-pager**90User: "Make a donut chart: Backend 45%, Frontend 30%, Infrastructure 25%"91Skill generates a 400×400 donut chart with three segments in blue/green/amber, percentage labels92on each segment, and a centered total label.9394**Example 3 — Stat card / KPI**95User: "Progress ring showing 73% completion for Q2 goal"96Skill generates a 300×300 SVG with a thick ring arc filled to 73%, the percentage displayed large97in the center, and "Q2 Goal" as a subtitle below the number.