@bpmnkit/docspack 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/.llms/chunks/cli.casen.aikit-skills.md +19 -0
  2. package/.llms/chunks/cli.casen.bpmn-generation-pipeline.md +32 -0
  3. package/.llms/chunks/cli.casen.connection-profiles.md +62 -0
  4. package/.llms/chunks/cli.casen.generate-bpmn-files.md +28 -0
  5. package/.llms/chunks/cli.casen.md +80 -0
  6. package/.llms/chunks/cli.casen.plugins.md +56 -0
  7. package/.llms/chunks/cli.casen.worker-commands.md +45 -0
  8. package/.llms/chunks/cli.connector.all-flags.md +29 -0
  9. package/.llms/chunks/cli.connector.browse-the-bundled-ootb-catalog.md +32 -0
  10. package/.llms/chunks/cli.connector.built-in-catalog.md +41 -0
  11. package/.llms/chunks/cli.connector.common-workflows.md +50 -0
  12. package/.llms/chunks/cli.connector.generate-from-the-openapi-catalog.md +30 -0
  13. package/.llms/chunks/cli.connector.md +20 -0
  14. package/.llms/chunks/cli.connector.programmatic-usage.md +7 -0
  15. package/.llms/chunks/cli.connector.what-gets-generated.md +20 -0
  16. package/.llms/chunks/cli.generate.definition-mode-ai-scripting-path.md +89 -0
  17. package/.llms/chunks/cli.generate.md +52 -0
  18. package/.llms/chunks/cli.generate.modify-existing-mode-input.md +59 -0
  19. package/.llms/chunks/cli.generate.typical-ai-workflow.md +18 -0
  20. package/.llms/chunks/cli.plugin-authoring.md +59 -0
  21. package/.llms/chunks/cli.plugin-authoring.plugin-naming-conventions.md +11 -0
  22. package/.llms/chunks/cli.plugin-authoring.test-locally.md +41 -0
  23. package/.llms/chunks/cli.plugin-authoring.the-bpmnkit-cli-sdk-sdk.md +82 -0
  24. package/.llms/chunks/cli.plugin-authoring.what-gets-generated.md +69 -0
  25. package/.llms/chunks/cli.plugin-authoring.writing-commands.md +84 -0
  26. package/.llms/chunks/cli.plugins.bpmnkit-casen-report.md +39 -0
  27. package/.llms/chunks/cli.plugins.bpmnkit-casen-worker-http.md +23 -0
  28. package/.llms/chunks/cli.plugins.md +25 -0
  29. package/.llms/chunks/cli.skills.deploy.md +24 -0
  30. package/.llms/chunks/cli.skills.implement.md +36 -0
  31. package/.llms/chunks/cli.skills.md +29 -0
  32. package/.llms/chunks/cli.skills.no-mcp-server-required.md +6 -0
  33. package/.llms/chunks/cli.skills.review.md +33 -0
  34. package/.llms/chunks/cli.skills.test.md +33 -0
  35. package/.llms/chunks/cli.view.folder-support.md +31 -0
  36. package/.llms/chunks/cli.view.md +70 -0
  37. package/.llms/chunks/cli.view.tabbed-navigation.md +28 -0
  38. package/.llms/chunks/getting-started.concepts.ai-compact-format.md +23 -0
  39. package/.llms/chunks/getting-started.concepts.auto-layout.md +24 -0
  40. package/.llms/chunks/getting-started.concepts.parsing-and-serializing.md +26 -0
  41. package/.llms/chunks/getting-started.concepts.the-fluent-builder.md +41 -0
  42. package/.llms/chunks/getting-started.concepts.zeebe-extensions.md +25 -0
  43. package/.llms/chunks/getting-started.installation.md +38 -0
  44. package/.llms/chunks/getting-started.installation.runtime-requirements.md +13 -0
  45. package/.llms/chunks/getting-started.installation.svg-canvas-viewer.md +41 -0
  46. package/.llms/chunks/getting-started.installation.worker-client.md +40 -0
  47. package/.llms/chunks/getting-started.quick-start.md +31 -0
  48. package/.llms/chunks/getting-started.quick-start.step-2-simulate-locally.md +28 -0
  49. package/.llms/chunks/getting-started.quick-start.step-3-deploy-to-camunda-8.md +33 -0
  50. package/.llms/chunks/getting-started.quick-start.what-s-next.md +14 -0
  51. package/.llms/chunks/guides.ai-agents.deploy-grade-validation.md +19 -0
  52. package/.llms/chunks/guides.ai-agents.how-it-s-modeled.md +11 -0
  53. package/.llms/chunks/guides.ai-agents.md +18 -0
  54. package/.llms/chunks/guides.ai-agents.see-also.md +7 -0
  55. package/.llms/chunks/guides.ai-agents.testing-without-a-real-llm-call.md +26 -0
  56. package/.llms/chunks/guides.ai-agents.the-aiagent-plan-step.md +62 -0
  57. package/.llms/chunks/guides.ai-implement.deploying.md +49 -0
  58. package/.llms/chunks/guides.ai-implement.extending-an-existing-process.md +10 -0
  59. package/.llms/chunks/guides.ai-implement.lightweight-alternative-casen-skills-install.md +28 -0
  60. package/.llms/chunks/guides.ai-implement.md +32 -0
  61. package/.llms/chunks/guides.ai-implement.the-claude-code-plugin.md +21 -0
  62. package/.llms/chunks/guides.ai.claude-api-example.md +41 -0
  63. package/.llms/chunks/guides.ai.mcp-server.md +20 -0
  64. package/.llms/chunks/guides.ai.md +32 -0
  65. package/.llms/chunks/guides.ai.minimal-empty-diagram.md +32 -0
  66. package/.llms/chunks/guides.ai.openai-function-calling.md +40 -0
  67. package/.llms/chunks/guides.building-processes.boundary-events.md +47 -0
  68. package/.llms/chunks/guides.building-processes.call-activities.md +47 -0
  69. package/.llms/chunks/guides.building-processes.events.md +57 -0
  70. package/.llms/chunks/guides.building-processes.multi-instance.md +20 -0
  71. package/.llms/chunks/guides.building-processes.service-tasks.md +39 -0
  72. package/.llms/chunks/guides.building-processes.sub-processes.md +40 -0
  73. package/.llms/chunks/guides.building-processes.task-defaults.md +18 -0
  74. package/.llms/chunks/guides.claude-code-plugin.ambient-hooks.md +24 -0
  75. package/.llms/chunks/guides.claude-code-plugin.configuration.md +126 -0
  76. package/.llms/chunks/guides.claude-code-plugin.md +47 -0
  77. package/.llms/chunks/guides.claude-code-plugin.reference-docs.md +61 -0
  78. package/.llms/chunks/guides.deployment.ci-cd-deploy-on-push.md +47 -0
  79. package/.llms/chunks/guides.deployment.deploying-a-process.md +52 -0
  80. package/.llms/chunks/guides.deployment.handling-jobs.md +50 -0
  81. package/.llms/chunks/guides.deployment.managing-incidents.md +33 -0
  82. package/.llms/chunks/guides.deployment.md +49 -0
  83. package/.llms/chunks/guides.gateways.branching-inside-sub-processes.md +27 -0
  84. package/.llms/chunks/guides.gateways.exclusive-gateway-xor.md +41 -0
  85. package/.llms/chunks/guides.gateways.inclusive-gateway-or.md +43 -0
  86. package/.llms/chunks/guides.gateways.nested-branching.md +27 -0
  87. package/.llms/chunks/guides.gateways.parallel-gateway-and.md +26 -0
  88. package/.llms/chunks/guides.patterns.how-matching-works.md +17 -0
  89. package/.llms/chunks/guides.patterns.md +26 -0
  90. package/.llms/chunks/guides.patterns.pattern-schema.md +38 -0
  91. package/.llms/chunks/guides.patterns.see-also.md +7 -0
  92. package/.llms/chunks/guides.patterns.using-patterns-from-the-cli.md +30 -0
  93. package/.llms/chunks/guides.patterns.what-a-pattern-contains.md +18 -0
  94. package/.llms/chunks/guides.simulation.dmn-decision-evaluation.md +51 -0
  95. package/.llms/chunks/guides.simulation.instance-state.md +29 -0
  96. package/.llms/chunks/guides.simulation.md +51 -0
  97. package/.llms/chunks/guides.simulation.message-correlation.md +30 -0
  98. package/.llms/chunks/guides.simulation.multiple-deployments.md +14 -0
  99. package/.llms/chunks/guides.workers-standalone.anatomy-of-a-worker.md +42 -0
  100. package/.llms/chunks/guides.workers-standalone.camunda-saas.md +43 -0
  101. package/.llms/chunks/guides.workers-standalone.environment-variables.md +14 -0
  102. package/.llms/chunks/guides.workers-standalone.md +35 -0
  103. package/.llms/chunks/guides.workers-standalone.running-workers.md +61 -0
  104. package/.llms/chunks/guides.workers-standalone.see-also.md +7 -0
  105. package/.llms/chunks/packages.api.incident-resolution.md +31 -0
  106. package/.llms/chunks/packages.api.observability-events.md +13 -0
  107. package/.llms/chunks/packages.api.overview.md +49 -0
  108. package/.llms/chunks/packages.api.process-operations.md +60 -0
  109. package/.llms/chunks/packages.api.resource-namespaces.md +20 -0
  110. package/.llms/chunks/packages.canvas.events.md +56 -0
  111. package/.llms/chunks/packages.canvas.options.md +24 -0
  112. package/.llms/chunks/packages.canvas.overview.md +35 -0
  113. package/.llms/chunks/packages.connector-gen.body-expansion.md +18 -0
  114. package/.llms/chunks/packages.connector-gen.catalog-reference.md +54 -0
  115. package/.llms/chunks/packages.connector-gen.catalogentry-type.md +21 -0
  116. package/.llms/chunks/packages.connector-gen.generating-from-the-catalog.md +44 -0
  117. package/.llms/chunks/packages.connector-gen.installation.md +42 -0
  118. package/.llms/chunks/packages.connector-gen.lower-level-api.md +31 -0
  119. package/.llms/chunks/packages.connector-gen.overview.md +16 -0
  120. package/.llms/chunks/packages.connector-gen.writeoptions.md +26 -0
  121. package/.llms/chunks/packages.core.dmn-support.md +36 -0
  122. package/.llms/chunks/packages.core.installation-bpmn.creatediagram-id.md +18 -0
  123. package/.llms/chunks/packages.core.installation-bpmn.createprocess-id-name.md +10 -0
  124. package/.llms/chunks/packages.core.installation-bpmn.export-definitions.md +10 -0
  125. package/.llms/chunks/packages.core.installation-bpmn.makeempty-processid-processname.md +11 -0
  126. package/.llms/chunks/packages.core.installation-bpmn.parse-xml.md +10 -0
  127. package/.llms/chunks/packages.core.installation-bpmn.sample_xml.md +7 -0
  128. package/.llms/chunks/packages.core.installation-compactify-definitions.md +13 -0
  129. package/.llms/chunks/packages.core.installation-expand-compact.md +13 -0
  130. package/.llms/chunks/packages.core.installation-layoutprocess-process.md +15 -0
  131. package/.llms/chunks/packages.core.installation-processbuilder-methods.md +29 -0
  132. package/.llms/chunks/packages.core.installation.md +11 -0
  133. package/.llms/chunks/packages.core.overview.md +15 -0
  134. package/.llms/chunks/packages.docspack.installation.md +45 -0
  135. package/.llms/chunks/packages.docspack.overview.md +23 -0
  136. package/.llms/chunks/packages.docspack.reading-it-yourself.md +34 -0
  137. package/.llms/chunks/packages.docspack.trust.md +13 -0
  138. package/.llms/chunks/packages.docspack.using-the-index-directly.md +52 -0
  139. package/.llms/chunks/packages.editor.basic-setup.md +41 -0
  140. package/.llms/chunks/packages.editor.full-editor-with-all-plugins.md +30 -0
  141. package/.llms/chunks/packages.editor.hud-options.md +41 -0
  142. package/.llms/chunks/packages.editor.overview.md +21 -0
  143. package/.llms/chunks/packages.engine.installation.md +77 -0
  144. package/.llms/chunks/packages.engine.overview.md +19 -0
  145. package/.llms/chunks/packages.engine.processinstance.md +17 -0
  146. package/.llms/chunks/packages.engine.variable-scoping.md +27 -0
  147. package/.llms/chunks/packages.worker-client.client.poll-jobtype-options.md +40 -0
  148. package/.llms/chunks/packages.worker-client.createworkerclient-options.md +32 -0
  149. package/.llms/chunks/packages.worker-client.job.complete-variables.md +29 -0
  150. package/.llms/chunks/packages.worker-client.md +33 -0
  151. package/.llms/chunks/packages.worker-client.oauth2-camunda-saas.md +26 -0
  152. package/.llms/chunks/packages.worker-client.see-also.md +7 -0
  153. package/.llms/manifest.json +2083 -0
  154. package/LICENSE +21 -0
  155. package/README.md +150 -0
  156. package/dist/build.d.ts +29 -0
  157. package/dist/build.js +89 -0
  158. package/dist/chunk.d.ts +41 -0
  159. package/dist/chunk.js +242 -0
  160. package/dist/cli.d.ts +9 -0
  161. package/dist/cli.js +160 -0
  162. package/dist/index.d.ts +13 -0
  163. package/dist/index.js +12 -0
  164. package/dist/load.d.ts +27 -0
  165. package/dist/load.js +144 -0
  166. package/dist/search.d.ts +53 -0
  167. package/dist/search.js +104 -0
  168. package/dist/text.d.ts +22 -0
  169. package/dist/text.js +204 -0
  170. package/dist/types.d.ts +48 -0
  171. package/dist/types.js +3 -0
  172. package/llms.txt +174 -0
  173. package/package.json +76 -0
