Skip to content
bpmn-diagram logo

BPMN Diagram Skill

bpmn-diagram

Converts BPMN 2.0 XML to PNG diagram images. Use when user provides BPMN XML content or file path and asks to visualize, render, or create a diagram from a BPMN process definition.

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

BPMN Diagram Skill

This skill converts BPMN 2.0 XML into PNG diagram images using the bpmn-js rendering toolkit.

Prerequisites

Before first use, ensure dependencies are installed:

cd ~/​.claude/​skills/​bpmn-diagram/​scripts && ./​setup.sh

Or for project-local skills:

cd .claude/​skills/​bpmn-diagram/​scripts && ./​setup.sh

Usage

Input Formats

The skill accepts BPMN 2.0 XML in two ways:

  1. File path: Path to an existing .bpmn or .xml file
  2. Inline XML: Raw BPMN XML content provided directly

Rendering a Diagram

From a file:

node scripts/​render-bpmn.js /​path/​to/​diagram.bpmn /​path/​to/​output.png

From inline XML:

  1. First, write the BPMN XML to a temporary file
  2. Then run the render script
  3. The PNG will be created at the specified output path

Script Options

OptionDescriptionDefault
--scale=NImage scale factor (e.g., 2 for 2x resolution)1
--min-dimensions=WxHMinimum output dimensions in pixels800x600

Example with options:

node scripts/​render-bpmn.js input.bpmn output.png --scale=2 --min-dimensions=1200x800

Workflow

When a user requests a BPMN diagram:

  1. Identify the input: Determine if XML is inline or in a file
  2. Validate the XML: Check for valid BPMN 2.0 structure
    • Must have <definitions> root element with BPMN namespace
    • Should contain <bpmndi:BPMNDiagram> for visual layout
  3. Prepare input file: If inline XML, write to a temp .bpmn file
  4. Execute render script: Run node scripts/​render-bpmn.js
  5. Report result: Provide the output PNG path to the user

BPMN 2.0 XML Structure

Valid BPMN 2.0 XML must follow this structure:

<?xml version="1.0" encoding="UTF-8"?>
<definitions
    xmlns="http://www.omg.org/​spec/​BPMN/​20100524/​MODEL"
    xmlns:bpmndi="http://www.omg.org/​spec/​BPMN/​20100524/​DI"
    xmlns:dc="http://www.omg.org/​spec/​DD/​20100524/​DC"
    xmlns:di="http://www.omg.org/​spec/​DD/​20100524/​DI"
    id="Definitions_1"
    targetNamespace="http://bpmn.io/​schema/​bpmn">

  <!-- Process definition -->
  <process id="Process_1" isExecutable="false">
    <!-- BPMN elements: events, tasks, gateways, flows -->
  </​process>

  <!-- Diagram interchange (visual layout) -->
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <!-- Shape and edge definitions for visual rendering -->
    </​bpmndi:BPMNPlane>
  </​bpmndi:BPMNDiagram>

</​definitions>

Error Handling

ErrorCauseSolution
"Not valid XML"Malformed XML syntaxCheck XML structure, escape special characters
"Not BPMN 2.0 format"Missing <definitions> rootEnsure proper BPMN namespace and root element
"No diagram layout"Missing <bpmndi:BPMNDiagram>Add diagram interchange section or use auto-layout
"Render failed"Canvas/​dependencies issueEnsure setup.sh was run, check system dependencies
"File not found"Invalid input pathVerify file path exists

Known Limitations

This skill uses a pure Node.js rendering approach with jsdom and canvas, which has some limitations compared to browser-based rendering:

  1. SVG Transform Positioning: Some complex transform operations may not be perfectly positioned
  2. Text Rendering: Font rendering depends on system fonts available
  3. Complex Diagrams: Very large or complex diagrams may have rendering artifacts

For production use with complex diagrams, consider:

  • Using bpmn-to-image with Puppeteer (requires Chrome/​Chromium)
  • Running the rendering in an actual browser environment

Common BPMN Elements

See references/​bpmn-elements.md for a complete reference of supported BPMN 2.0 elements.

Quick Reference

Events:

  • startEvent, endEvent, intermediateCatchEvent, intermediateThrowEvent

Activities:

  • task, userTask, serviceTask, scriptTask, sendTask, receiveTask
  • subProcess, callActivity

Gateways:

  • exclusiveGateway (XOR), parallelGateway (AND), inclusiveGateway (OR)
  • eventBasedGateway, complexGateway

Flows:

  • sequenceFlow, messageFlow, association

Swimlanes:

  • participant (Pool), lane

Example

Input (simple-process.bpmn):

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/​spec/​BPMN/​20100524/​MODEL"
             xmlns:bpmndi="http://www.omg.org/​spec/​BPMN/​20100524/​DI"
             xmlns:dc="http://www.omg.org/​spec/​DD/​20100524/​DC"
             id="Definitions_1">
  <process id="Process_1" isExecutable="false">
    <startEvent id="Start_1" name="Start"/>
    <task id="Task_1" name="Do Something"/>
    <endEvent id="End_1" name="End"/>
    <sequenceFlow id="Flow_1" sourceRef="Start_1" targetRef="Task_1"/>
    <sequenceFlow id="Flow_2" sourceRef="Task_1" targetRef="End_1"/>
  </​process>
  <bpmndi:BPMNDiagram id="BPMNDiagram_1">
    <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="Process_1">
      <bpmndi:BPMNShape id="Start_1_di" bpmnElement="Start_1">
        <dc:Bounds x="152" y="102" width="36" height="36"/>
      </​bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="Task_1_di" bpmnElement="Task_1">
        <dc:Bounds x="240" y="80" width="100" height="80"/>
      </​bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="End_1_di" bpmnElement="End_1">
        <dc:Bounds x="392" y="102" width="36" height="36"/>
      </​bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="Flow_1_di" bpmnElement="Flow_1">
        <di:waypoint x="188" y="120"/>
        <di:waypoint x="240" y="120"/>
      </​bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="Flow_2_di" bpmnElement="Flow_2">
        <di:waypoint x="340" y="120"/>
        <di:waypoint x="392" y="120"/>
      </​bpmndi:BPMNEdge>
    </​bpmndi:BPMNPlane>
  </​bpmndi:BPMNDiagram>
</​definitions>

Command:

node scripts/​render-bpmn.js simple-process.bpmn simple-process.png

Output: simple-process.png - A PNG image of the rendered BPMN diagram

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View