component-parameter-key-no-dot

A naming rule for Java code parameters marked with @ComponentParameter. Their keys must be flat names using letters, numbers, and underscores; dots are not allowed.

In plain words
What is it for?
Use it when defining or reviewing process-variable keys such as mdoc_id or task_config_id. It also guides variable-reading code and keeps error messages and documentation consistent.
Why use it?
It prevents workflow engines, editors, APIs, and stored data from interpreting dots inconsistently as nested paths. Consistent names also make contracts easier to check.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/xc404/kiwi/component-parameter-key-no-dot
Clone the repo
git clone --depth 1 https://github.com/xc404/kiwi

Made for: Cursor.

Per session 803 This file is loaded in full into every session.
When invoked 803 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00803 $0.00803
Opus 5 $0.00402 $0.00402
Sonnet 5 $0.00161 $0.00161
Haiku 4.5 $0.00080 $0.00080

Measured 2d ago against content hash 287bc0207fa5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

component-parameter-key-no-dot 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 2d 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.

.cursor/rules/component-parameter-key-no-dot.mdc · 80 lines

How it starts

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

@ComponentParameter key 命名规则(禁止使用 ".")

在所有 @ComponentParameter 声明的 key 中,禁止使用 .(点号)。 所有用于流程变量读写的 key 必须是顶层扁平命名,使用下划线(_)替代点号。

背景

历史上为了表达“嵌套对象”的语义(如 mdoc.idtask.config_id),曾用点分路径 作为 @ComponentParameter#key,并通过 ExecutionUtils.getStringInputVariableAtPath 做 nested Map 解析。

这种写法带来若干问题:

  • BPMN 引擎以及部分前端编辑器把 . 当作分隔符 / 非法字符处理;
  • execution.setVariable("foo.bar", ...) 等顶层 API 行为不一致,容易引发歧义;
  • 上下游契约(HTTP JSON / BPMN 变量 / DB 字段)混用点号与下划线,难以做静态检查;
  • getStringInputVariableAtPath 仅在调试期掩盖了契约不清的问题。

因此约定所有 @ComponentParameterkey 必须为扁平标识符。

命名约定

  • 仅允许字符:[a-zA-Z0-9_]禁止出现 .
  • 将点号替换为下划线,例如:
    • mdoc.idmdoc_id
    • mdoc.dataIdmdoc_dataId
    • task.idtask_id
    • task.config_idtask_config_id
  • 字段语义按现有的 camelCase / snake_case 习惯保留即可,本规则只约束 . 的去除。

代码侧配套

  • 读取流程变量统一使用 ExecutionUtils.getStringInputVariable(execution, "xxx") 等顶层 API,不再使用 getStringInputVariableAtPath / getInputVariableAtPath 这种 path 风格 API(除非有明确的嵌套对象解析需求,且已与上下游契约对齐)。
  • 抛出的异常信息、Javadoc、description 文案中提到的 key 也必须与 @ComponentParameter#key 完全一致,避免出现 mdoc.id / mdoc_id 混用。

推荐示例

@ComponentDescription(
        inputs = {
                @ComponentParameter(
                        key = "mdoc_id",
                        name = "MDocInstance id",
                        required = true),
                @ComponentParameter(
                        key = "mdoc_dataId",
                        name = "MDoc id",
                        required = true)
        })
public class SomeActivity implements JavaDelegate {

    @Override
    public void execute(DelegateExecution execution) {
        String instanceId = ExecutionUtils.getStringInputVariable(execution, "mdoc_id")
                .orElseThrow(() -> new IllegalArgumentException("流程变量 mdoc_id 不能为空"));
        // ...
    }
}

不推荐示例

// 禁止:key 含 "."
@ComponentParameter(key = "mdoc.id", name = "MDocInstance id", required = true)

// 禁止:读取时使用 path 风格 API
ExecutionUtils.getStringInputVariableAtPath(execution, "mdoc.id");

Read the full file on GitHub · 80 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. 2d ago First seen · 80 lines · 803 tokens per session scan A 287bc0207fa5

Subscribe to this mod's changes

component-parameter-key-no-dot is a cursor rule published in the GitHub repository xc404/kiwi (7 stars, last pushed 7d ago), licensed MIT. It adds 803 tokens to every session, about $0.0040 per session on Opus 5. 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-31.