analyticsengineering/ae-toolkit / skills/metric-definition
metric-definition
VerifiedDefines canonical business metric contracts with explicit population, grain, formula, dimensions, time semantics, ownership, and acceptance cases. Use when a KPI needs an authoritative definition, competing definitions must be reconciled, or a metric contract must be specified before implementation.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 6.5 KB |
| references/diagrams.md | markdown | 3.2 KB |
| references/operating-rules.md | markdown | 23.3 KB |
| references/privacy.md | markdown | 2.0 KB |
| references/severity-model.md | markdown | 1.5 KB |
| references/terminology.md | markdown | 1.9 KB |
| references/warehouse-portability.md | markdown | 4.9 KB |
| scripts/infer_conventions.py | script | 55.6 KB |
| scripts/inspect_dbt.py | script | 20.2 KB |
| scripts/inspect_git.py | script | 8.5 KB |
| scripts/inspect_repo.py | script | 13.5 KB |
| scripts/project_context.py | script | 27.4 KB |
| scripts/redact_secrets.py | script | 15.2 KB |
references/diagrams.md
View on GitHub# Diagrams
A diagram earns its place when it shows structure faster than a list: what a change reaches, why two grains differ, how layers move in a refactor. It never replaces the written list, which stays the record a reader can search, quote, and review. Draw only from repository files; a diagram holds model, source, and consumer names, never data values or query results.
## When to draw
- **Blast radius.** A pause, plan, or lineage trace that names three or more downstream consumers (models, semantic models or metrics, BI files, exposures, exports). Fewer than three reads fine as a sentence.
- **Grain decision.** A `# Grain Decision Needed` response: show the two candidate grains and the one-to-many join that separates them.
- **Refactor lineage.** A refactor that adds, removes, or moves a layer: show the chain before and after.
Draw nothing else unless the user asks. Do not draw for a single model, a straight one-input build, a review finding, or to decorate a summary.
## How to draw
Use exactly one fenced `mermaid` block, placed directly after the list it illustrates: `flowchart LR` for a blast radius or grain decision, and the `flowchart TB` before-and-after layout below for a refactor.
- Name each node with its file-level name (`fct_orders`, `sem_orders`, `finance_dashboard`) and give it a short kind label: `fct_orders["fct_orders (mart)"]`.
- Keep it under about fifteen nodes. Past that, group the rest into one node such as `more["4 more dashboards"]` and keep the full list in text.
- Edges point the way data flows: source to staging to mart to consumer.
- Mark what the request changes and what is published, with these two classes only:
```mermaid
flowchart LR
int_visits["int_visits (intermediate)"] --> fct_visits["fct_visits (mart, contract)"]
fct_visits --> sem_visits["sem_visits (semantic model)"]
sem_visits --> completed_visits["completed_visits (metric)"]
completed_visits --> review["clinic_performance_review (exposure)"]
completed_visits --> bonus["bonus_pool (exposure)"]
classDef changed stroke-width:3px,stroke-dasharray:4 2
classDef published font-weight:bold
class int_visits changed
class fct_visits,completed_visits published
```
- For a grain decision, draw the two tables and the join between them, with each grain as a node: `orders["orders: one row per order"] -->|"1 to many"| items["order_items: one row per order item"]`.
- For a refactor, use `flowchart TB` with two subgraphs, each starting with `direction LR`, and an invisible link `before ~~~ after` so "before" sits above "after". Node ids must be unique across the diagram, so suffix the after-side ids (`fct_orders2["fct_orders (mart)"]`) while the labels keep the real names:
```mermaid
flowchart TB
subgraph before
direction LR
src_orders["raw.orders (source)"] --> fct_orders["fct_orders (mart)"]
end
subgraph after
direction LR
src_orders2["raw.orders (source)"] --> stg_orders["stg_orders (staging)"] --> fct_orders2["fct_orders (mart)"]
end
before ~~~ after
```
Write valid Mermaid: quote labels that contain parentheses, colons, or spaces; use plain ASCII ids; do not put Markdown inside labels. Some editors show a Mermaid block as code instead of a picture, which is why the text list above it stays complete on its own.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |