Install
$ agentstack add skill-diagrid-labs-dapr-skills-create-workflow-from-diagram ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
Create Dapr Workflow from Diagram
Overview
This skill converts a workflow diagram into a runnable Dapr workflow project. Two input paths are supported:
- Image (PNG / JPG / JPEG / GIF / WebP) — uses Claude's vision to extract workflow structure
- BPMN 2.0 XML (
.bpmn,.bpmn20.xml) — parses the XML deterministically
Both paths produce the same intermediate representation (IR, JSON Lines), which is then rendered into code for the target language.
Execution Order
You MUST follow these phases in strict order:
- Check specification — Confirm you have the input diagram + target language. Ask clarifying questions only if missing.
- Phase 0: Detect input type — Decide between the image path and the BPMN path.
- Phase 1: Diagram → IR — Emit JSON Lines IR per
prompts/ir-schema.md. - Phase 2: Validate IR — Light checks per
prompts/ir-schema.mdacceptance rules. - Phase 3: IR → code — Render the project for the target language using
prompts/languages/.md. - Create README.md — Summarise the generated project + how to run it.
- Show final message — Your LAST output MUST be EXACTLY the message defined in
## Show final message. No extra text.
Check specification
You need three things. Ask at most three clarifying questions, interview-style, only for items not already provided:
- Input diagram — a path to a PNG/JPG/JPEG/GIF/WebP image or a
.bpmn/.bpmn20.xmlfile. If the user pasted the image directly into the chat, use that. - Target language — one of:
go,python,csharp,javascript,java. Default:python. - Project name — used as the folder name. No spaces. Defaults to a camelCased name derived from the workflow's `` or image filename.
Prerequisites
The following must be installed by the user before running the generated project:
Plus the language toolchain for the chosen target. See the matching shared/prereq-check-*.md for the full list.
The skill does not auto-install anything. The generated project's README tells the user what to install and run.
Phase 0: Detect input type
Decide the path:
- File extension
.png,.jpg,.jpeg,.gif,.webp, or pasted image → image path - File extension
.bpmn,.bpmn20.xml, or XML file containinghttp://www.omg.org/spec/BPMN/20100524/MODELnamespace → BPMN path - Anything else (e.g. Mermaid, PlantUML, free-form flowchart exports, draw.io without BPMN shape library) → stop, tell the user the input type is not supported in v1, suggest they export to BPMN or a standard image
Phase 1: Diagram → IR
Image path
- Load
prompts/guardrails.md— these apply to all output. - Load
prompts/system-prompt.md— this is the persona + directives. - Load
prompts/ir-schema.md— this is the full IR grammar, step-by-step extraction procedure (Step 0 content check → Step N emit records), and field definitions. - Use Claude's vision to read the attached image.
- Emit IR as JSON Lines (one object per line), following the schema. Do not wrap in markdown fences or prose.
- If the diagram is unreadable / not a workflow / prohibited content → emit a single
ambiguous_or_undiagrammable_workflowrecord (per schema Step 0) and stop.
BPMN path
- Load
prompts/guardrails.md. - Load
prompts/bpmn-to-ir.md— deterministic BPMN-element → IR-record mapping. - Load
prompts/ir-schema.mdfor the IR grammar. - Parse the
.bpmnXML. Emit IR as JSON Lines following the mapping table. - Unsupported BPMN elements (see
bpmn-to-ir.md) → emitunrecognized_itemrecords; do not silently drop.
Write the IR to /.workflow.ir.jsonl for reference.
Phase 2: Validate IR
Light structural checks before code generation:
- There is at least one
startand oneendrecord. - Every
edge.from/edge.toreferences an existing element id (activity, gateway, start, or end). - Every gateway has ≥ 1 incoming and ≥ 1 outgoing edge.
- No orphaned elements (activities / gateways with no edges either direction).
- No duplicate ids across all records.
If any check fails: report the specific issue to the user, abort (do not continue to Phase 3). Rerun Phase 1 with an adjusted diagram or ask the user for clarification.
Phase 3: IR → code
- Load
prompts/languages/.md— this defines the target-language Dapr Workflow patterns, file layout, and code conventions. Language slugs:go|python|csharp|javascript|java. - Optionally load
prompts/code-quality-judge.mdfor a self-critique pass after initial generation. - Optionally load
prompts/final-turn-prettifier.mdfor final cleanup. - Use the Write tool to create one file at a time. Follow the folder structure for the language — see
prompts/languages/.md. - Emit complete, compilable files. No
TODO, no placeholder bodies.
Folder structure
Use the conventions defined in prompts/languages/.md. Typical shape:
/
├── .gitignore
├── dapr.yaml
├── resources/
│ └── statestore.yaml
├── /
│ ├── workflow.(py|go|cs|ts|java)
│ ├── activities.(py|go|cs|ts|java)
│ └── models.(py|go|cs|ts|java)
├── README.md
└── .workflow.ir.jsonl # persisted IR from Phase 1
Python-specific layout matches create-workflow-python (pyproject.toml, runtime.py, main.py); see that skill's SKILL.md and REFERENCE.md if you want deeper structure parity. This skill focuses on the diagram → IR → code transform, not on language-specific project scaffolding — keep the generated code minimal and runnable.
Create README.md
Create a README.md in `` containing:
- One-sentence summary of what the workflow does (derive from the diagram / IR
workflowrecord). - Architecture description — language, Dapr version, required components.
- A Mermaid diagram re-rendered from the IR for quick visual reference.
- How to run locally with
dapr run -f dapr.yaml. - Endpoints (if the generated language produces an HTTP surface — Python, .NET and JavaScript do by default).
- How to inspect executions with the Diagrid Dev Dashboard.
See shared/running-locally-dapr.md and shared/running-with-catalyst.md in this repo for snippets to include.
Show final message
IMPORTANT: This is the LAST step. After Create README.md, your final output MUST be ONLY the message below — no preamble, no summary, no additional commentary. Replace `` with the actual value:
The workflow application is created from the diagram. Open the README.md file in the folder for a summary and instructions for running locally. The extracted IR is stored at /.workflow.ir.jsonl for reference.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: diagrid-labs
- Source: diagrid-labs/dapr-skills
- License: MIT
- Homepage: https://diagrid.io
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.