malloy-modeling
Installation
SKILL.md
STOP - READ BEFORE WRITING ANY MALLOY CODE
AI AGENTS: You MUST review this file before writing Malloy code. Cross-skill references below use logical
skill:names; load the referenced skill before acting. Before writing code, also read the gotcha skills:skill:malloy-gotchas-modeling,skill:malloy-gotchas-queries, andskill:malloy-gotchas-rendering.
Pre-Flight Checklist
- Discover first: ground yourself before writing ANY code, with the tool that matches what you are modelling.
- Modelling data already in a package:
malloy_getContextreturns that package's sources, views, and fields (with their docs). - Modelling a database with no package yet:
malloy_getContexthas nothing to return, so usemalloy_searchDatabaseSchemainstead. It walks the connection's schemas and tables, ranks them against a plain-English description, and gives you each table's columns plus thesource:line to start from. Take those names verbatim into step 5. Never guess field names either way.
- Modelling data already in a package:
- Search docs proactively: call
malloy_searchDocsBEFORE writing unfamiliar patterns (window functions, query-based sources, pipelines). Don't guess. Malloy syntax is specific and SQL intuition is often wrong. - Use
skill:malloy-patternsto discover available doc topics (YoY, cohorts, rendering, window functions). - Check diagnostics after writing: fix the FIRST error first, errors cascade.
- Read the gotcha skills:
skill:malloy-gotchas-modeling,skill:malloy-gotchas-queries, andskill:malloy-gotchas-renderingprevent the most common mistakes.