metric-creationlisted
Install: claude install-skill honeydew-ai/honeydew-ai-coding-agents-plugins
## Prerequisites
Before creating metrics, ensure you are on the correct workspace and branch. Use `get_session_workspace_and_branch` to check the current session context. For development work, create a branch with `create_workspace_branch` (the session switches automatically). See the `workspace-branch` skill for the full workspace/branch tool reference.
---
## Overview
A Honeydew **metric** is a named, reusable aggregation anchored to an entity.
Unlike a calculated attribute (which is per-row), a metric collapses multiple rows into a
single value.
Metrics are **context-sensitive**: they automatically respond to whatever filters and
groupings the consuming BI tool or analyst applies.
**Your job is to build an aggregation function that users can later group by.**
If a user asks for a group by ("sum sales by category"), ignore the group. You're building the aggregation to sum sales by ANYTHING. The user will later use it in a query with their chosen dimensions.
Use a metric when:
- The same aggregation logic is reused across dashboards, teams, or tools
- You need a governed, single source of truth for a KPI (e.g. "revenue", "active users")
- The calculation involves combining other metrics (ratios, deltas)
**Do not** use a metric when the value is per-row (use a calculated attribute instead).
---
## Building the SQL Expression
### Core Rules
- **MUST use an aggregation function** — metrics collapse rows
- **DO NOT use window functions** — only aggregations allowed