new-diagram

new-diagram is a skill for Claude Code from pedrohcgs/claude-code-my-workflow. It costs 60 tokens per session (1,853 once invoked), scanned A, original, MIT.

A guided template for creating a TikZ diagram, where TikZ is a LaTeX system for drawing diagrams in documents. It starts from tested examples and checks dimensions, coordinates, labels, and the compiled result.

In plain words
What is it for?
Use it to create flowcharts, timelines, causal diagrams, event studies, regression figures, and other supported TikZ diagrams.
Why use it?
It helps avoid common layout and direction errors that are easy to miss when writing diagram code from scratch.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; positional $N argument.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is python3 scripts/check-tikz-prevention.py "$DST".

Good fit Use it to create flowcharts, timelines, causal diagrams, event studies, regression figures, and other supported TikZ diagrams.

Compare 6 skills from other repositories ↓
About the project

claude-code-my-workflow is a forkable setup for using Claude Code to produce and review academic papers, slides, data analyses, and replication packages. Researchers use its agents, skills, rules, hooks, and quality checks to coordinate these tasks and verify their results. The catalogue entries define the reusable workflow components for Claude Code.

pedrohcgs/claude-code-my-workflow · 1,569 stars · on GitHub · psantanna.com

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/pedrohcgs/claude-code-my-workflow
agentmods
npx agentmods add skills/pedrohcgs/claude-code-my-workflow/new-diagram

Made for: Claude Code.

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 new-diagram

README.md
[![agentmods](https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/new-diagram/github.svg)](https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/new-diagram)
Your own site
<a href="https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/new-diagram"><img src="https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/new-diagram/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 new-diagram

Your own site · 80×15
<a href="https://agentmods.dev/skills/pedrohcgs/claude-code-my-workflow/new-diagram"><img src="https://agentmods.dev/badge/skills/pedrohcgs/claude-code-my-workflow/new-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 60 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,853 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 warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 140
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
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.00060 $0.01853
Opus 5 $0.00030 $0.00927
Sonnet 5 $0.00012 $0.00371
Haiku 4.5 $0.00006 $0.00185

Measured 10d ago against content hash ed8c7c515949, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

new-diagram 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 10d ago.

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.

.claude/skills/new-diagram/SKILL.md · 142 lines

How it starts

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

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

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

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.

Read the full file on GitHub · 142 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. 10d ago First seen · 142 lines · 60 tokens per session scan A ed8c7c515949

Subscribe to this mod's changes

new-diagram is a skill published in the GitHub repository pedrohcgs/claude-code-my-workflow (1,569 stars, last pushed 16d ago), licensed MIT. It adds 60 tokens to every session and 1,853 once invoked, about $0.0003 per session on Opus 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.