/camunda-skills:camunda-process-testfrom camunda-skills
Plans, writes, and runs Camunda Process Test (CPT) suites for Camunda 8.8+ to achieve 100% BPMN element coverage. Automates test scenario authoring and Maven execution for process paths, errors, and timeouts.
Ships in camunda-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
WORKFLOW SKILL: plan segments, author scenarios, run the Maven test command, and close coverage gaps.
Do not use this skill to author BPMN, DMN, FEEL, or forms, deploy to a live cluster, or test UI behavior. Route those tasks to camunda-bpmn, camunda-dmn, camunda-feel, camunda-forms, camunda-process-mgmt, or the relevant UI test framework.
Author and run Camunda Process Test suites for Camunda 8.8+ that reach 100% BPMN element coverage with the minimum number of test segments. Test assertions are limited to reachability and routing — CPT exercises that the engine traverses the right elements, not the data values produced by service tasks or external systems.
./mvnw), Docker runtime (OrbStack, Docker Desktop, or Rancher Desktop) — see references/setup.mdcamunda-process-test-spring 8.8+ on the test classpath for Java fallback suites; the instruction-based .test.json format and 8.9-only APIs require 8.9+For a Node.js layout, set NODE_RESOURCE_DIR and run Maven from the generated test/ directory as
described in references/setup.md. The Maven commands below are shell-neutral; the
Node.js POM reads the environment variable and standard Java layouts do not need it.
@TestDeployment failures.npx dmnlint for structural checks.COMPLETE_JOB_AD_HOC_SUB_PROCESS and context.when().then() orchestrate.c8ctl call deploys a process under test.ASSERT_VARIABLE instructions on service-task output unless the variable is the FEEL input to a downstream gateway you also test.Find the BPMN under test in priority order:
src/main/resources/processes/src/main/resources/bpmn/resources/ while the test harness lives in test/).Skip target/, node_modules/, .git/, build/. If multiple files match, list them and ask which to target.
Check pom.xml (or test/pom.xml) for camunda-process-test-spring. If missing, go to step 2.
If scenarios already exist, run a drift check before editing tests:
git diff <base-branch>...HEAD -- <bpmn-path>
Use the PR base branch or repository default branch as <base-branch> (often main).
Then classify current suite gaps:
elementId or processDefinitionId that no longer exists.Fix in this order: broken → stale → missing, then run mvn test and continue with coverage verification.
Follow references/setup.md: run the readiness preflight (Java, Maven/wrapper, Docker), add the CPT dependency, scaffold src/test/java/io/camunda/tests/ProcessTest.java and src/test/resources/scenarios/ for CPT 8.9+, or use the Java fallback for CPT 8.8. Confirm with mvn test-compile.
Plan the minimum number of segments before authoring anything. Apply references/coverage-strategy.md:
processId, element IDs and types, gateway outgoing flows + conditions, error / timer / escalation boundaries, end events, called DMN decisions (<zeebe:calledDecision decisionId="…">) and the DMN rules inside them.segment name | root | predicted ids covered | end condition. Authoring then implements exactly this list — no speculative scenarios that may be deduped later.Example: for a gateway with approved and rejected flows, plan one segment per flow, predict the visited IDs through the next join, and keep the smallest set of segments that covers both branches and the shared end path.
For CPT 8.9+, write one entry inside src/test/resources/scenarios/<processId>.test.json using references/authoring.md. For CPT 8.8, use the Java fallback described in that reference instead of .test.json. Naming: "<who/what> — <outcome>". Assertions: ASSERT_ELEMENT_INSTANCES on the elements the segment must visit, ASSERT_PROCESS_INSTANCE only when the segment runs to an end event.
For CPT 8.9+, use the Java fallback only when the segment needs Spring bean mocking, parameterized data tables, non-deterministic runtime races (context.when().then() (8.9+)), or assertions richer than the JSON instruction set offers. For CPT 8.8, Java tests are required because the instruction-based format is not available. See references/test-context.md; Java tests are invisible to Web Modeler.
Run Maven from the directory containing the relevant pom.xml. For a Node.js layout, use the
generated test/ directory and keep NODE_RESOURCE_DIR set to the resolved resource directory
for this command and every retry, as described in references/setup.md.
mvn test
On failure, diagnose with references/troubleshooting.md. Distinguish test problems (variable typo, wrong element id, missing instruction) from process problems (wrong FEEL condition, wrong DMN rule, wrong error code). Fix the right side. Re-run. Stop after 3 repair cycles with no progress.
When the run exits — pass or fail — proceed straight to step 6 and open the coverage report.
CPT emits a coverage report at target/coverage-report/report.html (per-process HTML; the page embeds the full coverage dataset in a window.COVERAGE_DATA JSON literal). Parse it:
python3 - <<'PY'
import re, json
html = open("target/coverage-report/report.html").read()
# Balanced-brace extraction. Walk character by character, but track string
# state so braces inside JSON strings (e.g. inside a description) don't
# unbalance the counter.
m = re.search(r"window\.COVERAGE_DATA\s*=\s*", html)
start = html.index("{", m.end())
depth = 0; in_str = False; esc = False; end = start
for k, ch in enumerate(html[start:], start):
if in_str:
if esc: esc = False
elif ch == "\\": esc = True
elif ch == '"': in_str = False
else:
if ch == '"': in_str = True
elif ch == "{": depth += 1
elif ch == "}":
depth -= 1
if depth == 0:
end = k + 1
break
data = json.loads(html[start:end])
el = set(); flows = set(); total = None
for s in data["suites"]:
for r in s["runs"]:
for c in r["coverages"]:
el.update(c.get("completedElements", []))
flows.update(c.get("takenSequenceFlows", []))
total = c.get("totalElementCount", total)
covered = len(el) + len(flows)
print(f"coverage={covered}/{total}={100*covered/total:.2f}%")
print("covered_elements:", sorted(el))
print("covered_flows:", sorted(flows))
PY
Diff against the BPMN element + sequenceFlow id list (grep -oE 'id="[A-Za-z0-9_]+"' <bpmn>, exclude _di, BPMNDiagram, BPMNPlane, Definitions_, ErrorDef_, TimerDef_, Signal_, Message_).
Surface the HTML report path to the user as soon as mvn test exits — pass or fail. The agent already verifies coverage from the JSON data above; the HTML report is for the user to inspect. Print the absolute path (target/coverage-report/report.html) in the final reply so they can open it themselves. In an interactive local session you may additionally offer to open it on their behalf (open on macOS, xdg-open on Linux, start on Windows) — do not run that unprompted in a sandboxed / remote environment where it has no effect.
Patch-loop on prediction misses — default behavior. Set-cover planning in step 3 should reach 100% on the first authoring pass. When it does not, the gap is a prediction miss: the static walk for some candidate did not match runtime behavior. For each uncovered id:
INCREASE_TIME with an ISO 8601 duration greater than the timer cycle (e.g. "PT25H" for R/PT24H). The boundary fires; the outgoing path's job is created; complete it with COMPLETE_JOB.PUBLISH_MESSAGE instruction with matching name + correlationKey.mvn test) → step 6. Each iteration should strictly reduce the uncovered set; if it does not, the planner's path prediction is wrong — fix the prediction logic in references/coverage-strategy.md, do not paper over with more scenarios.Hard blockers that terminate the loop:
Do not declare the suite done while ids remain uncovered and no hard blocker applies.
Note: in early 8.9 SNAPSHOT releases the report generator may throw
IllegalStateException: Report resources not foundand skip the HTML output. Tests still pass. Walk the BPMN against scenarios from source to confirm coverage in that case.
Set-cover planning in step 3 should produce a non-redundant suite by construction. Verify with a leave-one-out check against the runtime coverage data: for each scenario, compute the union of all other scenarios' covered ids; if removing the scenario loses zero ids, it is redundant and the planner has a bug — fix the planner, then drop the scenario.
Also flag (cheap, do unconditionally):
<who/what> — <outcome> (e.g. "test1", "happy").ASSERT_VARIABLE instructions on variables that no gateway or DMN downstream consumes — data assertions are out of scope.Print the Surefire result line, the coverage percentage, the segment count, and any flagged duplicates.
Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
Coverage: 100% (24/24 elements)
Segments: 1 happy path + 5 secondary
Duplicates flagged: 0
When tests already exist and the user asks to run, diagnose, or improve them (without generating a brand-new suite), use these focused workflows:
mvn test from the directory containing the relevant pom.xml; for a Node.js layout, run it from test/ with NODE_RESOURCE_DIR set to the resolved resource directory for the initial run and every retry. Classify each failure as infrastructure/test/process, then fix in batches. Use references/troubleshooting.md plus references/run-and-diagnose.md.These workflows are complementary: evaluate gaps first, implement new scenarios, then run/diagnose locally and in CI.
.test.json schema, full 8.9 instruction reference, Java fallbackCamundaProcessTestContext Java API surface (job/decision/child-process mocking, time control, conditional behavior)portability.json (opens in a new tab)references/authoring.md (opens in a new tab)references/ci.md (opens in a new tab)references/connectors-runtime.md (opens in a new tab)references/coverage-strategy.md (opens in a new tab)references/evaluation.md (opens in a new tab)references/run-and-diagnose.md (opens in a new tab)references/setup.md (opens in a new tab)references/test-context.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub camunda/skills --plugin camunda-skills13 skills in this plugin
/camunda-ai-agentsUse this skill when an LLM should act inside a business process — choosing tools or next steps, calling systems, handing off to people — with guardrails, human review, or an audit trail, even if Camunda isn't mentioned, and before hand-coding an agent loop. Models Camunda 8 AI Agent sub-processes: tools as BPMN tasks, fromAi() parameters, prompts, and limits.
Also covers v1/v2 element-template selection and upgrading v1 elements to v2.
/camunda-bpmnUse this skill whenever work that spans several steps, people, or systems must run reliably — approvals, hand-offs, escalations, deadlines, retries, or compensation — even if Camunda or BPMN isn't mentioned. Load it before recommending an approach or tool for running such work. Designs, edits, and lints executable BPMN processes for Camunda 8. Not for one-step jobs or CI pipelines.
/camunda-c8ctlUse this skill when someone needs a Camunda 8 cluster to work against — run one locally to try a process, connect to SaaS or Self-Managed, switch profiles, or set local connector secrets — and before other skills run c8ctl. Installs and configures c8ctl, the Camunda 8 CLI. Not for databases or other local services.
/camunda-connectorsUse this skill when a process step should call a common service without custom code — REST, Slack, email, Kafka, AWS, Salesforce, and similar — even if connectors aren't mentioned. Finds, configures, and applies Camunda 8's pre-built connector templates to BPMN elements with c8ctl. Not for building new connectors; use camunda-connectors-development.
Covers c8ctl template discovery, configuration, application, and updates.
/camunda-connectors-developmentUse this skill when no pre-built connector fits and processes need a reusable integration — a proprietary or internal API, custom auth, a shared retry policy, or an inbound webhook, subscription, or poller that starts processes. Builds custom Camunda 8 connectors as a JSON template on a protocol connector or in Java with the Connectors SDK.
/camunda-developmentUse this skill first when a process step must call or receive from another system — an API, Slack, Kafka, a webhook, an internal service, or an LLM — and it is still open whether to use a connector, a job worker, or an AI agent, even if those terms aren't mentioned. Weighs the requirements, then hands off.
Other plugins' skills for the same job