Agent skill

Tikz Figure Code

by 0xE1337 in 0xE1337/thesis-figure-skill

写出高质量、一次过编译、编辑安全的 TikZ/LaTeX 配图代码的工程基础技能. An agent skill from 0xE1337/thesis-figure-skill.

MITAuto-check passedDocuments & Office

Install Tikz Figure Code

skills CLI
$ npx skills add 0xE1337/thesis-figure-skill --skill tikz-figure-code -a claude-code

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

GitHub CLI
$ gh skill install 0xE1337/thesis-figure-skill tikz-figure-code --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/0xE1337/thesis-figure-skill.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/tikz-figure-code .claude/skills/tikz-figure-code && 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-figure-code
GitHub stars
142
Used in
1 other repo
Token cost
~1.2k tokens
SKILL.md length
316 words
Files
8 (incl. references)
Skills in repo
2
Repo updated
First seen
Licence
MIT

At a glance

写出高质量、一次过编译、编辑安全的 TikZ/LaTeX 配图代码的工程基础技能. An agent skill from 0xE1337/thesis-figure-skill.

  • Works in 2 steps: 盲写:你写到第 800… → 编辑即崩:同一个间距/中心被手抄在多处(zone…
  • : 写/审 TikZ 或 LaTeX 图代码、修图的排版/对齐/溢出/箭头问题、 tikz layout、latex figure code、tikz 编译报错、CJK 中文图渲染成色块
  • SKILL.md covers 为什么需要它(问题的根), 核心原则:LAYOUT BY CONSTRUCTION,不是…, 5 条… and 8 条硬约束(违反必失败——加载…, plus 4 more sections
  • Runs Shell scripts from its folder; calls node and bash

What it does

Tikz Figure Code is an agent skill from 0xE1337/thesis-figure-skill. 写出高质量、一次过编译、编辑安全的 TikZ/LaTeX 配图代码的工程基础技能。 教 agent 用「按构造布局」(positioning/fit/chains/anchor) 而非「手填绝对坐标」, 附 8 条硬约束、canonical 箭头、before/after 范例、一个静态检查入口 (lint.sh)。 Use when: 写/审 TikZ 或 LaTeX 图代码、修图的排版/对齐/溢出/箭头问题、 tikz layout、latex figure code、tikz 编译报错、CJK 中文图渲染成色块。

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files, including reference files (for example `references/by-construction.md`, `references/examples/README.md` and `references/hard-constraints.md`).

It sits in Documents & Office, covering LaTeX, Essays and academic help and Linting and formatting. It works with LaTeX. The repository describes itself as: 🎓 Claude Skill: Paste your paper text, auto-generate publication-ready LaTeX/TikZ diagrams. 粘贴论文文案,自动生成学术级配图。 The licence is MIT.

When your agent uses it

  • : 写/审 TikZ 或 LaTeX 图代码、修图的排版/对齐/溢出/箭头问题、 tikz layout、latex figure code、tikz 编译报错、CJK 中文图渲染成色块
  • Tasks that involve LaTeX
  • Tasks that involve Essays and academic help

Example prompts

  • “/tikz-figure-code”

Requirements

  • A Bash shell

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

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

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • node
    • bash

    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 Figure Code loads about 1.2k tokens when it runs, and up to ~67k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 316 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~70
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~67k

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 0xE1337/thesis-figure-skill at commit ffe6d07, republished under its MIT licence (© 0xE1337). 316 words, ~1,160 tokens.

Download SKILL.mdSave it as .claude/skills/tikz-figure-code/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
tikz-figure-code
description
写出高质量、一次过编译、编辑安全的 TikZ/LaTeX 配图代码的工程基础技能。 教 agent 用「按构造布局」(positioning/fit/chains/anchor) 而非「手填绝对坐标」, 附 8 条硬约束、canonical 箭头、before/after 范例、一个静态检查入口 (lint.sh)。 Use when: 写/审 TikZ 或 LaTeX 图代码、修图的排版/对齐/溢出/箭头问题、 tikz layout、latex figure code、tikz 编译报错、CJK 中文图渲染成色块。

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(必须照做——散文指南传不了布局技能,照抄这些代码)

① 布局节奏只放一处

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

latex
\newlength{\stagew}\setlength{\stagew}{4.5cm}   % 改一处,全图跟着变
\def\gap{0.5cm}
\tikzset{node distance=\gap}
② 模块用相对定位摆,不用绝对 at (x,y)

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

latex
\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,永不重抄边界坐标 ← 单点最大收益
latex
\draw[arrow] (s1.east) -- (s2.west);   % ✅ 任何重排下都不会错位
% ❌ \draw[arrow] (4.5,5) -- (5.0,5);   % 把 zone 边界又抄了一遍 = 改布局就断

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

④ 容器用 fit,标签用 text width(换行)不用 minimum width(撑大)
latex
\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"(硬,必修)降级成"挤一点"(软,审美)。

⑤ 整体居中用 calc 中点,不手算
latex
\coordinate (c) at ($(first.north west)!0.5!(last.north east)$);
\node[anchor=south] at ($(c)+(0,0.5)$) {标题};   % 行变宽,标题自动跟着居中

8 条硬约束(违反必失败——加载 references/hard-constraints.md 看全)

最高频的几条(很多是 CJK / xelatex 静默坑):

  • ⚠️ CJK 节点上 rotate=90 → 渲成不可读色块。所有中文标注必须水平。
  • ⚠️ \texttt{…中文…} → 报错。\texttt 只包纯英文代码。
  • ⚠️ xelatex 对缺失字体静默失败 → 编译后必须 grep "Missing character" *.log,非 0 = 字体没解析(常是 CJK)。
  • ⚠️ 直线单段 -- 上加 rounded corners → 端点鬼影弧。只在 ≥2 段折线 / |- 用。
  • ⚠️ 路径有弯折但没 \usetikzlibrary{bending} → 弯路上箭头 tip 必然 mis-align。
  • ⚠️ (A.south) |- (B.west) 当 A.x 落在 B 的 x 范围内 → 横线穿过 B 内部 (pierce)。用 waypoint 绕开或换 anchor。

Canonical 箭头(别手写 -{Stealth[scale=X]})

用预定义 style,只调 line width(0.6/1.0/1.6pt 三档),tip 自动跟随。详见 ../thesis-figure-skill/references/tikz-template.tex 的 6 个 canonical styles。铁律:

  • < 1.5cm 短箭头必用 arrow short(tip 3pt),否则默认 6.5pt tip 把 stem 吃光 = "只剩个头"。
  • fan-out 分叉的 stub 用 fan_stub(shorten <=0pt,紧贴 spine 无 gap),不用 arrow。
  • \usetikzlibrary{bending} 必加载。

工作流:写 → lint → 看图

bash
bash references/lint.sh figure.tex

一个入口跑完:① tikz-validator(编译前静态:微斜线/溢出/碰撞)→ ② xelatex 编译 → ③ missing-char 闸门 → ④ pdf-overlap-checker(硬 bug vs 候选分开报)→ ⑤ design-linter(advisory)。 退出码 0 = 无硬 bug,1 = 有硬 bug。

checker 是地板不是天花板。 它消灭便宜的 20%(编译错、重叠、已知坑),抓不到贵的 80% (图记不记得住、跨面板数字自洽、新几何对不对)。lint 过了仍必须亲眼看渲染 PNG—— 很多崩坏(zone 重叠、边框切穿内容)static 全盲,只有看图才发现。

何时用本技能 vs thesis-figure-skill

你要做的用
写/审任何 TikZ 图代码、修排版/对齐/溢出/箭头 bug、CJK 渲染问题本技能
把论文文案/参考图变成成品配图(设计 + 编排 + 视觉迭代 + skeleton 复用)thesis-figure-skill(它在代码正确性层 compose 本技能)

thesis-figure-skill 的 6 个 example-skeleton-*.tex 已全部按这 5 条 idiom 重写,是本技能最好的 worked examples。

按需加载

触发文件
要看 5 idiom 的完整代码模式references/by-construction.md
要看全部 8 条硬约束 + 修法references/hard-constraints.md
要对照 before/afterreferences/examples/(BAD vs GOOD + 编辑安全证明图)
要跑静态检查references/lint.sh(执行即可,不用 Read)

© 0xE1337, 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 7 other files (references) in skills/tikz-figure-code of 0xE1337/thesis-figure-skill.

  • SKILL.md
  • references/by-construction.md
  • references/examples/README.md
  • references/examples/pipeline-absolute-coords-BAD.tex
  • references/examples/pipeline-by-construction-GOOD.tex
  • references/examples/proof-edit-safety-hero-widen.png
  • references/hard-constraints.md
  • references/lint.sh

Open the folder on GitHubat commit ffe6d07

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in 0xE1337/thesis-figure-skill, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Tikz Figure Code 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 Figure Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Tikz Figure Code this skill0xE1337/thesis-figure-skill1421 repos~1.2kAutomated safety check: PassMIT
Thesis Defense PPTX Builderzouchenzhen/thesis-defense-pptx-skill266—~2.4kAutomated safety check: PassApache-2.0
Repo Maintenancewengan-li/ncku-thesis-template-latex151—~4.3kAutomated safety check: PassCustom licence
Sci PptShZhao27208/Aut_Sci_Write207—~757Automated safety check: PassMIT
Latex Defense Zhbahayonghang/academic-writing-skills494—~2.2kAutomated safety check: PassNone
Latex Thesis Zhbrycewang-stanford/Auto-Empirical-Research-Skills4.5k—~1.5kAutomated safety check: PassCustom licence

Similar skills

  • Thesis Defense PPTX Builder

    zouchenzhen/thesis-defense-pptx-skill

    Builds an editable thesis defense PowerPoint from a thesis PDF or LaTeX project while preserving a supplied university or lab template, then runs a visual quality check.

    266 GitHub stars~2.4k tokensUpdated 4 mo ago
    Documents & OfficeAuto-check passed
  • Repo Maintenance

    wengan-li/ncku-thesis-template-latex

    A skill your agent uses for maintaining and releasing this repository.

    151 GitHub stars~4.3k tokensUpdated 4 days ago
    Documents & OfficeAuto-check passed
  • Sci Ppt

    ShZhao27208/Aut_Sci_Write

    Generate professional academic PowerPoint (PPTX) presentations from paper PDFs, structured outlines, or plain text.

    207 GitHub stars~757 tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Latex Defense Zh

    bahayonghang/academic-writing-skills

    Chinese thesis defense deck builder for existing XeLaTeX PhD or master thesis repositories.

    494 GitHub stars~2.2k tokensUpdated 9 days ago
    Documents & OfficeAuto-check passed
  • Latex Thesis Zh

    brycewang-stanford/Auto-Empirical-Research-Skills

    Chinese LaTeX thesis assistant for existing .tex degree thesis projects (XeLaTeX/LuaLaTeX/latexmk).

    4.5k GitHub stars~1.5k tokensUpdated 2 days ago
    Documents & OfficeAuto-check passed
  • Latex Posters

    aipoch/medical-research-skills

    Creates academic-poster writing packages for LaTeX using beamerposter, tikzposter, or baposter.

    2k GitHub stars~1.3k tokensUpdated 20 days ago
    Documents & OfficeAuto-check passed

More from 0xE1337/thesis-figure-skill

  • Thesis Figure Skill

    0xE1337/thesis-figure-skill

    生成学术论文配图:LaTeX/TikZ 代码(结构化图表,直接嵌入论文)或 draw.io XML (技术路线图、汇报配图)。自动按论文领域风格设计,编译验证后交付。

    142 GitHub stars~9.1k tokensUpdated 2 mo ago
    Auto-check passed

Works with

Questions about Tikz Figure Code

What does Tikz Figure Code do?

写出高质量、一次过编译、编辑安全的 TikZ/LaTeX 配图代码的工程基础技能. An agent skill from 0xE1337/thesis-figure-skill. Tikz Figure Code is an agent skill from 0xE1337/thesis-figure-skill.

When should I use Tikz Figure Code?

Tikz Figure Code fits situations like: : 写/审 TikZ 或 LaTeX 图代码、修图的排版/对齐/溢出/箭头问题、 tikz layout、latex figure code、tikz 编译报错、CJK 中文图渲染成色块; tasks that involve LaTeX; tasks that involve Essays and academic help.

How do I install Tikz Figure Code in Claude Code?

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

How do I install Tikz Figure Code in Codex?

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

Can I use Tikz Figure Code 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 0xE1337/thesis-figure-skill --skill tikz-figure-code -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-figure-code, .gemini/skills/tikz-figure-code, .github/skills/tikz-figure-code and .opencode/skills/tikz-figure-code in your project.

What does Tikz Figure Code need to run?

Going by SKILL.md and its folder, Tikz Figure Code needs a shell for the scripts in its folder and the command-line tools its instructions call (node and bash). Our summary lists: A Bash shell.

Does Tikz Figure Code 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 Figure Code 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 Figure Code use?

Tikz Figure Code 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 Figure Code use?

About 1.2k tokens (SKILL.md is roughly 4.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 66k tokens, read only when the agent opens those files.

What are the alternatives to Tikz Figure Code?

Skills that share tags, products or a category with Tikz Figure Code: Thesis Defense PPTX Builder (zouchenzhen/thesis-defense-pptx-skill, 266 stars), Repo Maintenance (wengan-li/ncku-thesis-template-latex, 151 stars), Sci Ppt (ShZhao27208/Aut_Sci_Write, 207 stars) and Latex Defense Zh (bahayonghang/academic-writing-skills, 494 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Tikz Figure Code?

0xE1337 (a GitHub user) maintains it in 0xE1337/thesis-figure-skill, which has 142 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on July 25, 2026.

Source: 0xE1337/thesis-figure-skill on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.