auto-plantuml-edit
by @zhangjilei123-1
Convert natural language to UML diagrams, export editable PPT/EMF with individually editable shapes in PowerPoint.
clawhub install auto-plantuml-editπ About This Skill
name: AutoPlantUMLEdit description: Convert natural language to UML diagrams, export editable PPT/EMF with individually editable shapes in PowerPoint.
AutoPlantUMLEdit
Auto-generate UML diagrams from natural language, one-click export to editable PPT/EMF with individually editable shapes in PowerPoint.
Core Capabilities
Trigger Conditions
Activate when user expresses:
Usage Flow
1. Generate PlantUML syntax based on user requirements
2. Save as {name}.puml file
3. Run script to generate output
Script Commands
python svg2emf.py [-f ppt|svg|png|emf] [-o Parameters:
| Parameter | Description | Default |
|-----------|-------------|---------|
| | PlantUML source file | Required |
| -f | Output format | ppt |
| -o | Output file path | Same name .pptx |
Examples:
# Generate PPT (default)
python svg2emf.py sequence.pumlExport SVG
python svg2emf.py sequence.puml -f svgExport PNG
python svg2emf.py sequence.puml -f pngExport EMF (editable)
python svg2emf.py sequence.puml -f emfSpecify 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:
1. Generate .pptx format
2. Select the image in PowerPoint
3. Right-click β Group β Ungroup (may need to ungroup multiple times to fully separate all elements)
4. 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
1. Avoid Chinese characters, spaces, and special characters in .puml filenames
2. PlantUML syntax requires matching @startuml and @enduml
3. Output files are saved in the current working directory
4. Inkscape and JDK must be installed and configured in PATH (see dependency section below)
5. 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:
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:
1. Visit Inkscape download page: https://inkscape.org/release/
2. Download Windows installer (.exe or .msi)
3. Run the installer, make sure to check "Add Inkscape to PATH" during installation
4. 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:
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:
1. Visit Adoptium download page: https://adoptium.net/zh-CN/temurin/releases?version=8 2. Download Windows x64 JDK 8 (.msi or .exe) 3. Run the installer 4. 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 |
5. 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
π Tips & Best Practices
1. Avoid Chinese characters, spaces, and special characters in .puml filenames
2. PlantUML syntax requires matching @startuml and @enduml
3. Output files are saved in the current working directory
4. Inkscape and JDK must be installed and configured in PATH (see dependency section below)
5. Use system Python to run the script: Ensure dependencies are installed via pip install -r requirements.txt