umple-diagram-generator

umple-diagram-generator

Use this skill when user asks to generate state machine or class diagram with umple.

0звезд
0форков
Обновлено 1/22/2026
SKILL.md
readonlyread-only
name
umple-diagram-generator
description

Use this skill when user asks to generate state machine or class diagram with umple.

Umple Diagram Generator Skill

Overview

Generates UML diagrams from natural-language requirements using Umple CLI.

Supported Diagram Types & Guidance

Diagram Type Umple Generator Guidance File When to Use
State Machine GvStateDiagram references/state-machine-guidance.md User requests state machine diagram
Class Diagram GvClassDiagram references/class-diagram-guidance.md User requests class diagram
Unsupported - - Inform user it's not yet supported

Script Directory

Important: All scripts are located in the scripts/ subdirectory of this skill.

Agent Execution Instructions:

  1. Determine this SKILL.md file's directory path as SKILL_DIR
  2. Script path = ${SKILL_DIR}/scripts/main.ts
  3. Replace all ${SKILL_DIR} in this document with the actual path

Quick Start

# Folder mode: organized output with all files (.ump, .gv, .svg)
npx -y bun ${SKILL_DIR}/scripts/main.ts --input model.ump --output ./diagrams --name "light-controller"

# Exact path mode: save SVG to specific file path
npx -y bun ${SKILL_DIR}/scripts/main.ts --input model.ump --output ./my-diagram.svg

# Class diagram with custom name
npx -y bun ${SKILL_DIR}/scripts/main.ts --input model.ump --output ./diagrams --name "user-system" --type class-diagram

Script Options

Option Description
-i, --input <path> Input .ump file (required)
-o, --output <path> Output path: directory for folder mode, or .svg file for exact path (required)
-n, --name <name> Diagram name for folder mode (optional, triggers folder mode)
-t, --type <type> Diagram type: state-machine (default), class-diagram
-s, --suboption <opt> GvStateDiagram suboption (repeatable)
--json JSON output with details
-h, --help Show help

Output Modes

Folder Mode (when --name is specified or --output is a directory):

  • Creates organized folder with timestamped name
  • Includes all files: .ump (source), .gv (graphviz), .svg (diagram)

Folder naming:

  • With --name: <sanitized-name>_<timestamp>/
  • Without --name: <diagram-type>_<timestamp>/

Example:

diagrams/
└── light-controller_20260121_183045/
    ├── model.ump
    ├── model.gv
    └── model.svg

Exact Path Mode (when --output ends with .svg):

  • Saves only the SVG file to the exact specified path
  • Useful when user specifies a specific output location

Example:

npx -y bun ${SKILL_DIR}/scripts/main.ts --input model.ump --output /path/to/my-diagram.svg
# Result: /path/to/my-diagram.svg (only SVG, no folder created)

Exit Codes

Code Meaning
0 Success
1 Missing dependencies (umple or dot)
2 Umple validation/compilation failed
3 SVG generation failed or unsupported diagram type

Pre-flight checks (must do before running Umple)

Dependencies

Dependency Check Command Installation Required
Umple CLI command -v umple Download Yes
Graphviz command -v dot brew install graphviz Yes

If dependencies are missing, stop and inform the user.

Workflow (do this every time)

Step 1 — Clarify only what you must

If ambiguous, propose your plan and ask minimal clarifying questions:

Diagram Type Key Questions
State Machine Initial state? Events? Final states? Guards/actions?
Class Diagram Main entities? Attributes? Relationships? Multiplicities?

Step 2 — Write the Umple model

Critical: Read the appropriate guidance file from the table above before writing code.

Step 3 — Determine output path and generate the diagram

Agent should choose the appropriate mode:

  • Folder mode (recommended): Use when generating for user review/documentation
  • Exact path mode: Use only when user explicitly specifies a file path

Folder mode example:

tmpdir="$(mktemp -d)"
cat >"$tmpdir/model.ump" <<'EOF'
// (generated Umple goes here)
EOF

npx -y bun ${SKILL_DIR}/scripts/main.ts --input "$tmpdir/model.ump" --output <output-dir> --name "<meaningful-name>" --type [state-machine|class-diagram]

Folder naming guidelines:

  • Use --name with a descriptive name derived from user requirements (e.g., "user-authentication", "order-workflow")
  • If no clear name from requirements, omit --name to use auto-generated name
  • The script automatically adds timestamp to prevent conflicts

Exact path mode example (when user specifies):

npx -y bun ${SKILL_DIR}/scripts/main.ts --input "$tmpdir/model.ump" --output /path/specified/by/user.svg --type [state-machine|class-diagram]

Step 4 — Validate output correctness

Check exit code (see table above). If non-zero, read error output, fix Umple, and retry up to 3 times.

Repair loop (required)

On each failure:

  1. Identify the root cause from script output (syntax error, unknown state, missing semicolon, etc.).
  2. Apply a focused fix to the Umple model.
  3. Re-run: npx -y bun ${SKILL_DIR}/scripts/main.ts --input "$tmpdir/model.ump" --output <output-dir> --name "<name>" --type [state-machine|class-diagram]

Output contract

  1. Specify which diagram type was generated.
  2. Show the generated Umple code (single umple code block).
  3. Confirm the exact command you ran.
  4. Folder mode: Provide the output folder path and SVG file location.
    Exact path mode: Provide the SVG file path.

You Might Also Like

Related Skills

coding-agent

coding-agent

179Kdev-codegen

Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent via background process for programmatic control.

add-uint-support

add-uint-support

97Kdev-codegen

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

at-dispatch-v2

at-dispatch-v2

97Kdev-codegen

Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.

skill-writer

skill-writer

97Kdev-codegen

Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

Creates JavaScript classes using Bun's Zig bindings generator (.classes.ts). Use when implementing new JS APIs in Zig with JSC integration.