Camunda API Zod schemas
SkillDev toolsGuides your coding agent through editing Camunda 8 API Zod schemas correctly across version branches.
Use Camunda API Zod schemas in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Camunda API Zod schemas and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Camunda API Zod schemas skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
About this skill
Use when you add, change, or remove schemas, fields, enums, filters, sort fields, or endpoints in @camunda/camunda-api-zod-schemas (webapp/client/packages/camunda-api-zod-schemas/); when you align the package with the OpenAPI spec in zeebe/gateway-protocol/src/main/proto/v2/; when you add a module o
What this skill tells your AI
The instructions your AI receives, as published by camunda/camunda in .claude/skills/camunda-api-zod-schemas/SKILL.md and read by Ahel’s review.
This skill tells you how to change the package @camunda/camunda-api-zod-schemas.
The package is in webapp/client/packages/camunda-api-zod-schemas/. This skill calls this folder PKG.
The package contains Zod schemas, TypeScript types, and endpoint objects for the Camunda 8 REST API (v2). People write the package manually. No tool generates the package from the OpenAPI spec.
NOTE: The manual schemas are temporary. Issue #39752 will add automatic generation from the OpenAPI spec. Before you start, read the status of the issue. If the issue is closed, examine the package for a generation script before you change the schemas manually.
For the mapping tables, the names, and the changelog template, refer to reference.md.
Terms
| Term | Meaning |
|---|---|
| Spec | The OpenAPI files in zeebe/gateway-protocol/src/main/proto/v2/ |
| Version tree | A folder PKG/lib/<version>/ for one release line, for example 8.10 |
| Module | One file in a version tree, for example agent-instance.ts |
| Consumer | A package that uses this package, for example the orchestration cluster webapp |
Rules
- The spec is the reference. Do not add a field, enum value, or endpoint that is not in the spec.
- Each version tree is a full copy. A change in one tree does not go into the other trees.
- Keep the Camunda license header at the top of each file.
- Put
type X = z.infer<typeof xSchema>;immediately after each schema. - Use one
export {…}block and oneexport type {…}block at the end of each file. Do not use inlineexport. - Use the helpers in
common.ts. Do not write a new filter or query helper if a helper can do the work. - Do not change the
common.tsimports of a module. Tree 8.8 and some other modules importlib/common.ts. The other modules import./common. - Consumers read
PKG/dist/, notPKG/lib/. After you changelib/, build the package again. - If a different task (for example, a UI feature) causes the schema change, tell the user before you change the package.
Procedure 1: Find the spec
- Find the API path in
zeebe/gateway-protocol/src/main/proto/v2/rest-api.yaml. - Find the domain file in the
$refof the path, for exampleagent-instances.yaml. - In the domain file, find the schemas of the entity:
<Entity>Result: the response item.<Entity>Filter: the search filter.<Entity>SearchQuerySortRequest: the sort fields.<Entity>...Enum: the enum values.
- Find the version markers. Operations use
x-added-in-version. Properties usex-properties-added-in-version.
NOTE: Do not use the spec copies in target/ or dist/ folders. These copies can be old.
grep -n "agent-instances" zeebe/gateway-protocol/src/main/proto/v2/rest-api.yaml
grep -n "AgentInstanceMetrics:" -A40 zeebe/gateway-protocol/src/main/proto/v2/agent-instances.yaml
Procedure 2: Select the version trees
- Find the release line of the change. Use the version markers from Procedure 1.
- If the spec has no version marker, use the release line of
main. The<version>in the rootpom.xmlshows it. For example,8.11.0-SNAPSHOTis release line 8.11. - Change the version tree of that release line.
- Also change all version trees that have a higher version.
- Do not change version trees that have a lower version. Change them only if the task tells you to do this.
- If no version tree exists for the release line, do Procedure 6 first.
- Tell the user which version trees you selected, and why.
Example: the agent instance API has x-added-in-version: "8.10".
A new 8.10 property goes into lib/8.10/agent-instance.ts and lib/8.11/agent-instance.ts.
grep -m1 -n "<version>" pom.xml
ls webapp/client/packages/camunda-api-zod-schemas/lib
Procedure 3: Change a field or an enum
- Do Procedure 1 and Procedure 2.
- In each selected version tree, open
lib/<version>/<module>.ts. - Change the schema. Use the table "Spec to Zod" in reference.md.
- If the spec changes the filter, also change the filter schema.
- If the spec changes the sort fields, also change the
sortFieldsarray. - If you remove a field or an enum value, find the consumer code that uses it. Change that code.
- Compare the module in all selected trees. Make sure that the change is the same in each tree.
- Do Procedure 7 and Procedure 8.
Example (PR #62253):
const agentInstanceMetricsSchema = z.object({
inputTokens: z.number(),
outputTokens: z.number(),
+ reasoningTokenCount: z.number(),
+ cacheCreationTokenCount: z.number(),
+ cacheReadTokenCount: z.number(),
modelCalls: z.number(),
toolCalls: z.number(),
});
diff PKG/lib/8.10/agent-instance.ts PKG/lib/8.11/agent-instance.ts
Procedure 4: Add a schema or an endpoint to a module
-
Do Procedure 1 and Procedure 2.
-
In each selected version tree, open
lib/<version>/<module>.ts. -
Add the schemas and the types. Use the table "Names" in reference.md.
-
Add the endpoint object. If the URL has parameters, give them to
Endpoint<...>:const getAgentInstance = { method: 'GET', getUrl: ({agentInstanceKey}) => `/${API_VERSION}/agent-instances/${agentInstanceKey}` as const, } as const satisfies Endpoint<{agentInstanceKey: string}>; const queryAgentInstances = { method: 'POST', getUrl: () => `/${API_VERSION}/agent-instances/search` as const, } as const satisfies Endpoint; -
Add the new values to the
export {…}block. Add the new types to theexport type {…}block. -
Open
lib/<version>/index.ts. Change it in three locations:- Add the endpoint to the import list of the module.
- Add the endpoint to the
endpointsobject. - Add the new schemas and types to the
export {…} from './<module>';block.
-
Do not export the endpoint by name from
index.ts. Consumers useendpoints.<name>. -
Do Procedure 7 and Procedure 8.
Procedure 5: Add a module
-
Make the file
lib/<version>/<module>.ts. Copy the license header from a different module. -
Do Procedure 4 for the new file.
-
In
PKG/vite.config.ts, add an entry tobuild.lib.entry:'8.11/<module>': resolve(__dirname, 'lib/8.11/<module>.ts'), -
In
PKG/package.json, add an entry toexports:"./8.11/<module>": { "import": { "types": "./dist/8.11/<module>.d.ts", "default": "./dist/8.11/<module>.js" } }, -
Do steps 1 to 4 for each selected version tree.
-
If two modules import schemas from each other, move the shared schemas to a helper module. Examples are
processes.tsandgroup-role.ts. -
Do not add helper modules to
exports. -
Do Procedure 7 and Procedure 8.
CAUTION: The build stops if it finds a circular import. The plugin vite-plugin-circular-dependency does this check.
Procedure 6: Add a version tree
Use this procedure when the spec adds a change for a release line that has no version tree.
Commit b923833bf06 is an example.
-
Copy the highest version tree to a new folder:
cp -R PKG/lib/8.11 PKG/lib/8.12 -
In
PKG/vite.config.ts, copy the entries of the highest tree. Change the version in the copies. -
In
PKG/package.json, copy theexportsentries of the highest tree. Change the version in the copies. -
Put the new change only in the new tree.
-
If a lower tree has the change, remove the change from the lower tree.
-
In the consumers that need the change, change the import to the new sub-path, for example
/8.12. -
Add the new version to the version lists in these files:
docs/monorepo-docs/frontend/camunda-api-zod-schemas.mddocs/monorepo-docs/frontend/project-outline.md
-
Do Procedure 7 and Procedure 8.
Procedure 7: Increase the version
Do this procedure in the same PR as the schema change.
-
Find the current version in
PKG/package.json. -
Find the versions on npm:
npm view @camunda/camunda-api-zod-schemas versions --json -
If the current version is not on npm and
CHANGELOG.mdhas a section for it, add your change to that section. Then go to step 7. -
If the current version is on npm, increase the last number by one. For example,
0.0.93becomes0.0.94. -
Write the new version in these files:
PKG/package.json(version).webapp/client/apps/orchestration-cluster-webapp/package.json(dependencies).webapp/client/packages/c8-mocks/package.json(devDependencies).
-
In
webapp/client/, use this command to changepackage-lock.json. Do not change the lockfile manually.npm i -
Add a section at the top of
PKG/CHANGELOG.md, below# Changelog. Use the changelog template in reference.md. -
Do not change
operate/clientoridentity/clientin this PR. Refer to Procedure 9.
Procedure 8: Examine the change
Do these steps in webapp/client/:
-
Build the package:
npm run build -w @camunda/camunda-api-zod-schemas -
Do the type check of the package:
npm run typecheck -w @camunda/camunda-api-zod-schemas -
Do the type check of all workspaces. This step examines the consumers:
npm run typecheck -
Format the package:
npm run format -w @camunda/camunda-api-zod-schemas -
Do the lint:
npm run lint -
If a command shows errors, find the cause and remove it.
-
If a consumer type error occurs, change the consumer code or the MSW mocks in the consumer.
NOTE: The package has no unit tests. The build, the type checks, and the lint are the only automatic checks.
Procedure 9: Publish and change the legacy consumers
Do this procedure after the PR merges into main.
CAUTION: The publish workflow sends the package to the public npm registry. You cannot undo a publish. Do not start the workflow yourself.
-
Tell the user to start the workflow "Publish Zod Schemas to npm" (
.github/workflows/publish-zod-schemas.yml). -
Tell the user to start it from
mainand to setdry_runto false. The user can use this command:gh workflow run publish-zod-schemas.yml --repo camunda/camunda --ref main -f dry_run=false -
After the workflow completes, make sure that the new version is on npm:
npm view @camunda/camunda-api-zod-schemas version -
Offer to make the follow-up PRs for
operate/clientandidentity/client. -
If the user agrees, do these steps in each folder:
- In
package.json, change@camunda/camunda-api-zod-schemasto the new version. - Use
npm ito change thepackage-lock.jsonof that folder. - Use
npm run lintto do the type check and the lint.
- In
NOTE: The .npmrc files contain min-release-age=1. If npm i cannot find the new version, wait one day. Then do the step again.
Examples
| Change | Reference | Files |
|---|---|---|
| Field change and version | PR #62253 | lib/8.10/agent-instance.ts, PKG/package.json, CHANGELOG.md, 2 consumer package.json files, package-lock.json |
| New version tree | b923833bf06 | lib/8.11/*, vite.config.ts, PKG/package.json exports, consumer imports |
| Version increase only | 6b40fcd592f | PKG/package.json, CHANGELOG.md, 2 consumer package.json files, package-lock.json |
Signals
- GitHub stars
- 4k
- Forks
- 829
- Last commit
- Oct 2026
Advanced
- Item type
- skill
- Key
camunda-api-zod-schemas- Source
- github.com/camunda/camunda