bpmn-generator
Generate BPMN 2.0 compliant XML files from natural language process descriptions OR from structured markdown business process documents. Use this skill when a user wants to create a BPMN workflow, convert a business process to BPMN XML, model a workflow diagram, or generate process definitions. Triggers on requests like "create a BPMN", "generate workflow XML", "model this process", "convert to BPMN 2.0", "create process diagram", "build workflow", or "convert this markdown to BPMN".
What this skill does
# BPMN 2.0 XML Generator
## Overview
This skill transforms process descriptions into fully compliant BPMN 2.0 XML files. It operates in two modes:
| Mode | Trigger | Workflow |
|------|---------|----------|
| **Interactive** | Natural language description, no file provided | Structured Q&A to gather requirements |
| **Document Parsing** | Markdown file path provided | Parse document structure, extract elements |
The generated XML includes:
- Complete process definitions with all BPMN elements
- Proper namespace declarations for BPMN 2.0 compliance
- Diagram Interchange (DI) data for visual rendering
- Phase comments for PowerPoint generation compatibility
- Layouts compatible with Draw.io, Camunda, Flowable, and bpmn.io
---
# MODE DETECTION
## Automatic Mode Selection
Determine the operating mode based on user input:
```text
IF user provides a markdown file path (.md):
→ Document Parsing Mode
ELSE IF user provides a natural language description:
→ Interactive Mode
```
### Document Parsing Mode Indicators
- File path ending in `.md`
- "convert this document", "parse this file"
- "generate BPMN from [filename]"
- Markdown content pasted directly
### Interactive Mode Indicators
- Brief process description without file
- "create a BPMN for...", "model a process that..."
- Questions about process design
- No structured document provided
### Preview Mode
Both modes support an optional `--preview` flag:
When `--preview` is specified:
1. Generate the complete BPMN XML in memory
2. Validate structure (namespace, elements, flows)
3. Display summary:
```
Preview: /bpmn-generator
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Process: Order Fulfillment
Source: Interactive mode
Structure Summary:
Pools: 1
Lanes: 3 (Sales, Operations, Shipping)
Tasks: 8 (5 user, 3 service)
Gateways: 2 (1 exclusive, 1 parallel)
Events: 2 (1 start, 1 end)
Validation: PASSED
Output file: order-fulfillment.bpmn
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Save this file? (y/n):
```
4. Wait for user confirmation before saving
5. On 'n' or 'no': Exit without saving
---
# PART 1: INTERACTIVE MODE
Use this mode when the user provides a natural language description without a structured document.
## Interactive Question Framework
### Purpose
Initial process descriptions are rarely sufficient for optimal BPMN generation. This mode uses a structured clarification process to gather complete requirements before generating XML.
### Question Format
For EVERY clarifying question, use this EXACT format:
```markdown
## Question [N]: [Topic Category]
[Clear, specific question about the process]
### Options:
**A) [Recommended]**: [Specific answer]
*Why*: [2-3 sentence reasoning explaining why this is the best choice]
**B)** [Alternative answer 1]
**C)** [Alternative answer 2]
**D)** Provide your own answer
**E)** Accept recommended answers for all remaining questions (auto-accept mode)
---
Your choice (A/B/C/D/E):
```
### Auto-Accept Mode
When the user selects option **E**:
1. Set internal flag: `AUTO_ACCEPT_MODE = true`
2. For all subsequent questions, automatically use the recommended answer
3. Log each auto-accepted decision
4. Before generating XML, present a summary:
```markdown
## Auto-Accepted Decisions Summary
| Question | Topic | Decision |
|----------|-------|----------|
| Q3 | Gateway Type | Exclusive Gateway (XOR) |
| Q4 | Error Handling | Boundary Error Event |
| ... | ... | ... |
Proceeding with XML generation using these decisions.
```
### Question Phases
Process questions in this specific order:
#### Phase 1: Process Scope (Questions 1-3)
- Process name and identifier
- Process trigger (start event type)
- Process completion states (end event types)
#### Phase 2: Participants (Questions 4-5)
- Single process vs. collaboration (multiple pools)
- Lanes/roles within pools
#### Phase 3: Activities (Questions 6-10)
- Main activities/tasks identification
- Task types for each activity
- **Task descriptions/documentation** (CRITICAL for PowerPoint generation)
- Task sequencing and dependencies
- Subprocess candidates
#### Phase 4: Flow Control (Questions 11-15)
- Decision points requiring gateways
- Gateway types (exclusive, parallel, inclusive, event-based)
- Default flows
- Loop/cycle detection
#### Phase 5: Events & Exceptions (Questions 16-19)
- Intermediate events (timer, message, signal)
- Boundary events on tasks
- Error handling approach
- Compensation requirements
#### Phase 6: Data & Integration (Questions 20-22)
- Data objects needed
- External system integrations
- Message flows (for collaborations)
#### Phase 7: Optimization Review (Question 23)
- Final review of proposed structure
- Opportunity for adjustments
### Session Commands
Support these standard session commands during Interactive mode:
| Command | Aliases | Action |
|---------|---------|--------|
| `help` | `?`, `commands` | Show available session commands |
| `status` | `progress` | Show current phase and questions completed |
| `back` | `previous`, `prev` | Return to previous question |
| `skip` | `next`, `pass` | Skip current question (use recommended) |
| `quit` | `exit`, `stop` | Exit without generating BPMN |
**When user types `help`:**
```text
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Session Commands
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
help Show this help message
status Show current phase and progress
back Return to previous question
skip Skip question (uses recommended answer)
quit Exit without generating BPMN
Press E at any question to accept recommended
answers for all remaining questions.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
**Implementation notes:**
- Commands are case-insensitive
- Check for session commands before processing input as an answer choice
- Unknown input that is not A/B/C/D/E should trigger the help message
### Adaptive Questioning
Skip questions that don't apply:
- Skip participant questions for simple single-pool processes
- Skip data questions if no data dependencies mentioned
- Skip error handling if process is straightforward
- Always ask critical questions: start event, main tasks, end events
---
# PART 2: DOCUMENT PARSING MODE
Use this mode when the user provides a markdown file containing a structured business process document.
## Document Analysis Steps
### Step 1: Identify Document Structure
Analyze the markdown document for structural elements that map to BPMN constructs. Key patterns: H1 = process name, H2/H3 "Phase/Step" = phase comments, numbered lists = tasks, role tables = lanes, conditional language = gateways, "begins when" = start events, "completes when" = end events. See `../references/markdown-parsing-guide.md` for the complete document structure mapping table.
### Step 2: Extract Process Metadata
From the document, extract:
```yaml
process_name: [from H1 or title]
process_id: [sanitized process_name, e.g., "SocialMediaCommunityManagement"]
description: [from executive summary or overview section]
version: [from document metadata if present]
roles: [list of all mentioned roles/actors]
phases: [ordered list of phase names from section headings]
```
### Step 3: Map Roles to Lanes
Use the lane mapping configuration in `../templates/lane-mapping.yaml` to assign colors. Read `references/bpmn-elements.md` for the complete role-to-lane color mapping table (Sales, Legal, Finance, IT, Implementation, Training, Customer Success, Support, Customer).
### Step 4: Parse Phases and Tasks
#### Phase Detection Patterns
Match headings like "## Step 1:", "### Phase 2:", or "## 1.1 Section" using H2-H4 with step/phase/stage keywords or numbered sections. See `../references/markdown-parsing-guide.md` for regex patterns.
#### Task Type Inference
Use the task type selection table in `references/bpmn-elements.md` to map markdown language to BPMN task types. Common shortcuts: "reviews/approves" = userTask, "system/API" = Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.