agentleFS
malloydatamalloydata/publisher/skills/malloy-scope/SKILL.md

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.

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
  1. Distinctive:

    When: After you have inspected the model and its underlying data.

    line 13
  2. Distinctive:

    Only when there is no such tool, format them for a short typed reply:

    line 71
  3. Very specific:

    Make the choice easy to answer in one word: Avoid long prose the user has to read and synthesize.

    line 83
  4. Distinctive:

    Don't overwhelm: if there are 20+ tables, group them by domain and focus on the most relevant cluster.

    line 104

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- 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:

TableRowsColumnsRoleKey Relationships
orders1.2M24FactFK: customer_id → customers, product_id → products
customers50K15DimensionPK: customer_id
products2K12DimensionPK: product_id
order_items3.5M8BridgeFK: order_id → orders, product_id → products
audit_log10M6OperationalNo 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 orders instead
  • 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 orders table has ~3% duplicate rows on order_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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.