malloy-phrase-detection

Constructs search targets for the get_context tool by classifying phrases into dimension, measure, view, and source types.

Updated Jun 3, 2026
One-click install
npx skills add https://github.com/credibledata/credible-plugin --skill malloy-phrase-detection-credibledata
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: malloy-phrase-detection
Source: https://github.com/credibledata/credible-plugin/tree/main/codex/skills/malloy-phrase-detection
Command: npx skills add https://github.com/credibledata/credible-plugin --skill malloy-phrase-detection-credibledata

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Translating a user's natural-language question into well-formed search targets for the get_context tool is error-prone: concepts get misclassified, ambiguous phrases get collapsed, and literal values get searched as if they were model entities. This Skill provides the classification rules and decomposition patterns needed to build accurate dimension, measure, view, and source targets. ## Core Features & Use Cases - Target-Type Classification: Decision guide mapping user phrases to dimension, measure, view, or source target types, including time references and numeric ranges as dimensions. - Decomposition Patterns: Seven non-obvious rules such as splitting adjective-noun phrases ("active users"), covering ambiguous concepts with both types, and adding ranking measures for "top N" questions. - Categorical Value Resolution: Guidance to target the parent dimension and confirm exact stored strings ("NYC" vs "New York City") via execute_query before filtering. - Use Case: For the question "Customer churn in NYC over the last year for premium and basic subscribers", produce five correctly typed search targets and then verify the stored city and tier values before running the query. ## Quick Start Ask how to turn the question "top 6 products by revenue last quarter" into get_context search targets.

Frequently Asked Questions about malloy-phrase-detection

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build search targets for the get_context tool?

Write search_text as a short semantic description of the concept, classify it as dimension, measure, view, or source, and use one target per distinct concept. Time references and numeric ranges become dimension targets; aggregation metrics become measures.

How do I filter on a specific value like "premium" or "NYC" in Malloy?

Target the dimension the value lives on, such as the subscription tier or city dimension, then run execute_query to list that dimension's distinct values. Confirm the exact stored string before filtering, since data may store "Premium", "PREMIUM", or "NYC".

Should "last year" or "aged 50" be a dimension or measure target?

Both are dimension targets. Time references map to the relevant date field, and numeric ranges map to the numeric dimension; the comparison itself is applied later in the query, not matched as search text.

How do I handle ambiguous terms like "rating" or "duration"?

Create one target of each plausible type: one dimension target and one measure target. Ambiguous concepts could be either a categorical attribute or an aggregation metric, so covering both types ensures the match succeeds.

What makes a good source target search phrase?

Use 3-8 words naming the entity and its business process, like "customer order history and line items". Exclude filter values, time ranges, aggregations, and the user's brand or vertical, since source summaries describe data structure.

What are the limitations of get_context value search?

There is no value-search target in v1; get_context searches model metadata, not stored categorical values. Literal values must be resolved by targeting the parent dimension and querying its distinct values with execute_query.