malloy-gotchas-queries

malloy-gotchas-queries is a skill for Claude Code, Codex from malloydata/publisher. It costs 48 tokens per session (2,130 once invoked), scanned A, original, MIT.

A reference guide to common mistakes when writing Malloy queries and views. Malloy is a language for querying and presenting data, including charts and dashboards.

In plain words
What is it for?
Writing Malloy views, queries, notebooks, charts, dashboards, aggregate filters, joined-field aliases, and time-based groupings.
Why use it?
It helps prevent query errors and misleading chart results caused by invalid filters, missing aliases, or unsupported chart structures. The guide shows the correct pattern for each issue.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Writing Malloy views, queries, notebooks, charts, dashboards, aggregate filters, joined-field aliases, and time-based groupings.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/malloydata/publisher/malloy-gotchas-queries
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.

Any agent
npx skills add malloydata/publisher --skill malloy-gotchas-queries
Clone the repo
git clone --depth 1 https://github.com/malloydata/publisher

Made for: Claude Code, Codex.

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 malloy-gotchas-queries

README.md
[![agentmods](https://agentmods.dev/badge/skills/malloydata/publisher/malloy-gotchas-queries/github.svg)](https://agentmods.dev/skills/malloydata/publisher/malloy-gotchas-queries)
Your own site
<a href="https://agentmods.dev/skills/malloydata/publisher/malloy-gotchas-queries"><img src="https://agentmods.dev/badge/skills/malloydata/publisher/malloy-gotchas-queries/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 malloy-gotchas-queries

Your own site · 80×15
<a href="https://agentmods.dev/skills/malloydata/publisher/malloy-gotchas-queries"><img src="https://agentmods.dev/badge/skills/malloydata/publisher/malloy-gotchas-queries.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,130 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00048 $0.02130
Opus 5 $0.00024 $0.01065
Sonnet 5 $0.00010 $0.00426
Haiku 4.5 $0.00005 $0.00213

Measured 12d ago against content hash 8c2759fd0f7d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

malloy-gotchas-queries 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 12d 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.

skills/malloy-gotchas-queries/SKILL.md · 192 lines

How it starts

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

Query & View Gotchas

Read this before writing views or queries. These patterns cause most query errors.

Charts: ONE Aggregate Per View

Charts render only the first aggregate. Use exactly one aggregate per # bar_chart / # line_chart view.

// WRONG: revenue is ignored
# bar_chart
view: x is { group_by: status, aggregate: order_count, revenue }
// RIGHT: single aggregate
# bar_chart
view: x is { group_by: status, aggregate: revenue }

For multiple metrics: nest separate chart views in a # dashboard, or use y=['revenue','cost'] for multi-measure series.

Joined Fields in order_by: Must Alias First

// WRONG: compile error
view: x is { group_by: races.season_year, aggregate: pts, order_by: races.season_year }
// RIGHT: alias then reference
view: x is { group_by: yr is races.season_year, aggregate: pts, order_by: yr }

Any time you group_by a joined field, create an alias and use it in order_by.

having: vs where:: Aggregate Filters

// WRONG: "Aggregate expressions not allowed in where"
view: x is { group_by: cat, aggregate: n is count(), where: n > 10 }
// RIGHT
view: x is { group_by: cat, aggregate: n is count(), having: n > 10 }
  • where: filters rows BEFORE aggregation (dimensions/raw columns)
  • having: filters AFTER aggregation (measures)

Aggregating Joined Fields: Method Syntax

// WRONG: compile error: "Join path is required for this calculation; use 'inventory_items.item_cost.sum()'"
measure: cogs is sum(inventory_items.item_cost)
// RIGHT: method syntax
measure: cogs is inventory_items.item_cost.sum()

sum, avg, min, and max over a dotted joined path all produce that compile error; the diagnostic message even tells you the exact fix. Don't worry about catching this in code review; the compiler does it for you.

Method syntax is for aggregates over a path. Scalar functions never take it.

Read the full file on GitHub · 192 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. 12d ago First seen · 192 lines · 48 tokens per session scan A 8c2759fd0f7d

Subscribe to this mod's changes

malloy-gotchas-queries is a skill published in the GitHub repository malloydata/publisher (102 stars, last pushed today), licensed MIT. It adds 48 tokens to every session and 2,130 once invoked, about $0.0002 per session on Opus 5. 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 skills, from other repositories

reimagine-it-extract

Emit the content signals reimagine-it reads from an HTML file — title, anchors, proper nouns, dates, numbers, emails, links, source hex colors, and the derived palette — as JSON without generating a redesign. Use when the user says /reimagine-it extract, "what does the engine see in this page", "extract the palette"…

Kayforkind/reimagine-it · 133 tokens

reusable-visualization

Build ONE reusable chart visualization component that receives its data and its settings from the host application instead of fetching them, and declares the fields and config options the host exposes to viewers. Use this whenever a single chart component is reused across many different queries rather than built for…

lightdash/lightdash · 102 tokens

lightdash-agent-slack-messaging

Use this skill when writing, designing, or generating Slack messages for Lightdash's in-app analytics agent. Triggers when someone asks to create agent update messages, Slack digests, agent notifications, weekly summaries, daily summaries, or any Slack copy for the Lightdash project agent. Also use when asked to vary…

lightdash/lightdash · 114 tokens

developing-in-lightdash

Use when reading, creating, and editing Lightdash dashboards and charts as JSON, including dashboard layout and chart-type-specific configuration.

lightdash/lightdash · 31 tokens

developing-data-apps-locally

Use when editing a locally created or downloaded Lightdash data app — how local editing, building, and uploading work, and what is read-only.

lightdash/lightdash · 38 tokens

upgrade-preflight

Checks whether a self-hosted Lightdash upgrade is safe to run, and reads the tooling's answer without over-reading it. Use when upgrading a self-hosted instance, planning a maintenance window, answering "is this upgrade safe", or recovering a failed, hung, parked or lock-stuck migration — covers lightdash…

lightdash/lightdash · 101 tokens