malloy-define

Propose source plans and field definitions for Malloy semantic models backed by query evidence.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing a Malloy semantic model requires deciding which tables to model, at what grain, and which dimensions and measures to define. Doing this from schema alone leads to wrong grains, arbitrary bucket thresholds, and untested business assumptions. ## Core Features & Use Cases - Source plan proposals: Recommends base sources per table with grain and primary key, plus computed sources for grain mismatches and repeated aggregation patterns, including dependency mapping and deferred sources. - Data-driven field definitions: Proposes renames, dimensions, and measures per source, each backed by query results such as distributions, distinct values, and percentile-based bucket boundaries. - Business logic clarification: Flags decisions that cannot be made from data alone, such as which of two date columns is canonical, with specific evidence. - Use Case: Given an orders database, the skill inspects the existing model, queries value distributions, and proposes a confirmed source architecture and field set ready to write into the .malloy model. ## Quick Start Ask the assistant to propose a Malloy source plan and field definitions for the orders and customers tables, with every proposal backed by querying the data.

Frequently Asked Questions about malloy-define

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

FAQPage Schema
How do I design a Malloy semantic model from existing tables?▼

Start by proposing one base source per table with its grain and primary key, then add computed sources only for grain mismatches or repeated aggregation patterns. Confirm the source plan with stakeholders before defining fields.

How to choose dimensions and measures for a Malloy source?▼

Query the data first: check distinct values for categorical dimensions, distributions and percentiles for bucketed dimensions, and min/max ranges for measures. Propose 5-8 dimensions and 4-6 measures per base source, ranked by priority.

When should I use a computed source in Malloy?▼

Use a computed source when the analytical grain differs from any physical table, when the same group-by aggregation repeats in multiple places, or when cross-entity rollups like customer-level order facts are reused.

Should I use denormalized columns or joined aggregates in Malloy?▼

Compare the denormalized column against the joined aggregate by querying both and reporting the match rate. If discrepancies are significant, recommend the joined aggregate and keep or drop the denormalized column based on user preference.

How do I set bucket boundaries for a Malloy dimension?▼

Derive boundaries from the actual data distribution by querying min, p25, median, p75, p95, and max, then propose breaks at natural percentiles. Avoid arbitrary hardcoded thresholds unless the user explicitly provides business-specific values.