본문으로 건너뛰기
cccskills
무료GitHub에 공개

code-to-diagram

Turn a codebase into Mermaid diagrams such as architecture, ER, sequence, class, and flow diagrams. It analyzes relevant files, writes diagram source, renders SVG and PNG images, and checks the rendered result for readability and correctness.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

원문원문 설명 보기

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', 'ER diagram', 'sequence diagram', 'class diagram', 'flowchart from code', 'module dependency graph'.

dp-archive/archive스타 1,107(GitHub 1,107 + cccskills 0)

실행 점수 미검증

설치 방법 보기

이럴 때 유용합니다

  • Visualize a codebase architecture
  • Create an ER diagram from database models
  • Show an API flow as a sequence diagram
  • Map dependencies between modules

포함된 파일(2)

  • SKILL.md4.1 KB
  • references/mermaid-patterns.md6.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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 IntentDiagram TypeMermaid Keyword
System overview, module layoutArchitecturegraph TD + subgraph
Database tables, ORM modelsER DiagramerDiagram
API flow, request lifecycleSequence DiagramsequenceDiagram
Inheritance, interfacesClass DiagramclassDiagram
Business logic, conditionalsFlowchartflowchart TD
Task states, lifecycleState DiagramstateDiagram-v2
Import/dependency treeDependency Graphgraph LR
Timeline, project phasesGantt Chartgantt

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 <url> /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.

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

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Review text for patterns associated with AI-generated writing, including vocabulary, structure, formatting, citations, and model-specific artifacts. The skill combines multiple signals, weighs context and mitigating evidence, and presents a cautious assessment with confidence and caveats.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Review an essay for multiple AI-writing signals
  • Explain which text patterns may suggest AI authorship
  • Assess a draft while accounting for false-positive risks
dp-archive/archive1.1천2026년 3월 4일 업데이트

Extract audio from videos or download audio from supported websites with yt-dlp, then save it as MP3, M4A, FLAC, WAV, or OPUS. The workflow can embed track metadata and cover art, and process playlists or podcast episodes in batches.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Save a video's audio as MP3 or FLAC
  • Download podcast episodes as audio files
  • Convert a playlist into numbered audio tracks
dp-archive/archive1.1천2026년 3월 4일 업데이트

biopython

무료

Use Biopython to process DNA, RNA, and protein sequences, read and convert common biology file formats, run alignments or BLAST searches, access NCBI records, and work with protein structures and phylogenetic trees in Python.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Reading and converting FASTA, GenBank, or PDB files
  • Calculating sequence statistics or translating DNA
  • Searching NCBI and PubMed records in batches
dp-archive/archive1.1천2026년 3월 4일 업데이트

Turn a project description into a coordinated visual identity package. Define logo variants, color palettes, and typography, then create layouts for business cards and social media covers along with a brand specification document for consistent use.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Creating a logo system and brand kit
  • Choosing colors and typography for a new project
  • Designing a business card and social media cover
dp-archive/archive1.1천2026년 3월 4일 업데이트

Create original posters and static artwork by first defining a visual direction for color, shape, space, and typography. Receive a Markdown design philosophy alongside a PNG or PDF artwork that communicates primarily through visuals.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Create an original poster
  • Express a theme through abstract artwork
  • Develop a visual direction and finished artwork
dp-archive/archive1.1천2026년 3월 4일 업데이트

Create short brand copy that follows a defined voice and strict length limits. Use it for taglines, brand philosophy, business cards, social bios and cover text, with guidance for keeping wording consistent across touchpoints.

한국어 요약은 준비 중입니다. 영어 요약을 표시하고 있습니다.

  • Writing a short brand tagline
  • Defining a consistent brand voice
  • Fitting copy into a social media bio
dp-archive/archive1.1천2026년 3월 4일 업데이트

dp-archive의 스킬 모두 보기

이 스킬의 문제 신고