zenml-orm-schema

zenml-orm-schema is a cursor rule for Cursor from zenml-io/zenml. It costs 0 tokens per session (2,465 once invoked), scanned A, original, Apache-2.0.

A guide for defining and updating ZenML ORM schemas. An ORM schema describes database records as code so an application can read and write them through models.

In plain words
What is it for?
Use it when adding or changing schema classes in ZenML’s store, including model inheritance, identifiers, and creation or update timestamps.
Why use it?
It helps new schemas follow ZenML’s file locations, naming conventions, base classes, and shared fields.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when adding or changing schema classes in ZenML’s store, including model inheritance, identifiers, and creation or update timestamps.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/zenml-io/zenml/zenml-orm-schema
About the project

ZenML is a Python framework for turning machine-learning and AI workflows into tracked pipelines that run on different infrastructure backends. It is for ML and AI engineers building applications such as model-training workflows, language-model systems, and agent loops in company environments.

zenml-io/zenml · 5,637 stars · on GitHub · zenml.io

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.

Clone the repo
git clone --depth 1 https://github.com/zenml-io/zenml

Made for: Cursor.

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 zenml-orm-schema

README.md
[![agentmods](https://agentmods.dev/badge/rules/zenml-io/zenml/zenml-orm-schema/github.svg)](https://agentmods.dev/rules/zenml-io/zenml/zenml-orm-schema)
Your own site
<a href="https://agentmods.dev/rules/zenml-io/zenml/zenml-orm-schema"><img src="https://agentmods.dev/badge/rules/zenml-io/zenml/zenml-orm-schema/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 zenml-orm-schema

Your own site · 80×15
<a href="https://agentmods.dev/rules/zenml-io/zenml/zenml-orm-schema"><img src="https://agentmods.dev/badge/rules/zenml-io/zenml/zenml-orm-schema.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,465 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.02465
Opus 5.5 $0.00000 $0.00986
Sonnet 5.5 $0.00000 $0.00493
Haiku 4.5 $0.00000 $0.00247

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

Security

Grade A, and why

zenml-orm-schema 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.

.cursor/rules/zenml-orm-schema.mdc · 306 lines

How it starts

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

ZenML ORM Schemas

These are common patterns, rules and conventions used in defining ORM schemas within the ZenML project. Make sure to understand these patterns and adhere to these practices when working with the ORM schema.

All ORM schemas are located in the @zenml/src/zenml/zen_stores/schemas directory and referenced in the __init__.py file. The files are named following the convention <concept>_schemas.py (e.g. stack_schemas.py and component_schemas.py) and usually contain only one schema ORM class, unless multiple classes are required to define the same concept.

ORM Model Definition

Base Class Usage

ORM models typically inherit from the BaseSchema or NamedSchema class to ensure consistency and reuse common functionality. BaseSchema is defined in @zenml/src/zenml/zen_stores/schemas/base_schemas.py:

class BaseSchema(SQLModel):
    """Base SQL Model for ZenML entities."""

    id: UUID = Field(default_factory=uuid4, primary_key=True)
    created: datetime = Field(default_factory=datetime.utcnow)
    updated: datetime = Field(default_factory=datetime.utcnow)

NamedSchema is defined in @zenml/src/zenml/zen_stores/schemas/base_schemas.py, inheriting from BaseSchema and adding a name field:

class NamedSchema(BaseSchema):
    name: str

Declarative Style

Models are defined using a declarative style, where classes represent tables and attributes represent columns. For instance, in @zenml/src/zenml/zen_stores/schemas/component_schemas.py:

class StackComponentSchema(NamedSchema, table=True):
    """SQL Model for stack components."""

    __tablename__ = "stack_component"

    type: str
    flavor: str
    configuration: bytes
    labels: Optional[bytes]
    component_spec_path: Optional[str]
    ...

Note that the table=True argument is used to indicate that the model should be a table in the database and the __tablename__ attribute is used to specify the name of the table.

There is a tight relationship between ORM schemas and their associated domain models, especially concerning the names and types of attributes. Make sure to keep them in sync. Read zenml-domain-models.mdc to understand what ZenML domain models are and how they work.

Read the full file on GitHub · 306 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 · 306 lines · 0 tokens per session scan A c0d2c14db0d4

Subscribe to this mod's changes

zenml-orm-schema is a cursor rule published in the GitHub repository zenml-io/zenml (5,637 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 2,465 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.

Related

zenml-orm-schema compared with cursor rules from other repositories

zenml-orm-schema next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
zenml-orm-schemazenml-io/zenmlCursor rule5.6ktodayApache-2.0A0Cursor
specsstreamlit/streamlitCursor rule46ktodayApache-2.0A0Cursor
workflowsstreamlit/streamlitCursor rule46ktodayApache-2.0A0Cursor
skillsstreamlit/streamlitCursor rule46ktodayApache-2.0A0Cursor
e2e_playwrightstreamlit/streamlitCursor rule46ktodayApache-2.0A0Cursor
embedded_skillsstreamlit/streamlitCursor rule46ktodayApache-2.0A0Cursor
git-conventionschdb-io/chdbCursor rule2.9k7d agoApache-2.0A0Cursor