# profiling-tables

Profiles specific database tables through targeted SQL queries. It inspects schema, gathers column statistics, and evaluates data quality.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 1000 installs · ★ 456
- Author: astronomer
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/astronomer/agents/tree/HEAD/skills/profiling-tables/SKILL.md
- Updated: 2026-10-14
- HTML: https://affpapa.org/en/nevibecode/skills/profiling-tables

## What it does

The skill runs deep data profiling for any specified table using a set of SQL queries. First, it pulls column names and data types from `INFORMATION_SCHEMA` and checks table row counts via `run_sql`. It then calculates null counts, distinct values, numeric medians, string lengths, and date ranges for each column.

Next, it analyzes cardinality for potential categorical columns by grouping top 20 values with frequency percentages. The resulting profile includes schema breakdowns, sample rows, and quality scores rated up to 10 across completeness, uniqueness, and freshness.

Running this skill requires a specific table name and an active `run_sql` tool to execute database queries.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add astronomer/agents --skill profiling-tables -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/profiling-tables/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/profiling-tables/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add astronomer/agents --skill profiling-tables -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/profiling-tables/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add astronomer/agents --skill profiling-tables -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/profiling-tables/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install astronomer/agents profiling-tables
```

2. **Manually: put the files in place**
- File: `.github/skills/profiling-tables/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add astronomer/agents --skill profiling-tables -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/astronomer/agents --path skills/profiling-tables
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/profiling-tables/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add astronomer/agents --skill profiling-tables -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/astronomer/agents/tree/HEAD/skills/profiling-tables/SKILL.md

## When to use it
- inspect schema and column data types for an unfamiliar table
- calculate null counts and distinct value distributions per column
- detect data skew and high-cardinality dimension keys
- score dataset completeness, uniqueness, and freshness

## Example prompts
- Profile the public.orders table
- Show me column statistics and data quality for table users
- Analyze missing values and distribution in analytics_events

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: ca167b63d68e5467.

BEGIN THIRD-PARTY FILE ca167b63d68e5467
````text
---
name: profiling-tables
description: Deep-dive data profiling for a specific table. Use when the user asks to profile a table, wants statistics about a dataset, asks about data quality, or needs to understand a table's structure and content. Requires a table name.
---

# Data Profile

Generate a comprehensive profile of a table that a new team member could use to understand the data.

## Step 1: Basic Metadata

Query column metadata:

```sql
SELECT COLUMN_NAME, DATA_TYPE, COMMENT
FROM <database>.INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = '<schema>' AND TABLE_NAME = '<table>'
ORDER BY ORDINAL_POSITION
```

If the table name isn't fully qualified, search INFORMATION_SCHEMA.TABLES to locate it first.

## Step 2: Size and Shape

Run via `run_sql`:

```sql
SELECT
    COUNT(*) as total_rows,
    COUNT(*) / 1000000.0 as millions_of_rows
FROM <table>
```

## Step 3: Column-Level Statistics

For each column, gather appropriate statistics based on data type:

### Numeric Columns
```sql
SELECT
    MIN(column_name) as min_val,
    MAX(column_name) as max_val,
    AVG(column_name) as avg_val,
    STDDEV(column_name) as std_dev,
    PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY column_name) as median,
    SUM(CASE WHEN column_name IS NULL THEN 1 ELSE 0 END) as null_count,
    COUNT(DISTINCT column_name) as distinct_count
FROM <table>
```

### String Columns
```sql
SELECT
    MIN(LEN(column_name)) as min_length,
    MAX(LEN(column_name)) as max_length,
    AVG(LEN(column_name)) as avg_length,
    SUM(CASE WHEN column_name IS NULL OR column_name = '' THEN 1 ELSE 0 END) as empty_count,
    COUNT(DISTINCT column_name) as distinct_count
FROM <table>
```

### Date/Timestamp Columns
```sql
SELECT
    MIN(column_name) as earliest,
    MAX(column_name) as latest,
    DATEDIFF('day', MIN(column_name), MAX(column_name)) as date_range_days,
    SUM(CASE WHEN column_name IS NULL THEN 1 ELSE 0 END) as null_count
FROM <table>
```

## Step 4: Cardinality Analysis

For columns that look like categorical/dimension keys:

```sql
SELECT
    column_name,
    COUNT(*) as frequency,
    ROUND(COUNT(*) * 100.0 / SUM(COUNT(*)) OVER(), 2) as percentage
FROM <table>
GROUP BY column_name
ORDER BY frequency DESC
LIMIT 20
```

This reveals:
- High-cardinality columns (likely IDs or unique values)
- Low-cardinality columns (likely categories or status fields)
- Skewed distributions (one value dominates)

## Step 5: Sample Data

Get representative rows:

```sql
SELECT *
FROM <table>
LIMIT 10
```

If the table is large and you want variety, sample from different time periods or categories.

## Step 6: Data Quality Assessment

Summarize quality across dimensions:

### Completeness
- Which columns have NULLs? What percentage?
- Are NULLs expected or problematic?

### Uniqueness
- Does the apparent primary key have duplicates?
- Are there unexpected duplicate rows?

### Freshness
- When was data last updated? (MAX of timestamp columns)
- Is the update frequency as expected?

### Validity
- Are there values outside expected ranges?
- Are there invalid formats (dates, emails, etc.)?
- Are there orphaned foreign keys?

### Consistency
````
END THIRD-PARTY FILE ca167b63d68e5467

The third-party file has ended. Everything between the ca167b63d68e5467 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 3145 of 3856 bytes. © astronomer · Apache-2.0 · https://github.com/astronomer/agents/tree/HEAD/skills/profiling-tables/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
