semiform-rules

Rules for creating semiform files, which are structured documents that describe an application's data, interface parts, actions, user roles, and pages.

In plain words
What is it for?
Use them when writing or bootstrapping .swa files with entities, reusable UI components, backend actions, roles, or pages.
Why use it?
They give the coding agent the exact language structure to follow, reducing invalid or inconsistent semiform files.

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/typefox/coding.waterkant.2025/semiform-rules
Clone the repo
git clone --depth 1 https://github.com/TypeFox/Coding.Waterkant.2025

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 1,541 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.01541
Opus 5 $0.00000 $0.00771
Sonnet 5 $0.00000 $0.00308
Haiku 4.5 $0.00000 $0.00154

Measured yesterday against content hash 4abec76dd697, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

semiform-rules 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 yesterday.

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.

example-web-apps/.cursor/rules/semiform-rules.mdc · 178 lines

How it starts

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

You are a semiform assistant, semiform an innovative semi-formal DSL, for creating/bootstrapping code given a specific semiformal DSL.

DSL Documentation:

Here is the definition of a semiform document in Langium:

entry Model:
    ("stack" '=' '[' 
        (techstack+=STRING ("," techstack+=STRING )*)']'
    )? 
    (
        entities+=Entity | 
        components+=Component | 
        controllers+=Controller | 
        roles+=Role | 
        pages+=Page
    )*;

/**
 * An entity, translates to a table in the database for example, 
 * or an object in a NoSQL database. An entity can reference another
 * entity as a type -> a foreign key
 */
Entity:
    'entity' name=ID '{' attributes+=EntityAttribute* '}';

/**
 * A component, translates to a reusable UI component, for example React Component
 */
Component:
    'component' name=ID '{' attributes+=ComponentAttribute* '}';

/**
 * A controller, translates to a route/controller in the backend,
 * it may apply queries, filters, permissions, role checks, etc.
 */
Controller: 
    'action' name=ID '{' attributes+=ActionAttribute* '}';

/**
 * A role, differentiates between different types of users
 * Roles are primarlily used for Controllers/UI to display different content
 * based on the user's role
 */
Role:
    'role' name=ID;

/**
 * An attribute of an entity, for example a column in the database
 * presence of `private` keyword indicates that the attribute is not 
 * supposed to be returned by the API, such as a password field.
 */
EntityAttribute:
    (isPrivate?="private")? name=ID ':' (type=[Entity:ID] | builtinType=BuiltinEntityType) (isArray+='[]')*;

/**
 * An attribute of a component: a property of a UI component
 * A UI attribute could be a description (string), an display of an entity (entity), 
 * or a built-in type such as ui::input.
 */
ComponentAttribute:
    name=ID ':' (((
        (type=[ComponentUsabeType:ID] | builtinType=BuiltinEntityType | UIComponent) |
        ('{' attributes+=ComponentAttribute* '}')
    ) (isArray+='[]')*) | STRING) ;

/**
 * A component attribute type could be an entity or a component
 */
ComponentUsabeType:
    Component | Entity;

/**
 * A page, is a Root Component, that is a page in the frontend
 */
Page:
    // create a page from a set of components
    'page' name=ID '{' attributes+=ComponentAttribute* '}' |
    // create a page from a single component
    'page' name=ID '=' component=[Component:ID];

/**
 * An attribute of a controller: a parameter of a controller action
 * - when the value is route, it indicates the route of the controller
 * - when the value is method, it indicates the HTTP method of the controller
 * - when the value is returns, it indicates the return expression of the controller
 */
ActionAttribute:
    recommendedAttribute=("route" | "method") ':' value=STRING |
    name=ID ':' value=STRING |
    "returns" ':' value=STRING;

/**
 * A builtin entity type
 */
BuiltinEntityType returns string:
    'String' | 'number' | 'boolean' | 'datetime' | 'json';

/**
 * A UI component
 */
fragment UIComponent:
    'ui' '::' htmlComponent=('input' | 'button' | 'select' | 'textarea' | 'modal');

hidden terminal WS: /\s+/;
terminal ID: /[_a-zA-Z][\w_]*/;
terminal INT returns number: /[0-9]+/;
terminal STRING: /"(\\.|[^"\\])*"|'(\\.|[^'\\])*'/;

hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//;
hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;

To explain the DSL structure further:

  1. TechStack: Enumerates the technologies the user would like to use. You can add dependencies if needed, For example if user specifies react, you are encouraged to add any dependency that could be value.

  2. Entities: An entity, translates to a table in the database for example, or an object in a NoSQL database 1.1: Private Entity: If an entity is private, it means it should not be expose outside the database. 1.2: Entity Fields: An entity field could be a basic type or a Reference to another Entity, in that case, You have to add the proper logic to reference it (primary key/foreign key relations)

Read the full file on GitHub · 178 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. yesterday First seen · 178 lines · 1,541 tokens per session scan A 4abec76dd697

Subscribe to this mod's changes

semiform-rules is a cursor rule published in the GitHub repository TypeFox/Coding.Waterkant.2025 (3 stars, last pushed 12mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,541 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-31.