MCP HubMCP Hub
스킬 목록으로 돌아가기

generate-workflow-diagram

pjt222
업데이트됨 2 days ago
3 조회
17
2
17
GitHub에서 보기
메타aiautomationdesigndata

정보

이 스킬은 주석 처리된 워크플로 데이터에서 Mermaid 플로우차트 다이어그램을 생성하며, 아홉 가지 테마와 여러 출력 형식을 지원합니다. 개발자들이 README 파일, Quarto 또는 R Markdown에 클릭 가능한 노드와 같은 상호작용 기능을 갖춘 시각적 문서를 만들 수 있게 해줍니다. 워크플로 변경 후 다이어그램을 생성하거나 업데이트하거나, 다른 대상 독자에 맞게 시각 자료를 조정할 때 사용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add pjt222/agent-almanac -a claude-code
플러그인 명령대체
/plugin add https://github.com/pjt222/agent-almanac
Git 클론대체
git clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/generate-workflow-diagram

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Generate Workflow Diagram

Themed Mermaid flowchart from putior data → embed in docs.

Use When

  • After annotating sources → produce visual
  • Regenerate after workflow changes
  • Switch themes/formats for audiences
  • Embed in README, Quarto, R Markdown

In

  • Required: workflow data from put(), put_auto(), or put_merge()
  • Optional: theme (default "light"; light, dark, auto, minimal, github, viridis, magma, plasma, cividis)
  • Optional: out target (console, file, clipboard, raw)
  • Optional: interactive (show_source_info, enable_clicks)

Do

Step 1: Extract workflow data

library(putior)

# From manual annotations
workflow <- put("./src/")

# From manual annotations, excluding specific files
workflow <- put("./src/", exclude = c("build-workflow\\.R$", "test_"))

# From auto-detection only
workflow <- put_auto("./src/")

# From merged (manual + auto)
workflow <- put_merge("./src/", merge_strategy = "supplement")

node_type → Mermaid shape:

node_typeMermaid ShapeUse Case
"input"Stadium ([...])Data sources, configuration files
"output"Subroutine [[...]]Generated artifacts, reports
"process"Rectangle [...]Processing steps (default)
"decision"Diamond {...}Conditional logic, branching
"start" / "end"Stadium ([...])Entry/terminal nodes

Each → CSS class (class nodeId input;) for theme styling.

→ DF w/ ≥1 row: id, label + optional input, output, source_file, node_type.

If err: empty → no annotations/patterns. Run analyze-codebase-workflow or check syntax: put("./src/", validate = TRUE).

Step 2: Select theme + options

# List all available themes
get_diagram_themes()

# Standard themes
# "light"   — Default, bright colors
# "dark"    — For dark mode environments
# "auto"    — GitHub-adaptive with solid colors
# "minimal" — Grayscale, print-friendly
# "github"  — Optimized for GitHub README files

# Colorblind-safe themes (viridis family)
# "viridis" — Purple→Blue→Green→Yellow, general accessibility
# "magma"   — Purple→Red→Yellow, high contrast for print
# "plasma"  — Purple→Pink→Orange→Yellow, presentations
# "cividis" — Blue→Gray→Yellow, maximum accessibility (no red-green)

Extra params:

  • direction: "TD" (top-down, default), "LR", "RL", "BT"
  • show_artifacts: show artifact nodes (noisy for large, 16+ extra)
  • show_workflow_boundaries: wrap source file nodes in subgraph
  • source_info_style: source file display (subtitle)
  • node_labels: label format

→ Theme names printed. Pick by context.

If err: unrecognized → falls back "light". Check spelling.

Step 3: Custom palette w/ put_theme() (opt)

# Create custom palette — unspecified types inherit from base theme
cyberpunk <- put_theme(
  base = "dark",
  input    = c(fill = "#1a1a2e", stroke = "#00ff88", color = "#00ff88"),
  process  = c(fill = "#16213e", stroke = "#44ddff", color = "#44ddff"),
  output   = c(fill = "#0f3460", stroke = "#ff3366", color = "#ff3366"),
  decision = c(fill = "#1a1a2e", stroke = "#ffaa33", color = "#ffaa33")
)

# Use the palette parameter (overrides theme when provided)
mermaid_content <- put_diagram(workflow, palette = cyberpunk, output = "raw")
writeLines(mermaid_content, "workflow.mmd")

Accepts: input, process, output, decision, artifact, start, end. Each takes c(fill = "#hex", stroke = "#hex", color = "#hex"). Unset → base theme.

→ Mermaid out w/ custom classDef. Shapes preserved from node_type, colors change. All use stroke-width:2px (not overridable via put_theme()).

If err: not putior_theme class → descriptive err. Pass put_theme() return, not raw list.

Fallback — manual classDef replacement (fine-grained per-type stroke widths):

mermaid_content <- put_diagram(workflow, theme = "dark", output = "raw")
lines <- strsplit(mermaid_content, "\n")[[1]]
lines <- lines[!grepl("^\\s*classDef ", lines)]
custom_defs <- c("  classDef input fill:#1a1a2e,stroke:#00ff88,stroke-width:3px,color:#00ff88")
mermaid_content <- paste(c(lines, custom_defs), collapse = "\n")

Step 4: Generate Mermaid

# Print to console (default)
cat(put_diagram(workflow, theme = "github"))

# Save to file
writeLines(put_diagram(workflow, theme = "github"), "docs/workflow.md")

# Get raw string for embedding
mermaid_code <- put_diagram(workflow, output = "raw", theme = "github")

# With source file info (shows which file each node comes from)
cat(put_diagram(workflow, theme = "github", show_source_info = TRUE))

