Agent skill

Tikz

by flonat in flonat/flonat-research

Diagnose and fix residual TikZ label, arrow, box, and Bézier-path collisions with geometric calculations.

MITAuto-check passedDocuments & Office

Install Tikz

skills CLI
$ npx skills add flonat/flonat-research --skill tikz -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install flonat/flonat-research tikz --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/flonat/flonat-research.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tikz .claude/skills/tikz && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
tikz
GitHub stars
145
Token cost
~3.1k tokens
SKILL.md length
1,525 words
Files
2
Skills in repo
83
Repo updated
First seen
Licence
MIT

At a glance

Diagnose and fix residual TikZ label, arrow, box, and Bézier-path collisions with geometric calculations.

  • Works in 4 steps: Identify the file and run the pre-check → For each TikZ diagram, run all 6 Passes… → Fix, recompile, repeat → …
  • A generated .tex figure has overlapping labels
  • SKILL.md covers Critical context: this is a…, Step 1: Identify the file and…, Step 2: For each TikZ diagram,… and Step 3: Fix, recompile, repeat, plus 4 more sections
  • Calls node

What it does

Tikz is an agent skill from flonat/flonat-research. Diagnose and fix residual TikZ label, arrow, box, and Bézier-path collisions with geometric calculations. Use when a generated .tex figure has overlapping labels or crossed arrows. Not for generating a new figure; use $figure or the upstream deck workflow.

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `tikz_rules.md`).

It sits in Documents & Office, covering LaTeX. The repository describes itself as: Shareable Claude Code + Codex infrastructure for PhD researchers — skills, agents, hooks, and rules for academic workflows. The licence is MIT.

When your agent uses it

  • A generated .tex figure has overlapping labels
  • Tasks that involve LaTeX

Example prompts

  • “/tikz”

Requirements

  • Pre-approved tools (allowed-tools): Bash(pdflatex*), Bash(latexmk*), Bash(grep*), Bash(ls*), Read, Edit, Glob

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Identify the file and run the pre-check
  2. For each TikZ diagram, run all 6 Passes in order
  3. Fix, recompile, repeat
  4. Re-audit the ENTIRE file after any fix

What it can do on your machine

Read from SKILL.md and the folder at commit da27600. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(pdflatex*)
    • Bash(latexmk*)
    • Bash(grep*)
    • Bash(ls*)
    • Read
    • Edit
    • Glob

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • node

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Tikz loads about 3.1k tokens when it runs. Until then it costs about 65 tokens; SKILL.md has 1,525 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from flonat/flonat-research at commit da27600, republished under its MIT licence (© flonat). 1,525 words, ~3,121 tokens.

Download SKILL.mdSave it as .claude/skills/tikz/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
tikz
description
Diagnose and fix residual TikZ label, arrow, box, and Bézier-path collisions with geometric calculations. Use when a generated .tex figure has overlapping labels or crossed arrows. Not for generating a new figure; use $figure or the upstream deck workflow.
allowed-tools
Bash(pdflatex*), Bash(latexmk*), Bash(grep*), Bash(ls*), Read, Edit, Glob
argument-hint
[path/to/file.tex]

TikZ Collision Audit

Purpose: Find and fix residual visual collisions in TikZ figures in a given .tex file. Labels on arrows, text inside boxes, arrows crossing arrows — this skill catches them using measurement, not intuition.

The fundamental rule: an AI agent cannot reliably eyeball where TikZ elements land. All placement must be verified mathematically before declaring it safe.


Critical context: this is a repair tool, not the primary defense

tikz runs after TikZ has been generated. It audits existing code and fixes what it finds. But it cannot reliably fix diagrams that were never built with measurement in mind.

The upstream defense is writing TikZ safely from the start:

  1. Every \node declares explicit minimum width and minimum height
  2. Every edge label carries a directional keyword (above, below, etc.)
  3. A coordinate map comment block precedes every tikzpicture
  4. Standard diagram types use canonical safe templates
  5. scale is never used on complex diagrams

