data-context-extractor
When to use
Use this when generic SQL keeps returning plausible-but-wrong answers on a new company's warehouse because the real definitions live in analysts' heads. Capture that tribal knowledge once and turn it into a context file other data skills consult.
Not for: answering a specific data question now (use data-analyze), profiling one dataset's quality (use data-explore), or writing a single query (use data-write-query).
Method
- Inventory the landscape. Core tables, their grain, freshness/refresh cadence, and which are canonical vs deprecated. Flag the tempting "do not use" tables.
- Extract metric definitions. For each key metric (revenue, active user, churn): exact business definition, source column(s), filters applied, and gotchas (refunds excluded? test accounts filtered? which timezone?).
- Map the join graph. Correct keys between core tables and where fan-out risk lives. Note keys that look joinable but are not.
- Capture conventions. Fiscal vs calendar periods, standard segment definitions, status-code meanings, enum/category vocabulary.
- Record known traps. Duplicate-prone tables, late-arriving data, backfilled history, columns whose meaning changed on a known date.
- Interview by proxy. Decision point: when a fact is missing, do not guess — list the exact question to ask an analyst and mark the entry assumed.
Example
A single metric entry, with honest confidence marking:
### Metric: Active User [VERIFIED 2026-07-11 — analyst: R. Diaz]
- Definition: distinct user with >=1 session in trailing 28 days
- Source: events.sessions.user_id
- Filters: exclude is_internal = true (staff), exclude bot_flag = true
- Timezone: session_ts is UTC; "day" boundary is UTC, not local
- Gotcha: events.sessions is order-line grain — DISTINCT the user_id
Pitfalls
- Presenting an assumed metric definition as confirmed — the whole file's value is honest confidence.
- Documenting a deprecated table as canonical because it still has data.
- Recording a join without its fan-out warning, so downstream SUMs silently double.
- Capturing a definition without the timezone/filter gotchas that actually change the number.
Output format
## Tables | name | grain | freshness | canonical/deprecated |
## Metrics definition, source, filters, gotchas, verified example
## Joins key pairs, fan-out warnings
## Conventions calendars, segments, status codes, enums
## Traps dated caveats, data-quality landmines
## Open questions what still needs analyst confirmation
Mark every entry VERIFIED or ASSUMED. Never present an assumed definition as confirmed.
1---2name: data-context-extractor3version: 1.0.04description: Bootstrap a company-specific data reference by capturing an analyst's tribal knowledge into a durable, reusable context file.5author: matrixx00706tags: [onboarding, metadata, tribal-knowledge, documentation, semantics, metrics]7capabilities: []8metadata:9 source: https://skillmd.com/skills/matrixx0070/data-context-extractor10---1112# data-context-extractor1314## When to use1516Use this when generic SQL keeps returning plausible-but-wrong answers on a new company's warehouse because the real definitions live in analysts' heads. Capture that tribal knowledge once and turn it into a context file other data skills consult.1718**Not for:** answering a specific data question now (use data-analyze), profiling one dataset's quality (use data-explore), or writing a single query (use data-write-query).1920## Method21221. **Inventory the landscape.** Core tables, their grain, freshness/refresh cadence, and which are canonical vs deprecated. Flag the tempting "do not use" tables.232. **Extract metric definitions.** For each key metric (revenue, active user, churn): exact business definition, source column(s), filters applied, and gotchas (refunds excluded? test accounts filtered? which timezone?).243. **Map the join graph.** Correct keys between core tables and where fan-out risk lives. Note keys that look joinable but are not.254. **Capture conventions.** Fiscal vs calendar periods, standard segment definitions, status-code meanings, enum/category vocabulary.265. **Record known traps.** Duplicate-prone tables, late-arriving data, backfilled history, columns whose meaning changed on a known date.276. **Interview by proxy.** Decision point: when a fact is missing, do not guess — list the exact question to ask an analyst and mark the entry assumed.2829## Example3031A single metric entry, with honest confidence marking:3233```markdown34### Metric: Active User [VERIFIED 2026-07-11 — analyst: R. Diaz]35- Definition: distinct user with >=1 session in trailing 28 days36- Source: events.sessions.user_id37- Filters: exclude is_internal = true (staff), exclude bot_flag = true38- Timezone: session_ts is UTC; "day" boundary is UTC, not local39- Gotcha: events.sessions is order-line grain — DISTINCT the user_id40```4142## Pitfalls4344- Presenting an assumed metric definition as confirmed — the whole file's value is honest confidence.45- Documenting a deprecated table as canonical because it still has data.46- Recording a join without its fan-out warning, so downstream SUMs silently double.47- Capturing a definition without the timezone/filter gotchas that actually change the number.4849## Output format5051```markdown52## Tables | name | grain | freshness | canonical/deprecated |53## Metrics definition, source, filters, gotchas, verified example54## Joins key pairs, fan-out warnings55## Conventions calendars, segments, status codes, enums56## Traps dated caveats, data-quality landmines57## Open questions what still needs analyst confirmation58```5960Mark every entry VERIFIED or ASSUMED. Never present an assumed definition as confirmed.