zenml-domain-models

A set of coding rules for understanding and changing ZenML’s domain models, which are the software representations of its main business objects. It explains their class structure, locations, and design conventions.

In plain words
What is it for?
Use it when implementing, reviewing, or updating ZenML domain model files.
Why use it?
It helps developers add or modify these models consistently without breaking the project’s architecture.

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/zenml-io/zenml/zenml-domain-models
Clone the repo
git clone --depth 1 https://github.com/zenml-io/zenml

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,328 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.02328
Opus 5 $0.00000 $0.01164
Sonnet 5 $0.00000 $0.00466
Haiku 4.5 $0.00000 $0.00233

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

Security

Grade A, and why

zenml-domain-models 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.

.cursor/rules/zenml-domain-models.mdc · 283 lines

How it starts

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

ZenML Domain Models

Overview

ZenML domain models represent the core business entities in the ZenML ecosystem. They are built using a sophisticated layered architecture that emphasizes clean separation of concerns, type safety, and maintainable code. This document outlines the key patterns and conventions used in implementing domain models. Make sure to follow these patterns when implementing new domain models or modifying existing ones.

All model files are located in the @src/zenml/models directory.

Base Class Hierarchy

The domain models follow two main hierarchies: the Model Hierarchy and the Filter Hierarchy.

Model Hierarchy

BaseZenModel (base.py)
├── BaseRequest
│   ├── UserScopedRequest
│   │   └── WorkspaceScopedRequest
│   └── [Entity]Request
├── BaseUpdate
│   └── [Entity]Update
└── BaseResponse[Body, Metadata, Resources]
    ├── BaseResponseBody
    │   └── BaseDatedResponseBody
    │       ├── UserScopedResponseBody
    │       └── WorkspaceScopedResponseBody
    ├── BaseResponseMetadata
    │   ├── UserScopedResponseMetadata
    │   └── WorkspaceScopedResponseMetadata
    ├── BaseResponseResources
    │   ├── UserScopedResponseResources
    │   └── WorkspaceScopedResponseResources
    └── BaseIdentifiedResponse[DatedBody, Metadata, Resources]
        └── UserScopedResponse[Body, Metadata, Resources]
            └── WorkspaceScopedResponse[Body, Metadata, Resources]

Filter Hierarchy

BaseFilter (filter.py)
├── Filter (ABC)
│   ├── BoolFilter
│   ├── StrFilter
│   │   └── UUIDFilter
│   ├── NumericFilter
│   └── DatetimeFilter
├── UserScopedFilter
│   └── WorkspaceScopedFilter
└── TaggableFilter

FilterGenerator
└── Used to create appropriate Filter instances

Key Characteristics

  1. Model Base Classes:
    • BaseZenModel: Root class with analytics tracking and YAML serialization
    • BaseRequest: For creating new entities
    • BaseUpdate: For modifying existing entities
    • BaseResponse: Tripartite structure with Body/Metadata/Resources
    • BaseIdentifiedResponse: Adds UUID and permission handling
    • BaseDatedResponseBody: Adds creation/update timestamps

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

Subscribe to this mod's changes

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

Other cursor rules, from other repositories

workflows

This folder contains all GitHub Actions workflows for the Streamlit repository. Workflows automate CI/CD, testing, releases, and maintenance tasks.

streamlit/streamlit · 0 tokens

python_tests

We use the unit tests to cover internal behavior that can work without the web / backend counterpart. We aim for 95%+ unit test coverage of our Python code in lib/streamlit.

streamlit/streamlit · 0 tokens

skills

This file provides guidance to AI coding agents (Claude Code, Cursor, Copilot, etc.) when working with skills in this repository.

streamlit/streamlit · 0 tokens

e2e_playwright

We use playwright with pytest to e2e test Streamlit library. E2E tests verify the complete Streamlit system (frontend, backend, communication, state, visual appearance) from a user's perspective (black-box). They complement Python/JS unit tests, which are faster and focus on internal logic, input/output validation…

streamlit/streamlit · 0 tokens

embedded_skills

Skills under lib/streamlit/.agents/skills/ ship with the library and load from the user's installed Streamlit, so keep them current as features evolve. developing-with-streamlit uses SKILL.md for routing and references/ for topic files. Follow these conventions when adding or editing guidance.

streamlit/streamlit · 0 tokens

mod-007b-cannot-remove-or-rename-parameters-without-compat-mapper

Cannot remove or rename parameters in production models without implementing backwardcompatargmapper and incrementing modelcheckpointversion to maintain compatibility.

NVIDIA/physicsnemo · 29 tokens