holistics/anfra-skills

anfra-lookup-values

Verify the exact stored values of a field before filtering on them, guarding against case sensitivity, abbreviations, and typos.

查看源码

使用方法

  1. 复制安装命令,在自己的智能体环境安装前先检查源码包。
  2. 从原始文档核对所需工具、凭据和支持的宿主。
  3. 说明输入材料与期望交付物,并对照来源检查输出。
npx skills add https://github.com/holistics/anfra-skills --skill anfra-lookup-values

开始前需了解

  • 安装不包含模型订阅、API 额度或访问文件的权限。
  • 仓库星数和安装量反映活跃情况,不等于独立质量或安全测试。
仓库原始内容

按源仓库内容呈现,保留标题、案例、代码、表格、链接以及原文引用的演示图片。

Verifying field values before filtering

Before you filter on a value, confirm it actually exists in the data in that exact form. Filtering on a guessed literal ("Second-hand", "male", "VN") silently returns wrong or empty results when the stored form differs.

When to use

  • Any filter on a dimension whose exact stored values you haven't confirmed.
  • Especially categorical / text fields — and even "obvious" ones (a gender

column can still hold unexpected values like "f", "m", "F", "M").

How

  1. Identify the field(s) most likely to carry the concept (check field names,

labels, descriptions). Go from the most likely first.

  1. List the distinct values, narrowing with a case-insensitive

where(... ilike ...) filter. Batch 2–3 candidate patterns in a single query (joined with or) to go faster.

  1. Once you've identified the exact value(s), proceed to the real query. Don't

keep using lookups to compute the answer — write the AQL.

Command (swappable per scenario)

Default (Anfra) — unique() lists a dimension's distinct values; add a case-insensitive where(<model>.<field> ilike '%pattern%') to probe candidates, batching several patterns with or:

sh
# distinct values of a (small) column
anfra query --dataset <uname> 'unique(products.type)'

# batch 2–3 candidate patterns for "second-hand" in one query
anfra query --dataset <uname> "unique(products.type) | where(products.type ilike '%second%' or products.type ilike '%sh%' or products.type ilike '%used%')"
Replace this command for other runtimes if needed. The guidance above is stable; only the command changes.

If nothing matches

If you can't find the concept in any field, ask the user to clarify rather than guessing a value.


anfra skills 0.21.0

来自同一仓库

更多 Skills

全部 Skills