gen-metrics

Solid

Interactively define MetricFlow metrics from natural language business descriptions

Data & Documents 1,250 stars 195 forks Updated today NOASSERTION

Install

View on GitHub

Quality Score: 89/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Define Metric Skill Guide the user through interactive metric definition using natural language business descriptions. ## Phase 0: Discovery — Scan Existing Assets Before anything else, call `list_metrics()` to get all metrics already in the knowledge base. Note their names, types, and associated measures. Use this throughout the remaining phases to: - **Skip redundant work** — don't recreate metrics that already exist - **Reuse existing measures** — reference measures from existing models instead of creating duplicates - **Detect conflicts** — warn the user if a proposed metric name collides with an existing one - **Enable derived/ratio metrics** — know which metrics can serve as building blocks for more complex definitions ## Phase 1: Understand Intent (MANDATORY ask_user) Analyze the user's request, then **ALWAYS call `ask_user`** to confirm before proceeding. This phase supports two input modes: ### Input Mode Detection - **Single mode**: User describes one metric or provides one SQL → follow Step 1a–1d below - **Batch mode**: User provides multiple SQL queries (pasted directly, or a CSV file path containing `question` + `sql` columns) → follow Step 1-batch below ### Single Mode: Step 1a–1d **Step 1a: Inspect the table** — Call `describe_table(table_name)` to understand the columns and types. Optionally call `read_query` to sample data. **Step 1b: Ask for reference SQL (optional)** — Use `ask_user` to ask: > "Do you have any existing SQL queries for this table...

Details

Author
Datus-ai
Repository
Datus-ai/Datus-agent
Created
10 months ago
Last Updated
today
Language
Python
License
NOASSERTION

Similar Skills

Semantically similar based on skill content — not just same category