Set up tracking

From gethouston/houston · View interactive version

Set up tracking is an AI agent skill from the GitHub repository gethouston/houston. Set up the operational tracking you need so you're not flying blind. Pick what you need: a single metric I snapshot daily against your warehouse, or a full dashboard spec with sections, visualizations, cadence, and read-only SQL behind every chart. I draft the spec, you or your BI tool renders it.

How to use this skill

Skill file

Set Up Tracking

One skill for the tracking you need. scope param picks the shape: a single metric definition with daily snapshots, or a full dashboard spec (sections + visualizations + cadence + SQL per viz). Both write read-only SQL only and ground in your operating context.

Parameter: `scope`

User names scope in plain English ("track monthly revenue", "watch weekly active users", "spec a growth dashboard", "I want to see retention regularly") -> infer. Ambiguous -> ask ONE question naming both options.

When to use

metric:

dashboard:

Connections I need

I run external work through Composio. Before this skill runs I check the categories below are linked. Missing -> I name the category, ask you to connect it from the Integrations tab, stop.

For scope=metric I stop if no warehouse is connected. For scope=dashboard I never block - it produces a spec, not a rendered dashboard.

Information I need

I read your operations context first. For every required field that's missing I ask ONE plain-language question (best modality: connected app > file drop > URL > paste) and wait.

Steps

<!-- houston-workflow:v1 -->

Shared steps (both scopes)

  1. Read context/operations-context.md. If missing or empty, stop. Ask user to run set-up-my-ops-info first.

Branch on `scope`:

`metric`
  1. Clarify if needed. If phrasing ambiguous ("monthly revenue" could be billing-based, contract-based, or annual revenue / 12), ask ONE tight question. Else proceed.
  1. Identify source. Read config/data-sources.json. If user didn't name source, pick most likely from config/business-context.md (warehouse for core business metrics, product DB for engagement).
  1. Check existing metrics. Read config/metrics.json. If a metric with the same slug or overwhelmingly similar name exists, tell user, offer update instead of duplicate.
  1. Confirm schema. Read config/schemas.json for referenced tables. If entries missing, lazy-introspect (same pattern as ask-a-data-question step 3).
  1. Draft SQL. Return SELECT resolving to single numeric value for given date. Use {{date}} placeholder, scheduler substitutes at run time. Example (BigQuery dialect):

```sql

SELECT SUM(amount) AS value

FROM project.dataset.subscriptions

WHERE state = 'active'

AND start_date <= DATE('{{date}}')

AND (end_date IS NULL OR end_date > DATE('{{date}}'))

```

  1. Self-check read-only. Scan for forbidden DML/DDL keywords. Refuse if any appear.
  1. Capture cadence, direction, unit. Ask ONE question if not specified:

Do NOT hardcode thresholds - leave thresholds empty; if user wants custom sigma for anomaly detection, override later.

  1. Append metric definition to config/metrics.json. Also register reusable query under queries/{metric-slug}/ for audit (ask-a-data-question reuses it). Update queries.json.
  1. Snapshot now. Execute SQL with {{date}} = today (warehouse timezone, default UTC). Append to metrics-daily.json with { id, metricId, date, value, changeVsPrev, changeVs7dAvg, changeVs28dAvg, createdAt }. First-snapshot change fields null.
  1. Backfill if asked. If user said "backfill last N days," loop SQL across dates, append each snapshot. Warn on cost first (compare total estimated scanned bytes vs ceiling).
  1. Append to outputs.json with type: "metric-definition", status "ready".
  1. Report. Current value + cadence + where it shows on dashboard + note that analyze-my-data subject=anomaly flags deviations after >= 7 snapshots accumulate.
`dashboard`
  1. Clarify audience + cadence. If unclear: "Who's looking at this and how often? (operator daily / exec weekly / growth team daily / on-demand)." Defaults: audience: "operator", cadence: "daily".
  1. Propose metric list. From config/metrics.json, pick metrics that fit purpose. If user named untracked metrics, include as placeholders with sqlSnippet: "" and recommend running this skill with scope=metric first.
  1. Design sections. 2-4 sections max. Canonical shape:
  1. Per-viz details. Each visualization specify:
  1. Self-check read-only. Every sqlSnippet must be SELECT-only. Scan for forbidden DML/DDL keywords, refuse if any appear.
  1. Write spec to config/dashboards.json (atomic). Append or update by id:

```json

{

"id": "growth-daily",

"name": "Growth Daily",

"audience": "growth team",

"cadence": "daily",

"sections": [

{

"title": "Top-line",

"visualizations": [

{

"metricId": "signups",

"title": "Signups (today)",

"chart": "number",

"sqlSnippet": "SELECT COUNT(*) AS value FROM events WHERE event='signup' AND DATE(ts) = DATE('{{date}}')",

"notes": "Excludes bots flagged in users.is_bot"

}

]

}

],

"createdAt": "...",

"updatedAt": "..."

}

```

  1. Append to outputs.json with type: "dashboard-spec", status "ready".
  1. Report. Present spec in chat, one-line summary per section. Next step: "Paste this spec into your BI tool or ask me to translate a specific viz for {your tool}."

What I never do

Outputs

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.