MCPInstall

mz-ontology-design

Designing and reviewing the semantic layer of a Materialize SQL code base as a canonical ontology — a shared raw database, a shared core database, and one database per use case. Use this skill when a user asks how to structure or organize Materialize schemas and databases, wants to define canonical semantic objects (entities, events, measurements, relationship objects), needs identity resolution or temporal semantics for public objects, is deciding what belongs in a shared layer versus a consumer-specific one, is building or validating a relationship registry (core.public.relationships, reference edges, cardinality, optionality), or mentions ontology, semantic layer, semantic model, semantic objects, context graph, raw/core/use-case boundaries, grain, or enforceable layer dependencies. Also trigger when reviewing an existing Materialize code base for leaked private schemas, duplicated concepts, or undocumented public objects.

Installs
92
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/materializeinc/agent-skills --skill mz-ontology-design
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads mz-ontology-design automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Materialize ontology design

Build one canonical semantic graph between source-shaped data and consumer-specific outputs. Shared meaning belongs in the ontology; presentation and workflow policy belong at the edges.

Architecture

Use a shared raw database, a shared core database, and one database per use case. Preserve this dependency direction:

raw.<source_system>  ->  core.<source_system>  ->  core.internal
                                                    |
                                                    v
                                               core.public
                                                    |
                                                    v
                                         <use_case>.<schema>
  • raw contains source-shaped ingestion objects. Preserve source-table identity; recreating a source table can resnapshot the upstream system.
  • core.<source_system> contains private, source-local typing, cleanup, deduplication, and naming.
  • core.internal contains private cross-source integration and identity resolution.
  • core.public is the documented ontology and the only core schema consumers may read.
  • Each use case owns a database. Its schemas contain the projections, aggregates, scores, filters, and indexes for that application or workload. Use cases never share a database.

Only core reads raw. Every use-case database reads only core.public. Enforce these boundaries with grants and dependency validation rather than naming conventions alone.

Semantic objects

A semantic object is a canonical relation whose rows have one documented grain, one durable identity rule, explicit temporal semantics, and meaning independent of any consumer. It represents one of:

  • an entity: a durable thing with identity;
  • an event: an occurrence with event identity and event time;
  • a measurement: an observation at a subject, metric, and observation time; or
  • a relationship object: an association with attributes, evidence, history, or many-to-many meaning.

An aggregate, score, display category, report row, source replica, or one-to-one projection is not a semantic object merely because a consumer needs it.

Before adding a public object, require all of the following:

  1. Its grain and identity can be stated unambiguously.
  2. Its meaning does not depend on a particular dashboard, alert, model, or workflow.
  3. It is useful to multiple consumers or foundational to another public object.
  4. Its attributes belong at the same grain, have clear provenance, and are safe to expose through the public boundary.

If a use case needs missing data, first decide whether to add an attribute to an existing object, add an event, measurement, or relationship object, or keep a consumer-specific derivation at the edge. Never bypass the private boundary.

Identity and time

Prefer immutable upstream identifiers when they are globally meaningful. Use explicit composite keys when identity is scoped by a parent. Resolve cross-source identity once in core.internal and retain source identifiers for lineage. Use a deterministic synthetic identifier only when no durable key exists; document its inputs and stability boundary.

Do not publish warehouse sentinel members or duplicate surrogate hashes beside the keys they encode. Represent unresolved, unmatched, ambiguous, and resolved states explicitly when those distinctions matter.

Every public object declares whether it represents current state, an immutable event, a point-in-time measurement, or effective-dated history. Distinguish event time, effective time, and ingestion time when more than one affects interpretation.

Public and use-case objects

Define each core.public semantic object exactly once, name it with a domain noun, and publish it as a materialized view on transformation compute. This lets serving clusters consume maintained results without rebuilding the semantic graph.

Normalize shared meaning: one fact has one canonical owner. A denormalized copy is acceptable only when its derivation is canonical and its relationship documentation identifies it as denormalized.

Use-case databases may organize their surfaces into one or more schemas and reshape the ontology into stars, wide tables, cohorts, rankings, scores, or alert states. They may not redefine identity or maintain an independent version of a shared concept. Transformation compute and serving compute remain separate; serving workloads may share a cluster when their ownership, isolation, sizing, and availability requirements are compatible.

Relationships

Use two relationship forms:

  • A reference edge is represented by columns on one public object that identify one row in another public object. Its cardinality from the referencing side is many_to_one or one_to_one.
  • A relationship object is a public semantic object when the association has attributes, time, evidence, confidence, or many-to-many meaning. Its references to participating entities are ordinary reference edges.

Do not expose heuristic matches as foreign-key-like edges. Model the match as a relationship object with its method, status, evidence, confidence, and effective time.

