agentleFS
lldxflwblldxflwb/claude-code-skills/skills/tikz/SKILL.md

tikz

Skill28 starsChanged 8 months agoMITView on GitHub

Use TikZ to create high-quality vector diagrams and visualizations rendered to SVG with instant browser preview. Use this skill whenever the user asks to draw, visualize, or create diagrams — flowcharts, architecture diagrams, neural networks, mathematical figures, circuit diagrams, graphs, trees, state machines, timelines, or any structured visual. Also triggers on mentions of TikZ, LaTeX drawing, or pgfplots. Even if the user just says 'draw me a diagram' without mentioning TikZ, use this skill if TikZ is a good fit.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. scunning1975/MixtapeTools★ 473same name
    2. flonat/flonat-research★ 150same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository4 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Step 1: Write a .tex file in the project directory using the Write tool:

    line 12
  2. Very specific:

    Call ensure_server.py — the render script handles server internally

    line 53
  3. Distinctive:

    When creating diagrams for a plan or markdown document, render the diagram first, then use the relative URI as a markdown image:

    line 58
  4. Very specific:

    Use relative URI (e.g. /name.svg), not absolute URL or local file path.

    line 64
  5. Very specific:

    Write partial code (just \begin{tikzpicture}...\end{tikzpicture} + \usetikzlibrary / \usepackage lines) — auto-wrapped in standalone …

    line 68
  6. Very specific:

    Use positioning library for right=of syntax

    line 70
  7. Very specific:

    Use arrows.meta for modern arrow styles

    line 71
  8. Distinctive:

    Before first use, read setup.md and follow both steps:

    line 107
  9. Distinctive:

    Ask the user if they want to configure host, port, or default view mode

    line 109

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

TikZ Diagram Skill

How to Use

Step 1. Write a .tex file in the project directory using the Write tool:

\usetikzlibrary{arrows.meta, positioning}
\begin{tikzpicture}
  \node[circle, draw] (a) {A};
  \node[circle, draw, right=of a] (b) {B};
  \draw[->] (a) -- (b);
\end{tikzpicture}

Step 2. Pass the file path to the render script:

python3 /Users/karlchen/.claude/skills/tikz/scripts/render_tikz.py <path-to-tex-file>

Output is two lines: the URL and the local PNG file path. Each render gets a unique timestamp, so re-running the same file produces a new URL.

Step 3. Spawn a subagent to verify the rendering result and iterate if needed:

Use the Agent tool to spawn a subagent with this prompt:

"Read the PNG image at <png-path> and the TikZ source at <tex-path>.
Verify the rendering quality:
- Is any text overlapping or cut off?
- Are elements too crowded or poorly spaced?
- Are arrows and connections clear?
- Is the overall layout readable?

If issues are found, edit the .tex file to fix them (increase node distance,
adjust font size, reposition elements, etc.), then re-render:
  python3 /Users/karlchen/.claude/skills/tikz/scripts/render_tikz.py <tex-path>
Read the new PNG and verify again. Repeat until the result looks good.
Return the final URL."

Step 4. Return the final URL from the subagent to the user.

Do NOT:

  • Call ensure_server.py — the render script handles server internally
  • Open the URL with open command or browser tools

Embedding in Plan Documents

When creating diagrams for a plan or markdown document, render the diagram first, then use the relative URI as a markdown image:

![Pipeline Overview](/diagram_20260316_120000_123456.svg)

Use relative URI (e.g. /name.svg), not absolute URL or local file path. The plan viewer will display the image inline.

TikZ Tips

  • Write partial code (just \begin{tikzpicture}...\end{tikzpicture} + \usetikzlibrary / \usepackage lines) — auto-wrapped in standalone document
  • Or write a full document with \documentclass — used as-is
  • Use positioning library for right=of syntax
  • Use arrows.meta for modern arrow styles

Temp Markdown Preview

The preview server hosts a /temp/ directory for viewing arbitrary markdown files (translations, notes, etc.).

Submit content via the script (similar to render_tikz.py):

# Copy a file into temp preview
python3 /Users/karlchen/.claude/skills/tikz/scripts/submit_temp.py <path-to-file>

# Symlink instead of copy (good for large files or live-editing)
python3 /Users/karlchen/.claude/skills/tikz/scripts/submit_temp.py --link <path>

# Symlink a directory
python3 /Users/karlchen/.claude/skills/tikz/scripts/submit_temp.py --link /path/to/docs/

# Custom name
python3 /Users/karlchen/.claude/skills/tikz/scripts/submit_temp.py --name translated.md <path>

Output is two lines: the preview URL and the path in the temp directory. The script ensures the server is running automatically.

  • .md files are rendered with full markdown viewer (e-ink / normal / eyecare modes, TOC, auto-refresh)
  • Directories get an auto-generated index page
  • Other files are served as static downloads

Do NOT manipulate the temp directory directly — always use the script.

Error Recovery

Compilation errors are printed to stderr. Read the error, fix the .tex file, re-render.

Prerequisites

Before first use, read setup.md and follow both steps:

  1. Install dependencies (tectonic + pdf2svg)
  2. Ask the user if they want to configure host, port, or default view mode

Server Management

Server runs automatically. To stop (only when user explicitly asks):

python3 /Users/karlchen/.claude/skills/tikz/scripts/ensure_server.py --stop

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.