tikz-figure-code

tikz-figure-code is a skill for Claude Code, Codex from 0xE1337/thesis-figure-skill. It costs 152 tokens per session (2,484 once invoked), scanned A, original, MIT.

An engineering guide for writing TikZ diagrams in LaTeX, a document system often used for technical and academic writing. It recommends relative positioning and layout rules so diagrams remain aligned when edited.

In plain words
What is it for?
Use it to write, review, compile, and repair TikZ or LaTeX figures, including layout, alignment, arrows, and Chinese-text rendering issues.
Why use it?
It reduces overlaps, overflow, misplaced arrows, and cascading layout breakage caused by manually entering many fixed coordinates.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to write, review, compile, and repair TikZ or LaTeX figures, including layout, alignment, arrows, and Chinese-text rendering issues.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/0xe1337/thesis-figure-skill/tikz-figure-code
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add 0xE1337/thesis-figure-skill --skill tikz-figure-code
Clone the repo
git clone --depth 1 https://github.com/0xE1337/thesis-figure-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tikz-figure-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/0xe1337/thesis-figure-skill/tikz-figure-code/github.svg)](https://agentmods.dev/skills/0xe1337/thesis-figure-skill/tikz-figure-code)
Your own site
<a href="https://agentmods.dev/skills/0xe1337/thesis-figure-skill/tikz-figure-code"><img src="https://agentmods.dev/badge/skills/0xe1337/thesis-figure-skill/tikz-figure-code/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tikz-figure-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/0xe1337/thesis-figure-skill/tikz-figure-code"><img src="https://agentmods.dev/badge/skills/0xe1337/thesis-figure-skill/tikz-figure-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 152 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,484 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00152 $0.02484
Opus 5.5 $0.00061 $0.00994
Sonnet 5.5 $0.00030 $0.00497
Haiku 4.5 $0.00015 $0.00248

Measured 2mo ago against content hash 29b113c473e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tikz-figure-code scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/lint.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/tikz-figure-code/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TikZ Figure Code — 写对 + 编辑安全的工程基础

这是确定性地基:怎么写出编译干净、不重叠、改一处不崩的 TikZ 代码。 它不管"画什么图才美"——那是设计/编排层(见 thesis-figure-skill)的事。 本技能管的是:无论画什么,代码本身得写对、扛得住编辑。

一句话定位:thesis-figure-skill 决定画什么,本技能保证怎么写不出错。

为什么需要它(问题的根)

模型写 TikZ 的默认习惯是**"坐标凭感觉"——\node at (5.2, 3.1)、\fill rectangle (x0,y0)(x1,y1), 一格一格手摆。这是业余写法**,导致两类必然的痛:

  1. 盲写:你写到第 800 行时不知道渲染出来什么样,碰撞/溢出/箭头不贴框只能编译后看图才发现 → 被迫进昂贵的"渲染→审查→修"循环。
  2. 编辑即崩:同一个间距/中心被手抄在多处(zone 边界、内容中心、箭头坐标、底栏…)。改一个 stage 宽度要同步 5 处,漏一处就崩——而静态 checker 抓不到(实测:一个加宽 hero 的编辑把 zone 压重叠、边框切穿内容,validator + overlap-checker 全报 0 硬 bug,只有看图才发现)。

解法不是加更多检测,是换写法。 专家写 TikZ 是写一张约束图(相对定位 + fit + matrix), 让布局引擎算位置——碰撞按构造不可能发生,图correct by construction,不是 correct-after-review。

证据:references/examples/ 里同一张 5-stage pipeline,绝对坐标版 (BAD) 和按构造版 (GOOD) 渲染视觉等价;但施加同一个最自然的编辑(加宽 hero / 加长 label),BAD 崩、GOOD 自动重排。 见 proof-edit-safety-hero-widen.png。

核心原则:LAYOUT BY CONSTRUCTION,不是 BY COORDINATE

作用域:按构造纪律施加在宏观骨架层(模块/zone 彼此怎么放、怎么连)。 嵌入 viz 内部(热力图一格格、柱状图)可以继续局部手画——它自包含、坐标错了不级联—— 但要用 \begin{scope}[shift={(parent.center)}] 挂到父节点 anchor,让它随父节点移动。

5 条 idiom(必须照做——散文指南传不了布局技能,照抄这些代码)

① 布局节奏只放一处

同一个间距/行高/列宽只定义一次,到处引用。永不把同一个数字抄在多处。

\newlength{\stagew}\setlength{\stagew}{4.5cm}   % 改一处,全图跟着变
\def\gap{0.5cm}
\tikzset{node distance=\gap}

② 模块用相对定位摆,不用绝对 at (x,y)

第一个锚定,其余 right=of / below=of 前一个。间距活在 node distance 一处。

\node[zone] (s1) at (0,0) {};
\node[zone, right=of s1] (s2) {};      % ✅ 间距由 node distance 决定
\node[zone, right=of s2] (s3) {};      % 加宽 s2 → s3 自动右移
% ❌ \node[zone] (s2) at (5,0) {};      % 手填 5 = 改 s1 宽度就得改这里

网格/表格用 \matrix of nodes,流水线用 chains——别手动给 x 加 2cm。

③ 连线走节点 anchor,永不重抄边界坐标 ← 单点最大收益

\draw[arrow] (s1.east) -- (s2.west);   % ✅ 任何重排下都不会错位
% ❌ \draw[arrow] (4.5,5) -- (5.0,5);   % 把 zone 边界又抄了一遍 = 改布局就断

箭头引用节点,就永远不可能 misalign。这一条单独就能消灭评审环里一大半 bug。

④ 容器用 fit,标签用 text width(换行)不用 minimum width(撑大)

\node[fit=(a)(b)(c), draw, rounded corners] {};         % zone 自动包住内容
\node[box, text width=3.2cm, align=center] {长标签会换行不会溢出};
% ❌ minimum width=3.2cm → 长标签把框横向撑大、顶破 zone

text width 让超长内容换行(保持框宽),minimum width 让框长出去(溢出邻居)。 前者把"碰撞 bug"(硬,必修)降级成"挤一点"(软,审美)。

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 130 lines · 152 tokens per session scan A 29b113c473e7

Subscribe to this mod's changes

tikz-figure-code is a skill published in the GitHub repository 0xE1337/thesis-figure-skill (151 stars, last pushed 3mo ago), licensed MIT. It adds 152 tokens to every session and 2,484 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

tikz-figure-code compared with skills from other repositories

tikz-figure-code next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tikz-figure-code0xE1337/thesis-figure-skillSkill1513mo agoMITA152Claude Code, Codex
pre-submission-reportflonat/flonat-researchSkill1493d agoMITA59Claude Code
proof-readabilityflonat/flonat-researchSkill1493d agoMITA50Claude Code, Codex
bib-parseflonat/flonat-researchSkill1493d agoMITA54Claude Code
computational-experimentsflonat/flonat-researchSkill1493d agoMITA43Claude Code
latexflonat/flonat-researchSkill1493d agoMITA74Claude Code
beamer-deckflonat/flonat-researchSkill1493d agoMITA63Claude Code