core.public.relationships is the machine-readable registry of all reference edges. Read references/relationships.sql when creating or reviewing it. Composite references list columns positionally and must be either wholly null or wholly non-null when optional.

Validate the registry against the compiled schema: relationship names are unique; objects and columns exist; column counts and types match; referenced columns form a unique key; required references have no nulls or orphans; one-to-one references are unique on the referencing side; enums are valid; and every public reference is registered.

Documentation and tests

Use comment on for the consumer contract. Each public object documents its grain, identity, temporal behavior, meaning, and important exclusions. Comment keys, timestamps, units, state fields, nullable relationships, sensitive fields, and non-obvious derivations. Include semantic provenance when it affects interpretation; exclude source mechanics, join implementation, and performance notes.

Keep implementation notes in SQL comments. Test public key uniqueness and non-nullness, accepted states, relationship integrity, grain preservation, and non-obvious semantic rules. CI should also reject reverse-layer dependencies, private-schema access by use-case databases, undocumented public objects, and consumer indexes on transformation compute.

FAQ

What does the mz-ontology-design skill do?

Designing and reviewing the semantic layer of a Materialize SQL code base as a canonical ontology — a shared raw database, a shared core database, and one database per use case. Use this skill when a user asks how to structure or organize Materialize schemas and databases, wants to define canonical semantic objects (entities, events, measurements, relationship objects), needs identity resolution or temporal semantics for public objects, is deciding what belongs in a shared layer versus a consumer-specific one, is building or validating a relationship registry (core.public.relationships, reference edges, cardinality, optionality), or mentions ontology, semantic layer, semantic model, semantic objects, context graph, raw/core/use-case boundaries, grain, or enforceable layer dependencies. Also trigger when reviewing an existing Materialize code base for leaked private schemas, duplicated concepts, or undocumented public objects.

How do I install mz-ontology-design?

Run npx skills add https://github.com/materializeinc/agent-skills --skill mz-ontology-design in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/mz-ontology-design/ (personal) or .claude/skills/mz-ontology-design/ (project).

Which AI agents can use mz-ontology-design?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is mz-ontology-design safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains mz-ontology-design?

It is published by materializeinc in materializeinc/agent-skills. It has 92 recorded installs.

More from materializeinc/agent-skills

View all →

materialize-docs

materializeinc/agent-skills

Materialize documentation for SQL syntax, data ingestion, concepts, and best practices. Use when users ask about Materialize queries, sources, sinks, views, or clusters.

Docs & Writing532 installs

mcp-developer-analysis

materializeinc/agent-skills

Open the skill to read its SKILL.md instructions.

AI & Agents289 installs

materialize-dbt

materializeinc/agent-skills

Open the skill to read its SKILL.md instructions.

Data & Databases126 installs

materialize-terraform-self-managed

materializeinc/agent-skills

Terraform modules for deploying self-managed Materialize on AWS (EKS), Azure (AKS), and GCP (GKE). Covers networking, Kubernetes clusters, managed PostgreSQL, object storage, the Materialize operator, and Materialize instance configuration. Use this skill whenever the user asks about deploying self-managed Materialize with Terraform, setting up Materialize infrastructure on any cloud, configuring EKS/AKS/GKE for Materialize, troubleshooting a self-managed deployment, upgrading Materialize instances, customizing Terraform variables for Materialize, or working with the materialize-terraform-self-managed repository. Also trigger when the user mentions Karpenter node pools for Materialize, persist or metadata backend URLs, the Materialize operator Helm chart, CRD versions (v1alpha1 vs v1), rollout strategies, or NVMe swap configuration for Materialize nodes.

DevOps & Cloud118 installs

materialize-terraform-provider

materializeinc/agent-skills

Using the Materialize Terraform provider to manage Materialize resources declaratively. Covers clusters, sources (Kafka, Postgres, MySQL, SQL Server), sinks (Kafka, Iceberg), connections, materialized views, indexes, tables, roles, grants, secrets, network policies, and cloud-only resources (users, SSO, SCIM, app passwords). Use this skill whenever the user asks about writing Terraform for Materialize, creating or configuring Materialize resources with Terraform, importing existing Materialize objects into Terraform state, configuring the Materialize provider for Cloud or self-managed, setting up RBAC or grants via Terraform, creating connections or sources in Terraform, or troubleshooting Terraform plan/apply issues with Materialize resources. Also trigger when the user mentions materializecluster, materializesourcekafka, materializeconnectionpostgres, or any other materialize resource type.

DevOps & Cloud117 installs

mz-sql-navigation

materializeinc/agent-skills

Open the skill to read its SKILL.md instructions.

Data & Databases116 installs

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases462.2K installs

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases393.5K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases392.3K installs

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases390.8K installs

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases384.4K installs

Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.

OfficialData & Databases378.9K installs