tikz-iterate — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited tikz-iterate (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Compile a TikZ snippet, render the PDF to a PNG, ask the tikz-reviewer sub-agent to judge it, apply the returned fixes, and repeat until the reviewer says APPROVED or the iteration cap (default 5) is reached. The skill orchestrates the loop; the sub-agent does the visual judgment.
Concept inspired by Scott Cunningham's /tikz 3-pass collision audit in scunning1975/MixtapeTools. This skill extends the idea into a multi-round refine loop driven by the tikz-reviewer sub-agent.
Trigger on any of:
/tikz-iterateDo not invoke for:
/slide-excellence.tikz-reviewer sub-agent directly.| Argument | Type | Default | Meaning |
|---|---|---|---|
positional path-or-snippet | string | required | A .tex/.tikz file path, or an inline TikZ block. If the input is not a complete document, the skill wraps it. |
--goal="..." | string | empty | Free-text description of what the diagram should communicate (passed to the reviewer). |
--max-iter=N | int | 5 | Hard cap on compile/review rounds. |
--output=path | string | <scratch>/final.tex | Where to write the approved .tex. |
The skill needs two binaries on PATH:
latexmk — bundled with MiKTeX (Windows), MacTeX (macOS), and TeX Live (Linux).pdftoppm — ships with the Poppler bundle included in MiKTeX, MacTeX (via the poppler Homebrew dep), and TeX Live's standard install. On Linux distros without it: sudo apt install poppler-utils.If either binary is missing, surface SETUP_MISSING:<tool> to the caller and stop. See docs/tex-setup.md (to be written) for per-OS install notes.
Use a scratch directory under ~/.claude/state/tikz-iterate/<timestamp>/ to keep .aux, .log, and .pdf debris isolated from the user's project tree.
Resolve path-or-snippet: if it's a path that exists, Read it; otherwise treat the argument as inline TikZ source. Detect whether the input already contains \documentclass.
If the input lacks \documentclass, wrap with this minimal standalone preamble:
\documentclass[tikz,border=4pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning,calc,decorations.pathreplacing,shapes.geometric}
\usepackage{amsmath,amssymb}
\begin{document}
% --- user TikZ here ---
\end{document}Write to <scratch>/diagram.tex.
cd ~/.claude/state/tikz-iterate/<timestamp>
latexmk -pdf -interaction=nonstopmode -halt-on-error diagram.texSame command on Windows, macOS, and Linux. If exit code is non-zero, read diagram.log, extract the first line matching ^! plus the following l.<N> line, and surface COMPILE_FAILED:<line>:<message>. Abort the loop.
pdftoppm -r 200 diagram.pdf diagramProduces diagram-1.png at 200 DPI. If pdftoppm fails or the PNG is missing, surface RENDER_FAILED:<message> and abort.
Invoke the tikz-reviewer sub-agent via the Task tool with subagent_type: "tikz-reviewer" and the prompt template below. The sub-agent's Read tool will pick up the PNG as multimodal input.
Copy the current .tex to --output. Surface the PNG path. Write a one-paragraph rationale describing what changed across iterations (collect the issue list from each round's reviewer response).
Parse the numbered fix list. Apply each fix to <scratch>/diagram.tex using the Edit tool with surgical old_string/new_string replacements — do not rewrite the whole snippet. Bump iteration counter. Go to Step 3.
If iteration counter reaches --max-iter without approval, surface:
<scratch>/diagram.tex path.Let the caller decide whether to merge, continue manually, or restart with a different goal.
The exact text sent to tikz-reviewer on each round:
You are reviewing a TikZ diagram for visual quality.
ITERATION: {iter} of {max_iter}
USER GOAL:
{goal_or_"(none provided — judge purely on visual quality)"}
CURRENT TIKZ SOURCE (file: {tex_path}):{tex_contents}
RENDERED PNG: {png_path}
Please Read the PNG to inspect the actual rendered output.
Evaluate using your standard checks (label overlap, geometric accuracy,
visual semantics, spacing, polish). Then return EXACTLY ONE of:
(a) The single word APPROVED on its own line — if zero CRITICAL and zero
MAJOR issues remain.
(b) A numbered list of concrete fixes, each phrased as a surgical edit
the orchestrator can apply via search-and-replace. Example:
1. Node "A" overlaps the arrow from (1,0) to (2,1).
Change `\node at (1.5,0.5) {A};` to `\node at (1.5,0.9) {A};`.
2. Missing arrowhead on the edge B->C.
Change `\draw (B) -- (C);` to `\draw[->] (B) -- (C);`.
Each item must name the problem AND give the exact textual replacement.
Do NOT rewrite the whole snippet. Do NOT include explanatory prose
outside the numbered list.| Symptom | Cause | Skill response |
|---|---|---|
latexmk exits non-zero | LaTeX syntax error in snippet or preamble | Surface COMPILE_FAILED:<line>:<msg> from .log, abort. |
pdftoppm exits non-zero or PNG absent | Poppler missing, PDF corrupt | Surface RENDER_FAILED:<msg>, abort. |
Sub-agent returns neither APPROVED nor a parseable list | Reviewer drift | Re-prompt once with "Please respond in the required format." If second attempt also fails, abort and surface the raw response. |
| Sub-agent times out | Task tool timeout | Treat as iteration failure; surface scratch path and let caller retry. |
Reaches --max-iter | Genuinely hard diagram, or oscillation between two fixes | Surface last PNG, outstanding fix list, and in-progress .tex. |
Input: a .tikz file with four nodes and three edges; labels overlap two arrows.
/tikz-iterate ~/scratch/causal-dag.tikz --goal="DAG showing X -> Y with mediator M and confounder U"Iteration 1: reviewer flags label M overlapping the X->Y edge and a missing arrowhead on U->Y. Skill applies both surgical edits. Iteration 2: reviewer returns APPROVED. Final .tex written to --output; PNG path surfaced.
Input: an inline TikZ block (no \documentclass) drawing six coefficient estimates with CIs.
/tikz-iterate "<pasted tikz>" --goal="coefficient plot, CIs not touching the y-axis labels, treatment color = ForestGreen"Skill wraps the snippet, compiles. Iteration 1: reviewer flags two CI whiskers crossing the y-axis tick labels and a red literal violating the requested ForestGreen. Iteration 2: minor — one label vertical-anchor inconsistency. Iteration 3: APPROVED. Rationale paragraph notes the three concrete shifts applied.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.