generate-workflow-diagram
정보
이 스킬은 `putior` 워크플로 데이터에서 테마가 적용된 Mermaid 플로우차트 다이어그램을 생성합니다. 여러 테마, 출력 형식, 문서 임베딩을 위한 인터랙티브 기능을 제공합니다. 소스 파일에 주석을 추가한 후 워크플로를 시각화하거나 다양한 대상에 맞춰 다이어그램을 업데이트해야 할 때 사용하세요.
빠른 설치
Claude Code
추천npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/generate-workflow-diagramClaude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요
문서
Generate Workflow Diagram
Make themed Mermaid flowchart diagram from putior workflow data. Embed in docs.
When Use
- After annotating source files, ready to make visual diagram
- Regenerate diagram after workflow changes
- Switch themes or output formats for different audiences
- Embed workflow diagrams in README, Quarto, R Markdown docs
Inputs
- Required: Workflow data from
put(),put_auto(), orput_merge() - Optional: Theme name (default:
"light"; options: light, dark, auto, minimal, github, viridis, magma, plasma, cividis) - Optional: Output target: console, file path, clipboard, raw string
- Optional: Interactive features:
show_source_info,enable_clicks
Steps
Step 1: Extract Workflow Data
Get workflow data from one of three sources.
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")
Workflow data frame may include node_type column from annotations. Node types control Mermaid shapes:
node_type | Mermaid Shape | Use 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 node_type also gets CSS class (class nodeId input;) for theme-based styling.
Got: Data frame with at least one row, has id, label, optionally input, output, source_file, node_type columns.
If fail: Data frame empty? No annotations or patterns found. Run analyze-codebase-workflow first, or check annotations syntactically valid with put("./src/", validate = TRUE).
Step 2: Pick Theme + Options
Pick theme for target audience.
# 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)
Additional parameters:
direction: Diagram flow direction —"TD"(top-down, default),"LR"(left-right),"RL","BT"show_artifacts:TRUE/FALSE— show artifact nodes (files, data); noisy for large workflows (16+ extra nodes)show_workflow_boundaries:TRUE/FALSE— wrap each source file nodes in Mermaid subgraphsource_info_style: How source file info displayed on nodes (subtitle)node_labels: Format for node label text
Got: Theme names printed. Pick one by context.
If fail: Theme name not recognized? put_diagram() falls back to "light". Check spelling.
Step 3: Custom Palette with put_theme() (Optional)
9 built-in themes don't match project palette? Make custom theme with put_theme().
# 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")
put_theme() takes input, process, output, decision, artifact, start, end node types. Each takes named vector c(fill = "#hex", stroke = "#hex", color = "#hex"). Unset types inherit from base theme.
Got: Mermaid output with custom classDef lines. Node shapes from node_type preserved; only colors change. All node types use stroke-width:2px — override not supported via put_theme().
If fail: Palette object not putior_theme class? put_diagram() raises descriptive error. Pass return value of put_theme(), not raw list.
Fallback — manual classDef replacement: Fine-grained control beyond put_theme() (per-type stroke widths)? Generate with base theme + replace classDef lines manually:
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 Output
Make diagram in desired output mode.
# 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"
))
Got: Valid Mermaid code starts with flowchart TD (or LR by direction). Nodes connected by arrows showing data flow.
If fail: Output is flowchart TD with no nodes? Workflow data frame empty. Connections missing? Check output filenames match input filenames across nodes.
Step 5: Embed in Target Document
Insert diagram into appropriate docs format.
GitHub README (```mermaid code fence):
## Workflow
```mermaid
flowchart TD
A["Extract Data"] --> B["Transform"]
B --> C["Load"]
```
Quarto document (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 (with mermaid.js CDN or DiagrammeR):
DiagrammeR::mermaid(put_diagram(workflow, output = "raw"))
Got: Diagram renders correct in target format. GitHub renders mermaid code fences native.
If fail: GitHub won't render diagram? Code fence must use exactly ```mermaid (no extra attributes). Quarto → use knit_child() approach since direct variable interpolation in {mermaid} chunks not supported.
Checks
-
put_diagram()produces valid Mermaid code (starts withflowchart) - All expected nodes appear in diagram
- Data flow connections (arrows) present between connected nodes
- Selected theme applied (check init block in output for theme-specific colors)
- Diagram renders correct in target format (GitHub, Quarto)
Pitfalls
- Empty diagrams: Usually
put()returned no rows. Check annotations exist + syntactically valid. - All nodes disconnected: Output filenames must exactly match input filenames (including extension) for putior to draw connections.
data.csv+Data.csvare different. - Theme not visible on GitHub: GitHub mermaid renderer has limited theme support.
"github"theme designed for GitHub.%%{init:...}%%theme block may be ignored by some renderers. - Quarto mermaid variable interpolation: Quarto
{mermaid}chunks don't support R variables direct. Useknit_child()from Step 5. - Clickable nodes not working: Click directives need renderer supporting Mermaid interaction events. GitHub static renderer no click support. Use local Mermaid renderer or putior Shiny sandbox.
- Self-referential meta-pipeline files: Scanning directory including build script generating diagram → duplicate subgraph IDs + Mermaid errors. Use
excludeparameter:workflow <- put("./src/", exclude = c("build-workflow\\.R$", "build-workflow\\.js$")) show_artifacts = TRUEtoo noisy: Large projects generate many artifact nodes (10–20+), clutter diagram. Useshow_artifacts = FALSE+ rely onnode_typeannotations to mark key inputs/outputs explicit.
See Also
annotate-source-files— prerequisite: files annotated before diagram generationanalyze-codebase-workflow— auto-detection supplements manual annotationssetup-putior-ci— automate diagram regeneration in CI/CDcreate-quarto-report— embed diagrams in Quarto reportsbuild-pkgdown-site— embed diagrams in pkgdown docs sites
GitHub 저장소
연관 스킬
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을 선택하십시오.
