AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Code To Diagram

skill-dp-archive-archive-code-to-diagram · by dp-archive

Generate architecture diagrams, ER diagrams, sequence diagrams, flowcharts, and class diagrams from codebases using Mermaid.js. Use when users ask to visualize code structure, draw architecture diagrams, create ER diagrams from database models, generate sequence diagrams from API flows, or produce any diagram from source code. Triggers on: 'draw architecture', 'generate diagram', 'visualize code'…

No reviews yet
0 installs
6 views
0.0% view→install

Install

$ agentstack add skill-dp-archive-archive-code-to-diagram

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-dp-archive-archive-code-to-diagram)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Code To Diagram? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Code to Diagram

Generate production-quality diagrams from source code via Mermaid.js, rendered to SVG/PNG with mmdc.

Environment

Executor required: This skill needs the diagram executor (Chromium + Node.js + mmdc pre-installed). If mmdc is not available, install first:

npm install -g @mermaid-js/mermaid-cli

Puppeteer config for headless environments — create at /tmp/puppeteer-config.json if missing:

{"args": ["--no-sandbox", "--disable-setuid-sandbox"]}

Workflow

  1. Analyze — Read the codebase to understand structure (glob, grep, read)
  2. Plan — Decide diagram type(s) based on user request and code patterns
  3. Generate — Write .mmd file with Mermaid syntax
  4. Render — Run mmdc to produce SVG and PNG
  5. Verify — Read the output image and check correctness

Diagram Type Selection

| User Intent | Diagram Type | Mermaid Keyword | |-------------|-------------|-----------------| | System overview, module layout | Architecture | graph TD + subgraph | | Database tables, ORM models | ER Diagram | erDiagram | | API flow, request lifecycle | Sequence Diagram | sequenceDiagram | | Inheritance, interfaces | Class Diagram | classDiagram | | Business logic, conditionals | Flowchart | flowchart TD | | Task states, lifecycle | State Diagram | stateDiagram-v2 | | Import/dependency tree | Dependency Graph | graph LR | | Timeline, project phases | Gantt Chart | gantt |

Analysis Strategy

Do NOT read every file. Use progressive analysis:

Step 1 — Directory scan: glob("**/*.py") or glob("**/*.ts") to understand module structure.

Step 2 — Entry points:

  • Python: main.py, app.py, __init__.py, pyproject.toml
  • Node.js: package.json, index.ts, app.ts
  • Java: pom.xml, Application.java

Step 3 — Targeted reads by diagram type:

  • ER → ORM models (models.py, schema.prisma, *.entity.ts)
  • Architecture → Router registrations, dependency injection, config
  • Sequence → Specific endpoint handler + service call chain
  • Class → Class definitions via grep("class ")

Step 4 — GitHub repos:

git clone --depth 1  /tmp/repo-name

Then apply the same progressive scan.

Rendering

# SVG (transparent background, good for docs)
mmdc -i diagram.mmd -o diagram.svg -b transparent -p /tmp/puppeteer-config.json

# PNG (white background, 2x scale for sharpness)
mmdc -i diagram.mmd -o diagram.png -b white -s 2 -p /tmp/puppeteer-config.json

Always generate both formats. Use -s 2 for PNG (sharp at any zoom level).

Mermaid Syntax Reference

For detailed patterns and examples per diagram type, see [references/mermaid-patterns.md](references/mermaid-patterns.md).

Key rules:

  • Short IDs, descriptive labels: DB[("PostgreSQL 16")]
  • Use subgraph for logical grouping in architecture diagrams
  • Limit ER diagrams to ~10 entities — split by domain if larger
  • participant aliases in sequence diagrams for short names
  • Quote labels with special chars: A["Node (v1)"]
  • Max ~20 nodes per diagram — split into multiple if larger

Output Conventions

  • Write .mmd source + rendered files to workspace
  • Descriptive names: architecture.mmd, er-diagram.png, api-sequence.svg
  • Multiple diagrams → create diagrams/ folder with index

Quality Checklist

  • All entities/modules from the code are represented
  • Relationships and data flow directions are correct
  • Labels readable, not truncated or overlapping
  • No Mermaid syntax errors
  • Output image visually verified

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.