AutoPlantUMLEdit
Auto-generate UML diagrams from natural language, one-click export to editable PPT/EMF with individually editable shapes in PowerPoint.
Core Capabilities
- Natural Language → PlantUML: Generate PlantUML syntax from user requirements
- One-click Export: SVG → EMF → PPT, supports SVG/PNG/EMF/PPT formats
- Fully Editable: EMF/PPT can be ungrouped in PowerPoint for independent shape editing
Trigger Conditions
Activate when user expresses:
- "Generate a... sequence/class/flowchart diagram"
- "Draw me a... architecture diagram"
- "Create a... state diagram"
- "I want to see... UML diagram"
Usage Flow
- Generate PlantUML syntax based on user requirements
- Save as
{name}.puml file
- Run script to generate output
Script Commands
python svg2emf.py <input.puml> [-f ppt|svg|png|emf] [-o <output>]
Parameters:
| Parameter | Description | Default |
|---|
<input.puml> | PlantUML source file | Required |
-f | Output format | ppt |
-o | Output file path | Same name .pptx |
Examples:
# Generate PPT (default)
python svg2emf.py sequence.puml
# Export SVG
python svg2emf.py sequence.puml -f svg
# Export PNG
python svg2emf.py sequence.puml -f png
# Export EMF (editable)
python svg2emf.py sequence.puml -f emf
# Specify output path
python svg2emf.py sequence.puml -o my_diagram.pptx
PlantUML Syntax Reference
Sequence Diagram
@startuml
participant Alice as A
participant Bob as B
A -> B : message
B --> A : response
@enduml
Class Diagram
@startuml
class User {
+name: String
+login()
}
class Order {
+items: List
+calculate()
}
User "1" -- "*" Order : places
@enduml
Activity Diagram (Flowchart)
@startuml
start
:Login system;
if (Password correct?) then (Yes)
:Go to home;
else (No)
:Show error;
stop
endif
stop
@enduml
State Diagram
@startuml
[*] --> Waiting
Waiting --> Processing: Start
Processing --> Completed: Success
Processing --> Failed: Error
Completed --> [*]
Failed --> [*]
@enduml
Use Case Diagram
@startuml
left to right direction
actor User as U
rectangle System {
U -- (Login)
U -- (Place Order)
U -- (Query Order)
}
@enduml
Output Format Guide
| Format | Description | PowerPoint Editable |
|---|
.pptx | Slide with embedded EMF | ✅ Ungroup to edit |
.emf | Enhanced Metafile | ✅ Ungroup to edit |
.svg | Vector image | ❌ Needs conversion |
.png | Raster image | ❌ Not editable |
Recommended Workflow:
- Generate
.pptx format
- Select the image in PowerPoint
- Right-click →
Group → Ungroup (may need to ungroup multiple times to fully separate all elements)
- Edit each element independently
⚠️ Important Notes
After generating PPT, you MUST tell the user the following:
"PPT generated! To edit each shape: Select the image → Right-click → Group → Ungroup. Note: You may need to ungroup multiple times (Ctrl+Shift+G) to fully separate all elements and ensure each shape can be edited independently."
Notes
- Avoid Chinese characters, spaces, and special characters in
.puml filenames
- PlantUML syntax requires matching
@startuml and @enduml
- Output files are saved in the current working directory
- Inkscape and JDK must be installed and configured in PATH (see dependency section below)
- Use system Python to run the script: Ensure dependencies are installed via
pip install -r requirements.txt
⚠️ Swimlane/Participant Names Must Be in English
Due to PlantUML encoding limitations, swimlane names and participant names must be in English. Activity descriptions and messages should use the user's language.
@startuml ecommerce_flow
|Customer|
start
:Browse Products;
:Place Order;
|OrderService|
:Process Order;
@enduml
Rules:
- Swimlane/Participant names: Must be in English (e.g., Customer, OrderService)
- Activity descriptions/messages: Use user's language (if user speaks Chinese, use Chinese "浏览商品"; if English, use "Browse Products")
- State names: Use English (e.g., Active, Pending, Completed)
Reason: PlantUML has an encoding bug when handling non-English swimlane/participant names, producing SVGs with corrupted HTML entity references. This is a PlantUML limitation that cannot be resolved via configuration.
Dependency Instructions
External Dependencies Check
Before using this skill, verify the following dependencies are installed:
1. Inkscape (Vector Conversion)
Inkscape is used to convert SVG to EMF format, it's the core dependency.
Check if installed:
# Run in command line
inkscape --version
If not installed, follow these steps:
- Visit Inkscape download page: https://inkscape.org/release/
- Download Windows installer (
.exe or .msi)
- Run the installer, make sure to check "Add Inkscape to PATH" during installation
- After installation, reopen command line window and verify:
inkscape --version
Version requirement: Inkscape 1.0 or higher
Important: If not added to PATH during installation, you can add manually:
- Add
C:\Program Files\Inkscape\bin to system PATH environment variable
2. OpenJDK (Run PlantUML)
Check if installed:
java --version
If not installed, follow these steps:
- Visit Adoptium download page: https://adoptium.net/zh-CN/temurin/releases?version=8
- Download Windows x64 JDK 8 (.msi or .exe)
- Run the installer
- Configure environment variables:
| Variable | Value |
|---|
JAVA_HOME | C:\Program Files\Eclipse Adoptium\jdk-8.x.x.x-hotspot (adjust to actual install path) |
PATH (append) | %JAVA_HOME%\bin |
- Verify installation:
java --version
Python Dependencies
Install via pip:
pip install -r requirements.txt
requirements.txt contents:
PlantUML Jar Download
Important: If scripts/plantuml.jar does not exist, the AI model should download it automatically.
Download command:
# Navigate to AutoPlantUMLEdit skill directory first
curl -L -o "scripts/plantuml.jar" "https://github.com/plantuml/plantuml/releases/download/v1.2026.2/plantuml-1.2026.2.jar"
Or using PowerShell:
# Navigate to AutoPlantUMLEdit skill directory first
Invoke-WebRequest -Uri "https://github.com/plantuml/plantuml/releases/download/v1.2026.2/plantuml-1.2026.2.jar" -OutFile "scripts/plantuml.jar"
Verify after download:
java -jar scripts/plantuml.jar -version