bsl-query-expert
БесплатноБез исполняемых скриптовНе проверенQuery BSL semantic models with group_by, aggregate, filter, and visualizations. Use for data analysis from existing semantic tables.
Об этом скилле
BSL Query Expert
Query semantic models using BSL. Be concise.
Workflow
list_models()→ discover available modelsget_model(name)→ get schema (REQUIRED before querying)get_documentation("query-methods")→ call before first query to learn syntaxquery_model(query)→ execute, auto-displays results- Brief summary (1-2 sentences max)
Behavior
- Execute queries immediately - don't show code to user
- Never stop after listing models - proceed to query
- Charts/tables auto-display - don't print data inline
- Reuse context: Don't re-call tools if info already in context
- IMPORTANT: If query fails → call
get_documentation("query-methods")to learn correct syntax before retrying
CRITICAL: Field Names
- Use EXACT names from
get_model()output - Joined columns:
t.customers.country(nott.customer_id.country()) - Direct columns:
t.region(nott.model.region) - NEVER invent methods on columns - they don't exist!
CRITICAL: Never Guess Filter Values
- WRONG:
.filter(lambda t: t.region.isin(["US", "EU"]))without checking actual values first - Data uses codes/IDs that differ from what you expect (e.g., "California" might be "CA" or "US-CA")
- Always discover values first, then filter with real data
Multi-Hop Query Pattern
When filtering by names/locations/categories you haven't seen:
Step 1 (discover): query_model(query="model.group_by('region').aggregate('count')", records_limit=50, get_chart=false)
Step 2 (filter): query_model(query="model.filter(lambda t: t.region.isin(['CA','NY'])).group_by('region').aggregate('count')", get_records=false)
- Step 1: Get data to LLM (
records_limit=50), hide chart (get_chart=false) - Step 2: Display to user (
get_records=false), show chart (default)
query_model Parameters
get_records=true(default): Return data to LLM, table auto-displaysget_records=false: Display-only, no data returned to LLMrecords_limit=N: Max records to LLM (increase for discovery queries)get_chart=true(default): Show chart;falsefor table-only
CRITICAL: Exploration vs Final Query
- Discovery/exploration queries: Use
get_chart=false- no chart when exploring data values - Final answer query: Use
get_chart=true(default) - show chart for user's answer - Example: Looking up airport codes? →
get_chart=false. Final flight count? → chart enabled
Charts
- Default: Omit chart_spec - auto-detect handles most cases
- Override only if needed:
chart_spec={"chart_type": "line"}or"bar" - CRITICAL: Charting only works on BSL SemanticQuery results (after group_by + aggregate)
- If you use filter-only queries (returns Ibis Table), set
get_chart=false- charts will fail on raw tables
Time Dimensions
- Use
.truncate()for time columns:with_dimensions(year=lambda t: t.date.truncate("Y")) - Units:
"Y","Q","M","W","D","h","m","s"
CRITICAL: Case Expressions
- Use
ibis.cases()(PLURAL) - NOTibis.case() - Syntax:
ibis.cases((condition1, value1), (condition2, value2), else_=default) - Example:
ibis.cases((t.value > 100, "high"), (t.value > 50, "medium"), else_="low")
Help
get_documentation(topic) for:
- Core: getting-started, semantic-table, yaml-config, profile, compose, query-methods
- Advanced: windowing, bucketing, nested-subtotals, percentage-total, indexing, sessionized, comparison
- Charts: charting, charting-altair, charting-plotly, charting-plotext
Additional Information
Available documentation:
- Getting Started: Introduction to BSL, installation, and basic usage with semantic tables
- Semantic Tables: Building semantic models with dimensions, measures, and expressions
- YAML Configuration: Defining semantic models in YAML files for better organization
- Profiles: Database connection profiles for connecting to data sources
- Composing Models: Joining multiple semantic tables together
- Query Methods: Complete API reference for group_by, aggregate, filter, order_by, limit, mutate
- Window Functions: Running totals, moving averages, rankings, lag/lead, and cumulative calculations
- Bucketing with Other: Create categorical buckets and consolidate long-tail into 'Other' category
- URL: https://github.c
Установить bsl-query-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл bsl-query-expert?
Query BSL semantic models with group_by, aggregate, filter, and visualizations. Use for data analysis from existing semantic tables.
Как установить скилл bsl-query-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bsl-query-expert запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic