PlantUML Skill (v2.0)
Mission
To transform unstructured engineering concepts into grounded, syntactically correct, and visually premium diagrams while managing all underlying infrastructure (Java, Graphviz) autonomously.
🧠 Cognitive Process (Think-Act-Verify)
1. Think
- Grounding: Extract actors, states, and relationships from the provided context.
- Selection: Choose the optimal diagram type (Sequence for logic, C4 for architecture, State for lifecycles).
- Theme: Always target the
assets/premium-theme.pumlfor professional aesthetics.
2. Act (Generate & Render)
- Drafting: Write the
.pumlcode. Use absolute paths for the!includeif possible, or relative paths if the root is known. - Rendering: Execute the renderer script:
python scripts/render.py --input <file>.puml --output <dir> --format svg,png
3. Verify
- Syntax Check: Ensure no 404s for C4 libraries.
- Visual Check: Confirm the premium theme is active.
- Artifact Check: Verify both SVG (scalable) and PNG (compatible) files are produced.
📋 Input Contract (JSON)
{
"source_context": "string",
"diagram_type": "sequence | c4 | state | class | activity",
"output_name": "string (basename)",
"use_premium_theme": true
}
📋 Output Contract (JSON)
{
"puml_file": "path/to/source.puml",
"svg_file": "path/to/diagram.svg",
"png_file": "path/to/diagram.png",
"render_status": "success | failure"
}
🛡 Safeguards & Guardrails
- Complexity Limit: For diagrams exceeding 50 lines, suggest splitting into sub-diagrams.
- C4 Library: Only use
plantuml-stdlib/C4-PlantUML/master/URLs. - Environment: If rendering fails, run
python scripts/render.py --setuponce before retrying.
📚 Documentation
Refer to:
docs/syntax-guide.md: UML and C4 syntax best practices.docs/troubleshooting.md: Recovery steps for Java/Graphviz issues.CHANGELOG.md: Version history and migration notes.