Borrowing it
Nothing to install: this file belongs to wedsamuel1230/electronic-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/wedsamuel1230/electronic-mcp-server/main/.github/skills/mermaid-diagram-generator/SKILL.mdgit clone --depth 1 https://github.com/wedsamuel1230/electronic-mcp-serverWrote 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.
[](https://agentmods.dev/skills/wedsamuel1230/electronic-mcp-server/mermaid-diagram-generator)<a href="https://agentmods.dev/skills/wedsamuel1230/electronic-mcp-server/mermaid-diagram-generator"><img src="https://agentmods.dev/badge/skills/wedsamuel1230/electronic-mcp-server/mermaid-diagram-generator/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.
<a href="https://agentmods.dev/skills/wedsamuel1230/electronic-mcp-server/mermaid-diagram-generator"><img src="https://agentmods.dev/badge/skills/wedsamuel1230/electronic-mcp-server/mermaid-diagram-generator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.03414 |
| Opus 5 | $0.00000 | $0.01707 |
| Sonnet 5 | $0.00000 | $0.00683 |
| Haiku 4.5 | $0.00000 | $0.00341 |
Grade A, and why
mermaid-diagram-generator 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 12d 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.
How it starts
The opening of the file, as written. The whole thing — 510 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mermaid Diagram Generator
Generates Mermaid diagrams from Arduino code to visualize state machines, timing, architecture, and workflows.
Resources
- scripts/generate_diagram.py - Python script with PEP 723 inline dependencies
- references/diagram-templates.md - Mermaid templates for common patterns
- assets/examples/ - Example diagrams for reference
Quick Start
# Generate state machine diagram from Arduino code
uv run mermaid-diagram-generator/scripts/generate_diagram.py \
--input src/main.ino \
--type state-machine \
--output docs/state-machine.mmd
# Generate timing diagram for I2C communication
uv run mermaid-diagram-generator/scripts/generate_diagram.py \
--type timing \
--signals "SDA,SCL,START,DATA,STOP" \
--output docs/i2c-timing.mmd
# Interactive mode
uv run mermaid-diagram-generator/scripts/generate_diagram.py --interactive
When to Use
Use this skill when:
- Visualizing state machines - FSM from switch/case or enum states
- Documenting timing - I2C, SPI, UART protocol sequences
- Architecture diagrams - Show task relationships in FreeRTOS
- Flowcharts - Visualize control flow for complex logic
- Sequence diagrams - Inter-task communication patterns
Don't use when:
- ❌ Simple code (3-5 lines) doesn't need visualization
- ❌ No state/timing complexity to illustrate
Core Principles
- Code Analysis - Parse Arduino code to extract states, transitions, timing
- Template Selection - Choose appropriate Mermaid diagram type
- Auto-Generation - Produce valid Mermaid syntax from code patterns
- Validation - Check diagram syntax before output
- Integration - Embed diagrams in README.md or documentation
Implementation
Pattern 1: State Machine Extraction
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.8"
# dependencies = ["re"]
# ///
"""Extract state machine from Arduino code."""
import re
def extract_states(code):
"""Find enum states or #define constants."""
states = []
# Pattern 1: enum StateType { STATE_A, STATE_B, ... }
enum_pattern = r'enum\s+\w+\s*\{([^}]+)\}'
enum_match = re.search(enum_pattern, code)
if enum_match:
states_str = enum_match.group(1)
states = [s.strip().split('=')[0].strip()
for s in states_str.split(',') if s.strip()]
# Pattern 2: #define STATE_A 0
define_pattern = r'#define\s+(STATE_\w+)\s+\d+'
states += re.findall(define_pattern, code)
return list(set(states))
def extract_transitions(code, states):
"""Find state transitions in code."""
transitions = []
for i, state in enumerate(states):
# Look for assignments: currentState = NEXT_STATE
pattern = rf'{state}.*?=\s*(\w+)'
matches = re.findall(pattern, code)
for next_state in matches:
if next_state in states and next_state != state:
transitions.append((state, next_state))
return transitions
# Example usage
arduino_code = '''
enum State {
STATE_IDLE,
STATE_READING,
STATE_PROCESSING,
STATE_DONE
};
State currentState = STATE_IDLE;
void loop() {
switch(currentState) {
case STATE_IDLE:
if (buttonPressed()) {
currentState = STATE_READING;
}
break;
case STATE_READING:
readSensor();
currentState = STATE_PROCESSING;
break;
case STATE_PROCESSING:
processData();
currentState = STATE_DONE;
break;
case STATE_DONE:
currentState = STATE_IDLE;
break;
}
}
'''
states = extract_states(arduino_code)
transitions = extract_transitions(arduino_code, states)
print("States:", states)
print("Transitions:", transitions)
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 12d ago First seen · 510 lines · 0 tokens per session scan A 4415e4d8fb00
mermaid-diagram-generator is a skill published in the GitHub repository wedsamuel1230/electronic-mcp-server (1 stars, last pushed 8mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,414 tokens. 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-31.
Other skills, from other repositories
readme-generator
Auto-generates professional README.md files for Arduino/ESP32/RP2040 projects following open-source best practices. Use when user wants to document their project for GitHub, needs help writing a README, or says "make my project shareable". Follows awesome-readme standards with sections for Overview, Hardware…
battery-selector
Helps choose the right battery type and charging solution for Arduino/ESP32/RP2040 projects. Use when user asks about battery options, charging circuits, power source selection, or says "what battery should I use". Covers chemistry selection, safety, voltage regulation, and charging circuits.
bom-generator
Generates Bill of Materials (BOM) from project descriptions for Arduino/ESP32/RP2040 projects. Use when user needs component lists, parts shopping lists, cost estimates, or asks "what parts do I need". Outputs formatted BOMs with part numbers, quantities, suppliers (DigiKey, Mouser, Amazon, AliExpress), and…
code-review-facilitator
Automated code review for Arduino/ESP32/RP2040 projects focusing on best practices, memory safety, and common pitfalls. Use when user wants code feedback, says "review my code", needs help improving code quality, or before finalizing a project. Generates actionable checklists and specific improvement suggestions.
datasheet-interpreter
Extracts key specifications from component datasheet PDFs for maker projects. Use when user shares a datasheet PDF URL, asks about component specs, needs pin assignments, I2C addresses, timing requirements, or register maps. Downloads and parses PDF to extract essentials. Complements datasheet-parser for quick lookups.
error-message-explainer
Explain Arduino and embedded compiler, upload, boot, power, and runtime errors in plain English. Use when a user shares an error or failure from Arduino IDE, Arduino CLI, PlatformIO, or a vendor-specific tool. Separate build, upload, hardware, and system evidence and give a board-specific recovery path without…