analyzing-data
Queries a data warehouse using SQL to answer business questions about metrics, trends, and aggregations.
Identity proven by GitHub's verified organisation badge (astronomer)
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode
- License
- Apache-2.0 (permissive)
- Pin
- 486ee63pinned Oct 9, 2026
- Context cost
- about 1,200 tokenswhen the skill loads
- GitHub stars
- 451on astronomer/agents
- Scripts
- 24 scripts
What it does
“Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example "who uses X", "how many Y", "show me Z", "find customers", "what is the count").”
Generated summary from the skill's own text
Queries a data warehouse using SQL to answer business questions about metrics, trends, and aggregations. The skill provides CLI tools to discover tables, cache query patterns and concepts, and execute SQL through a managed kernel that auto-starts and handles concurrent queries.
When to use it
- Answering questions requiring warehouse counts, metrics, or aggregations
- Finding data across multiple joined tables or performing ad-hoc analysis
- Looking up customers, users, or other entities matching criteria
- Analyzing trends and generating reports from historical data
When not to
- Working with data warehouses not already configured in the environment
- Needing real-time data updates faster than warehouse query latency allows
- Performing tasks that do not require structured SQL query execution
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add astronomer/agents --skill analyzing-dataInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install astronomer/agents analyzing-data@486ee63d01f8126c52fbc92c36cd36ec31708dcdInstalls the commit we checked (486ee63).
Copy by hand
Download the folder at 486ee63 and put it in .claude/skills/analyzing-data for Claude Code and in .agents/skills/analyzing-data for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install astronomer-data-agents@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install data@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Claude Code plugin
/plugin install data-engineering@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "analyzing-data" by Astronomer. Source, pinned to commit 486ee63d01f8126c52fbc92c36cd36ec31708dcd: https://github.com/astronomer/agents/tree/486ee63d01f8126c52fbc92c36cd36ec31708dcd/skills/analyzing-data 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/analyzing-data/ for Claude Code and .agents/skills/analyzing-data/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/astronomer/analyzing-data
SKILL.md at the pin
---
name: analyzing-data
description: Queries the data warehouse with SQL and answers business questions about data. Use when answering anything that needs warehouse data - counts, metrics, trends, aggregations, joins across tables, data lookups, or ad-hoc SQL analysis (for example "who uses X", "how many Y", "show me Z", "find customers", "what is the count").
---
# 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
1. **Pattern lookup** — Check for a cached query strategy:
```bash
uv run scripts/cli.py pattern lookup "<user's question>"
```
If a pattern exists, follow its strategy. Record the outcome after executing:
```bash
uv run scripts/cli.py pattern record <name> --success # or --failure
```
2. **Concept lookup** — Find known table mappings:
```bash
uv run scripts/cli.py concept lookup <concept>
```
3. **Table discovery** — If cache misses, search the codebase (`Grep pattern="<concept>" glob="**/*.sql"`) or query `INFORMATION_SCHEMA`. See [reference/discovery-warehouse.md](reference/discovery-warehouse.md).
4. **Execute query**:
```bash
uv run scripts/cli.py exec "df = run_sql('SELECT ...')"
uv run scripts/cli.py exec "print(df)"
```
5. **Cache learnings** — Always cache before presenting results:
```bash
# 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"
```
6. **Present findings** to user.
## Kernel Functions
| Function | Returns |
|----------|---------|
| `run_sql(query, limit=100)` | Polars DataFrame |
| `run_sql_pandas(query, limit=100)` | Pandas DataFrame |
| `run_sql_many(queries, limit=100)` | List of Polars DataFrames (one per query) |
`pl` (Polars) and `pd` (Pandas) are pre-imported.
**Run independent queries together** with `run_sql_many` — they execute concurrently (Snowflake async / connection-pool fan-out) instead of one at a time:
```bash
uv run scripts/cli.py exec "dfs = run_sql_many(['SELECT ...', 'SELECT ...']); print(dfs[0])"
```
`run_sql_many` is **fail-fast**: if any query errors, the call raises and the results of the queries that succeeded are discarded. Use separate `run_sql` calls if you need partial results.
**Timeouts:** `exec` waits up to 120s by default, then interrupts the query and returns a "client stopped waiting" message (the query may still finish server-side). Raise it for known long-running queries: `uv run scripts/cli.py exec "..." -t 600`.
**Idle kernel:** the kernel self-terminates after 2h idle (preserving state until then). Override with `ASTRO_KERNEL_IDLE_TIMEOUT` (seconds; `0` disables).
## CLI Reference
### Kernel
```bash
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
```bash
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
```bash
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
```bash
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
```bash
uv run scripts/cli.py cache status # Stats
uv run scripts/cli.py cache clear [--stale-only] # Clear
```
## References
- [reference/discovery-warehouse.md](reference/discovery-warehouse.md) — Large table handling, warehouse exploration, INFORMATION_SCHEMA queries
- [reference/common-patterns.md](reference/common-patterns.md) — SQL templates for trends, comparisons, top-N, distributions, cohorts
From astronomer/agents at 486ee63, shown as plain text under its license: Apache-2.0 (permissive). The license text is in LICENSE.
View SKILL.md on GitHub at 486ee63Files
- SKILL.md5.1 KB · 27643c365be0
- reference/
- common-patterns.md1.7 KB · 6b0bd8eb04ef
- discovery-warehouse.md4.3 KB · 547e2d74a33d
- scripts/
- .gitignore8 B · f49c88d5919b
- cache.py10.0 KB · a3b740f8bae0
- cli.py14 KB · 435c684932ab
- config.py2.0 KB · 9dc069547639
- connectors.py31 KB · 90ae97dbf423
- kernel.py16 KB · 3710d891ebf1
- pyproject.toml618 B · b13305ab60fe
- templates.py4.3 KB · 6b2e397be7a6
- tests/
- __init__.py45 B · 4f803dd48641
- conftest.py240 B · 560b00cc1297
- integration/
- __init__.py49 B · e2055718ce8f
- conftest.py1.5 KB · 2a8c57c8fbaa
- test_duckdb_e2e.py3.7 KB · 654f9468687e
- test_kernel_interrupt.py2.3 KB · 62958c65f9fa
- test_postgres_e2e.py3.8 KB · 6bc0c5d24625
- test_sqlite_e2e.py4.5 KB · fdfc10e33135
- test_cache.py7.9 KB · 8ac218504157
- test_config.py5.4 KB · ee75463fc2e0
- test_connectors.py44 KB · f9e4bfce869b
- test_kernel.py7.0 KB · 4713828ba470
- test_utils.py2.4 KB · 4b88ebfb54e9
- test_warehouse.py4.3 KB · 81d2dffd00c9
- ty.toml644 B · a6c9848b2f32
- warehouse.py1.6 KB · 0c917be01e98
27 files, 178 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 486ee63More from Astronomer
airflow
This skill uses the `af` CLI to query, manage, and troubleshoot Apache Airflow instances.
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.6K tokens · pinned 6 days ago
airflow-adapter
This skill provides an adapter layer that automatically detects whether an agent is connected to Airflow 2.x or 3.x and routes API calls to the correct…
Claude Code · about 170 tokens · pinned 6 days ago
airflow-hitl
Implements human-in-the-loop workflows in Airflow 3.1+ using deferrable operators that pause DAGs and collect human decisions via the UI or REST API.
Claude Code, Codex, Cursor +4 · about 1.7K tokens · pinned 6 days ago
airflow-plugins
Builds Airflow 3.1+ plugins that embed FastAPI apps, custom UI pages, React components, middleware, macros, and operator links directly into the Airflow UI…
Claude Code, Codex, Cursor +4 · about 5.8K tokens · pinned 6 days ago
airflow-state-store
Helps agents work with Airflow 3.3's task and asset state stores for persisting coordination state across task retries, implementing crash-safe external job…
Claude Code, Codex, Cursor +4 · about 5.9K tokens · pinned 6 days ago
annotating-task-lineage
Add data lineage annotations to Airflow tasks using inlets and outlets, enabling tracking of data flow through datasets from various sources like Snowflake…
Claude Code, Codex, Cursor +4 · about 2.8K tokens · pinned 6 days ago
Related in Data and databases
data-table-manager
This skill manages n8n Data Tables through creation, import, querying, and mutation operations.
by n8nOfficial publisher
Claude Code, Codex, Cursor +3 · about 2.1K tokens · pinned 6 days ago
algolia-automation
This skill automates Algolia search and indexing operations through the Rube MCP interface.
by ComposioOfficial publisher
Claude Code, Codex, Cursor +3 · about 690 tokens · pinned 6 days ago
expo-sqlite
This skill enables SQLite database operations in Expo and React Native apps for structured data storage, offline queues, and persistent caches.
by ExpoOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.6K tokens · pinned 6 days ago
prisma-8
This skill helps agents work with Prisma 8, a contract-first data layer for TypeScript projects.
by PrismaOfficial publisher
Contains scripts
Claude Code, Codex, Cursor +3 · about 3.5K tokens · pinned 6 days ago
analyzing-experiment-session-replays
This skill enables agents to analyze session recordings from experiment variants to identify behavioral differences between control and test groups.
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 2.3K tokens · pinned 6 days ago
auditing-warehouse-view-health
Audits materialized views in a PostHog data warehouse to identify failed views and flag unused ones that waste compute resources.
by PostHogOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.4K tokens · pinned 6 days ago