---
name: uchicago-data-analytics-warehouse-exploration
description: Guided warehouse-data exploration for UChicago domains. Use after the parent exploration router selects warehouse data, including SIA, ARD, Workday, AURA, SQL generation, validation, execution, result synthesis, and QA/PROD labeling.
---

# Warehouse Exploration

## Purpose

Guide users through governed warehouse analysis without requiring them to know
tables, SQL, or domain ownership.

## Domain Selection

Present domains from `${CLAUDE_PLUGIN_ROOT}/core/domain_catalog.yaml`:

```text
1. Student Information (SIA) — enrollment, admissions, academic programs
2. Alumni Relations and Development (ARD) — alumni giving, engagement, fundraising
3. HR / Workforce (Workday) — headcount, positions, compensation
4. AURA — cross-functional institutional reporting
5. More than one, or I’m not sure
```

After selection, load:

- `${CLAUDE_PLUGIN_ROOT}/domains/<id>/domain.yaml`
- `${CLAUDE_PLUGIN_ROOT}/domains/<id>/sql_rules.md`

If the topic is not represented by dictionaries, say so directly and offer
feedback capture. Do not invent data structures.

## Exploration Flow

1. Ask what report, decision, or question the user is trying to answer.
2. Resolve business terms before SQL:
   - metric definition
   - population
   - timeframe
   - grain
   - filters
   - comparison/baseline
3. Present a concise confirmed brief and ask for confirmation.
4. If the confirmed brief requires individual-level output, complete the
   governance warning and explicit confirmation gate before generating SQL.
5. Generate SQL only from loaded domain dictionaries and rules.
6. Show SQL before execution.
7. Call `uchicago_analytics_validate_sql`. Set `individual_detail_approved`
   only if the warning gate was completed in this conversation.
8. Execute with `uchicago_analytics_execute_sql` after approval or config
   auto-approval.
   Set `individual_detail_approved` only if the warning gate was completed.
9. Preserve execution metadata: `Environment`, `DSN`, `Max rows`.

## Result Response

Always include:

- Plain-English summary
- Source environment (`QA`, `PROD`, or `UNKNOWN`)
- Data level (`aggregate` or `individual-level`)
- Assumptions
- Main finding
- Caveats and confidence
- One concrete next action

Create a Chart.js HTML report with `uchicago_analytics_save_report` only when a
chart improves understanding. Include environment metadata in the report.

## Cross-Domain Policy

For multiple domains, generate separate queries unless an approved join path is
documented. Synthesize in the response layer.

## Save Point

After confirmed brief, after execution, or after final interpretation, offer to
save analysis state with `uchicago-data-analytics-analysis-state`.
