Agent skill

New Diagram

by pedrohcgs in pedrohcgs/claude-code-my-workflow

Scaffold a new TikZ diagram from the snippet gallery with prevention rules pre-applied (explicit node dimensions, coordinate map, directional edge labels).

MITAuto-check: notesResearch & Science

Install New Diagram

skills CLI
$ npx skills add pedrohcgs/claude-code-my-workflow --skill new-diagram -a claude-code

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

GitHub CLI
$ gh skill install pedrohcgs/claude-code-my-workflow new-diagram --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/pedrohcgs/claude-code-my-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/new-diagram .claude/skills/new-diagram && 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
new-diagram
GitHub stars
1.7k
Token cost
~1.8k tokens
SKILL.md length
758 words
Files
1
Skills in repo
59
Repo updated
First seen
Licence
MIT

At a glance

Scaffold a new TikZ diagram from the snippet gallery with prevention rules pre-applied (explicit node dimensions, coordinate map, directional edge labels).

  • Works in 9 steps: Pick a snippet → Copy the snippet to the output path → Edit the content to fit the user's intent → …
  • Tasks that involve Diagrams
  • SKILL.md covers Inputs, Workflow, Why start from a snippet? and Cross-references
  • Calls python3

What it does

New Diagram is an agent skill from pedrohcgs/claude-code-my-workflow. Scaffold a new TikZ diagram from the snippet gallery with prevention rules pre-applied (explicit node dimensions, coordinate map, directional edge labels). Compiles standalone, invokes tikz-reviewer with citations from tikz-measurement.md, and loops on revisions until APPROVED.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Research & Science, covering Diagrams and Citation management. The repository describes itself as: A ready-to-fork Claude Code template for academics using LaTeX/Beamer + R. Multi-agent review, quality gates, adversarial QA, and replication protocols. The licence is MIT.

When your agent uses it

  • Tasks that involve Diagrams
  • Tasks that involve Citation management

Example prompts

  • “/new-diagram”

Requirements

  • Python 3
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Agent, Task

Workflow steps

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

  1. Pick a snippet
  2. Copy the snippet to the output path
  3. Edit the content to fit the user's intent
  4. Prevention pre-check (MANDATORY)
  5. Standalone compile
  6. Visual review via tikz-reviewer
  7. Optional — convert to SVG for Quarto
  8. Clean up build artifacts
  9. Report

What it can do on your machine

Read from SKILL.md and the folder at commit ae72617. 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:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Agent
    • Task

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • python3

    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

New Diagram loads about 1.8k tokens when it runs. Until then it costs about 73 tokens; SKILL.md has 758 words of instructions outside code blocks.

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

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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Agent, Task

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 pedrohcgs/claude-code-my-workflow at commit ae72617, republished under its MIT licence (© pedrohcgs). 758 words, ~1,770 tokens.

