Turn a business question into data discovery, SQL, and a plain-English answer. — Claude Skill
A Claude Skill for Claude Code by Astronomer — run /analyzing-data in Claude·Updated Jun 14, 2026·vmain@789b454
Finds the right warehouse concepts and tables, drafts the analysis query, checks assumptions, and returns an answer with caveats a business stakeholder can understand.
- Translates stakeholder questions into metrics, dimensions, filters, and data sources.
- Discovers tables and prior analysis patterns before writing new SQL.
- Returns the answer, caveats, and recommended next analysis in business language.
- Caches useful learnings so repeated questions get easier over time.
A stakeholder asks for a number, but metric definition and source table assumptions stay hidden.
Run /analyzing-data to make definitions, source selection, query logic, result, and caveats visible.
Who this is for
What it does
Answer activation, retention, conversion, or usage questions from warehouse data.
Analyze pipeline, win rate, segment performance, or campaign contribution.
Find the right source tables and definitions before building a dashboard.
How it works
Clarify the decision, metric, segment, date range, and acceptable caveats.
Look up relevant concepts, tables, prior queries, and known definitions.
Draft SQL or analysis steps that match the metric definition.
Validate results against simple reasonableness checks.
Explain the result, caveats, and suggested follow-up.
Input options
The decision the analysis should support.
Example
Question: Did the onboarding checklist improve activation? Definition: activation means workspace invited 2+ teammates and created first project within 7 days. Launch date: June 1. Segments: SMB, mid-market, enterprise. Known tables: product_events, workspaces, accounts. Need: analysis approach, result summary, caveats, and next analysis.
Metric: 7-day activation. Compare workspaces created before June 1 with workspaces created after June 1. Segment by account size. Exclude workspaces created less than 7 days ago because they have not had enough time to activate.
Activation appears to improve after launch in SMB and mid-market. Enterprise moves less clearly because sample size is smaller and sales-assisted onboarding may follow a different path.
| Segment | Before launch | After launch | Change | Readout | |---|---:|---:|---:|---| | SMB | 36% | 44% | +8 pts | Likely positive movement | | Mid-market | 42% | 51% | +9 pts | Strong signal to investigate | | Enterprise | 37% | 42% | +5 pts | Directional only | | All | 38% | 46% | +8 pts | Improvement, not proof of causality |
This is a before/after analysis, not an experiment. Check acquisition mix, seasonality, event tracking stability, and whether workspaces had a full 7-day window.
Break down checklist completion by step. If invite step completion rose, the checklist likely helped. If only traffic mix changed, do not credit the checklist yet.
Metrics this improves
Works with
Want to use Analyzing Data?
Choose how to get started.
Install and run this skill locally on your computer.
Open a terminal on your computer and paste this command:
This downloads the skill with all its files to your computer:
Add -g at the end to make it available in all your projects.
Start Claude Code, then type the command:
Data Analysis
Answer business questions by querying the data warehouse. The kernel auto-starts on first exec call.
All CLI commands below are relative to this skill's directory. Before running any scripts/cli.py command, cd to the directory containing this file.
Workflow
-
Pattern lookup — Check for a cached query strategy:
uv run scripts/cli.py pattern lookup "<user's question>"If a pattern exists, follow its strategy. Record the outcome after executing:
uv run scripts/cli.py pattern record <name> --success # or --failure -
Concept lookup — Find known table mappings:
uv run scripts/cli.py concept lookup <concept> -
Table discovery — If cache misses, search the codebase (
Grep pattern="<concept>" glob="**/*.sql") or queryINFORMATION_SCHEMA. See reference/discovery-warehouse.md. -
Execute query:
uv run scripts/cli.py exec "df = run_sql('SELECT ...')" uv run scripts/cli.py exec "print(df)" -
Cache learnings — Always cache before presenting results:
# Cache concept → table mapping uv run scripts/cli.py concept learn <concept> <TABLE> -k <KEY_COL> # Cache query strategy (if discovery was needed) uv run scripts/cli.py pattern learn <name> -q "question" -s "step" -t "TABLE" -g "gotcha" -
Present findings to user.
Kernel Functions
| Function | Returns |
|---|---|
run_sql(query, limit=100) | Polars DataFrame |
run_sql_pandas(query, limit=100) | Pandas DataFrame |
pl (Polars) and pd (Pandas) are pre-imported.
CLI Reference
Kernel
uv run scripts/cli.py warehouse list # List warehouses
uv run scripts/cli.py start [-w name] # Start kernel (with optional warehouse)
uv run scripts/cli.py exec "..." # Execute Python code
uv run scripts/cli.py status # Kernel status
uv run scripts/cli.py restart # Restart kernel
uv run scripts/cli.py stop # Stop kernel
uv run scripts/cli.py install <pkg> # Install package
Concept Cache
uv run scripts/cli.py concept lookup <name> # Look up
uv run scripts/cli.py concept learn <name> <TABLE> -k <KEY_COL> # Learn
uv run scripts/cli.py concept list # List all
uv run scripts/cli.py concept import -p /path/to/warehouse.md # Bulk import
Pattern Cache
uv run scripts/cli.py pattern lookup "question" # Look up
uv run scripts/cli.py pattern learn <name> -q "..." -s "..." -t "TABLE" -g "gotcha" # Learn
uv run scripts/cli.py pattern record <name> --success # Record outcome
uv run scripts/cli.py pattern list # List all
uv run scripts/cli.py pattern delete <name> # Delete
Table Schema Cache
uv run scripts/cli.py table lookup <TABLE> # Look up schema
uv run scripts/cli.py table cache <TABLE> -c '[...]' # Cache schema
uv run scripts/cli.py table list # List cached
uv run scripts/cli.py table delete <TABLE> # Delete
Cache Management
uv run scripts/cli.py cache status # Stats
uv run scripts/cli.py cache clear [--stale-only] # Clear
References
- reference/discovery-warehouse.md — Large table handling, warehouse exploration, INFORMATION_SCHEMA queries
- reference/common-patterns.md — SQL templates for trends, comparisons, top-N, distributions, cohorts
Reference documents
name: analyzing-data description: Queries data warehouse and answers business questions about data. Handles questions requiring database/warehouse queries including "who uses X", "how many Y", "show me Z", "find customers", "what is the count", data lookups, metrics, trends, or SQL analysis.
Data Analysis
Answer business questions by querying the data warehouse. The kernel auto-starts on first exec call.
All CLI commands below are relative to this skill's directory. Before running any scripts/cli.py command, cd to the directory containing this file.
Workflow
-
Pattern lookup — Check for a cached query strategy:
uv run scripts/cli.py pattern lookup "<user's question>"If a pattern exists, follow its strategy. Record the outcome after executing:
uv run scripts/cli.py pattern record <name> --success # or --failure -
Concept lookup — Find known table mappings:
uv run scripts/cli.py concept lookup <concept> -
Table discovery — If cache misses, search the codebase (
Grep pattern="<concept>" glob="**/*.sql") or queryINFORMATION_SCHEMA. See reference/discovery-warehouse.md. -
Execute query:
uv run scripts/cli.py exec "df = run_sql('SELECT ...')" uv run scripts/cli.py exec "print(df)" -
Cache learnings — Always cache before presenting results:
# Cache concept → table mapping uv run scripts/cli.py concept learn <concept> <TABLE> -k <KEY_COL> # Cache query strategy (if discovery was needed) uv run scripts/cli.py pattern learn <name> -q "question" -s "step" -t "TABLE" -g "gotcha" -
Present findings to user.
Kernel Functions
| Function | Returns |
|---|---|
run_sql(query, limit=100) | Polars DataFrame |
run_sql_pandas(query, limit=100) | Pandas DataFrame |
pl (Polars) and pd (Pandas) are pre-imported.
CLI Reference
Kernel
uv run scripts/cli.py warehouse list # List warehouses
uv run scripts/cli.py start [-w name] # Start kernel (with optional warehouse)
uv run scripts/cli.py exec "..." # Execute Python code
uv run scripts/cli.py status # Kernel status
uv run scripts/cli.py restart # Restart kernel
uv run scripts/cli.py stop # Stop kernel
uv run scripts/cli.py install <pkg> # Install package
Concept Cache
uv run scripts/cli.py concept lookup <name> # Look up
uv run scripts/cli.py concept learn <name> <TABLE> -k <KEY_COL> # Learn
uv run scripts/cli.py concept list # List all
uv run scripts/cli.py concept import -p /path/to/warehouse.md # Bulk import
Pattern Cache
uv run scripts/cli.py pattern lookup "question" # Look up
uv run scripts/cli.py pattern learn <name> -q "..." -s "..." -t "TABLE" -g "gotcha" # Learn
uv run scripts/cli.py pattern record <name> --success # Record outcome
uv run scripts/cli.py pattern list # List all
uv run scripts/cli.py pattern delete <name> # Delete
Table Schema Cache
uv run scripts/cli.py table lookup <TABLE> # Look up schema
uv run scripts/cli.py table cache <TABLE> -c '[...]' # Cache schema
uv run scripts/cli.py table list # List cached
uv run scripts/cli.py table delete <TABLE> # Delete
Cache Management
uv run scripts/cli.py cache status # Stats
uv run scripts/cli.py cache clear [--stale-only] # Clear
References
- reference/discovery-warehouse.md — Large table handling, warehouse exploration, INFORMATION_SCHEMA queries
- reference/common-patterns.md — SQL templates for trends, comparisons, top-N, distributions, cohorts