Tooluck logoTooluck
SKILL.md

baoyu-diagram

Agent skill fromJimLiu/baoyu-skills

Create professional diagrams with configurable dark/light theme via CSS custom properties. Use this skill whenever the user asks for any kind of technical or conceptual diagram, visualization of a system, process flow, data flow, component relationship, network topology, decision tree, org chart, state machine, or any visual representation of structure/logic/process. Also trigger when the user says "画个图" "画一个架构图" "diagram" "flowchart" "sequence diagram" "draw me a ..." or uploads content and asks to visualize it. Outputs a dark-theme SVG, a light-theme SVG, and a @2x PNG of each.

How to install baoyu-diagram

install baoyu-diagram
# install the baoyu-skills pack with the skills CLI
npx skills add JimLiu/baoyu-skills

# or add only this skill to Claude Code: copy the folder

skills/baoyu-diagram/

# into

~/.claude/skills/baoyu-diagram/ (all projects)

.claude/skills/baoyu-diagram/ (one project)

skills/baoyu-diagram/SKILL.md

MITFull file
1# Diagram Generator
2
3Create SVG diagrams. Each SVG embeds its own styles, uses CSS custom properties for theming, and loads nothing over the network.
4
5## Output Files
6
7For a diagram saved as `<name>.svg`, produce exactly these files:
8
9| File | What it is | Made by |
10|------|-----------|---------|
11| `<name>.svg` | Source SVG, CSS variables with dark theme values | You (the LLM) |
12| `<name>.light.svg` | Same markup with light theme values | `theme-switch.ts --theme=light` |
13| `<name>@2x.png` | Dark PNG at 2x scale | `main.ts` |
14| `<name>.light@2x.png` | Light PNG at 2x scale | `main.ts --theme light` |
15
16If the user asks for only one theme, or only SVG, produce just those files.
17
18## Themes
19
20All colors are CSS custom properties defined in the `:root` block of the SVG's `<style>`; markup references them as `var(--bg)`, `var(--color-primary-fill)`, etc. Never hardcode color values in SVG attributes.
21
22Theme values live in `{baseDir}/themes/<name>.json` — one flat JSON object mapping CSS property names (keys starting with `--`) to colors. Other keys (e.g. `"description"`) are metadata, ignored by scripts. Built-in: `dark.json`, `light.json`.
23
24**Custom themes:** drop a new `.json` into `themes/` — no script changes needed:
25
26```json
27// themes/my-brand.json
28{
29 "description": "Corporate brand theme",
30 "--bg": "#ffffff",
31 "--text": "#1a1a2e",
32 "--text-muted": "#6b7280",
33 "--arrow": "#9ca3af",
34 "--color-primary-fill": "rgba(37,99,235,0.12)",
35 "--color-primary-stroke": "#2563eb",
36…

Excerpt shown under the repository's MIT license.

More skills in baoyu-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates