malloy-modeling

Build governed semantic data models in Malloy for the Malloy Publisher.

9|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/mathisdrn/orca --skill malloy-modeling-mathisdrn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: malloy-modeling
Source: https://github.com/mathisdrn/orca/tree/main/.agents/skills/malloy-modeling
Command: npx skills add https://github.com/mathisdrn/orca --skill malloy-modeling-mathisdrn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing Malloy semantic models by hand is error-prone: reserved words, SQL-intuition traps, and undocumented business logic produce models that compile but mislead. This Skill enforces a structured, human-confirmed workflow so models are correct, documented, and governed. ## Core Features & Use Cases - 8-Step Modeling Workflow: Orchestrates discovery, scoping, source definition, base and joined source builds, review, and curation with explicit user confirmation checkpoints. - Publisher MCP Tool Integration: Uses malloy_getContext, malloy_compile, malloy_reloadPackage, malloy_executeQuery, malloy_searchDocs, and malloy_searchDatabaseSchema to ground every field in real schema data. - Syntax Guardrails: Provides SQL-to-Malloy translation tables, reserved-word lists, anti-pattern corrections, and routing to gotcha and pattern skills. - Use Case: A data analyst asks to model a new Postgres database; the agent searches the schema, proposes sources and definitions for user sign-off, writes documented .malloy files, validates via compile and reload, and records open decisions in modeling-notes.md. ## Quick Start Ask the agent to model your database or existing Malloy package, for example by saying "Model my data" or "Create a Malloy model from these tables".

Frequently Asked Questions about malloy-modeling

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Malloy semantic model from my database?▼

Follow the 8-step workflow: discover the schema with malloy_searchDatabaseSchema, propose scope and sources for user confirmation, then write documented base and joined source files. Validate each change with malloy_compile before saving and reloading the package.

What is the difference between Malloy count() and count(x)?▼

In Malloy, count() counts rows while count(x) counts distinct values of x. The SQL pattern count(distinct x) is deprecated; write count(x) instead.

Why is my Malloy field name causing a compile error?▼

Malloy has many reserved words such as date, number, source, and string that collide with common column names. Wrap the column name in backticks, for example `Date`, or rename the field to a non-reserved alias.

How do I filter on an aggregate measure in Malloy?▼

Use having: for aggregate filters rather than where:, which only applies to dimensions. Applying where: to a measure is a common SQL-intuition mistake that produces incorrect or failing queries.

Can Malloy read CSV, Parquet, or Excel files directly?▼

Yes, .csv, .parquet, .json, .ndjson, and .xlsx files work in place through duckdb.table('data/file.ext') without conversion. For .xlsx files, verify the row count first since title rows or blank spacers can silently truncate reads.

Why is my new Malloy source not queryable after saving?▼

Publisher compiles packages at boot and serves the cached model, so saved edits are not queryable until you call malloy_reloadPackage. Validate first with malloy_compile, save the file, reload, then run the view.