slidev:redraw-diagrams

slidev:redraw-diagrams is a command for Claude Code from rhuss/cc-slidev. It costs 28 tokens per session (2,916 once invoked), scanned A, original, MIT.

A command for extracting diagrams from Slidev presentations and redesigning them for Mermaid, PlantUML, and Excalidraw. Slidev is a tool for making presentations from Markdown, while these are diagram formats and editors.

In plain words
What is it for?
Finding a presentation, analyzing its inline diagrams, and producing Mermaid, PlantUML, and rendered Excalidraw versions.
Why use it?
It creates platform-specific versions of a diagram instead of treating every format as a direct conversion, which can produce clearer results.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the slidev plugin — 8 skills, 18 commands, 2 agents shipped together

Good fit Finding a presentation, analyzing its inline diagrams, and producing Mermaid, PlantUML, and rendered Excalidraw versions.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add rhuss/cc-slidev
Claude Code
/plugin install slidev

Made for: Claude Code.

Or install slidev, the plugin that ships this one along with the rest of its 8 skills, 18 commands, 2 agents.

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 slidev:redraw-diagrams

README.md
[![agentmods](https://agentmods.dev/badge/commands/rhuss/cc-slidev/redraw-diagrams/github.svg)](https://agentmods.dev/commands/rhuss/cc-slidev/redraw-diagrams)
Your own site
<a href="https://agentmods.dev/commands/rhuss/cc-slidev/redraw-diagrams"><img src="https://agentmods.dev/badge/commands/rhuss/cc-slidev/redraw-diagrams/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 slidev:redraw-diagrams

Your own site · 80×15
<a href="https://agentmods.dev/commands/rhuss/cc-slidev/redraw-diagrams"><img src="https://agentmods.dev/badge/commands/rhuss/cc-slidev/redraw-diagrams.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,916 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.
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.00028 $0.02916
Opus 5 $0.00014 $0.01458
Sonnet 5 $0.00006 $0.00583
Haiku 4.5 $0.00003 $0.00292

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

Security

Grade A, and why

slidev:redraw-diagrams 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 9d 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.

slidev/commands/redraw-diagrams.md · 383 lines

How it starts

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

Redraw Diagrams - Semantic Redesign Across Platforms

Extract inline diagrams from slides and semantically redesign them for each platform's strengths, rather than mechanically converting between formats.

Philosophy: Each diagram platform (Mermaid, PlantUML, Excalidraw) has unique visual paradigms. This command analyzes the slide's semantic content and existing diagrams, then redesigns diagrams to leverage each platform's specific capabilities.

CRITICAL - Excalidraw Rule: NEVER embed Excalidraw JSON in markdown files. Always:

  1. Write JSON to diagrams/<slug>.excalidraw
  2. Convert to SVG using render-excalidraw.sh
  3. Put SVG in public/images/<slug>/diagram-excalidraw.svg
  4. Reference only the SVG image in markdown

Use Cases:

  • Redesign existing diagrams to better utilize platform features
  • Create platform-specific versions that aren't just conversions
  • Improve diagram quality by rethinking visual approach per platform

Execution

1. Find Presentation

Locate slides.md:

  • Check current directory
  • Check subdirectories
  • If multiple found: ask user which one

2. Get Slide Mapping from Master slides.md

Read master slides.md directly to extract slide information:

---
src: ./slides/01-title.md
---
<!-- Slide 1: Title -->

---
src: ./slides/05-microservices-benefits.md
---
<!-- Slide 5: Microservices Benefits -->

Parse comment pattern <!-- Slide \d+: .* --> to get:

  • Slide numbers
  • Slide titles/descriptions for directory naming
  • File paths (from src: lines)

3. Extract and Analyze Diagrams Semantically

Scan slides.md for diagram code blocks:

Mermaid diagrams:

```mermaid
[diagram code]

**PlantUML diagrams:**
```markdown
```plantuml
@startuml
[diagram code]
@enduml

**For each diagram found:**
1. Note slide number and title
2. Extract complete diagram code
3. **Read slide content** to understand semantic context
4. **Analyze diagram semantics:**
   - What concept is being visualized?
   - Is it showing flow/process, architecture/structure, or concepts/relationships?
   - What is the diagram's intent?
5. Identify existing diagram type and platform

Read the full file on GitHub · 383 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. 9d ago First seen · 383 lines · 28 tokens per session scan A 848353de701c

Subscribe to this mod's changes

slidev:redraw-diagrams is a command published in the GitHub repository rhuss/cc-slidev (51 stars, last pushed 21d ago), licensed MIT. It adds 28 tokens to every session and 2,916 once invoked, about $0.0001 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.