malloy-scope
Skill116 starsChanged 2 months agoMITView on GitHub
Present discovery findings and propose an analytical scope before modeling. Use after inspecting a package's model and data, to classify tables and recommend an analytical focus the user can pick from.
In this repository45 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- fix-scan-findingSkill
- publisher-releaseSkill
- eval-answerSkill
- eval-diagnoseSkill
- eval-importSkill
- eval-improveSkill
- eval-judgeSkill
- eval-loopSkill
- eval-reportSkill
- malloy-analysis-pitfallsSkill
- malloy-analysis-reportSkill
- malloy-analysisSkill
- malloy-analyzeSkill
- malloy-chartsSkill
- malloy-dashboardsSkill
- malloy-data-app-designSkill
- malloy-debugSkill
- malloy-defineSkill
- malloy-discoverSkill
- malloy-documentSkill
- malloy-getting-startedSkill
- malloy-gotchas-modelingSkill
- malloy-gotchas-queriesSkill
- malloy-gotchas-renderingSkill
- malloy-html-data-app-embeddingSkill
- malloy-html-data-app-runtimeSkill
- malloy-html-data-appsSkill
- malloy-lookml-reviewSkill
- malloy-materializationSkill
- malloy-materialization-tuningSkill
- malloy-model-as-you-goSkill
- malloy-modelingSkill
- malloy-modelSkill
- malloy-notebook-chatSkill
- malloy-notebooksSkill
- malloy-patternsSkill
- malloy-phrase-detectionSkill
- malloy-powerbi-reviewSkill
- malloy-publishSkill
- malloy-queriesSkill
- malloy-reviewSkill
- malloySkill
- malloy-source-unreachableSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
When: After you have inspected the model and its underlying data.
- Distinctive: line 71
Only when there is no such tool, format them for a short typed reply:
- Very specific: line 83
Make the choice easy to answer in one word: Avoid long prose the user has to read and synthesize.
- Distinctive: line 104
Don't overwhelm: if there are 20+ tables, group them by domain and focus on the most relevant cluster.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
Copyright (c) Credible Data Inc.
SPDX-License-Identifier: MIT
-->Propose Analytical Scope
When: After you have inspected the model and its underlying data. You have read the package's sources and fields and looked at the data distributions.
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.
Goal: Present what you found and recommend an analytical focus. The user selects a direction.
Ground yourself first with get_context: it returns the package's sources, views, and fields, so it tells you what data exists, how it relates, and what is already modeled. Query the data with execute_query to get row counts and spot data-quality issues. Record the proposal and the user's decision in your modeling workflow's modeling-notes.md.
Scope is "which questions", not just "which tables". A single A/B/C question about table inclusion is step 3's architecture question wearing step 2's clothes. The scope proposal must establish what the model is for: a model aimed at recommendation looks different from one aimed at catalog analysis over the same tables.
What to Present
1. Table Summary
Present a table of the discovered tables with key metadata:
| Table | Rows | Columns | Role | Key Relationships |
| orders | 1.2M | 24 | Fact | FK: customer_id → customers, product_id → products |
| customers | 50K | 15 | Dimension | PK: customer_id |
| products | 2K | 12 | Dimension | PK: product_id |
| order_items | 3.5M | 8 | Bridge | FK: order_id → orders, product_id → products |
| audit_log | 10M | 6 | Operational | No joins to business tables |
Classify each table by role:
- Fact: the events or transactions you measure (orders, sessions, payments).
- Dimension: the entities you slice by (customers, products, regions).
- Bridge: many-to-many linking tables (order_items, tags).
- Operational: ETL, staging, or audit tables that aren't analytical.
2. Recommended Analytical Focus
Identify 2-3 analytical domains: categories of questions the data can answer. Typically these are the business processes (measurement events like taking an order or billing a customer) the data records, or, for entity/snapshot datasets, the entities it describes.
Say what kind of model this is, and what that rules out. A dataset of events supports a fact-centred model with trends over time; a dataset of entities with cumulative counters supports an entity/snapshot model that cannot do period-over-period analysis however well it is built. State the kind in the proposal, and name the concrete consequences (e.g. "release dates are 98% null, so this model cannot do calendar analysis at all: no month, quarter, or year-over-year"). The user should learn what the model will never answer before choosing a scope, not discover it from a failed query later.
- Order Analysis: Revenue, order trends, product performance, customer purchasing patterns. (Covers: orders, order_items, products, customers)
- Customer Health: Retention, segmentation, lifetime value, churn risk. (Covers: customers, orders)
- Inventory Management: Stock levels, reorder patterns, supplier performance. (Covers: products, inventory, suppliers)
Recommend one as the starting point with reasoning:
"I'd recommend starting with Order Analysis. It covers your most-used tables and the core business questions around revenue and performance. We can add Customer Health as a separate source later."
3. Tables to Skip
Flag tables that shouldn't be modeled (with reasoning):
- audit_log: Operational/ETL table, not analytical
- staging_orders: Staging table, use
ordersinstead - monthly_summary: Pre-aggregated snapshot, compute fresh in Malloy instead
4. Scope Options
Offer 2-3 concrete options. Each is one line: a label, the tables it covers, and the key questions it answers. Mark your recommendation.
If your host has an ask_user tool, the options belong in that card and nowhere else. Write the evidence and your recommendation as prose, then let the card carry the choices. Do not also list them as A/B/C: saying the same three options twice buries the recommendation, and the user reads one decision as though it were two.
Only when there is no such tool, format them for a short typed reply:
A. Order Analysis (recommended): orders + customers + products + order_items. Answers: What's selling? How is revenue trending? Who are the top customers?
B. Full Commerce: Everything in A plus inventory and suppliers. Broader but more complex.
C. Customer Focus: customers + orders only. Narrower, focused on retention and segmentation.
Pick one (or mix, e.g., "A plus suppliers").
User Interaction
Make the choice easy to answer in one word. Avoid long prose the user has to read and synthesize. An ask_user card if the host has one; otherwise lettered options with one-line descriptions.
The user will:
- Select one of the options (or combine them, e.g., "A plus inventory")
- Add tables you missed
- Remove tables they don't want
- Redirect to a different analytical focus entirely
After User Confirms
Restate the confirmed scope in the conversation so it's clear what you'll model next, and record it (with the skip list and reasons) in modeling-notes.md. A useful shape to summarize:
- Connection / schema: the connection name and schema the sources draw from.
- Tables in scope: table, row count, role (Fact/Dimension/Bridge), and any notes.
- Analytical focus: one line describing the analytical domain.
- Deferred: tables left out, with the reason.
Then hand off to modeling: use your modeling workflow to turn the confirmed scope into Malloy sources, dimensions, measures, and views.
Tips
- Don't overwhelm: if there are 20+ tables, group them by domain and focus on the most relevant cluster.
- Show evidence: mention row counts, column counts, relationship density to justify your recommendation.
- Be opinionated: recommend one option clearly, don't present them as equal.
- Flag data quality issues discovered while inspecting the data (e.g., "The
orderstable has ~3% duplicate rows onorder_id").
Done
Scope confirmed, in the conversation and in modeling-notes.md: tables in scope, analytical focus, model kind and what it rules out, and what's deferred. Continue with your modeling workflow.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