When new decks are authored via beamer-deck, prefer applying these rules during generation. tikz is the downstream cleanup pass for anything that slipped through or for legacy/hand-written TikZ.

When upstream rules were applied: tikz should find few or no issues. Run it as a check.

When upstream rules were NOT applied (legacy TikZ, hand-written diagrams, inherited decks): tikz does its best, but expect more findings, more iteration, and lower reliability on autosized nodes and scaled diagrams.

The companion reference tikz_rules.md (in this skill's directory) contains the full formulas and worked examples — read it once before running the audit passes below.


Step 1: Identify the file and run the pre-check

If the user specified a file, use it. If not, ask. Then:

bash
grep -n "tikzpicture\|begin{frame}\|node\|draw\|bend\|foreach" [file].tex | head -100

Get a sense of scope: how many TikZ diagrams, how many frames, how many arrows.

Pre-check: were the generation rules followed?

Before running the six audit passes, quickly assess whether the TikZ was written safely:

bash
# Check for autosized nodes (no minimum width/height)
grep -n "\\\\node" [file].tex | grep -v "minimum"
bash
# Check for scale on tikzpicture
grep -n "scale=" [file].tex
bash
# Check for coordinate map comments
grep -n "% Coordinate map\|% Node map\|% Layout" [file].tex

If autosized nodes are widespread: warn that repair reliability will be lower. The fix is upstream — add explicit dimensions to every node. Consider doing that first before running the audit passes.

If scale is used on a complex diagram: warn that coordinates are compressed but text is not. Gap calculations in Passes 2–5 must compensate for the scale factor, but this compensation is fragile. The better fix is upstream: redesign at intended size.

If no coordinate map exists: the audit will take longer because spatial relationships must be reverse-engineered from the code rather than read from a plan.


Step 2: For each TikZ diagram, run all 6 Passes in order

Full rules and formulas are in tikz_rules.md alongside this SKILL. Read it if you haven't. What follows is the operational checklist — the reference file has the formulas and worked examples.


Pass 0: Cross-slide consistency
bash
grep -n "node.*{" [file].tex | grep -v "^[[:space:]]*%"

If the same diagram appears on multiple slides: colors, positions, and font sizes must be identical across all instances. Only the deliberate change (a new highlight, a new node) should differ.


Pass 1: Bézier curves — do this FIRST
bash
grep -n "bend" [file].tex

For each curved arrow found, compute:

chord_length = distance between the two endpoints
max_depth    = (chord_length / 2) × tan(bend_angle / 2)
safe_zone    = max_depth + 0.5cm

Quick reference:

Bendtan(angle/2)
20°0.176
25°0.222
30°0.268
35°0.315
40°0.364
45°0.414

Check 1: Is any label within safe_zone of the baseline, in the direction the curve bends? If yes → move the label.

Check 2: Does the curve cross any other arrow in the same figure? Curves bending down cross vertical arrows. Fix: reverse the bend direction.


Pass 2: Label-between-nodes gap calculation

For every arrow label placed between two nodes:

Available gap  = center-to-center distance − half-width(A) − half-width(B)
Usable space   = Available gap − 0.6cm   [0.3cm padding each side]

Estimate label width using character counts:

FontWidth/char
\scriptsize0.10 cm
\footnotesize0.12 cm
\small0.15 cm
\normalsize0.18 cm
Bold+10%

Known limitation: these estimates break down for math mode ($\beta$ is wider than 1 character), \textbf content, multi-word labels, and anything non-ASCII. When in doubt, overestimate width by 20%.

If scale is in effect: multiply the usable space by the scale factor, but leave the label width estimate at native size. This is the core of the scale problem — coordinates shrink, text does not.

If estimated label width > usable space: guaranteed collision. Fix: move above/below, or shorten text, or increase node spacing.

The most common fix for labels that exceed the gap: break the label out as a standalone \node positioned above the arrow midpoint — clear of both boxes — rather than as an inline edge label.


Pass 3: Arrow label positioning keywords
bash
grep -n "node\[" [file].tex | grep -v "above\|below\|left\|right\|anchor\|pos\|midway\|near"

Every arrow label must carry a directional keyword. Any node[...] on an arrow without above, below, left, right, anchor=, pos=, or midway will sit ON the arrow line. Fix: add the keyword.


Pass 4: Labels vs. drawn shapes (Boundary Rule)

For every \node, \fill, \draw circle/rectangle: compute the boundary. Any text within 0.4cm of a shape edge is a collision.

Circles: center (cx, cy), radius r → boundary from cy − r to cy + r Rectangles/boxes: bottom-left (x,y), width w, height h → top edge at y + h

If a label coordinate puts it inside or touching a shape boundary — move it 0.4cm outside.

Note on scale: scale=0.8 shrinks coordinates but NOT text. A 2 cm gap becomes 1.6 cm, but a \small label stays \small. Recalculate all gaps accounting for scale. If the diagram uses scale on a complex figure, flag this to the user as an upstream problem — the reliable fix is to redesign at intended size, not to compensate in the audit.


Pass 5: Margin check

Minimum clearances:

PairMinimum
Label ↔ label0.3 cm
Label ↔ axis line0.3 cm
Label ↔ arrow0.3 cm
Arrow origin ↔ box edge0.15 cm
Label ↔ shape boundary0.4 cm
Any object ↔ slide edge0.5 cm

Also check:

  • Multi-line nodes have align=center or align=left?
  • No node text clipped by the slide margin?
  • If scale is used: did text get unintentionally large relative to shrunken coordinates?

Show full SKILL.md (579 more words)Show less
Pass 6: Debug bounding-box verification

Do NOT attempt to visually inspect the PDF by "eyeballing." An AI agent cannot reliably see TikZ collisions in rendered PDFs. Instead, use a debug bounding-box approach:

  1. Temporarily add red debug outlines around every node to make bounding boxes structurally visible:
latex
% DEBUG — add to preamble temporarily, remove before shipping
\tikzset{every node/.append style={draw=red, very thin}}
  1. Compile and inspect: with red outlines, overlapping bounding boxes are visible as overlapping red rectangles. This makes collisions structurally obvious rather than visually estimated.

  2. For each red-box overlap found: go back to the source, fix the coordinates or dimensions, remove the debug line, and recompile.

  3. Remove the debug line before declaring the audit complete. The debug outlines are a diagnostic tool, not a permanent addition.

This replaces the older instruction to "open the PDF and visually confirm." The debug-outline method catches the same problems but does not depend on Claude's unreliable ability to interpret rendered PDF geometry.


Step 3: Fix, recompile, repeat

After making fixes, prefer latexmk (the user's default):

bash
latexmk -pdf -interaction=nonstopmode [file].tex 2>&1 | grep -E "Overfull|Underfull|Error|Warning"

or pdflatex if latexmk isn't set up for the file:

bash
pdflatex -interaction=nonstopmode [file].tex 2>&1 | grep -E "Overfull|Underfull|Error|Warning"

Must return zero lines of Error. Fix any new Overfull/Underfull warnings introduced by the repositioning. Repeat until clean.


Step 4: Re-audit the ENTIRE file after any fix

One collision fix often reveals a second one nearby, or introduces a new label that now crowds a different object. After every change, re-run Passes 1–5 on all TikZ figures in the file — not just the one you just touched.

bash
grep -c "tikzpicture" [file].tex

That count is how many diagrams need a clean bill of health.


Known limitations

These are the cases where tikz is least reliable. When you encounter them, the better fix is almost always upstream (rewrite the TikZ safely) rather than downstream (try to repair it).

LimitationWhy it's hardUpstream fix
Autosized nodes (no minimum width/minimum height)Rendered dimensions depend on text content and font — tikz can only estimate, not compute exactlyAdd explicit dimensions
scale on complex diagramsCoordinates shrink but text does not; gap calculations require fragile compensationRedesign at intended size
Math-mode label widths$\hat{\beta}_{it}$ is wider than character-count × width/char suggestsOverestimate by 20–30% or measure with a test compile
Nested tikzpicture environmentsCoordinate systems interact unpredictablyFlatten into a single environment
\foreach loops generating many nodesGap calculations must be done per-iteration; easy to miss oneWrite explicit nodes for small counts; check loop bounds for large counts

Common collision patterns and fast fixes

PatternSymptomFix
Label between wide boxesText bleeds into box edgeMove label above arrow as standalone \node
Step 1 / Step 2 labels on flow diagramsLabels overlap box textPlace labels above the arrow band, not as edge labels
Diagonal arrow label at below rightLabel lands inside another boxUse pos=0.55 + compute landing position
Return curve crossing vertical arrowArrows intersect visuallyReverse bend direction (bend left ↔ bend right)
Scale mismatchText large, gaps smallRedesign at intended size; do not use scale on complex diagrams
Slope label on regression lineLabel sits on the lineUse node[anchor=west] at a point 0.3cm off the line end
\\ inside \textcolor{}Hbox overflowBreak into two separate \textcolor calls on separate lines
Curve labels at right endpoints colliding with brace annotationsLabels horizontally adjacent at similar yMove curve labels to different x position, or use a legend in the text column instead

Acknowledgments

Ported from Scott Cunningham's MixtapeTools skill library (resources/academics/scott-cunningham/MixtapeTools/.claude/skills/tikz/). The companion tikz_rules.md is adapted from MixtapeTools/.claude/skills/compiledeck/tikz_rules.md. Upstream-defense references have been rewritten to point at beamer-deck and the user's unified user-beamer template.

© flonat, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/tikz of flonat/flonat-research.

  • SKILL.md
  • tikz_rules.md

Open the folder on GitHubat commit da27600

Compare with similar skills

Tikz next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Tikz compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tikz this skillflonat/flonat-research145—~3.1kAutomated safety check: PassMIT
Research Writingalfonso0512/research-writing-skill4871 repos~818Automated safety check: PassMIT
Paper WritingMLNLP-World/Paper-Writing-Tips4.7k—~630Automated safety check: PassNone
Evomath TaoEvoScientist/EvoSkills4752 repos~3.8kAutomated safety check: PassApache-2.0
Math Modeling to EI Conference Paperjihe520/MathModelAgent6.2k—~688Automated safety check: PassNone
PaperjurySpark-To-Paper-Skills/paperjury1.2k—~5.3kAutomated safety check: PassMIT

Similar skills

  • Research Writing

    alfonso0512/research-writing-skill

    科研论文写作助手,提供 30 个 Prompt 模板覆盖论文写作全流程. An agent skill from alfonso0512/research-writing-skill.

    487 GitHub starsUsed in 1 repo~818 tokens
    Documents & OfficeAuto-check passed
  • Paper Writing

    MLNLP-World/Paper-Writing-Tips

    学术论文写作检查与优化助手。基于 MLNLP-World 社区整理的论文写作技巧,帮助检查和优化学术论文。Use when: (1) 检查论文 LaTeX 格式和排版, (2) 优化公式符号使用, (3) 改进图表设计, (4) 润色英文学术表达, (5) 检查参考文献格式, (6) 投稿前终稿检查, (7) 用户询问论文写作技巧或规范。

    4.7k GitHub stars~630 tokensUpdated 12 days ago
    Documents & OfficeAuto-check passed
  • Evomath Tao

    EvoScientist/EvoSkills

    A skill your agent uses whenever the user submits a non-trivial mathematical claim that needs a rigorous proof or audit.

    475 GitHub starsUsed in 2 repos~3.8k tokens
    Documents & OfficeAuto-check passed
  • Rewrites a math modeling competition paper into an English EI conference submission, using a bundled IEEE LaTeX template, with evidence tracked back to the original paper.

    6.2k GitHub stars~688 tokensUpdated 5 days ago
    Documents & OfficeAuto-check passed
  • Paperjury

    Spark-To-Paper-Skills/paperjury

    Three modes for CS-conference papers (CVPR/ICCV/ECCV vision, ACL/EMNLP/NAACL NLP, ICLR/NeurIPS/ICML/AAAI ML).

    1.2k GitHub stars~5.3k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Compiledeck

    scunning1975/MixtapeTools

    Create and compile beautiful Beamer presentations following the Rhetoric of Decks philosophy.

    470 GitHub starsUsed in 2 repos~3.1k tokens
    Documents & OfficeAuto-check passed

More from flonat/flonat-research

All 83 skills in this repo
  • Latex Posters

    flonat/flonat-research

    Create a large-format academic poster in LaTeX using beamerposter, tikzposter, or baposter.

    145 GitHub stars~1.5k tokensUpdated 9 days ago
    Auto-check: notes
  • Skill Creator

    flonat/flonat-research

    Create, revise, and evaluate reusable AI workflow skills, including trigger-quality tests.

    145 GitHub stars~4.4k tokensUpdated 9 days ago
    Auto-check passed
  • DOCX

    flonat/flonat-research

    Create, read, edit, or convert Microsoft Word documents while preserving professional document structure.

    145 GitHub stars~1.2k tokensUpdated 9 days ago
    Auto-check passed
  • PDF

    flonat/flonat-research

    Read, create, combine, split, rotate, OCR, watermark, secure, or extract content from PDF files.

    145 GitHub stars~488 tokensUpdated 9 days ago
    Auto-check passed
  • Init Project Orchestration

    flonat/flonat-research

    Create or migrate project-level agents, repeatable project workflows, and planning state from one client-neutral contract, then render repository-scoped adapters for both Claude Code and Codex.

    145 GitHub stars~1.6k tokensUpdated 9 days ago
    Auto-check passed
  • Pre Commit Audit

    flonat/flonat-research

    Deliver a fast pre-commit safety scan: file size, anonymity (author / affiliation strings in tex/bib), hardcoded secrets, and invisible-Unicode carriers.

    145 GitHub stars~2.8k tokensUpdated 9 days ago
    Auto-check: notes

Questions about Tikz

What does Tikz do?

Diagnose and fix residual TikZ label, arrow, box, and Bézier-path collisions with geometric calculations. Tikz is an agent skill from flonat/flonat-research. Diagnose and fix residual TikZ label, arrow, box, and Bézier-path collisions with geometric calculations.

When should I use Tikz?

Tikz fits situations like: A generated .tex figure has overlapping labels; tasks that involve LaTeX.

How do I install Tikz in Claude Code?

Run `npx skills add flonat/flonat-research --skill tikz -a claude-code`. Or copy the skill folder (skills/tikz in flonat/flonat-research) into .claude/skills/tikz in your project. Claude Code loads it when a task matches its description.

How do I install Tikz in Codex?

Run `npx skills add flonat/flonat-research --skill tikz -a codex`. Or copy the skill folder (skills/tikz in flonat/flonat-research) into .agents/skills/tikz in your project. Codex loads it when a task matches its description.

Can I use Tikz in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add flonat/flonat-research --skill tikz -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tikz, .gemini/skills/tikz, .github/skills/tikz and .opencode/skills/tikz in your project.

What does Tikz need to run?

Going by SKILL.md and its folder, Tikz needs the command-line tools its instructions call (node). Its frontmatter pre-approves these tools: Bash(pdflatex*), Bash(latexmk*), Bash(grep*), Bash(ls*), Read, Edit, Glob.

Does Tikz access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Tikz safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Tikz use?

Tikz is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Tikz use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Tikz?

Skills that share tags, products or a category with Tikz: Research Writing (alfonso0512/research-writing-skill, 487 stars), Paper Writing (MLNLP-World/Paper-Writing-Tips, 4.7k stars), Evomath Tao (EvoScientist/EvoSkills, 475 stars) and Math Modeling to EI Conference Paper (jihe520/MathModelAgent, 6.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tikz?

flonat (a GitHub user) maintains it in flonat/flonat-research, which has 145 GitHub stars. The repository holds 83 skills in this directory. The repository was last updated on September 29, 2026.

Source: flonat/flonat-research on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.