# With clickable nodes (for VS Code, RStudio, or file:// protocol)
cat(put_diagram(workflow,
  theme = "github",
  enable_clicks = TRUE,
  click_protocol = "vscode"  # or "rstudio", "file"
))

# Full-featured
cat(put_diagram(workflow,
  theme = "viridis",
  show_source_info = TRUE,
  enable_clicks = TRUE,
  click_protocol = "vscode"
))

→ Valid Mermaid starting flowchart TD (or LR by direction). Nodes connected by arrows.

If err: flowchart TD no nodes → empty DF. Missing connections → check output filenames match input filenames across nodes.

Step 5: Embed in doc

GitHub README (```mermaid fence):

## Workflow

```mermaid
flowchart TD
  A["Extract Data"] --> B["Transform"]
  B --> C["Load"]
```

Quarto (native mermaid chunk via knit_child):

# Chunk 1: Generate code (visible, foldable)
workflow <- put("./src/")
mermaid_code <- put_diagram(workflow, output = "raw", theme = "github")
# Chunk 2: Output as native mermaid chunk (hidden)
#| output: asis
#| echo: false
mermaid_chunk <- paste0("```{mermaid}\n", mermaid_code, "\n```")
cat(knitr::knit_child(text = mermaid_chunk, quiet = TRUE))

R Markdown (mermaid.js CDN or DiagrammeR):

DiagrammeR::mermaid(put_diagram(workflow, output = "raw"))

→ Renders in target format. GitHub native mermaid fence render.

If err: GitHub no render → fence must be exactly ```mermaid (no extra attrs). Quarto → use knit_child() (direct var interpolation in {mermaid} not supported).

Check

  • put_diagram() valid Mermaid (starts flowchart)
  • All expected nodes appear
  • Arrows between connected nodes
  • Theme applied (check init block)
  • Renders in target format

Traps

  • Empty diagrams: put() no rows → check annotations + syntax.
  • All nodes disconnected: output filenames must exactly match input (inc ext). data.csvData.csv.
  • Theme not visible on GitHub: limited theme support. "github" designed for GitHub. %%{init:...}%% may be ignored.
  • Quarto var interpolation: {mermaid} no R vars. Use knit_child().
  • Clickable not working: need renderer w/ Mermaid interaction. GitHub static no clicks. Use local Mermaid or putior Shiny sandbox.
  • Self-referential meta-pipeline: scanning dir w/ build script → duplicate subgraph IDs + Mermaid errs. Use exclude:
    workflow <- put("./src/", exclude = c("build-workflow\\.R$", "build-workflow\\.js$"))
    
  • show_artifacts = TRUE noisy: large projects → 10-20+ artifact nodes. Use FALSE + rely on node_type for key in/out.

  • annotate-source-files — prereq before gen
  • analyze-codebase-workflow — auto-detect supplements manual
  • setup-putior-ci — automate regen in CI/CD
  • create-quarto-report — embed in Quarto
  • build-pkgdown-site — embed in pkgdown

GitHub 저장소

pjt222/agent-almanac
경로: i18n/caveman-ultra/skills/generate-workflow-diagram
0
agentsagentskillsai-assisted-developmentclaude-codeskillsteams

연관 스킬

content-collections

메타

이 스킬은 콘텐츠 콜렉션(Content Collections)을 위한 프로덕션 검증된 설정을 제공합니다. 콘텐츠 콜렉션은 Markdown/MDX 파일을 Zod 검증이 포함된 타입 안전한 데이터 콜렉션으로 변환해주는 TypeScript 최우선 도구입니다. 블로그, 문서 사이트 또는 콘텐츠 중심의 Vite + React 애플리케이션을 구축할 때 타입 안전성과 자동 콘텐츠 검증을 보장하기 위해 사용하세요. Vite 플러그인 구성과 MDX 컴파일부터 배포 최적화 및 스키마 검증에 이르기까지 모든 것을 다룹니다.

스킬 보기

polymarket

메타

이 스킬은 개발자들이 Polymarket 예측 시장 플랫폼을 활용한 애플리케이션을 구축할 수 있도록 지원하며, 거래 및 시장 데이터를 위한 API 통합 기능을 포함합니다. 또한 WebSocket을 통한 실시간 데이터 스트리밍을 제공하여 실시간 거래와 시장 활동을 모니터링할 수 있습니다. 이를 통해 거래 전략을 구현하거나 실시간 시장 업데이트를 처리하는 도구를 생성하는 데 활용할 수 있습니다.

스킬 보기

creating-opencode-plugins

메타

이 스킬은 개발자들이 명령어, 파일, LSP 작업 등 25개 이상의 이벤트 유형에 연결되는 OpenCode 플러그인을 만들 수 있도록 돕습니다. JavaScript/TypeScript 모듈을 위한 플러그인 구조, 이벤트 API 명세, 구현 패턴을 제공합니다. OpenCode AI 어시스턴트의 라이프사이클을 사용자 정의 이벤트 기반 로직으로 가로채거나, 모니터링하거나, 확장해야 할 때 사용하세요.

스킬 보기

sglang

메타

SGLang은 RadixAttention 프리픽스 캐싱을 활용하여 JSON, 정규식, 에이전트 워크플로우를 위한 고속 구조화 생성에 특화된 고성능 LLM 서빙 프레임워크입니다. 특히 반복되는 프리픽스가 있는 작업에서 상당히 빠른 추론 속도를 제공하여 복잡한 구조화 출력 및 다중 턴 대화에 이상적입니다. 제약 디코딩이 필요하거나 광범위한 프리픽스 공유가 있는 애플리케이션을 구축할 때는 vLLM과 같은 대안보다 SGLang을 선택하십시오.

스킬 보기