Download SKILL.mdSave it as .claude/skills/new-diagram/SKILL.md (or your agent's skills folder).
name
new-diagram
description
Scaffold a new TikZ diagram from the snippet gallery with prevention rules pre-applied (explicit node dimensions, coordinate map, directional edge labels). Compiles standalone, invokes tikz-reviewer with citations from tikz-measurement.md, and loops on revisions until APPROVED.
allowed-tools
Read, Write, Edit, Bash, Glob, Agent, Task
argument-hint
[snippet-name] [output.tex] (both optional; interactive if omitted)
disable-model-invocation
true

Create a New TikZ Diagram

Scaffold a diagram from templates/tikz-snippets/, check it against the prevention rules, compile standalone, run the reviewer with measurement citations, and loop until the diagram passes. Use this instead of writing TikZ from scratch; the snippets embed the invariants that tikz-prevention.md requires.

Inputs

  • $0 (optional) — snippet name (without .tex). One of the filenames in templates/tikz-snippets/. If omitted, list the gallery and ask the user to pick.
  • $1 (optional) — output path. Defaults to Figures/new_diagram.tex — ask the user if this target exists so we don't clobber.

Workflow

Step 1: Pick a snippet
bash
ls -1 templates/tikz-snippets/*.tex

Current gallery (see templates/tikz-snippets/README.md for descriptions):

  • dag-basic — 3-node causal DAG (X → Y with confounder U)
  • dag-mediation — X → M → Y with direct path
  • did-two-period — two-period difference-in-differences
  • event-study — event-time coefficients with 95% CIs
  • timeline — horizontal timeline with staggered events
  • regression-scatter — scatter + OLS fit + confidence band
  • flowchart-3step — vertical flow with decision diamond
  • supply-demand — supply/demand with shifted demand

If $0 is not one of these, or is omitted, ask the user which to use.

Step 2: Copy the snippet to the output path
bash
SRC="templates/tikz-snippets/$0.tex"
DST="${1:-Figures/new_diagram.tex}"

# Confirm before overwriting
if [ -f "$DST" ]; then
  echo "Output path already exists: $DST"
  # Ask the user whether to overwrite. Do NOT clobber silently.
fi

mkdir -p "$(dirname "$DST")"
cp "$SRC" "$DST"
Step 3: Edit the content to fit the user's intent

Ask the user what the diagram should show. Edit $DST with the Edit tool:

  1. Update the comment block at the top so the intent sentence matches the user's goal.
  2. Update the coordinate map comment if coordinates change.
  3. Rename nodes and edit labels. Keep node style (dag-node, flow-node, etc.) unless the meaning actually changes.
  4. Do not add a bare scale=X to the tikzpicture options. Coordinates shrink, text does not — collisions follow. Allowed forms: scale=X, every node/.style={scale=X} or scale=X, transform shape. See tikz-prevention.md P3 for the full rule and tikz-visual-quality.md for the scale=1.1 convention.
  5. Every new edge label must carry a directional keyword (above, below, left, right, above left, etc.). midway alone is a path position, not a direction — P4 violation.
Step 4: Prevention pre-check (MANDATORY)

Run the same shared Python checker /extract-tikz uses — this is the one tool that enforces both P3 and P4 consistently across the two skills:

bash
python3 scripts/check-tikz-prevention.py "$DST"
  • Exit 0 → passed, continue.
  • Exit 1 → violations (stderr reports line, rule, snippet). Fix $DST and re-run until zero.
  • Exit 2 → usage error (missing file etc.).

Do NOT re-implement the grep inline. The Python checker correctly handles multi-line \begin{tikzpicture}[...] options and multi-line \draw ... node {...} spans that a line-oriented grep cannot see.

Step 5: Standalone compile

All snippets are \documentclass[border=4pt]{standalone} so they compile without a Beamer frame and without Preambles/header.tex:

bash
cd "$(dirname "$DST")"
xelatex -interaction=nonstopmode "$(basename "$DST")" > /tmp/tikz-compile.log 2>&1

Check exit code and *.pdf file size. If compile fails, read /tmp/tikz-compile.log and fix the .tex source.

Show full SKILL.md (337 more words)Show less
Step 6: Visual review via tikz-reviewer

Spawn the tikz-reviewer agent with Task (subagent_type=tikz-reviewer). Pass the .tex source and the compiled .pdf path. The reviewer is now required to cite the pass and formula from tikz-measurement.md for every CRITICAL/MAJOR finding — vague reports are rejected.

Loop:

  1. If APPROVED → go to Step 7.
  2. If NEEDS REVISION or REJECTED → apply fixes to $DST, re-run Step 4 (prevention pre-check), re-compile (Step 5), re-invoke reviewer.

Max 5 rounds. If after 5 rounds the reviewer is still reporting CRITICAL issues, surface the situation to the user — the snippet or the requested content may need redesign, not just tweaking.

Step 7: Optional — convert to SVG for Quarto

If the user plans to use the diagram in Quarto slides (not just Beamer), convert the compiled PDF to SVG:

bash
pdf2svg "${DST%.tex}.pdf" "${DST%.tex}.svg" 1

Snippet-based diagrams are single-page, so a single .svg with the same basename as .tex is correct here. This differs from /extract-tikz, which produces a multi-page PDF from a Figures/LectureN/extract_tikz.tex master and names outputs tikz_exact_00.svg, tikz_exact_01.svg, ... (0-based filenames over 1-indexed PDF pages). If you need multi-page output for slide-by-slide reveals, use /extract-tikz instead.

Step 8: Clean up build artifacts
bash
cd "$(dirname "$DST")"
rm -f *.aux *.log *.out *.synctex.gz

Leave the .pdf and .svg (if generated). They're what downstream tools use.

Step 9: Report

Print a summary:

  • Snippet used → output path
  • Reviewer verdict and number of rounds
  • .pdf size and page count
  • .svg path if generated
  • Reminder to \input or \includegraphics the diagram in the target Beamer/Quarto file

Why start from a snippet?

Writing TikZ from scratch reliably produces collisions because the author cannot visually estimate where curves and labels will land. The snippets embed the invariants that tikz-prevention.md requires — coordinate maps, explicit node dimensions, directional edge labels — so the diagram passes the prevention pre-check by construction. You can always deviate from the snippet; the rules still apply.

Cross-references

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

Files

Just SKILL.md in .claude/skills/new-diagram of pedrohcgs/claude-code-my-workflow.

Open the folder on GitHubat commit ae72617

Compare with similar skills

New Diagram 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.

New Diagram compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
New Diagram this skillpedrohcgs/claude-code-my-workflow1.7k—~1.8kAutomated safety check: NotesMIT
Paper Analyzerzsyggg/paper-craft-skills1.3k—~1.9kAutomated safety check: PassNone
Academic Paper Writing PipelineImbad0202/academic-research-skills51k—~16kAutomated safety check: PassCustom licence
Collaborating With Claudeappautomaton/latex-arxiv-SKILL4581 repos~1.5kAutomated safety check: PassMIT
Collaborating With Geminiappautomaton/latex-arxiv-SKILL4581 repos~1.1kAutomated safety check: PassMIT
Academic Integrity Rewritelin1111-1/academic-integrity-rewrite102—~1.1kAutomated safety check: PassMIT

Similar skills

  • Paper Analyzer

    zsyggg/paper-craft-skills

    将学术论文转化为深度HTML长文。6轮强制工作流、代码仓库搜索、公式渲染、Mermaid图表. An agent skill from zsyggg/paper-craft-skills.

    1.3k GitHub stars~1.9k tokensUpdated 4 mo ago
    Research & ScienceAuto-check passed
  • Academic Paper Writing Pipeline

    Imbad0202/academic-research-skills

    Runs a 12-agent pipeline that plans, drafts, cites, reviews and formats academic papers, with modes for revision, rebuttals, abstracts and citation checks.

    51k GitHub stars~16k tokensUpdated yesterday
    Research & ScienceAuto-check passed
  • Collaborating With Claude

    appautomaton/latex-arxiv-SKILL

    Use the Claude Code CLI to consult Claude and delegate coding tasks for prototyping, debugging, and code review.

    458 GitHub starsUsed in 1 repo~1.5k tokens
    Research & ScienceAuto-check passed
  • Collaborating With Gemini

    appautomaton/latex-arxiv-SKILL

    Use the Gemini CLI to consult Gemini and delegate coding tasks for prototyping, debugging, and code review.

    458 GitHub starsUsed in 1 repo~1.1k tokens
    Research & ScienceAuto-check passed
  • Academic Integrity Rewrite

    lin1111-1/academic-integrity-rewrite

    Revise Chinese or English academic writing for lower unnecessary textual overlap while preserving meaning, evidence, numbers, equations, terminology, and citations.

    102 GitHub stars~1.1k tokensUpdated 1 mo ago
    Research & ScienceAuto-check passed
  • Ref Downloader

    ltczding-gif/ref-downloader

    A skill your agent uses when the user asks to batch-download academic PDFs with ref-downloader — either ALL references of one paper (Mode A: DOI or PDF input), OR a custom batch of papers (Mode B…

    139 GitHub stars~5.9k tokensUpdated 4 mo ago
    Research & ScienceAuto-check passed

More from pedrohcgs/claude-code-my-workflow

All 59 skills in this repo
  • Devils Advocate

    pedrohcgs/claude-code-my-workflow

    Adversarial 5-7 question challenge to a deck's pedagogical choices — ordering, prerequisites, cognitive load, motivation.

    1.7k GitHub starsUsed in 2 repos~641 tokens
    Auto-check passed
  • Vaccinate

    pedrohcgs/claude-code-my-workflow

    Qualify a check before it is allowed to clear anything — prove it can detect the failure it is meant to catch.

    1.7k GitHub stars~2.1k tokensUpdated 13 days ago
    Auto-check: notes
  • Compile Latex

    pedrohcgs/claude-code-my-workflow

    Compile a Beamer LaTeX slide deck with XeLaTeX (3 passes + bibtex).

    1.7k GitHub starsUsed in 1 repo~492 tokens
    Auto-check: notes
  • Context Status

    pedrohcgs/claude-code-my-workflow

    Show current context status and session health. An agent skill from pedrohcgs/claude-code-my-workflow.

    1.7k GitHub starsUsed in 1 repo~613 tokens
    Auto-check: notes
  • Capture Environment

    pedrohcgs/claude-code-my-workflow

    Snapshot the computational environment for a replication package — detects the analysis stack (R / Stata / Python) and emits the right lockfiles (renv.lock + sessionInfo.txt, requirements.txt /…

    1.7k GitHub stars~2.8k tokensUpdated 13 days ago
    Auto-check: notes
  • Checkpoint

    pedrohcgs/claude-code-my-workflow

    Save a structured state snapshot before stopping or handing off.

    1.7k GitHub stars~2.8k tokensUpdated 13 days ago
    Auto-check: notes

Questions about New Diagram

What does New Diagram do?

Scaffold a new TikZ diagram from the snippet gallery with prevention rules pre-applied (explicit node dimensions, coordinate map, directional edge labels). New Diagram is an agent skill from pedrohcgs/claude-code-my-workflow. Scaffold a new TikZ diagram from the snippet gallery with prevention rules pre-applied (explicit node dimensions, coordinate map, directional edge labels).

When should I use New Diagram?

New Diagram fits situations like: tasks that involve Diagrams; tasks that involve Citation management.

How do I install New Diagram in Claude Code?

Run `npx skills add pedrohcgs/claude-code-my-workflow --skill new-diagram -a claude-code`. Or copy the skill folder (.claude/skills/new-diagram in pedrohcgs/claude-code-my-workflow) into .claude/skills/new-diagram in your project. Claude Code loads it when a task matches its description.

How do I install New Diagram in Codex?

Run `npx skills add pedrohcgs/claude-code-my-workflow --skill new-diagram -a codex`. Or copy the skill folder (.claude/skills/new-diagram in pedrohcgs/claude-code-my-workflow) into .agents/skills/new-diagram in your project. Codex loads it when a task matches its description.

Can I use New Diagram 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 pedrohcgs/claude-code-my-workflow --skill new-diagram -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/new-diagram, .gemini/skills/new-diagram, .github/skills/new-diagram and .opencode/skills/new-diagram in your project.

What does New Diagram need to run?

Going by SKILL.md and its folder, New Diagram needs the command-line tools its instructions call (python3). Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Agent, Task.

Does New Diagram 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 New Diagram safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does New Diagram use?

New Diagram 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 New Diagram use?

About 1.8k tokens (SKILL.md is roughly 7.1k 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 New Diagram?

Skills that share tags, products or a category with New Diagram: Paper Analyzer (zsyggg/paper-craft-skills, 1.3k stars), Academic Paper Writing Pipeline (Imbad0202/academic-research-skills, 51k stars), Collaborating With Claude (appautomaton/latex-arxiv-SKILL, 458 stars) and Collaborating With Gemini (appautomaton/latex-arxiv-SKILL, 458 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains New Diagram?

pedrohcgs (a GitHub user) maintains it in pedrohcgs/claude-code-my-workflow, which has 1,655 GitHub stars. The repository holds 59 skills in this directory. The repository was last updated on September 27, 2026.

Source: pedrohcgs/claude-code-my-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.