agents/dashboard-builder/SKILL.md
Creates feature dashboards in Hex Threads. Given a feature name (and optionally a PRD, Figma link, or context), discovers events, builds a metric spec, gets human approval, and instructs Hex to build charts using business context. Hex writes its own SQL — Claude provides context, table/event names, and exact segmentation logic. Use when someone asks to create, build, or generate a feature dashboard.
npx skillsauth add lightricks/ltx-analytics-agents dashboard-builderInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Key difference from v1: Claude no longer writes exact SQL for every metric. Instead, Claude provides Hex with rich business context, table names, event names, metric definitions, and exact segmentation CTEs. Hex writes the SQL itself.
A Hex Thread serving as the dashboard, containing:
PHASE 1: DISCOVER → Feature Brief
↓
PHASE 2: PLAN → Dashboard Spec + Hex Context Brief
↓
✋ HUMAN APPROVES SPEC
↓
PHASE 3: BUILD → Hex Thread (business context, Hex writes SQL)
↓
PHASE 4: VALIDATE → QA Report + Slack notification
Goal: Build a Feature Brief with verified events.
Gather inputs from the user:
Look up events in the registry:
shared/event-registry.yamlQuery Figma (if link provided):
Search codebase (if GitHub available):
analytics.track, logEvent, trackEventSearch Slack for context (via Slack MCP):
Build or load a Data Spec:
docs/{feature}_spec.md already exists.claude/skills/build-data-spec/SKILL.md) to create one by exploring the dbt codebase at ~/dwh-data-model-transformsPresent Feature Brief using template from agents/dashboard-builder/templates/feature-brief.md:
DO NOT proceed to Phase 2 without user confirming the Feature Brief.
Goal: Build a Dashboard Spec and prepare the Hex Context Brief.
Read shared files:
shared/metric-standards.md — metric definitions and calculation logicshared/bq-schema.md — table names, columns, joinsDetermine metric set.
Every feature gets:
shared/bq-schema.md)Feature-specific metrics — evaluate per feature:
Look at the event's key_properties in shared/event-registry.yaml.
Properties suggest additional metrics:
fetch_result → success rate (NOTE: column name is fetch_result not result)tokens / be_cost → avg cost per actionis_applied → apply rate (applied / total views)video_duration_seconds → avg durationmodel_name / model_gen_type → breakdown by modelPropose feature-specific metrics to the user — they must approve before inclusion.
If unsure about funnel steps or retention events, ask the user.
Define filters:
shared/bq-schema.md)Build dashboard mockup — show the full layout based on the metrics determined in step 2:
┌──────────────────────────────────────────────────┐
│ {Feature Name} Dashboard │
│ Filters: {list filters from step 3} │
├──────────────────────────────────────────────────┤
│ USAGE │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ DAU │ │ Actions/ │ │ Adoption rate │ │
│ │ (line) │ │ user │ │ (line or KPI) │ │
│ └──────────┘ └──────────┘ └──────────────────┘ │
├──────────────────────────────────────────────────┤
│ FUNNEL │
│ ┌──────────────────────────────────────────────┐│
│ │ {Step 1} → {Step 2} → ... → {Step N} ││
│ └──────────────────────────────────────────────┘│
├──────────────────────────────────────────────────┤
│ RETENTION │
│ ┌──────────────────────────────────────────────┐│
│ │ Cohort × Day-N heatmap ││
│ └──────────────────────────────────────────────┘│
├──────────────────────────────────────────────────┤
│ SEGMENTATION │
│ ┌──────────────────────────────────────────────┐│
│ │ {Main metric} by user segment (stacked bar) ││
│ └──────────────────────────────────────────────┘│
├──────────────────────────────────────────────────┤
│ FEATURE-SPECIFIC (if approved in step 2) │
│ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ │
│ │ {metric} │ │ {metric} │ │ {metric} │ │
│ └──────────┘ └──────────┘ └──────────────────┘ │
└──────────────────────────────────────────────────┘
Adapt the mockup to the actual metrics.
Prepare the Hex Context Brief — this is what Hex will receive in the initial message. Compile:
ltx-dwh-prod-processed.web.ltxstudio_user_all_actionsshared/bq-schema.md)shared/bq-schema.md)shared/bq-schema.md lines 441-516 (verbatim — see Phase 3 step 0)lt_id as user ID, exclude LT team (is_lt_team IS FALSE), filter on partition columns, exclude today's incomplete data, use SAFE_DIVIDE for percentagesPresent full spec using template from agents/dashboard-builder/templates/dashboard-spec.md and dashboard mockup including filters
DO NOT proceed to Phase 3 without explicit user approval ("yes", "go ahead", "approved"). Incorporate any feedback before proceeding.
Goal: Create the dashboard in Hex via Threads MCP. Hex writes the SQL — Claude provides context and guidance.
Prepare Segmentation Logic (if dashboard includes user segmentation):
shared/bq-schema.md lines 441-516 to extract the segmentation CTEsent_users and ent_users_final)heavy_users_over_time with weeks helper)Read agents/dashboard-builder/hex-prompts/patterns.md — follow prompt patterns for how to communicate with Hex.
Start the Thread with create_thread:
Add each metric with continue_thread:
Poll get_thread after each message until status = "idle"
continue_thread
shared/bq-schema.md. If you can't resolve the error after 2 attempts, escalate to the human user.AGENT_OVERLOADED or capacity errors: wait 1 minute, then continue_thread with "try again" and restate the full context. Do NOT fall back to writing SQL queries — always let Hex write its own SQL.Run data quality checks after each query executes:
Known blocker: Hex MCP cannot convert a Thread into a Hex Project. After the Thread is complete, the user must do this manually in Hex (Thread → Save as Project).
Goal: Detect and report data quality issues during query execution.
After each metric executes in Hex, review the results and check for:
lt_id, action_ts, metric values)shared/metric-standards.md.shared/bq-schema.mdGoal: Check output and share with stakeholders.
Do a final get_thread to review the complete Thread.
Check for issues:
Ask Hex to validate and optimize its own queries:
continue_thread message asking Hex to review all SQL queries in the Threadaction_ts filters are applied for BigQuery performanceAPPROX_COUNT_DISTINCT where exact counts aren't neededAggregate data quality warnings:
Report to user:
✅ Dashboard created: {Thread URL}
Metrics: {metrics},
Segmentation by {dimensions}
⚠️ Data Quality Issues (if any):
Critical:
- {Schema errors, missing data, invalid values}
Warnings:
- {Small sample sizes, date gaps, NULL values}
Info:
- {Performance suggestions}
Manual step needed:
- Convert Thread to Hex Project for long-term use
Next steps:
- {Suggested additions or improvements}
Write a Hex Project organization prompt for the user:
Draft a stakeholder summary message:
| File | Read in phase |
|------|---------------|
| shared/product-context.md | Phase 1 |
| shared/bq-schema.md | Phase 2, Phase 3 (segmentation CTEs) |
| shared/event-registry.yaml | Phase 1 |
| shared/metric-standards.md | Phase 2 |
| File | Read in phase |
|------|---------------|
| docs/{feature}_spec.md (if exists) | Phase 1, Phase 2 |
| .claude/skills/build-data-spec/SKILL.md | Phase 1 (if spec missing) |
| agents/dashboard-builder/hex-prompts/patterns.md | Phase 3 |
| agents/dashboard-builder/templates/feature-brief.md | Phase 1 |
| agents/dashboard-builder/templates/dashboard-spec.md | Phase 2 |
shared/event-registry.yaml or confirmed by user.lt_id. Never anonymous_id. Tell Hex this explicitly.action_name_detailed for generation filtering. When filtering for specific generation types (e.g., generate_video, generate_image), always use action_name_detailed, NOT action_name. Hex tends to default to action_name which can produce incorrect results. Tell Hex this explicitly in the context message and correct it if it uses the wrong column.development
Adds the analyst layer (segmentation framing, filter/KPI surfacing, LTX-specific definitions, contextual follow-ups) on top of any Data MasterMind data interaction for LTX stakeholders (PMs, marketers, design, leadership). Wraps `get-data` / `validate-data` / `understand-data` / `visualize-data` — dialing intensity from a full guided session (for "look into X", "investigate Y", "do an analysis of …") down to a compressed wrap (for "what's MRR?", "is this number right?"). Output mode (chat-only or HTML artifact) is chosen up front for session-style asks. Always asks about Enterprise / paid non-Enterprise / Free segmentation and Studio-feature tier-gating when relevant. Do NOT use only when the user explicitly opts out ("just give me the number, no extras") or for templated feature dashboards (that's the Hex-based `dashboard-builder`).
testing
Generate LTX Studio sales opportunities report and credit limit alerts. Covers pipeline by rep/product (yesterday + QTD), new PELs/PQLs, future meetings, and enterprise orgs at 80%+ token usage. Use when: sales standup, pipeline review, account health check, or when asked for 'sales numbers' or 'credit alerts'.
data-ai
Generate LTX Studio product daily report with revenue, usage by segment (Enterprise, Pilot, Paying Non-Enterprise, Free), and DoD/DOW-avg comparisons. Use when: daily product standup, executive reporting, or when asked for 'yesterday's product numbers'.
data-ai
Generate LTX Studio marketing & sales daily report with lead gen, spend, PELs/PQLs, sales metrics, and top org usage vs 7-day averages. Use when: daily marketing standup, GTM review, or when asked for 'marketing numbers' or 'lead performance'.