malloy-define

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

A planning guide for building a Malloy semantic model, which gives data sources and fields clear names and meanings.

In plain words
What is it for?
Use it to choose sources, decide the level of detail for each source, and propose renamed fields, categories, and calculations.
Why use it?
It prevents modeling decisions from being based on guessed tables or fields and lets the user confirm the scope first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to choose sources, decide the level of detail for each…

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/malloydata/publisher/malloy-define.svg)](https://agentmods.dev/skills/malloydata/publisher/malloy-define)
Your own site
<a href="https://agentmods.dev/skills/malloydata/publisher/malloy-define"><img src="https://agentmods.dev/badge/skills/malloydata/publisher/malloy-define.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,459 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.
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.00053 $0.02459
Opus 5 $0.00026 $0.01229
Sonnet 5 $0.00011 $0.00492
Haiku 4.5 $0.00005 $0.00246

Measured 7d ago against content hash 68b78355a91c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

malloy-define 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 7d 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-define/SKILL.md · 199 lines

How it starts

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

Propose sources and definitions

This skill covers two consecutive activities when building or extending a Malloy semantic model:

Tool names are written bare here - get_context, execute_query, search_malloy_docs. The exact prefixed name depends on the host surface; match each against the tools you actually have.

  • Propose sources: the architectural blueprint (which sources, what grain).
  • Propose definitions: the specific fields per base source (renames, dimensions, measures).

Both happen in conversation. Propose, let the user confirm or adjust, then carry the confirmed plan forward into the actual .malloy model. There is no separate plan-file store: keep the source plan and field proposals in the conversation, and write the model itself when the user has confirmed. See your modeling workflow for the broader picture.

Read the existing model first so you propose against what is really there. Use get_context with a plain-English description to inspect the current sources and fields and find the most relevant existing sources. Confirm the scope (which tables are in play) before proposing the source plan.

Propose a source plan

Goal: Propose the full source architecture for the tables in scope.

Base sources

One base source per table in scope. For each, specify:

Source Table Grain Primary Key Role
orders sales.orders one row per order order_id Fact, transactions
customers sales.customers one row per customer customer_id Dimension, who
products sales.products one row per product product_id Dimension, what

Computed sources

Computed sources are created from queries, not physical tables. Propose them when:

  1. Grain mismatch: the analytical scope requires a grain that no physical table provides (e.g., customer-level metrics from an order-grain table).
  2. Repeated aggregation patterns: the same group-by plus aggregate pattern would be used in multiple places.
  3. Cross-entity aggregations: inspecting the model and querying the data shows that an aggregate rolled up to a different entity would be reused.

Read the full file on GitHub · 199 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. 7d ago First seen · 199 lines · 53 tokens per session scan A 68b78355a91c

Subscribe to this mod's changes

malloy-define is a skill published in the GitHub repository malloydata/publisher (100 stars, last pushed yesterday), licensed MIT. It adds 53 tokens to every session and 2,459 once invoked, about $0.0003 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

effective-dbt-sql

Use when writing or modifying dbt model SQL — deciding whether to add a subquery or reuse an existing dimension/metric, structuring a query, joining models, or refactoring a metric's SQL. Encodes SQL semantic-correctness rules: reuse existing fields, prefer CTEs over correlated subqueries, and make joins and column…

lightdash/lightdash · 0 tokens

alibabacloud-data-agent-mcp-skill

Alibaba Cloud Data Agent MCP skill (alibabacloud-data-agent-mcp-skill, data-agent MCP) for enterprise database/file analysis. Use when the user asks (in any language, including Chinese) to query/analyze DMS-managed databases, run SQL/data analysis, start quick-query (lite) or deep-analysis (pro/ultra) sessions…

aliyun/data-agent-skill · 199 tokens

wren-usage

Wren Engine — semantic SQL engine for AI agents. Query 22+ data sources (PostgreSQL, BigQuery, Snowflake, MySQL, ClickHouse, etc.) through a modeling layer (MDL). This skill is the main entry point: it guides setup, delegates to focused sub-skills for SQL authoring, MDL generation, project management, and MCP server…

Canner/wren-engine · 126 tokens

wren-onboarding

Onboard a user to Wren Engine end-to-end. Walks through environment checks, project scaffolding, connection configuration via .env, and first query. Use when: user wants to install Wren Engine, set up a new data source connection, or bootstrap a new project from scratch. Triggers: '/wren-onboarding', 'install wren'…

Canner/wren-engine · 98 tokens

arrowspace

Spectral vector search using graph Laplacian eigenstructure. Use when cosine/L2 similarity misses latent structure in your embeddings.

sickn33/agentic-awesome-skills · 28 tokens

system-prompts

Write system prompts, tool docs, and agent definitions. Project tag conventions + RFC 2119 keywords + dense compression. Use when authoring or editing any prompt the model reads.

can1357/oh-my-pi · 40 tokens