cumulocity-dynamic-mapper: Command for Claude Code

.claude/commands/smart-function-sync.md

smart-function-sync is a command for Claude Code from Cumulocity-IoT/cumulocity-dynamic-mapper. It costs 0 tokens per session (723 once invoked), scanned A, original, Apache-2.0.

An audit command that compares a Java Smart Function API with its TypeScript declarations. It checks methods and message fields exposed by Java against the types documented for JavaScript users.

In plain words
What is it for?
Use it to verify that the Java source and TypeScript types for Smart Functions stay in sync.
Why use it?
It finds missing, extra, or mismatched declarations before JavaScript code relies on an inaccurate API description.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is Cumulocity-IoT/cumulocity-dynamic-mapper's own configuration. It tells Claude Code how to work on cumulocity-dynamic-mapper itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cumulocity-dynamic-mapper configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Cumulocity-IoT/cumulocity-dynamic-mapper. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Cumulocity-IoT/cumulocity-dynamic-mapper/main/.claude/commands/smart-function-sync.md
Clone the repo
git clone --depth 1 https://github.com/Cumulocity-IoT/cumulocity-dynamic-mapper

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for smart-function-sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/cumulocity-iot/cumulocity-dynamic-mapper/smart-function-sync/github.svg)](https://agentmods.dev/commands/cumulocity-iot/cumulocity-dynamic-mapper/smart-function-sync)
Your own site
<a href="https://agentmods.dev/commands/cumulocity-iot/cumulocity-dynamic-mapper/smart-function-sync"><img src="https://agentmods.dev/badge/commands/cumulocity-iot/cumulocity-dynamic-mapper/smart-function-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for smart-function-sync

Your own site · 80×15
<a href="https://agentmods.dev/commands/cumulocity-iot/cumulocity-dynamic-mapper/smart-function-sync"><img src="https://agentmods.dev/badge/commands/cumulocity-iot/cumulocity-dynamic-mapper/smart-function-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 723 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00723
Opus 5.5 $0.00000 $0.00289
Sonnet 5.5 $0.00000 $0.00145
Haiku 4.5 $0.00000 $0.00072

Measured 2mo ago against content hash 5fcc97dda927, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

smart-function-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/smart-function-sync.md · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Smart Function Sync Audit

Audit the Smart Function API surface to verify that the Java source and TypeScript declarations are in sync. Follow the strategy described in docs/smart-function-type-sync.md.

Steps

1. Read the Java source of truth

Read these files in full:

  • dynamic-mapper-service/src/main/java/dynamic/mapper/processor/model/DataPrepContext.java
  • dynamic-mapper-service/src/main/java/dynamic/mapper/processor/model/SmartFunctionContext.java
  • dynamic-mapper-service/src/main/java/dynamic/mapper/processor/model/InputMessage.java

Extract:

  • All public method signatures from DataPrepContext (the interface) — these are callable from JavaScript via GraalVM.
  • Any additional public methods on SmartFunctionContext that are not on the interface (also callable).
  • All public fields on InputMessage — these become msg.* in Smart Functions.

2. Read the TypeScript declarations

Read these files in full:

  • dynamic-mapper-smart-function/src/types/dataprep.types.ts
  • dynamic-mapper-smart-function/src/types/smart-function-dynamic-mapper.types.ts

Extract:

  • All methods declared on SmartFunctionContext and SmartFunctionContextV2 interfaces.
  • All fields declared on DynamicMapperDeviceMessage (inbound msg) and OutboundMessage (outbound msg).

3. Read the mock helpers

In smart-function-dynamic-mapper.types.ts (or its spec file), find createMockRuntimeContext, createMockRuntimeContextV2, createMockInputMessage, createMockOutboundMessage. Check that every interface method/field is implemented in the corresponding mock.

The spec file is at: dynamic-mapper-smart-function/src/types/smart-function-dynamic-mapper.types.spec.ts

4. Diff and report

Produce a report with four sections:

A. Methods in Java but missing from TypeScript List each Java method that has no matching TypeScript declaration. These are gaps that break IntelliSense and may surprise developers.

B. Methods in TypeScript but absent from Java (phantoms) List each TypeScript declaration that does not match any public method on DataPrepContext or SmartFunctionContext. These may be stale docs or errors.

Read the full file on GitHub · 66 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 66 lines · 0 tokens per session scan A 5fcc97dda927

Subscribe to this mod's changes

smart-function-sync is a command published in the GitHub repository Cumulocity-IoT/cumulocity-dynamic-mapper (19 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 723 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.