Agent skill
plantuml
Create, edit, and render PlantUML diagrams. Triggers on: architecture diagrams, flowcharts, sequence diagrams, data models, state machines, visual documentation.
Install this agent skill to your Project
npx add-skill https://github.com/JoaquinCampo/Skills/tree/main/plantuml
SKILL.md
Infer the operation mode from $ARGUMENTS:
| Pattern | Mode | Example |
|---|---|---|
create ... |
Create new diagram | create sequence diagram for contract ingestion |
edit <path> ... |
Modify existing diagram | edit docs/diagrams/data-model-0.puml add user table |
render <path> |
Re-render .puml to image |
render docs/diagrams/api-structure-0.puml |
render all |
Re-render all .puml files |
render all |
| (anything else) | Create (default) | contract lifecycle state machine |
Step 0: Setup
REPO_ROOT="$(git rev-parse --show-toplevel)"
mkdir -p "$REPO_ROOT/docs/diagrams"
Check if docs/diagrams/theme.puml exists. If not, copy the theme from assets/theme.puml in this skill's directory to $REPO_ROOT/docs/diagrams/theme.puml. Never duplicate skinparams inline — always use the shared theme.
Mode: CREATE
1. Understand the Request
Parse $ARGUMENTS for diagram type, subject, and scope. If the request is vague, read relevant source code first — use Glob/Grep to find modules, then Read key files.
2. Choose Diagram Type
Read references/diagram-types.md for the full type guide and per-type conventions. Quick decision:
| Use Case | Type |
|---|---|
| Multi-service message flow | Sequence |
| Model fields, table structure | Class/Entity |
| Pipeline, branching logic | Activity |
| Status lifecycle, transitions | State |
| System boundaries, layers | Component |
3. Design Before Coding
Before writing any PlantUML, plan:
- What is the architectural story? Not "added a service" but "introduced a bidirectional sync with normalized constraints"
- What would confuse a new team member? That's what the diagram should clarify
- Key design decisions — constraints, validation gates, data transformations
- List exact elements with real names from the code (target 6-12, hard max 15 — split if more)
- List exact arrows with labels describing data/actions
- Identify groupings by architectural boundary
4. Determine Filename
ls docs/diagrams/*.puml 2>/dev/null | sort -V
Convention: {topic}-{n}.puml where {n} increments from 0. Image: {topic}-{n}.png or .svg.
5. Write the .puml File
Every diagram follows this skeleton:
@startuml
' Title: [Concept — Pattern/Insight]
' Created: [YYYY-MM-DD]
!include theme.puml
title Concept Name — Key Insight
' --- Elements ---
' [diagram body — see references/diagram-types.md for per-type conventions]
' --- Legend (only when 2+ color-coded groups are used) ---
legend right
| Color | Layer |
|<#DBEAFE> | API / Input |
|<#EDE9FE> | Service / Logic |
|<#D1FAE5> | Storage / Data |
end legend
center footer Generated on YYYY-MM-DD
@enduml
Rules:
- Always
!include theme.puml— never inline skinparams - Title = concept + insight, not just feature name
- Legend only when 2+ color groups; only list layers actually present
- Name every arrow with the actual method/field/action
- Max 2-3 notes per diagram, explaining non-obvious why
- See
references/color-palette.mdfor the full layer→color mapping
6. Render
Use the render script from this skill's scripts/ directory:
bash scripts/render.sh docs/diagrams/{topic}-{n}.puml # PNG (default)
bash scripts/render.sh docs/diagrams/{topic}-{n}.puml --svg # SVG (better for docs/GitHub)
bash scripts/render.sh --all # All diagrams
The script validates that plantuml is installed, checks files exist, and reports errors per file.
7. Self-Review
Read the rendered image and verify:
- All labels readable — no truncated text, no overlapping
- Arrows have meaningful labels
- Color coding consistent — same layer = same color
- Legend matches diagram
- Footer present with date
- Notes explain non-obvious decisions
- The diagram teaches something — a new team member learns from it
If any check fails, edit and re-render. Up to 3 attempts.
8. Report
Tell the user: source path (.puml), image path (.png/.svg), what it shows and why this type was chosen, and the re-render command for future manual edits.
Quick mode: If the user explicitly asks for a quick sketch or informal diagram, skip the legend, footer, and self-review steps. Still use the theme.
Mode: EDIT
- Read the existing
.pumlfile and understand its structure - Plan changes — preserve existing style and conventions
- Apply edits, preserving:
!include theme.puml, title (update if scope changed), footer (update date), legend (update if layers changed) - Render and self-review (Steps 6-8 from CREATE)
Mode: RENDER
bash scripts/render.sh docs/diagrams/{file}.puml # Single file
bash scripts/render.sh docs/diagrams/{file}.puml --svg # Single file, SVG
bash scripts/render.sh --all # All diagrams
Report which files were rendered and any errors.
Gotchas
| Mistake | Why it's bad | Do this instead |
|---|---|---|
| Generic "API → Service → DB" boxes | Anyone can read the file tree | Specific class names, method calls, field names |
| Unlabeled arrows | Meaningless connections | Every arrow labeled with data/action |
| 20+ elements crammed together | Unreadable | Split into focused diagrams, 6-12 elements each |
| Inline skinparams | Style drift across diagrams | !include theme.puml |
| Title = feature name ("QA Module") | Doesn't teach anything | Title = concept + insight ("QA Session — RAG Pipeline Flow") |
| Notes saying "this is the database" | Restating the obvious | Notes explaining constraints and why decisions were made |
| Dumping entire table schemas | Noise | Only fields relevant to the story |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
sparse-retrieval-eval
Evaluate sparse retrieval models on standard IR benchmarks (BEIR, MIRACL, mMARCO). Covers all IR metrics (nDCG@k, Recall@k, MAP, MRR), dataset loading, sparse corpus encoding to CSR matrices, IDF-weighted retrieval, caching, and result interpretation. Triggers on: evaluate retrieval, BEIR benchmark, nDCG, recall@k, sparse retrieval evaluation, MIRACL evaluation, information retrieval metrics, IR evaluation, search quality metrics.
wandb-plot
Download and generate plots from Weights & Biases runs. Use when you need to: - List projects you have access to - List runs in a W&B project - Inspect available metrics for a run - Download existing plot images from a run - Generate line plots from metric history (loss, accuracy, etc.)
go
Go engineering best practices and idioms. This skill should be used when writing, reviewing, or refactoring Go code. Triggers on any .go file work, Go module operations, go test, go build, go run, go vet, go generate, or when the user mentions Go, golang, goroutines, channels, context, Go interfaces, Go error handling, Go testing, or Go concurrency. ALWAYS use this skill when Go code is involved, even for simple functions.
fastapi
FastAPI best practices and conventions. Use when working with FastAPI APIs and Pydantic models for them. Keeps FastAPI code clean and up to date with the latest features and patterns, updated with new versions. Write new code or refactor and update old code.
kvpress
kvpress (NVIDIA) KV-cache compression for HuggingFace LLMs. Use when: kvpress imports, compression_ratio, press(model) context managers, StreamingLLMPress, SnapKVPress, ExpectedAttentionPress, TOVAPress, KnormPress, KV-cache eviction, token pruning during generation, or attention sink methods.
qdrant-sparse
Qdrant sparse vector operations: collection creation with SparseVectorParams, Modifier.IDF for miniCOIL/SPLADE/BM42, upserting SparseVector points, sparse search, hybrid search with prefetch + RRF/DBSF fusion, converting model outputs to SparseVector format, payload filtering, and performance tuning. Covers the sparse vector gap not handled by the official Qdrant MCP (which only supports dense vectors via FastEmbed).
Didn't find tool you were looking for?