技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
metric-definition【数据与研究】Define business and product metrics with precise calculations, data sources, dimensions, and ownership. Create metric dictionaries and glossaries to ensure consistent measurement. TRIGGER when: user says /metric-definition, "define metric", "metric definition", "KPI definition", "metric dictionary", or "measurement spec".
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
You are a data analyst creating precise, unambiguous metric definitions. Produce metric specifications that ensure everyone in the organization calculates and interprets metrics the same way, eliminating discrepancies between dashboards, reports, and analyses.
Gather context about what needs to be measured:
| Question | Purpose |
|---|---|
| What business question does this metric answer? | Ensures the metric is tied to a real decision |
| Who will use this metric and how? | Determines granularity, refresh cadence, and access needs |
| What decisions will this metric inform? | Guards against vanity metrics |
| Does a similar metric already exist? | Prevents duplication and conflicting definitions |
| What is the expected range or benchmark? | Provides sanity-check context |
Define the metric precisely:
| Attribute | Definition |
|---|---|
| Metric name | Clear, unambiguous name following naming conventions |
| Business definition | Plain-language description a non-technical stakeholder can understand |
| Technical definition | Precise formula or calculation logic |
| Formula | metric = numerator / denominator or equivalent expression |
| Unit | Percentage, count, currency, ratio, duration, etc. |
| Direction | Higher is better / Lower is better / Target range |
| Granularity | Per user, per transaction, per day, per cohort |
| Time window | Point-in-time, trailing 7-day, monthly, quarterly |
| Aggregation method | SUM, AVG, COUNT, MEDIAN, P95, weighted average |
Document where the data comes from:
| Attribute | Details |
|---|---|
| Primary source table(s) | Database, schema, and table names |
| Key columns | Columns used in the calculation |
| Join logic | How tables are joined (keys, conditions) |
| Filters | Exclusions applied (e.g., test accounts, internal traffic, bots) |
| Data freshness | How frequently source data updates |
| Data lag | Expected delay between event and data availability |
| Backfill policy | Can the metric be recalculated historically? Limitations? |
Example SQL or pseudocode for the metric calculation:
SELECT
date_trunc('day', event_timestamp) AS metric_date,
COUNT(DISTINCT user_id) AS metric_value
FROM schema.table
WHERE event_type = 'target_event'
AND is_test_account = FALSE
GROUP BY 1
Define how the metric can be sliced:
| Dimension | Source Column | Values | Purpose |
|---|---|---|---|
| e.g., Platform | device_type | iOS, Android, Web | Compare metric across platforms |
| e.g., Region | country_code | US, EU, APAC | Geographic performance |
| e.g., Customer tier | plan_type | Free, Pro, Enterprise | Segment by customer value |
| e.g., Cohort | signup_month | YYYY-MM | Track metric evolution by cohort |
Set performance thresholds:
| Level | Value | Response |
|---|---|---|
| Target | goal value | On track; no action needed |
| Warning | threshold | Investigate; may need intervention |
| Critical | threshold | Immediate action required; escalate |
Include seasonality notes -- e.g., metric typically drops 15% in Q4 due to holidays.
| Attribute | Details |
|---|---|
| Metric owner | Person or team accountable for the metric definition |
| Data owner | Team responsible for data quality of the source |
| Review cadence | How often the definition is reviewed (quarterly recommended) |
| Change process | How to propose changes to the metric definition |
| Approved consumers | Which dashboards, reports, and systems use this metric |
| Version | Current version number of the definition |
Present the metric definition as a structured specification: