Agent skill

Malloy Phrase Detection

by malloydata in malloydata/publisher

How to phrase searchtext on a getcontext call so retrieval returns the fields you need instead of a truncated catalog.

MITAuto-check passed

Install Malloy Phrase Detection

skills CLI
$ npx skills add malloydata/publisher --skill malloy-phrase-detection -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install malloydata/publisher malloy-phrase-detection --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/malloydata/publisher.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/malloy-phrase-detection .claude/skills/malloy-phrase-detection && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
malloy-phrase-detection
GitHub stars
116
Token cost
~2.8k tokens
SKILL.md length
1,625 words
Files
1
Skills in repo
29
Repo updated
First seen
Licence
MIT

At a glance

How to phrase searchtext on a getcontext call so retrieval returns the fields you need instead of a truncated catalog.

  • Works in 9 steps: Adjective + noun, split. "active users"… → Ambiguous concept, cover both types.… → Time references are dimensions. "last… → …
  • SKILL.md covers Always send search_text, Authoring search_text for…, Target-type decision guide and Non-obvious decomposition…, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Malloy Phrase Detection is an agent skill from malloydata/publisher. How to phrase searchtext on a getcontext call so retrieval returns the fields you need instead of a truncated catalog. Covers target-type classification and decomposition patterns.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: Publisher is the open-source analytics engine for Malloy. It lets you define data models once — and use them everywhere. The licence is MIT.

Example prompts

  • “/malloy-phrase-detection”

Workflow steps

9 steps, taken from the first numbered list in SKILL.md.

  1. Adjective + noun, split. "active users" becomes two dimension targets: one for the attribute ("the status of the user account") and one…
  2. Ambiguous concept, cover both types. "rating", "duration", and the like could be either a dimension or a measure: create one target of…
  3. Time references are dimensions. "last year" becomes a dimension target for the relevant date field ("the date the event occurred").
  4. Numeric ranges are dimensions. "aged 50", "revenue over $1M" become dimension targets; the comparison is applied in the query, not matched…
  5. Categorical strings that look numeric are still dimensions. "18-30", "<5 days", "tier 2" are stored as literal strings on a dimension…
  6. "Top N" without a named measure, add a ranking measure. "top 6 products" becomes a measure for the ranking concept ("the performance…
  7. Multiple values for one concept, one dimension target. Several values ("premium and basic") still map to a single dimension target for the…
  8. The quantity asked for is a measure, even when nothing names it. "How many titles were released in 2019?" is asking for a count, but no…
  9. A population qualifier is a target, and so is the one the question omits. Words like "real", "actual", "genuine", "live" or "production"…

What it can do on your machine

Read from SKILL.md and the folder at commit b9a1a19. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Malloy Phrase Detection loads about 2.8k tokens when it runs. Until then it costs about 52 tokens; SKILL.md has 1,625 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~52
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from malloydata/publisher at commit b9a1a19, republished under its MIT licence (© malloydata). 1,625 words, ~2,751 tokens.

Download SKILL.mdSave it as .claude/skills/malloy-phrase-detection/SKILL.md (or your agent's skills folder).
name
malloy-phrase-detection
description
How to phrase search_text on a get_context call so retrieval returns the fields you need instead of a truncated catalog. Covers target-type classification and decomposition patterns.
<!-- Copyright (c) Credible Data Inc. SPDX-License-Identifier: MIT -->

Search Target Construction for get_context

The get_context tool description defines each field and what a call returns. This skill focuses on the parts you won't get right by default: classifying concepts into target types and splitting ambiguous phrases.

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.

Scope of this skill: the patterns below build dimension / measure / view / dimensional_value targets. Phrasing for source targets is covered at the end.

A note on matching: get_context searches over the model (sources, fields, views, and their descriptions), and dimensional_value targets search the categorical values stored in the data. Some servers don't index values; check the tool's description. On one that doesn't, find a literal value by targeting its dimension, then querying its distinct values with execute_query (see "Where value search isn't available" below).

Always send search_text

Do not enumerate. Omitting search_text lists a catalog rather than searching it. Knowing the package narrows where to look; it does not substitute for saying what you need: if you know the package, that is a reason to scope, not a reason to skip search_text. Enumerated listings are capped per source and per entity type, and with no relevance signal the cap drops the fields your question is about while keeping join-path noise.

A bare listing has three legitimate uses. The first is answering "what data is here?" when the user has named no subject at all. The second is reading a specific entity you already have the exact name of: scope to its source, set entity_name, and pass search_text: null, which returns that entity's docstring and Malloy code without spending a search. The third is checking whether a source you can name is in the catalog at all, after a ranked search did not return it (malloy-source-unreachable covers this). Every other call carries search_text on every target.

Authoring search_text for entity targets

Write search_text as a brief semantic description of what you're looking for, not an echo of the user's word. This applies even when you already know the entity name from a prior result: still describe it, don't just repeat the name. That is a rule about how to phrase a search, and it does not conflict with the exact-entity lookup above: if you want that one entity's code and docstring rather than a ranked set, pin it with entity_name and skip the search entirely. Sending its name back as search_text is the move this rule forbids, because it searches for a name instead of either describing a concept or asking for the entity.

One target per concept is enough: the tool handles phrasing variants internally. Don't pile up dimension targets that point at the same field. Use multiple targets only when they describe genuinely distinct concepts (see "Non-obvious decomposition patterns" below).

Target-type decision guide

  • dimension: categorical attribute to group, filter, or join on. Also used for time and numeric fields.
    • "region" becomes "the geographic region"
  • measure: aggregation metric (count, sum, average, rate).
    • "total revenue" becomes "the total revenue or sales amount"
  • view: pre-built analysis. Include one whenever the question sounds like a canned report (summary, breakdown, top-N, trend).
    • "sales summary" becomes "a summary of sales metrics"
  • dimensional_value: a literal value the user named, stored in some dimension. search_text is the value itself, the one target where echoing the user's word is right.
    • "CyberArk" stays "CyberArk"
    • Best practice is to scope the call to the source that holds the value. An unscoped value search covers every indexed dimension in scope, so it is slow on a large package. If you truly don't know the source, you can leave the scope off, but expect a slow call.
  • source: data domain, for a question that names a subject area rather than fields (phrasing below).

Resolving categorical values. When the user names a literal value like "premium" or "New York City", send a dimensional_value target for it, scoped to its source once you know the source. Filter on the exact string it returns: the data may store "Premium", "PREMIUM", "NYC", or "New York", and only the data tells you which.

Where value search isn't available. Some servers have no value index and return nothing for a dimensional_value target, and on others a particular dimension's values may not be indexed. Then target the dimension the value lives on ("the subscription tier", "the city where the subscriber lives"), and confirm the exact stored string by querying that dimension's distinct values with execute_query before you filter on it.

Show full SKILL.md (871 more words)Show less

Non-obvious decomposition patterns

These are the rules you won't apply correctly by default:

  1. Adjective + noun, split. "active users" becomes two dimension targets: one for the attribute ("the status of the user account") and one for the noun ("the user or account holder"). Resolve the modifier ("active") to the exact stored value with a dimensional_value target, or the status dimension's distinct values where values aren't indexed.
  2. Ambiguous concept, cover both types. "rating", "duration", and the like could be either a dimension or a measure: create one target of each type.
  3. Time references are dimensions. "last year" becomes a dimension target for the relevant date field ("the date the event occurred").
  4. Numeric ranges are dimensions. "aged 50", "revenue over $1M" become dimension targets; the comparison is applied in the query, not matched as text.
  5. Categorical strings that look numeric are still dimensions. "18-30", "<5 days", "tier 2" are stored as literal strings on a dimension. Target that dimension, then confirm the exact string with a dimensional_value target, or execute_query where values aren't indexed.
  6. "Top N" without a named measure, add a ranking measure. "top 6 products" becomes a measure for the ranking concept ("the performance metric for a product") plus a dimension for the entity. If the measure is explicit ("top products by total sales"), use it directly and skip the generic ranking measure.
  7. Multiple values for one concept, one dimension target. Several values ("premium and basic") still map to a single dimension target for the parent field; confirm the exact stored values with dimensional_value targets, or execute_query where values aren't indexed.
  8. The quantity asked for is a measure, even when nothing names it. "How many titles were released in 2019?" is asking for a count, but no noun in it is the count: the visible phrases are the subject ("titles") and the filter ("2019"), and mapping only those yields a source and a dimension target with no way to answer. Always add a measure target for the quantity itself ("the number of titles"). This holds for every interrogative that IS the aggregation -- "how many", "how much", "how often" -- and it is the pattern most easily lost when a filter or grouping is the loud part of the sentence. Measured: an answerer got this right on "How many titles are in the dataset?" and dropped it on "How many titles were released in 2019?", where the year took the attention.
  9. A population qualifier is a target, and so is the one the question omits. Words like "real", "actual", "genuine", "live" or "production" are not filler: they name rows the model marks for exclusion. Target the flag itself ("the flag marking synthetic, test or monitoring traffic"), not just the noun they modify. Add one such target even when the question carries no qualifier at all, because a table of events, requests, sessions or logs usually holds test, internal or cancelled rows and nothing in the wording will say so. Resolve it to the model's own flag rather than inventing a filter on an id or a name; a hand-rolled exclusion and the documented one rarely select the same rows.

Worked example

User: "Customer churn in NYC over the last year for premium and basic subscribers"

The targets for this question:

target_typesearch_text
measure"the rate at which customers leave the service"
dimension"the city where the subscriber lives"
dimension"the date the subscription was canceled"
dimension"the tier of the subscription"
view"subscriber churn or retention analysis"

Key moves: time ("last year") becomes a dimension on the cancellation date; "NYC" and "premium/basic subscribers" resolve to the city and tier dimensions in this first call, because the source is not known yet and an unscoped value search is slow. One view target is included to surface any canned churn analysis.

The response returns the source these fields live on (here subscriptions) with the matched fields on its card. Then send a second call scoped to subscriptions, with dimensional_value targets for "NYC", "premium" and "basic", to get the exact strings to filter on ("New York City" vs "NYC", "premium" vs "Premium"). Where values aren't indexed, run execute_query on the city and tier dimensions' distinct values instead.

Authoring search_text for source targets

Aim for 3-8 words that name the entity and its business process. Don't include filter values, time ranges, or aggregations: those belong in entity targets.

Too vagueOver-specific (entity-shaped)Good
"orders""total order revenue by customer last year""customer order history and line items"
"customer data""premium subscribers who churned in NYC""subscriber accounts and churn"
"metrics""monthly revenue variance by account""sales pipeline and revenue forecasts"

Heuristics:

  1. Translate, don't echo. "How did sales go last month?" becomes "sales order revenue", not "sales last month".
  2. Differentiate by data shape or business process, not by the user's industry, brand, or product category. Prefer "order fulfillment and shipping" over "ecommerce data" when multiple commerce-ish packages exist. Do NOT add words like "eyewear", "subscription box", "Acme Corp", or the user's specific vertical/brand. Source summaries describe data structure, not the customer's vertical, so those words add noise and can hurt matching.
  3. Retry with alternative phrasings if the right source isn't in the results before concluding it's missing.

© malloydata, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/malloy-phrase-detection of malloydata/publisher.

Open the folder on GitHubat commit b9a1a19

Compare with similar skills

Malloy Phrase Detection next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Malloy Phrase Detection compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Malloy Phrase Detection this skillmalloydata/publisher116—~2.8kAutomated safety check: PassMIT
Iterative Retrievalaffaan-m/ECC276k7 repos~1.6kAutomated safety check: PassMIT
Threat Detectionalirezarezvani/claude-skills28k—~3.5kAutomated safety check: PassMIT
Resemble Detectgithub/awesome-copilot40k3 repos~4.1kAutomated safety check: PassApache-2.0
Pii Detectruvnet/ruflo74k—~350Automated safety check: NotesMIT
Detecting Dnp3 Protocol Anomaliesmukul975/Anthropic-Cybersecurity-Skills34k—~3.6kAutomated safety check: PassApache-2.0

Similar skills

  • Pattern for progressively refining context retrieval to solve the subagent context problem.

    276k GitHub starsUsed in 7 repos~1.6k tokens
    Agent WorkflowsAuto-check passed
  • Threat Detection

    alirezarezvani/claude-skills

    A skill your agent uses when hunting for threats in an environment, analyzing IOCs, or detecting behavioral anomalies in telemetry.

    28k GitHub stars~3.5k tokensUpdated 1 mo ago
    SecurityAuto-check passed
  • Resemble Detect

    github/awesome-copilot

    Official

    Deepfake detection and media safety — detect AI-generated audio, images, video, and text, trace synthesis sources, apply watermarks, verify speaker identity, and analyze media intelligence using…

    40k GitHub starsUsed in 3 repos~4.1k tokens
    Media & CreativeAuto-check passed
  • Pii Detect

    ruvnet/ruflo

    Detect and flag personally identifiable information (PII) in text, code, and configurations.

    74k GitHub stars~350 tokensUpdated today
    Auto-check: notes
  • Detecting Dnp3 Protocol Anomalies

    mukul975/Anthropic-Cybersecurity-Skills

    Detect anomalies in DNP3 communications used in SCADA/ICS systems by monitoring unauthorized control commands, firmware update attempts, protocol violations, and deviations from baseline traffic…

    34k GitHub stars~3.6k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Detecting Attacks On Scada Systems

    mukul975/Anthropic-Cybersecurity-Skills

    This skill covers detecting cyber attacks targeting Supervisory Control and Data Acquisition (SCADA) systems including man-in-the-middle attacks on industrial protocols, unauthorized command…

    34k GitHub stars~6.9k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed

More from malloydata/publisher

All 29 skills in this repo
  • Eval Answer

    malloydata/publisher

    Score one analytical answer against a verified golden, and score which of the entities the golden depends on retrieval delivered to the answerer.

    116 GitHub stars~4.3k tokensUpdated today
    Auto-check passed
  • Fix Scan Finding

    malloydata/publisher

    Fix a CRITICAL Trivy finding that is failing CI in this repo (a vulnerability, misconfiguration, or secret from security-scan.yml or image-scan.yml), or add, review, or retire an entry in…

    116 GitHub stars~5.1k tokensUpdated today
    Auto-check passed
  • Eval Import

    malloydata/publisher

    Turn a list of questions into an eval set, whatever shape it arrived in: a JSONL a customer sent, a CSV, a spreadsheet export, a markdown doc, an email thread, or a pull from production logs.

    116 GitHub stars~5.9k tokensUpdated today
    Auto-check passed
  • Eval Loop

    malloydata/publisher

    Conduct a local Publisher evaluation loop in five steps: scrape/run, eval, diagnose, improve, checkpoint.

    116 GitHub stars~7.8k tokensUpdated today
    Auto-check passed
  • Eval Improve

    malloydata/publisher

    Make the smallest safe Malloy model edit that closes a diagnosed model-owned gap, with a probe receipt for every factual claim.

    116 GitHub stars~2.8k tokensUpdated today
    Auto-check passed
  • Eval Judge

    malloydata/publisher

    Decide whether ONE answer matches its golden, and say whether you believe the golden.

    116 GitHub stars~3.4k tokensUpdated today
    Auto-check passed

Questions about Malloy Phrase Detection

What does Malloy Phrase Detection do?

How to phrase searchtext on a getcontext call so retrieval returns the fields you need instead of a truncated catalog. Malloy Phrase Detection is an agent skill from malloydata/publisher. How to phrase searchtext on a getcontext call so retrieval returns the fields you need instead of a truncated catalog.

How do I install Malloy Phrase Detection in Claude Code?

Run `npx skills add malloydata/publisher --skill malloy-phrase-detection -a claude-code`. Or copy the skill folder (skills/malloy-phrase-detection in malloydata/publisher) into .claude/skills/malloy-phrase-detection in your project. Claude Code loads it when a task matches its description.

How do I install Malloy Phrase Detection in Codex?

Run `npx skills add malloydata/publisher --skill malloy-phrase-detection -a codex`. Or copy the skill folder (skills/malloy-phrase-detection in malloydata/publisher) into .agents/skills/malloy-phrase-detection in your project. Codex loads it when a task matches its description.

Can I use Malloy Phrase Detection in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add malloydata/publisher --skill malloy-phrase-detection -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/malloy-phrase-detection, .gemini/skills/malloy-phrase-detection, .github/skills/malloy-phrase-detection and .opencode/skills/malloy-phrase-detection in your project.

What does Malloy Phrase Detection need to run?

SKILL.md names no scripts, command-line tools or credentials: Malloy Phrase Detection is instructions for the agent only.

Does Malloy Phrase Detection access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Malloy Phrase Detection safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Malloy Phrase Detection use?

Malloy Phrase Detection is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Malloy Phrase Detection use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Malloy Phrase Detection?

Skills that share tags, products or a category with Malloy Phrase Detection: Iterative Retrieval (affaan-m/ECC, 276k stars), Threat Detection (alirezarezvani/claude-skills, 28k stars), Resemble Detect (github/awesome-copilot, 40k stars) and Pii Detect (ruvnet/ruflo, 74k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Malloy Phrase Detection?

malloydata (a GitHub organization) maintains it in malloydata/publisher, which has 116 GitHub stars. The repository holds 29 skills in this directory. The repository was last updated on October 9, 2026.

Source: malloydata/publisher on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.