| name | plantuml |
| description | Generate PlantUML diagrams from text descriptions and convert them to PNG/SVG images. This skill should be used when users need to create UML or non-UML diagrams (sequence, class, ER, Gantt, mindmaps, etc.), convert .puml files to images, or extract PlantUML code blocks from markdown files and replace them with image links. Supports all PlantUML diagram types including UML (sequence, class, activity, state, component, deployment, use case, object, timing) and non-UML (ER diagrams, Gantt charts, JSON/YAML visualization, mindmaps, WBS, network diagrams, wireframes, and more). |
PlantUML Diagram Generation and Conversion
Purpose
This skill enables comprehensive PlantUML diagram creation and conversion workflows. PlantUML is a text-based diagramming tool that generates professional diagrams from simple, intuitive syntax. Use this skill to:
- Create diagrams from natural language descriptions
- Convert source code to architecture diagrams (Spring Boot, FastAPI, Python ETL, Node.js, React, etc.)
- Convert standalone
.pumlfiles to PNG or SVG images - Extract
pumlcode blocks from markdown and convert to images - Process linked
.pumlfiles in markdown () - Enrich diagrams with Unicode symbols for semantic clarity
- Validate PlantUML syntax without conversion
- Replace markdown diagrams with image links for publication (Confluence, etc.)
When to Use This Skill
Use this skill when:
- User requests diagram creation (e.g., "Create a sequence diagram showing authentication flow")
- User wants to visualize code architecture (e.g., "Create deployment diagram for my Spring Boot app")
- User needs to convert
.pumlfiles to images - User wants to process markdown files containing ```puml code blocks or linked .puml files
- User asks to convert markdown for Confluence or other doc systems that don't support PlantUML
- β οΈ IMPORTANT: User is uploading markdown to Confluence or Notion - If the markdown contains PlantUML diagrams (```puml blocks or .puml file links), use this skill FIRST to convert diagrams to images before upload
- User asks for specific diagram types: UML (sequence, class, activity, state, component, deployment, use case, object, timing) or non-UML (ER, Gantt, mindmap, WBS, JSON/YAML, network, Archimate, wireframes)
- User wants to add semantic meaning with Unicode symbols (e.g., π for security, πΎ for database)
- User needs to validate PlantUML syntax before committing
- User mentions PlantUML explicitly
Setup Verification
Before creating diagrams, verify the PlantUML setup is complete. Run the setup checker:
python scripts/check_setup.py
This verifies:
- Java installation (required)
- Graphviz installation (recommended for complex layouts)
- plantuml.jar availability
Quick Setup Guide
If components are missing:
- Java: Download from https://www.oracle.com/java/technologies/downloads/
- plantuml.jar: Download from https://plantuml.com/download
- Place in:
~/plantuml.jaror setPLANTUML_JARenvironment variable
- Place in:
- Graphviz (optional): Download from https://graphviz.org/download/
- Required for most UML diagrams and complex layouts
Creating Diagrams
Process for Diagram Requests
When a user requests a diagram:
Identify the diagram type based on user intent:
- Sequence: Interactions between objects/actors over time
- Class: System structure with classes and relationships
- Activity: Workflows, processes, decision flows
- State: Object states and transitions
- ER (Entity Relationship): Database schemas with entities and relationships
- Gantt: Project timelines and task scheduling
- MindMap: Idea organization and brainstorming
- Component: System architecture and modules
- Use Case: Actors and system features
- Others: See
references/toc.mdfor all 19 diagram types
Consult references for syntax:
references/toc.md: Navigation hub linking to all diagram typesreferences/[diagram_type].md: Detailed syntax for specific diagram (e.g.,sequence_diagrams.md,class_diagrams.md)references/common_format.md: Universal elements shared across diagramsreferences/styling_guide.md: Modern<style>syntax for visual customizationreferences/plantuml_reference.md: Comprehensive command-line and troubleshooting guide
Generate the PlantUML source code following syntax rules:
- All diagrams start with
@start<type>(e.g.,@startuml) - All diagrams end with
@end<type>(e.g.,@enduml) - Use appropriate keywords for the diagram type
- Add comments with
'for clarity
- All diagrams start with
Save to
.pumlfile or present to user for reviewConvert to image using the conversion script (see below)
Resilient Workflow (Primary - Recommended)
For reliable diagram generation with error recovery, use the 4-step resilient workflow:
Step 1: Identify Diagram Type & Load Reference
- Identify diagram type from user intent (sequence, class, ER, etc.)
- Load
references/[diagram_type]_diagrams.mdfor syntax guide - If ambiguous, consult
references/toc.md
Step 2: Create File with Structured Naming
Save diagrams using the naming convention:
./diagrams/<markdown_name>_<num>_<type>_<title>.puml
Examples:
./diagrams/architecture_001_sequence_user_authe.puml
./diagrams/api_design_002_class_order_servi.puml
Automated:
python scripts/resilient_processor.py article.md --format png
Step 3: Convert with Error Handling (max 3 retries)
If conversion fails:
- Check
references/troubleshooting/toc.mdfor error classification - Load specific guide from
references/troubleshooting/[category]_guide.md - Check
references/common_syntax_errors.mdfor diagram type - External search fallback (in order):
- Perplexity (
mcp__perplexity-ask__perplexity_ask) - Brave Search (
mcp__brave-search__brave_web_search) - Gemini skill
- WebSearch tool
- Perplexity (
Step 4: Validate & Integrate into Markdown
Only after successful generation:
- Verify image file exists at expected path
- Add image link:
 - Keep .puml source file for future edits
Full documentation: references/workflows/resilient-execution-guide.md
Syntax Reference Quick Guide
Common Elements:
- Comments:
' Single lineor/' Multi-line '/ - Relationships:
->(solid),-->(dashed),..>(dotted) - Labels:
A -> B : Label text - Styling: Use
skinparamor!theme <name>
Key Diagram Types:
Sequence Diagram:
@startuml
participant Alice
participant Bob
Alice -> Bob: Request
activate Bob
Bob --> Alice: Response
deactivate Bob
@enduml
Class Diagram:
@startuml
class Animal {
-name: String
+move()
}
class Dog extends Animal {
+bark()
}
Animal <|-- Dog
@enduml
ER Diagram:
@startuml
entity "User" {
*id: int
name: string
}
entity "Post" {
*id: int
user_id: int
}
User ||--o{ Post
@enduml
Consult references/toc.md to navigate to specific diagram type guides with comprehensive examples.
Converting Source Code to Diagrams
This skill includes comprehensive examples of converting common application architectures into PlantUML diagrams. The examples/ directory contains language-specific templates and patterns.
Available Code-to-Diagram Examples
Spring Boot Applications (examples/spring-boot/)
- Deployment Diagram: AWS ECS deployment with RDS, ElastiCache, S3
- Component Diagram: Controller β Service β Repository architecture
- Sequence Diagram: Complete REST API request flow with JWT authentication
- Symbols: π± Spring, π― Controllers, πΌ Services, π¦ Repositories, π Security
Example mapping: When analyzing Spring Boot code, identify:
@RestControllerβ API endpoints π―@Serviceβ Business logic πΌ@Repositoryβ Data access π¦@Configurationβ System config βοΈ- Security filters β π JWT validation
FastAPI Applications (examples/fastapi/)
- Deployment Diagram: Kubernetes (GKE) with Cloud SQL, Memorystore Redis, Pub/Sub
- Component Diagram: Async routers, dependencies, Pydantic models
- Symbols: β‘ FastAPI/Async, π Uvicorn, π Python, π Pydantic, π OAuth2
Example mapping: When analyzing FastAPI code:
APIRouterβ API routers π―Depends()β Dependency injectionPydantic BaseModelβ Data validation πasync defβ Async processing β‘- Background tasks β β±οΈ Async jobs
Python ETL Pipelines (examples/python-etl/)
- Architecture Diagram: Complete ETL pipeline with Airflow orchestration
- Symbols: π Python, βοΈ Transform, π Analytics, π PostgreSQL, βοΈ Cloud storage
Example mapping: When analyzing ETL code:
- Data sources β π Sources (databases, APIs, files)
- Extraction logic β π₯ Extract modules
- Transformation β βοΈ Transform (pandas, Pydantic)
- Data quality β β Validation (Great Expectations)
- Loading β π€ Load to warehouse/lake
- Scheduling β π― Airflow DAGs
Node.js Web Applications (examples/nodejs-web/)
- Component diagrams for Express.js/Nest.js architectures
- Symbols: π’ Node.js, β‘ Express, π― Routes, πΌ Services
React Frontend (examples/react-frontend/)
- Deployment diagrams for SPA hosting (S3 + CloudFront)
- Component architecture diagrams
- Symbols: βοΈ React, π¨ Components, ποΈ State management
How to Use Code-to-Diagram Examples
- Identify the application type (Spring Boot, FastAPI, ETL, etc.)
- Examine the example in
examples/[app-type]/ - Map your code structure to the diagram patterns
- Copy and adapt the example
.pumlfile - Use consistent Unicode symbols from the examples
- Add domain-specific details relevant to your application
Example workflow:
# User has a Spring Boot microservice
# 1. Review example
cat examples/spring-boot/deployment-diagram.puml
# 2. Copy and customize
cp examples/spring-boot/deployment-diagram.puml my-service-deployment.puml
# Edit my-service-deployment.puml with your service details
# 3. Convert to image
python scripts/convert_puml.py my-service-deployment.puml --format svg
Unicode Symbols for Semantic Enrichment
PlantUML diagrams can be enhanced with Unicode symbols to add visual meaning without cluttering with text. The comprehensive symbol guide is available at references/unicode_symbols.md.
Quick Symbol Reference
Common Symbols by Category:
- Web/Network: π Web, π‘ Communication, π Links, β‘ Fast/Async
- Data/Storage: πΎ Database, ποΈ Warehouse, π Analytics, π Files
- Security: π Secure, π Key/Token, π‘οΈ Firewall, π€ User
- System: βοΈ Config, π§ Tools, π― Target/Endpoint, πΌ Business logic
- Messaging: π¬ Queue, π¨ Message, π Notification, π’ Broadcast
- Languages: π Python, β Java, π’ Node.js, π± Spring Boot, βοΈ React
- Cloud: βοΈ Cloud, π °οΈ AWS, π΅ Azure, π’ GCP, βΈοΈ Kubernetes
- Processing: π Loop/Retry, βοΈ Transform, β Valid, β Error
- Monitoring: π Metrics, π Increasing, π Decreasing, π¦ Health status
Using Unicode Symbols
Always enclose labels with symbols in double quotes:
@startuml
node "βοΈ AWS Cloud" as aws
component "π Security Service\nJWT Validation" as security
database "πΎ PostgreSQL" as db
queue "π¬ RabbitMQ" as mq
security --> db : "π Encrypted queries"
security --> mq : "π¨ Events"
@enduml
Best practices:
- Use consistently throughout a diagram
- Don't overuse - 1-2 symbols per node maximum
- Choose context-appropriate symbols
- Combine with descriptive text
- See
references/unicode_symbols.mdfor comprehensive guide
Converting Diagrams
Convert Standalone .puml Files
Use the convert_puml.py script to convert .puml files to images:
# Convert to PNG (default)
python scripts/convert_puml.py diagram.puml
# Convert to SVG
python scripts/convert_puml.py diagram.puml --format svg
# Specify output directory
python scripts/convert_puml.py diagram.puml --format svg --output-dir images/
When to use:
- User has existing
.pumlfiles - User requests image export of created diagrams
- Batch conversion of multiple
.pumlfiles needed
Extract and Convert from Markdown (Enhanced)
β οΈ CRITICAL for Confluence/Notion Uploads: If you are uploading a markdown document to Confluence or Notion that contains PlantUML diagrams, you MUST use this workflow FIRST to convert diagrams to images. Confluence and Notion do not natively render PlantUML code blocks.
Use the new process_markdown_puml.py script to process markdown files. This enhanced script supports both embedded code blocks AND linked .puml files.
# Process both embedded ```puml blocks AND linked  files
python scripts/process_markdown_puml.py article.md
# Convert to SVG format
python scripts/process_markdown_puml.py article.md --format svg
# Custom output directory
python scripts/process_markdown_puml.py article.md --output-dir diagrams/
# Validate syntax without converting (useful for CI/CD)
python scripts/process_markdown_puml.py article.md --validate
What this script does:
- Scans for embedded code blocks: Finds all
pumlcode blocks - Scans for linked .puml files: Finds
links - Validates syntax: Checks PlantUML syntax for all diagrams
- Converts to images: Generates PNG or SVG using plantuml.jar
- Replaces in markdown: Both embedded blocks and links become
 - Saves updated markdown: Creates
*_with_images.mdfor publication
When to use:
- REQUIRED: Before uploading markdown to Confluence or Notion if document contains PlantUML diagrams
- User has markdown with embedded PlantUML diagrams (```puml blocks)
- User has markdown linking to external
.pumlfiles (IDE-friendly workflow) - User wants to convert documentation for Confluence or other systems without PlantUML support
- User needs to validate PlantUML syntax in CI/CD pipeline
- User wants to generate article versions with images instead of code blocks
Confluence/Notion Workflow:
- Detect PlantUML diagrams in markdown (```puml blocks or
links)
- Run:
python scripts/process_markdown_puml.py document.md --format png - Result:
document_with_images.mdwith
references - Upload both the transformed markdown AND the images/ directory to Confluence/Notion
IDE-Friendly Workflow:
Many IDEs (IntelliJ, VS Code with extensions) can render .puml files directly. This workflow allows developers to keep diagrams as separate files during development, then convert for publication:
# Development version (article.md)
## Architecture
See the deployment diagram:

See the component diagram:

When processed:
python scripts/process_markdown_puml.py article.md --format svg
Generates article_with_images.md:
# Development version
## Architecture
See the deployment diagram:

See the component diagram:

Benefits of linked .puml files:
- β IDEs with PlantUML support render diagrams in preview
- β Diagrams are versioned separately from documentation
- β Easier to maintain and update diagrams
- β Reuse diagrams across multiple markdown files
- β Better for code reviews (diff .puml files directly)
- β Same processing script handles both embedded and linked diagrams
Example markdown input:
# My Article
Here's a sequence diagram:
```puml
@startuml
Alice -> Bob: Hello
@enduml
```
Output after processing:
# My Article
Here's a sequence diagram:

Direct Command-Line Usage
For advanced users or custom workflows, PlantUML can be invoked directly:
# Basic PNG conversion
java -jar ~/plantuml.jar diagram.puml
# SVG with custom output
java -jar ~/plantuml.jar --svg --output-dir out/ diagram.puml
# Batch conversion
java -jar ~/plantuml.jar "**/*.puml" --svg
# Pipe input
echo "@startuml Alice->Bob @enduml" | java -jar ~/plantuml.jar -pipe --svg > output.svg
See references/plantuml_reference.md for comprehensive command-line options.
Best Practices
Diagram Quality
- Use descriptive names: Generate meaningful filenames from diagram content
- Add comments: Use
'for single-line comments to explain complex logic - Follow conventions: Use standard UML notation for consistency
- Test incrementally: Verify simple diagrams before adding complexity
Format Selection
- PNG: Best for web publishing, smaller file sizes, fixed resolution
- SVG: Best for documentation, scalable, supports hyperlinks and tooltips
- Use SVG when: Diagrams need to be printed or scaled to different sizes
Styling and Themes
Modern <style> syntax (recommended):
@startuml
<style>
classDiagram {
class {
BackgroundColor LightBlue
BorderColor Navy
FontColor DarkBlue
}
arrow {
LineColor SeaGreen
}
}
</style>
' Your diagram content
@enduml
See references/styling_guide.md for comprehensive modern styling with CSS-like syntax, stereotypes, and advanced techniques.
Themes for quick styling:
@startuml
!theme cerulean
' Your diagram content
@enduml
Available themes: cerulean, bluegray, plain, sketchy, amiga
Note: Modern <style> syntax is preferred over legacy skinparam for better organization and maintainability.
Error Handling
IMPORTANT: PlantUML syntax is tricky and errors are common. We provide comprehensive troubleshooting resources.
Quick Diagnosis Process
If diagram generation fails:
- Check syntax:
java -jar plantuml.jar --check-syntax file.puml - Identify error type: Missing delimiters, arrow syntax, special characters, etc.
- Load troubleshooting guide:
references/common_syntax_errors.md - Navigate to your issue:
- General syntax errors (delimiters, arrows, quotes)
- Diagram-specific errors (by diagram type)
- Setup issues (Java, Graphviz, plantuml.jar)
When to Load Troubleshooting Resources
NEW: Comprehensive Troubleshooting Guides (215+ common errors documented):
Start here: Load references/troubleshooting/toc.md - Navigation hub with error decision tree
For specific issues:
- Setup problems:
references/troubleshooting/installation_setup_guide.md(15 errors) - Syntax errors:
references/troubleshooting/general_syntax_guide.md(20 errors) - Arrow/relationship issues:
references/troubleshooting/arrows_relationships_guide.md(20 errors) - Text/label problems:
references/troubleshooting/text_labels_guide.md(20 errors) - Styling issues:
references/troubleshooting/styling_themes_guide.md(20 errors) - Include/preprocessor:
references/troubleshooting/preprocessor_includes_guide.md(20 errors) - Sequence diagrams:
references/troubleshooting/sequence_diagrams_guide.md(20 errors) - Class diagrams:
references/troubleshooting/class_diagrams_guide.md(20 errors) - ER diagrams:
references/troubleshooting/er_diagrams_guide.md(20 errors) - Activity diagrams:
references/troubleshooting/activity_diagrams_guide.md(20 errors) - Image generation:
references/troubleshooting/image_generation_guide.md(20 errors) - Performance issues:
references/troubleshooting/performance_guide.md(20 errors)
Legacy resources (also available):
references/common_syntax_errors.md- Original comprehensive guidereferences/plantuml_reference.md- Installation and CLI reference
Common Error Categories
The troubleshooting guide covers:
- Delimiter errors: Missing/mismatched
@startuml/@enduml - Arrow syntax errors: Incorrect relationship symbols
- Quote handling: Curly quotes, escape sequences
- Special characters: Unicode, whitespace (NBSP/tabs)
- Preprocessor issues:
!define,!include, environment variables - Styling conflicts: Mixing
skinparamwith<style> - Version-specific issues: PlantUML v1.2025+ changes
- Diagram-specific errors: 5+ common errors for each of 19 diagram types
Workflow Examples
Example 1: Create and Convert ER Diagram
User request: "Create an ER diagram for a blog database with Users and Posts"
- Generate PlantUML source:
@startuml
entity "User" {
*id: int
username: string
email: string
created_at: datetime
}
entity "Post" {
*id: int
user_id: int
title: string
content: text
published_at: datetime
}
User ||--o{ Post : writes
@enduml
Save to
blog_er.pumlConvert to SVG:
python scripts/convert_puml.py blog_er.puml --format svg
Example 2: Process Markdown with Multiple Diagrams
User request: "Convert all PlantUML diagrams in my_article.md to images"
- Run extraction script:
python scripts/extract_and_convert_puml.py my_article.md --format png
Review
my_article_with_images.mdImages saved to
images/directory
Example 3: Create Gantt Chart
User request: "Create a Gantt chart for a 3-phase project"
- Generate PlantUML:
@startgantt
Project starts 2025-11-08
[Phase 1: Planning] lasts 10 days
[Phase 2: Development] starts after [Phase 1: Planning]'s end and lasts 20 days
[Phase 3: Testing] starts after [Phase 2: Development]'s end and lasts 7 days
@endgantt
Save to
project_timeline.pumlConvert to PNG:
python scripts/convert_puml.py project_timeline.puml --format png
Troubleshooting
Common Issues
"plantuml.jar not found"
- Download from https://plantuml.com/download
- Place in
~/plantuml.jaror setPLANTUML_JARenvironment variable - Verify with:
python scripts/check_setup.py
"Graphviz not found"
- Install from https://graphviz.org/download/
- Add
dotexecutable to PATH - Some diagrams (JSON, YAML, Gantt, MindMap) don't require Graphviz
"Syntax Error?"
- Check
@start/@enddelimiters match (seereferences/common_format.md) - Verify diagram-specific keywords
- Consult specific diagram guide from
references/toc.mdfor correct syntax
"Java not found"
- Install Java JRE/JDK 8+
- Add to PATH
- Verify:
java -version
References
Load these files for detailed information:
Core Syntax References
references/toc.md: Navigation hub linking to all 19 diagram typesreferences/sequence_diagrams.md,class_diagrams.md,er_diagrams.md, etc.: Comprehensive guides for specific diagram typesreferences/common_format.md: Universal elements shared across all diagram types (delimiters, metadata, comments, notes)references/styling_guide.md: Modern<style>syntax with CSS-like rules, stereotypes, and advanced stylingreferences/plantuml_reference.md: Installation, command-line operations, and troubleshooting
New Resources
Troubleshooting Guides (β οΈ START HERE FOR ERRORS):
references/troubleshooting/toc.md: Navigation hub with error decision tree and quick referencereferences/troubleshooting/*.md: 12 focused guides covering 215+ common errors- Installation & setup, general syntax, arrows, text/labels, styling
- Sequence, class, ER, activity diagram-specific errors
- Preprocessor, image generation, performance issues
Other Resources:
references/common_syntax_errors.md: Original comprehensive guide (1,755 lines, all 19 diagram types)references/unicode_symbols.md: Unicode symbol guide for semantic enrichment (π π πΎ βοΈ etc.)examples/spring-boot/: Spring Boot to PlantUML diagram examples (deployment, component, sequence)examples/fastapi/: FastAPI/Python async to PlantUML diagram examplesexamples/python-etl/: Python ETL pipeline architecture diagramsexamples/nodejs-web/: Node.js/Express application diagramsexamples/react-frontend/: React frontend deployment and component diagrams
Summary
To use this skill effectively:
- Verify setup: Run
python scripts/check_setup.py - Navigate diagram types: Start with
references/toc.mdto find the right diagram type - Learn syntax: Open specific diagram guides (e.g.,
references/sequence_diagrams.md) for detailed examples - Use modern styling: Apply
<style>syntax fromreferences/styling_guide.mdfor professional appearance - Enrich with symbols: Use Unicode symbols from
references/unicode_symbols.mdfor visual clarity (π πΎ βοΈ) - Map code to diagrams: Review
examples/[framework]/for code-to-diagram patterns (Spring Boot, FastAPI, ETL, etc.) - Convert standalone files: Use
scripts/convert_puml.pyfor.pumlto image conversion - Process markdown (enhanced): Use
scripts/process_markdown_puml.pyfor both embedded ```puml blocks AND linked .puml files - Validate syntax: Use
--validateflag for CI/CD pipeline checks - IDE-friendly workflow: Link to
.pumlfiles in markdown for IDE preview, convert for publication - Troubleshoot: Consult
references/plantuml_reference.mdfor installation and CLI help
This skill supports all PlantUML capabilities including:
- UML diagrams: sequence, class, activity, state, component, deployment, use case, object, timing
- Non-UML diagrams: ER, Gantt, mindmap, WBS, JSON/YAML, network, Archimate, wireframes
- Modern styling:
<style>syntax with CSS-like rules - Unicode symbols: Semantic enrichment with π π πΎ βοΈ π and 100+ other symbols
- Code-to-diagram: Examples for Spring Boot, FastAPI, Python ETL, Node.js, React
- Advanced features: Themes, hyperlinks, icons, validation
- Markdown integration: Embedded code blocks AND linked .puml files