@@ -0,0 +1,62 @@
1
+ # AI Agents — The `aiAgent` plan step
2
+
3
+ ```json
4
+ {
5
+ "kind": "aiAgent",
6
+ "id": "triage_agent",
7
+ "name": "Triage agent",
8
+ "provider": "anthropic",
9
+ "model": "claude-sonnet-5",
10
+ "providerInputs": {
11
+ "provider.anthropic.authentication.apiKey": "{{secrets.ANTHROPIC_API_KEY}}"
12
+ },
13
+ "systemPrompt": "You triage support tickets and post updates to Slack.",
14
+ "userPrompt": "=ticketText",
15
+ "tools": [
16
+ {
17
+ "id": "notify_slack",
18
+ "description": "Post a status update to the #support-escalations Slack channel.",
19
+ "connector": {
20
+ "template": "io.camunda.connectors.Slack.v1",
21
+ "values": {
22
+ "method": "chat.postMessage",
23
+ "token": "{{secrets.SLACK_OAUTH_TOKEN}}",
24
+ "data.channel": "#support-escalations",
25
+ "data.text": "placeholder"
26
+ }
27
+ },
28
+ "params": [
29
+ { "name": "message", "description": "The status update to post", "type": "string", "target": "data.text" }
30
+ ]
31
+ },
32
+ {
33
+ "id": "escalate",
34
+ "description": "Escalate the ticket to a human agent.",
35
+ "jobType": "escalate:1",
36
+ "params": [{ "name": "reason", "description": "Why this needs a human" }]
37
+ }
38
+ ],
39
+ "errorBoundary": {
40
+ "errorCode": "AGENT_FAILED",
41
+ "steps": [{ "kind": "end", "id": "agent_failed", "errorCode": "AGENT_FAILED" }]
42
+ }
43
+ }
44
+ ```
45
+
46
+ Compile it like any other plan:
47
+
48
+ ```sh
49
+ casen synth support-triage.plan.json --output support-triage.bpmn
50
+ casen lint lint support-triage.bpmn --profile deploy
51
+ ```
52
+
53
+ Key points:
54
+
55
+ - **Every tool needs an `id` and a `description`** written for the LLM to read, like briefing a teammate.
56
+ - **A tool is either connector-backed (`connector`) or a plain job-worker (`jobType`)** — never both. Search the connector catalog first (`casen connector search`), fall back to `jobType` (with a scaffolded worker) only when no connector exists.
57
+ - **A `params[].target` matching a connector value's key overrides it** — the standard way to let the LLM control one field of an otherwise-fixed connector call, as in `notify_slack` above: the channel is fixed, but the message text is supplied by the agent at call time. Give the overridden key a placeholder value in `connector.values`, not a real one.
58
+ - **Always give the agent step an error boundary** — an unhandled agent/tool failure needs somewhere to go.
59
+ - **Secrets always use `{{secrets.NAME}}`** — never a literal API key or token.
60
+
61
+ ---
62
+ Source: https://docs.bpmnkit.com/guides/ai-agents/
@@ -0,0 +1,49 @@
1
+ # Building Processes with AI — Deploying
2
+
3
+ ```
4
+ Deploy to local Reebe, deploy to Camunda 8, or skip?
5
+ ```
6
+
7
+ - **Local Reebe** — deploys via `ZEEBE_ADDRESS` (default `http://localhost:26500`). Start Reebe first: `casen reebe start --port 26500`.
8
+ - **Camunda 8** — deploys using the active `casen` profile. Set one up with `casen profile create`.
9
+ - **Skip** — leaves the plan and BPMN file on disk for manual review and deployment.
10
+
11
+
12
+ ## Implementing workers
13
+
14
+ Each scaffolded worker uses `@bpmnkit/worker-client`'s real polling API:
15
+
16
+ ```typescript
17
+ // workers/validate-invoice/index.ts
18
+ import { createWorkerClient } from "@bpmnkit/worker-client"
19
+
20
+ const client = createWorkerClient({ workerName: "validate-invoice-worker" })
21
+
22
+ for await (const job of client.poll("validate-invoice:1")) {
23
+ try {
24
+ // TODO: implement invoice validation
25
+ await job.complete({ /* output variables */ })
26
+ } catch (err) {
27
+ await job.fail(String(err))
28
+ }
29
+ }
30
+ ```
31
+
32
+ Start a worker for development:
33
+
34
+ ```sh
35
+ cd workers/validate-invoice
36
+ npm install
37
+ npm start
38
+ ```
39
+
40
+ Or start all workers at once:
41
+
42
+ ```sh
43
+ casen worker start
44
+ ```
45
+
46
+ See [Standalone Workers](/guides/workers-standalone/) for deployment options.
47
+
48
+ ---
49
+ Source: https://docs.bpmnkit.com/guides/ai-implement/
@@ -0,0 +1,10 @@
1
+ # Building Processes with AI — Extending an existing process
2
+
3
+ ```
4
+ /bpmnkit:extend invoice-approval.bpmn add a timeout boundary event to the approval task
5
+ ```
6
+
7
+ This lifts the process back into plan form (`casen plan extract`), writes a small delta plan touching only the changed step, and merges it in (`casen synth --merge`) — the diff is reported at the element level, not as an XML diff.
8
+
9
+ ---
10
+ Source: https://docs.bpmnkit.com/guides/ai-implement/
@@ -0,0 +1,28 @@
1
+ # Building Processes with AI — Lightweight alternative: `casen skills install`
2
+
3
+ If you don't want the full plugin, four minimal slash commands are available directly from the CLI — see [AIKit Skills](/cli/skills/):
4
+
5
+ ```sh
6
+ casen skills install
7
+ ```
8
+
9
+ This installs `/implement`, `/review`, `/test`, `/deploy` into `.claude/commands/`. Same underlying pipeline, less scaffolding around it (no `/extend`/`/agent`/`/connect`, no generated reference docs).
10
+
11
+
12
+ ## What gets created
13
+
14
+ ```
15
+ project/
16
+ invoice-approval.plan.json ← the source of truth — edit this, not the XML
17
+ invoice-approval.bpmn ← compiled by casen synth
18
+ invoice-approval.bpmn.tests.json ← scenarios, if the plan had a `tests` array
19
+ workers/
20
+ validate-invoice/
21
+ index.ts ← implement the job logic here
22
+ package.json
23
+ tsconfig.json
24
+ README.md
25
+ ```
26
+
27
+ ---
28
+ Source: https://docs.bpmnkit.com/guides/ai-implement/
@@ -0,0 +1,32 @@
1
+ # Building Processes with AI
2
+
3
+ BPMNKit's AI pipeline never asks an LLM to write BPMN XML. Every process is authored as a
4
+ `ProcessPlan` JSON file and compiled deterministically by `casen synth` — this is what makes
5
+ generated processes reliably valid, deployable, and easy to diff. The LLM's job is narrower and
6
+ more reliable: write the plan, resolve connectors, and fix reported problems.
7
+
8
+
9
+ ## The pipeline
10
+
11
+ ```
12
+ "implement X" (natural language)
13
+
14
+
15
+ ProcessPlan JSON ──casen synth──▶ laid-out, deployable .bpmn
16
+ │ │
17
+ │ casen lint --profile deploy
18
+ │ │
19
+ └──casen plan extract◀──────── casen test
20
+ (for later edits)
21
+ ```
22
+
23
+ 1. **Check for a reusable domain pattern** — `casen pattern list`/`get` (see [Pattern Library](/guides/patterns/)) surfaces domain context (regulations, conventions) and realistic worker specs, used as reference while writing the plan below — not pasted in as a `ProcessPlan` directly.
24
+ 2. **Resolve external interactions** — `casen connector search "<system>"` / `casen connector show <template-id>` find the right Camunda connector template and its required inputs, instead of guessing property keys.
25
+ 3. **Write the plan** — a `ProcessPlan` JSON file (`casen plan schema` prints the full format reference).
26
+ 4. **Compile** — `casen synth <plan>.json --output <file>.bpmn`. Problems are reported keyed by JSON path (e.g. `steps[2].connector.values.token`) — fix the plan, never the XML, and re-run.
27
+ 5. **Test** — a `tests` array in the plan compiles to a `<file>.bpmn.tests.json` sidecar automatically; run it with `casen test <file>.bpmn`.
28
+ 6. **Deploy-readiness gate** — `casen lint <file>.bpmn --profile deploy` must report zero errors before deploying.
29
+ 7. **Deploy** — `casen deploy deploy <file>.bpmn` (local Reebe) or `--target camunda8`.
30
+
31
+ ---
32
+ Source: https://docs.bpmnkit.com/guides/ai-implement/
@@ -0,0 +1,21 @@
1
+ # Building Processes with AI — The Claude Code plugin
2
+
3
+ The richest way to drive this pipeline is the `bpmnkit` Claude Code plugin:
4
+
5
+ ```sh
6
+ /plugin marketplace add github:bpmnkit/monorepo
7
+ /plugin install bpmnkit
8
+ ```
9
+
10
+ It's **CLI-first**: every skill drives `casen` via Bash — no MCP server, no proxy daemon. Each skill reads the relevant generated/hand-written reference doc (plan format, connector catalog, agentic pattern, FEEL syntax, modeling conventions) before authoring a plan.
11
+
12
+ ```
13
+ /bpmnkit:implement an invoice approval process for accounts payable
14
+ ```
15
+
16
+ Claude works through: resolve connectors → write the plan → compile → test → scaffold missing workers → present a summary → ask where to deploy.
17
+
18
+ Related skills: `/bpmnkit:extend <file> <change>` (lift an existing process to a plan, apply a targeted delta, merge), `/bpmnkit:agent` (design an AI Agent Sub-process — see [AI Agents](/guides/ai-agents/)), `/bpmnkit:connect <file> <step> <service>` (wire an existing step to a connector), `/bpmnkit:review`, `/bpmnkit:test`, `/bpmnkit:deploy`.
19
+
20
+ ---
21
+ Source: https://docs.bpmnkit.com/guides/ai-implement/
@@ -0,0 +1,41 @@
1
+ # AI Integration — Claude API Example
2
+
3
+ Using the Anthropic SDK to generate a process from a description:
4
+
5
+ ```typescript
6
+ import Anthropic from "@anthropic-ai/sdk";
7
+ import { Bpmn, expand } from "@bpmnkit/core";
8
+ import type { CompactDiagram } from "@bpmnkit/core";
9
+
10
+ const anthropic = new Anthropic();
11
+
12
+ async function generateProcess(description: string): Promise<string> {
13
+ const response = await anthropic.messages.create({
14
+ model: "claude-opus-4-6",
15
+ max_tokens: 2048,
16
+ system: `You are a BPMN process designer. Return only valid JSON matching the
17
+ CompactDiagram schema. No explanation, no markdown — raw JSON only.`,
18
+ messages: [
19
+ {
20
+ role: "user",
21
+ content: `Create a BPMN process for: ${description}`,
22
+ },
23
+ ],
24
+ });
25
+
26
+ const json = response.content[0];
27
+ if (json?.type !== "text") throw new Error("Unexpected response type");
28
+
29
+ const compact = JSON.parse(json.text) as CompactDiagram;
30
+ const definitions = expand(compact);
31
+
32
+ return Bpmn.export(definitions);
33
+ }
34
+
35
+ const xml = await generateProcess(
36
+ "An invoice approval process where invoices over $10,000 need manager approval"
37
+ );
38
+ ```
39
+
40
+ ---
41
+ Source: https://docs.bpmnkit.com/guides/ai/
@@ -0,0 +1,20 @@
1
+ # AI Integration — MCP Server
2
+
3
+ BPMN Kit ships with a Model Context Protocol (MCP) server that exposes process editing
4
+ tools to any MCP-compatible AI client (Claude Desktop, Cursor, etc.):
5
+
6
+ ```sh
7
+ # Start the MCP server
8
+ casen mcp
9
+ ```
10
+
11
+ Available MCP tools:
12
+ - `get_diagram` — returns the current diagram as CompactDiagram JSON
13
+ - `update_diagram` — applies a CompactDiagram diff
14
+ - `add_service_task` — adds a single service task with Zeebe config
15
+ - `add_http_call` — adds a pre-configured Camunda HTTP connector task
16
+ - `apply_layout` — re-runs auto-layout on the current diagram
17
+ - `validate` — validates the diagram and returns any schema errors
18
+
19
+ ---
20
+ Source: https://docs.bpmnkit.com/guides/ai/
@@ -0,0 +1,32 @@
1
+ # AI Integration
2
+
3
+ BPMN Kit is designed from the ground up to work with AI agents. The compact intermediate
4
+ format lets a complete process diagram fit in a single LLM prompt, and the builder API
5
+ produces valid BPMN without requiring the AI to write raw XML.
6
+
7
+
8
+ ## The Compact Format
9
+
10
+ Raw BPMN XML is far too verbose for LLMs — a simple three-node process generates ~60 lines.
11
+ The compact format represents the same information as a small JSON object:
12
+
13
+ ```typescript
14
+ import { Bpmn, compactify, expand } from "@bpmnkit/core";
15
+
16
+ // Parse some BPMN XML
17
+ const definitions = Bpmn.parse(existingXml);
18
+
19
+ // Convert to compact format
20
+ const compact = compactify(definitions);
21
+ // compact is ~500 tokens for a typical approval workflow
22
+
23
+ // Send to your LLM, get back a modified compact object
24
+ const modified = await llm.modify(compact, "Add a parallel notification step after approval");
25
+
26
+ // Convert back to full BPMN
27
+ const updatedDefinitions = expand(modified);
28
+ const updatedXml = Bpmn.export(updatedDefinitions);
29
+ ```
30
+
31
+ ---
32
+ Source: https://docs.bpmnkit.com/guides/ai/
@@ -0,0 +1,32 @@
1
+ # AI Integration — Minimal Empty Diagram
2
+
3
+ When an AI agent needs to start fresh, use `Bpmn.makeEmpty()` to get a valid starting point
4
+ with a single start event:
5
+
6
+ ```typescript
7
+ import { Bpmn } from "@bpmnkit/core";
8
+
9
+ // Returns a valid BPMN XML string — one start event, ready for an agent to extend
10
+ const xml = Bpmn.makeEmpty("my-process", "My Process");
11
+ ```
12
+
13
+
14
+ ## Prompting Strategy
15
+
16
+ For best results, give the LLM the compact diagram and a clear instruction. A good system
17
+ prompt excerpt:
18
+
19
+ ```
20
+ You are a BPMN process designer. The user will describe a business process and you will
21
+ return a CompactDiagram JSON object.
22
+
23
+ Rules:
24
+ - Use camelCase IDs
25
+ - Every service task needs a taskType string (the Zeebe worker subscription)
26
+ - Use FEEL expressions for gateway conditions (start with "= ")
27
+ - Always include a start event and at least one end event
28
+ - Do not add fields that are not part of the CompactDiagram schema
29
+ ```
30
+
31
+ ---
32
+ Source: https://docs.bpmnkit.com/guides/ai/
@@ -0,0 +1,40 @@
1
+ # AI Integration — OpenAI Function Calling
2
+
3
+ Use function/tool calling for reliable structured output:
4
+
5
+ ```typescript
6
+ import OpenAI from "openai";
7
+ import { expand, Bpmn } from "@bpmnkit/core";
8
+
9
+ const openai = new OpenAI();
10
+
11
+ const response = await openai.chat.completions.create({
12
+ model: "gpt-4o",
13
+ messages: [
14
+ {
15
+ role: "user",
16
+ content: "Create a customer onboarding process with email verification and KYC check",
17
+ },
18
+ ],
19
+ tools: [
20
+ {
21
+ type: "function",
22
+ function: {
23
+ name: "create_bpmn_process",
24
+ description: "Create a BPMN process diagram",
25
+ parameters: compactDiagramJsonSchema, // export from @bpmnkit/core
26
+ },
27
+ },
28
+ ],
29
+ tool_choice: { type: "function", function: { name: "create_bpmn_process" } },
30
+ });
31
+
32
+ const toolCall = response.choices[0]?.message.tool_calls?.[0];
33
+ if (!toolCall) throw new Error("No tool call");
34
+
35
+ const compact = JSON.parse(toolCall.function.arguments);
36
+ const xml = Bpmn.export(expand(compact));
37
+ ```
38
+
39
+ ---
40
+ Source: https://docs.bpmnkit.com/guides/ai/
@@ -0,0 +1,47 @@
1
+ # Building Processes — Boundary Events
2
+
3
+ ### `.withBoundary()` — recommended
4
+
5
+ `.withBoundary()` attaches a boundary event to the preceding task, lets you build the
6
+ error/timeout path inline, then **automatically restores the cursor to the original task**
7
+ so the main flow continues naturally:
8
+
9
+ ```typescript
10
+ .serviceTask("charge", { name: "Charge Card", taskType: "payment-charge" })
11
+ .withBoundary("on-fail", { errorCode: "PAYMENT_FAILED", cancelActivity: true }, (p) =>
12
+ p
13
+ .serviceTask("notify", { taskType: "send-email" })
14
+ .endEvent("end-failed"),
15
+ )
16
+ // cursor is back on "charge" — main flow continues here
17
+ .serviceTask("fulfill", { name: "Fulfill Order", taskType: "warehouse-pick" })
18
+ .endEvent("end-ok")
19
+ ```
20
+
21
+ Timer boundaries work the same way:
22
+
23
+ ```typescript
24
+ .serviceTask("slow-task", { taskType: "long-job" })
25
+ .withBoundary("on-timeout", { timerDuration: "PT30S", cancelActivity: false }, (p) =>
26
+ p.serviceTask("escalate", { taskType: "alert" }).endEvent("escalated"),
27
+ )
28
+ .serviceTask("next-task", { taskType: "continue" })
29
+ ```
30
+
31
+ ### `.boundaryEvent()` — lower-level
32
+
33
+ Use `.boundaryEvent()` directly when you need precise cursor control. It moves the
34
+ builder cursor to the boundary event itself:
35
+
36
+ ```typescript
37
+ .serviceTask("process-order", { taskType: "order-processor" })
38
+ .boundaryEvent("timeout", {
39
+ attachedTo: "process-order",
40
+ cancelActivity: true,
41
+ timer: { timeDuration: "PT30M" },
42
+ })
43
+ .endEvent("timed-out")
44
+ ```
45
+
46
+ ---
47
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,47 @@
1
+ # Building Processes — Call Activities
2
+
3
+ Invoke a separate (reusable) process definition:
4
+
5
+ ```typescript
6
+ .callActivity("run-subprocess", {
7
+ name: "Run Fulfillment Sub-Process",
8
+ calledElement: "fulfillment-process",
9
+ propagateAllChildVariables: false,
10
+ inputMappings: [
11
+ { source: "= orderId", target: "orderId" },
12
+ ],
13
+ outputMappings: [
14
+ { source: "= trackingNumber", target: "trackingNumber" },
15
+ ],
16
+ })
17
+ ```
18
+
19
+
20
+ ## Multi-Process Diagrams
21
+
22
+ `Bpmn.createDiagram()` assembles multiple processes into a single definitions document.
23
+ This is useful for caller/callee pairs or any workflow that references another process:
24
+
25
+ ```typescript
26
+ import { Bpmn } from "@bpmnkit/core";
27
+
28
+ const defs = Bpmn.createDiagram("OrderSystem")
29
+ .process("order-flow", (p) =>
30
+ p
31
+ .startEvent("start")
32
+ .callActivity("run-payment", { processId: "payment-flow" })
33
+ .endEvent("end"),
34
+ )
35
+ .process("payment-flow", (p) =>
36
+ p
37
+ .startEvent("s")
38
+ .serviceTask("charge", { name: "Charge", taskType: "payment-charge" })
39
+ .endEvent("e"),
40
+ )
41
+ .build();
42
+
43
+ const xml = Bpmn.export(defs); // both processes in one XML file
44
+ ```
45
+
46
+ ---
47
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,57 @@
1
+ # Building Processes — Events
2
+
3
+ ### Start Events
4
+
5
+ ```typescript
6
+ // None start
7
+ .startEvent("start")
8
+
9
+ // Timer start (runs on a schedule)
10
+ .startEvent("start-daily", {
11
+ timer: { timeCycle: "R/PT24H" }, // ISO 8601 repeating interval
12
+ })
13
+
14
+ // Message start
15
+ .startEvent("start-on-order", {
16
+ message: { name: "order-received", correlationKey: "= orderId" },
17
+ })
18
+ ```
19
+
20
+ ### Intermediate Events
21
+
22
+ ```typescript
23
+ // Catch a timer (delay)
24
+ .intermediateCatchEvent("wait-1h", {
25
+ timer: { timeDuration: "PT1H" },
26
+ })
27
+
28
+ // Catch a message (wait for external signal)
29
+ .intermediateCatchEvent("wait-for-payment", {
30
+ message: { name: "payment-confirmed", correlationKey: "= orderId" },
31
+ })
32
+
33
+ // Throw a message
34
+ .intermediateThrowEvent("notify-warehouse", {
35
+ message: { name: "order-ready" },
36
+ })
37
+ ```
38
+
39
+ ### End Events
40
+
41
+ ```typescript
42
+ // Normal end
43
+ .endEvent("end")
44
+
45
+ // Error end (triggers error boundary event)
46
+ .endEvent("end-error", {
47
+ error: { code: "PAYMENT_FAILED", message: "Payment processing failed" },
48
+ })
49
+
50
+ // Message end
51
+ .endEvent("end-notify", {
52
+ message: { name: "process-complete" },
53
+ })
54
+ ```
55
+
56
+ ---
57
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,20 @@
1
+ # Building Processes — Multi-Instance
2
+
3
+ Run a task or sub-process once per item in a collection:
4
+
5
+ ```typescript
6
+ .serviceTask("notify-all", {
7
+ name: "Notify Each Customer",
8
+ taskType: "send-email",
9
+ multiInstance: {
10
+ parallel: true, // false = sequential
11
+ inputCollection: "= customers",
12
+ inputElement: "customer",
13
+ outputCollection: "results",
14
+ outputElement: "= { sent: true, email: customer.email }",
15
+ },
16
+ })
17
+ ```
18
+
19
+ ---
20
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,39 @@
1
+ # Building Processes — Service Tasks
2
+
3
+ A service task represents work done by a system. In Camunda 8 / Zeebe, a job worker picks up
4
+ the task and completes it:
5
+
6
+ ```typescript
7
+ .serviceTask("charge-card", {
8
+ name: "Charge Credit Card",
9
+ taskType: "payment-charge", // worker subscribes to this type
10
+ taskHeaders: {
11
+ retries: "3",
12
+ },
13
+ inputMappings: [
14
+ { source: "= amount", target: "chargeAmount" },
15
+ { source: "= card.token", target: "token" },
16
+ ],
17
+ outputMappings: [
18
+ { source: "= transactionId", target: "paymentTransactionId" },
19
+ ],
20
+ })
21
+ ```
22
+
23
+
24
+ ## User Tasks
25
+
26
+ A user task waits for a human actor. Optionally attach a Camunda form:
27
+
28
+ ```typescript
29
+ .userTask("review-order", {
30
+ name: "Review Order",
31
+ assignee: "= initiator", // FEEL expression
32
+ candidateGroups: "approvers",
33
+ formKey: "camunda-forms:bpmn:review-form",
34
+ dueDate: "= now() + duration(\"P2D\")",
35
+ })
36
+ ```
37
+
38
+ ---
39
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,40 @@
1
+ # Building Processes — Sub-Processes
2
+
3
+ Embed a child process inline. Sub-processes support the full builder API including
4
+ gateways and branching:
5
+
6
+ ```typescript
7
+ .subProcess("handle-payment", (sub) =>
8
+ sub
9
+ .startEvent("sub-start")
10
+ .serviceTask("charge", { taskType: "payment-charge" })
11
+ .exclusiveGateway("charge-ok?")
12
+ .branch("success", (b) =>
13
+ b.condition("= success").serviceTask("receipt", { taskType: "send-receipt" }).endEvent("sub-end")
14
+ )
15
+ .branch("failure", (b) =>
16
+ b.defaultFlow().endEvent("sub-failed", { error: { code: "CHARGE_FAILED" } })
17
+ )
18
+ )
19
+ ```
20
+
21
+ ### Event Sub-Processes
22
+
23
+ An event sub-process starts when a boundary event fires:
24
+
25
+ ```typescript
26
+ .eventSubProcess("compensation", {
27
+ triggeredByEvent: true,
28
+ startEvent: {
29
+ interrupting: false,
30
+ error: { code: "PAYMENT_FAILED" },
31
+ },
32
+ }, (sub) =>
33
+ sub
34
+ .serviceTask("refund", { taskType: "issue-refund" })
35
+ .endEvent("refunded")
36
+ )
37
+ ```
38
+
39
+ ---
40
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,18 @@
1
+ # Building Processes — Task Defaults
2
+
3
+ `.defaults()` sets process-wide defaults applied to all subsequent task calls.
4
+ Useful when every service task in a process should share the same retry policy:
5
+
6
+ ```typescript
7
+ Bpmn.createProcess("my-flow")
8
+ .defaults({ serviceTask: { retries: "5" } })
9
+ .startEvent("s")
10
+ .serviceTask("t1", { name: "Task 1", taskType: "worker-a" }) // retries: "5"
11
+ .serviceTask("t2", { name: "Task 2", taskType: "worker-b" }) // retries: "5"
12
+ .serviceTask("t3", { name: "Task 3", taskType: "worker-c", retries: "1" }) // override
13
+ .endEvent("e")
14
+ .build()
15
+ ```
16
+
17
+ ---
18
+ Source: https://docs.bpmnkit.com/guides/building-processes/
@@ -0,0 +1,24 @@
1
+ # Claude Code Plugin — Ambient Hooks
2
+
3
+ The plugin installs two background hooks:
4
+
5
+ | Hook | Trigger | What it does |
6
+ |---|---|---|
7
+ | SessionStart | Every Claude Code session | Checks `casen` is installed |
8
+ | PostToolUse | After any Write or Edit | Silently lints any `.bpmn` file that was written |
9
+
10
+ The PostToolUse hook means every `.bpmn` file you (or Claude) writes is automatically
11
+ checked against the BPMNKit optimizer — zero extra steps.
12
+
13
+ ---
14
+
15
+
16
+ ## No MCP server required
17
+
18
+ Unlike earlier versions of this plugin, none of the skills above call an MCP tool — they
19
+ call `casen` directly via Bash. The separate `@bpmnkit/proxy` MCP server (`bpmn-aikit`)
20
+ still exists for Claude Desktop, Cursor, or other MCP-only hosts, but it's unrelated to
21
+ this plugin.
22
+
23
+ ---
24
+ Source: https://docs.bpmnkit.com/guides/claude-code-plugin/