[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MGX8PP14XPS0XKAR5NC9HS":3,"skill-same:01M6MGX8PP14XPS0XKAR5NC9HS":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":23,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":48,"ownerHtmlUrl":49,"ownerBlogUrl":50,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M6MGX8PP14XPS0XKAR5NC9HS","metric-creation",null,"Guides you step-by-step through defining a business metric (aggregation) on a Honeydew entity. Covers SQL expression building and pushes to Honeydew via the MCP tools.","hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fhoneydew-ai\u002Fhoneydew-ai-coding-agents-plugins\u002Fskills\u002Fmetric-creation\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37],"creation","metric","metric creation","MCP","sql","mcp tools","aggregation","Tools","business","expression","via","guides","you","entity","2026-11-10 10:12:30",false,"---\nname: metric-creation\ndescription: Guides you step-by-step through defining a business metric (aggregation) on a Honeydew entity. Covers SQL expression building and pushes to Honeydew via the MCP tools.\n---\n\n## Prerequisites\n\nBefore 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 `model-exploration` skill for the full workspace\u002Fbranch tool reference.\n\n---\n\n## Overview\n\nA Honeydew **metric** is a named, reusable aggregation anchored to an entity.\nUnlike a calculated attribute (which is per-row), a metric collapses multiple rows into a\nsingle value.\nMetrics are **context-sensitive**: they automatically respond to whatever filters and\ngroupings the consuming BI tool or analyst applies.\n\n**Your job is to build an aggregation function that users can later group by.**\n\nIf 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.\n\nUse a metric when:\n\n- The same aggregation logic is reused across dashboards, teams, or tools\n- You need a governed, single source of truth for a KPI (e.g. \"revenue\", \"active users\")\n- The calculation involves combining other metrics (ratios, deltas)\n\n**Do not** use a metric when the value is per-row (use a calculated attribute instead).\n\n---\n\n## Building the SQL Expression\n\n### Core Rules\n\n- **MUST use an aggregation function** — metrics collapse rows\n- **DO NOT use window functions** — only aggregations allowed\n- **DO NOT use joins or subqueries** — simple expressions only\n- **NEVER use COUNT(\\*)** — use the entity's built-in count metric (e.g., `entity.count`) if available,\n  or `COUNT(entity.key_field)` on a specific key column.\n- **Reuse existing attributes and metrics** — if a calculated attribute or metric already exists (or you just created one),\n  reference it by name (e.g., `entity.attribute_name`) rather than repeating its SQL logic in the new metric expression.\n  This keeps definitions DRY and ensures changes propagate.\n- **Use fully qualified column names** — `entity.attribute`, not just `attribute`\n\nSee [reference.md](reference.md) for: aggregation functions, filtered aggregations, date handling, text summarization, data types, metric types, and format strings.\n\n---\n\n## Creation Methods\n\n### create_object (Required)\n\nAlways use `create_object` with full YAML to ensure proper datatype and all properties are set.\n\nCall `create_object` with `yaml_text`:\n\n```yaml\ntype: metric\nentity: \u003Centity_name>\nname: \u003Csnake_case_name>\ndisplay_name: \u003CHuman Readable Name>\ndescription: |-\n  \u003Cbusiness description>\nowner: \u003Cowner_email_or_team>\ndatatype: float|number|string|date|timestamp\nsql: |-\n  \u003Caggregation SQL expression>\n```\n\n**Required fields:**\n\n- `type: metric`\n- `entity` — the entity this metric belongs to\n- `name` — snake_case identifier\n- `owner` — **CRITICAL: always set to current username** (from workspace context)\n- `datatype` — **CRITICAL: always set explicitly** (default to `float` for most metrics, `number` for counts)\n- `sql` — the aggregation expression\n\n**Optional fields:**\n\n- `display_name` — human readable name\n- `description` — business context\n- `format_string` — display format (e.g., `$#,##0.00`)\n- `labels` — categorization tags\n- `folder` — organizational path\n\n### update_object (for updates)\n\nTo modify an existing metric:\n\n1. Use `get_entity` with the entity name to find the metric and its details.\n2. Use `search_model` (with `search_mode: EXACT`) to find the metric's `object_key`.\n3. Call `update_object` with the full updated YAML (`yaml_text`) and the `object_key`.\n\n> **Minimal diff rule:** When updating, preserve the existing field order and formatting from the current YAML. Only change the fields you need to modify. Objects are versioned in git, so unnecessary reordering or reformatting creates noisy diffs.\n\n### After Creation\u002FUpdate: Display the UI Link\n\nAfter a successful `create_object` or `update_object` call, the response includes a `ui_url` field. **Always display this URL to the user** so they can quickly open the object in the Honeydew application.\n\n### delete_object (for deletion)\n\n1. Use `search_model` (with `search_mode: EXACT`) to find the metric's `object_key`.\n2. Call `delete_object` with the `object_key`.\n\n---\n\n## Examples\n\nSee [examples.md](examples.md) for full worked examples covering: basic, derived, filtered, ratio, count, distinct count, fixed grouping, nested aggregation, text summary, update, and delete.\n\n---\n\n## Discovery Helpers\n\nUse these MCP tools to explore existing metrics:\n\n- `get_entity` — Get entity details including all its metrics, attributes, datasets, and relations\n- `get_field` — Get detailed info about a specific metric by entity and field name\n- `search_model` — Search for metrics across the model by name (use `search_mode: EXACT` for known names, `OR` for broad discovery)\n- `list_entities` — List entities to identify where to anchor new metrics\n\n---\n\n---\n\n## Clarify Ambiguous Requests (BEFORE creating)\n\nMany metric requests are ambiguous. **ALWAYS clarify before implementing:**\n\n| Ambiguous Term       | Possible Interpretations               | Ask User                                                                                       |\n| -------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------- |\n| \"per day\u002Fweek\u002Fmonth\" | A) Breakdown by period (multiple rows) | \"Do you want revenue _for each day_ (fixed grouping) or _average daily revenue_ (single KPI)?\" |\n|                      | B) Average per period (single value)   |                                                                                                |\n| \"rate\"               | A) Ratio (X \u002F Y)                       | \"Is this a ratio (e.g., conversion rate = orders\u002Fvisits) or velocity (e.g., orders per hour)?\" |\n|                      | B) Velocity (X per time unit)          |                                                                                                |\n| \"growth\"             | A) Absolute difference                 | \"Do you want absolute growth ($100 → $150 = $50) or percentage growth (50%)?\"                  |\n|                      | B) Percentage change                   |                                                                                                |\n| \"average\"            | A) Simple mean                         | \"Simple average or weighted average? If weighted, by what?\"                                    |\n|                      | B) Weighted mean                       |                                                                                                |\n\n---\n\n## Map User Choice → Implementation Pattern\n\nAfter user clarifies intent, use the correct SQL pattern:\n\n| User Choice             | SQL Pattern                                                    | Example                                                                 |\n| ----------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- |\n| **Breakdown by period** | `AGG(field) GROUP BY (time_field)`                             | `SUM(order_header.order_total) GROUP BY (order_header.order_date)`      |\n| **Average per period**  | `AGG(metric GROUP BY (*, time_field))` or `SUM\u002FCOUNT DISTINCT` | `AVG(order_header.total_revenue GROUP BY (*, order_header.order_date))` |\n| **Ratio**               | `metric_a \u002F NULLIF(metric_b, 0)`                               | `order_count \u002F NULLIF(customer_count, 0)`                               |\n| **Velocity (per time)** | `AGG(field) \u002F COUNT(DISTINCT time_field)`                      | `SUM(order_total) \u002F NULLIF(COUNT(DISTINCT order_date), 0)`              |\n| **Absolute growth**     | `current - previous`                                           | Requires time comparison logic                                          |\n| **Percentage growth**   | `(current - previous) \u002F NULLIF(previous, 0) * 100`             | Requires time comparison logic                                          |\n\n**CRITICAL: \"Breakdown by X\" or \"for each X\" = Fixed GROUP BY**\n\n- ✅ `SUM(order_header.order_total) GROUP BY (order_header.order_date)`\n- ❌ `SUM(order_header.order_total)` ← requires manual grouping at query time\n\n---\n\n## Additional Grouping Clarifications\n\nWhen the user's request contains phrases suggesting a specific granularity, **ask before creating**:\n\n| Phrase                                 | Likely Intent                 | Clarifying Question                                                                                   |\n| -------------------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------- |\n| \"in an order\", \"per order\", \"by order\" | Fixed grouping by order_id    | \"Should this always be calculated per order (fixed grouping), or flexible to group by any dimension?\" |\n| \"in a day\", \"per day\", \"daily\"         | Fixed grouping by date        | \"Should this always be at daily granularity, or flexible?\"                                            |\n| \"per customer\", \"by customer\"          | Fixed grouping by customer_id | \"Should this always be per customer, or flexible?\"                                                    |\n\n**Rule:** If the request mentions \"per X\" or \"in an X\", clarify whether they want:\n\n1. **Fixed Grouping** — `SUM(entity.field) GROUP BY (entity.x_id)`\n2. **Flexible Aggregation** — `SUM(entity.field)` that users can group by anything later\n\n---\n\n## Documentation Lookup\n\nUse the `honeydew-docs` MCP tools to search the Honeydew documentation when:\n\n- You need to understand metric types or advanced aggregation patterns beyond what `reference.md` covers\n- The user asks about how metrics behave in BI tools or how context-sensitive aggregation works\n- You need guidance on derived metrics, fixed groupings, or metric composition patterns\n- The user needs **time intelligence** features — period-over-period comparisons, YTD\u002FMTD\u002FQTD calculations, trailing windows, or time-based growth metrics\n\nSearch for topics like: \"metrics\", \"aggregation\", \"derived metrics\", \"fixed grouping\", \"time intelligence\", \"period over period\", \"YTD\", \"trailing window\".\n\n---\n\n## Best Practices\n\n- **Use `FILTER (WHERE ...)` for filtered aggregations** — NOT `CASE WHEN`.\n  The FILTER syntax is cleaner, more readable, and the native Honeydew pattern.\n  - ✅ `SUM(orders.amount) FILTER (WHERE orders.is_promotional)`\n  - ✅ `COUNT(truck.truck_id) FILTER (WHERE truck.is_electric)`\n  - ❌ `SUM(CASE WHEN orders.is_promotional THEN orders.amount ELSE 0 END)`\n  - ❌ `COUNT(CASE WHEN truck.is_electric THEN truck.truck_id END)`\n- **Reuse existing objects — don't repeat logic.**\n  If you created a calculated attribute (e.g., `orders.net_price`), reference it in your metric (`SUM(orders.net_price)`)\n  rather than inlining the attribute's SQL expression.\n  Similarly, if a metric already exists, reference it in derived metrics by name (`entity.existing_metric`).\n  This keeps definitions DRY and ensures changes propagate automatically.\n- **Never use COUNT(\\*).** Use the entity's built-in count metric (e.g., `entity.count`) when available.\n  Otherwise, use `COUNT(entity.key_field)` on the entity's key column.\n- **Name metrics after the business concept**, not the SQL. `gross_margin` is better than `revenue_minus_cogs_divided_by_revenue`.\n- **Use Derived metrics for ratios.** Build numerator and denominator as separate metrics first.\n- **Use fully qualified column names.** `orders.amount`, not just `amount`.\n- **Ignore grouping requests.** Build the aggregation; users add dimensions later.\n\n---\n\n## MANDATORY: Validate After Creating\n\n**After creating ANY metric, you MUST invoke the `validation` skill to test and validate results.**\n\nSee `validation` skill for:\n\n- How to execute metrics via `get_data_from_fields`\n- Sanity checks (magnitude, sign, consistency)\n- When to alert the user about suspicious results\n- Cross-validation with related metrics\n\n**Quick validation:**\n\nCall `get_data_from_fields` with:\n\n- `metrics`: `[\"\u003Centity>.\u003Cmetric_name>\"]`\n\n---\n\n## Common Pitfalls to Avoid\n\n- **Using `COUNT(*)`** — use the entity's built-in count metric if available, or `COUNT(entity.key_field)` on a specific key.\n- **Repeating logic that already exists** — if a calculated attribute or metric already exists, reference it by name instead of duplicating its SQL.\n- **Using window functions** — only aggregations allowed in metrics.\n- **Using joins or subqueries** — simple expressions only.\n- **Unqualified column references** — always prefix with entity name.\n","## Prerequisites\n\nBefore 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 `model-exploration` skill for the full workspace\u002Fbranch tool reference.\n\n---\n\n## Overview\n\nA Honeydew **metric** is a named, reusable aggregation anchored to an entity.\nUnlike a calculated attribute (which is per-row), a metric collapses multiple rows into a\nsingle value.\nMetrics are **context-sensitive**: they automatically respond to whatever filters and\ngroupings the consuming BI tool or analyst applies.\n\n**Your job is to build an aggregation function that users can later group by.**\n\nIf 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.\n\nUse a metric when:\n\n- The same aggregation logic is reused across dashboards, teams, or tools\n- You need a governed, single source of truth for a KPI (e.g. \"revenue\", \"active users\")\n- The calculation involves combining other metrics (ratios, deltas)\n\n**Do not** use a metric when the value is per-row (use a calculated attribute instead).\n\n---\n\n## Building the SQL Expression\n\n### Core Rules\n\n- **MUST use an aggregation function** — metrics collapse rows\n- **DO NOT use window functions** — only aggregations allowed\n- **DO NOT use joins or subqueries** — simple expressions only\n- **NEVER use COUNT(\\*)** — use the entity's built-in count metric (e.g., `entity.count`) if available,\n  or `COUNT(entity.key_field)` on a specific key column.\n- **Reuse existing attributes and metrics** — if a calculated attribute or metric already exists (or you just created one),\n  reference it by name (e.g., `entity.attribute_name`) rather than repeating its SQL logic in the new metric expression.\n  This keeps definitions DRY and ensures changes propagate.\n- **Use fully qualified column names** — `entity.attribute`, not just `attribute`\n\nSee [reference.md](reference.md) for: aggregation functions, filtered aggregations, date handling, text summarization, data types, metric types, and format strings.\n\n---\n\n## Creation Methods\n\n### create_object (Required)\n\nAlways use `create_object` with full YAML to ensure proper datatype and all properties are set.\n\nCall `create_object` with `yaml_text`:\n\n```yaml\ntype: metric\nentity: \u003Centity_name>\nname: \u003Csnake_case_name>\ndisplay_name: \u003CHuman Readable Name>\ndescription: |-\n  \u003Cbusiness description>\nowner: \u003Cowner_email_or_team>\ndatatype: float|number|string|date|timestamp\nsql: |-\n  \u003Caggregation SQL expression>\n```\n\n**Required fields:**\n\n- `type: metric`\n- `entity` — the entity this metric belongs to\n- `name` — snake_case identifier\n- `owner` — **CRITICAL: always set to current username** (from workspace context)\n- `datatype` — **CRITICAL: always set explicitly** (default to `float` for most metrics, `number` for counts)\n- `sql` — the aggregation expression\n\n**Optional fields:**\n\n- `display_name` — human readable name\n- `description` — business context\n- `format_string` — display format (e.g., `$#,##0.00`)\n- `labels` — categorization tags\n- `folder` — organizational path\n\n### update_object (for updates)\n\nTo modify an existing metric:\n\n1. Use `get_entity` with the entity name to find the metric and its details.\n2. Use `search_model` (with `search_mode: EXACT`) to find the metric's `object_key`.\n3. Call `update_object` with the full updated YAML (`yaml_text`) and the `object_key`.\n\n> **Minimal diff rule:** When updating, preserve the existing field order and formatting from the current YAML. Only change the fields you need to modify. Objects are versioned in git, so unnecessary reordering or reformatting creates noisy diffs.\n\n### After Creation\u002FUpdate: Display the UI Link\n\nAfter a successful `create_object` or `update_object` call, the response includes a `ui_url` field. **Always display this URL to the user** so they can quickly open the object in the Honeydew application.\n\n### delete_object (for deletion)\n\n1. Use `search_model` (with `search_mode: EXACT`) to find the metric's `object_key`.\n2. Call `delete_object` with the `object_key`.\n\n---\n\n## Examples\n\nSee [examples.md](examples.md) for full worked examples covering: basic, derived, filtered, ratio, count, distinct count, fixed grouping, nested aggregation, text summary, update, and delete.\n\n---\n\n## Discovery Helpers\n\nUse these MCP tools to explore existing metrics:\n\n- `get_entity` — Get entity details including all its metrics, attributes, datasets, and relations\n- `get_field` — Get detailed info about a specific metric by entity and field name\n- `search_model` — Search for metrics across the model by name (use `search_mode: EXACT` for known names, `OR` for broad discovery)\n- `list_entities` — List entities to identify where to anchor new metrics\n\n---\n\n---\n\n## Clarify Ambiguous Requests (BEFORE creating)\n\nMany metric requests are ambiguous. **ALWAYS clarify before implementing:**\n\n| Ambiguous Term       | Possible Interpretations               | Ask User                                                                                       |\n| -------------------- | -------------------------------------- | ---------------------------------------------------------------------------------------------- |\n| \"per day\u002Fweek\u002Fmonth\" | A) Breakdown by period (multiple rows) | \"Do you want revenue _for each day_ (fixed grouping) or _average daily revenue_ (single KPI)?\" |\n|                      | B) Average per period (single value)   |                                                                                                |\n| \"rate\"               | A) Ratio (X \u002F Y)                       | \"Is this a ratio (e.g., conversion rate = orders\u002Fvisits) or velocity (e.g., orders per hour)?\" |\n|                      | B) Velocity (X per time unit)          |                                                                                                |\n| \"growth\"             | A) Absolute difference                 | \"Do you want absolute growth ($100 → $150 = $50) or percentage growth (50%)?\"                  |\n|                      | B) Percentage change                   |                                                                                                |\n| \"average\"            | A) Simple mean                         | \"Simple average or weighted average? If weighted, by what?\"                                    |\n|                      | B) Weighted mean                       |                                                                                                |\n\n---\n\n## Map User Choice → Implementation Pattern\n\nAfter user clarifies intent, use the correct SQL pattern:\n\n| User Choice             | SQL Pattern                                                    | Example                                                                 |\n| ----------------------- | -------------------------------------------------------------- | ----------------------------------------------------------------------- |\n| **Breakdown by period** | `AGG(field) GROUP BY (time_field)`                             | `SUM(order_header.order_total) GROUP BY (order_header.order_date)`      |\n| **Average per period**  | `AGG(metric GROUP BY (*, time_field))` or `SUM\u002FCOUNT DISTINCT` | `AVG(order_header.total_revenue GROUP BY (*, order_header.order_date))` |\n| **Ratio**               | `metric_a \u002F NULLIF(metric_b, 0)`                               | `order_count \u002F NULLIF(customer_count, 0)`                               |\n| **Velocity (per time)** | `AGG(field) \u002F COUNT(DISTINCT time_field)`                      | `SUM(order_total) \u002F NULLIF(COUNT(DISTINCT order_date), 0)`              |\n| **Absolute growth**     | `current - previous`                                           | Requires time comparison logic                                          |\n| **Percentage growth**   | `(current - previous) \u002F NULLIF(previous, 0) * 100`             | Requires time comparison logic                                          |\n\n**CRITICAL: \"Breakdown by X\" or \"for each X\" = Fixed GROUP BY**\n\n- ✅ `SUM(order_header.order_total) GROUP BY (order_header.order_date)`\n- ❌ `SUM(order_header.order_total)` ← requires manual grouping at query time\n\n---\n\n## Additional Grouping Clarifications\n\nWhen the user's request contains phrases suggesting a specific granularity, **ask before creating**:\n\n| Phrase                                 | Likely Intent                 | Clarifying Question                                                                                   |\n| -------------------------------------- | ----------------------------- | ----------------------------------------------------------------------------------------------------- |\n| \"in an order\", \"per order\", \"by order\" | Fixed grouping by order_id    | \"Should this always be calculated per order (fixed grouping), or flexible to group by any dimension?\" |\n| \"in a day\", \"per day\", \"daily\"         | Fixed grouping by date        | \"Should this always be at daily granularity, or flexible?\"                                            |\n| \"per customer\", \"by customer\"          | Fixed grouping by customer_id | \"Should this always be per customer, or flexible?\"                                                    |\n\n**Rule:** If the request mentions \"per X\" or \"in an X\", clarify whether they want:\n\n1. **Fixed Grouping** — `SUM(entity.field) GROUP BY (entity.x_id)`\n2. **Flexible Aggregation** — `SUM(entity.field)` that users can group by anything later\n\n---\n\n## Documentation Lookup\n\nUse the `honeydew-docs` MCP tools to search the Honeydew documentation when:\n\n- You need to understand metric types or advanced aggregation patterns beyond what `reference.md` covers\n- The user asks about how metrics behave in BI tools or how context-sensitive aggregation works\n- You need guidance on derived metrics, fixed groupings, or metric composition patterns\n- The user needs **time intelligence** features — period-over-period comparisons, YTD\u002FMTD\u002FQTD calculations, trailing windows, or time-based growth metrics\n\nSearch for topics like: \"metrics\", \"aggregation\", \"derived metrics\", \"fixed grouping\", \"time intelligence\", \"period over period\", \"YTD\", \"trailing window\".\n\n---\n\n## Best Practices\n\n- **Use `FILTER (WHERE ...)` for filtered aggregations** — NOT `CASE WHEN`.\n  The FILTER syntax is cleaner, more readable, and the native Honeydew pattern.\n  - ✅ `SUM(orders.amount) FILTER (WHERE orders.is_promotional)`\n  - ✅ `COUNT(truck.truck_id) FILTER (WHERE truck.is_electric)`\n  - ❌ `SUM(CASE WHEN orders.is_promotional THEN orders.amount ELSE 0 END)`\n  - ❌ `COUNT(CASE WHEN truck.is_electric THEN truck.truck_id END)`\n- **Reuse existing objects — don't repeat logic.**\n  If you created a calculated attribute (e.g., `orders.net_price`), reference it in your metric (`SUM(orders.net_price)`)\n  rather than inlining the attribute's SQL expression.\n  Similarly, if a metric already exists, reference it in derived metrics by name (`entity.existing_metric`).\n  This keeps definitions DRY and ensures changes propagate automatically.\n- **Never use COUNT(\\*).** Use the entity's built-in count metric (e.g., `entity.count`) when available.\n  Otherwise, use `COUNT(entity.key_field)` on the entity's key column.\n- **Name metrics after the business concept**, not the SQL. `gross_margin` is better than `revenue_minus_cogs_divided_by_revenue`.\n- **Use Derived metrics for ratios.** Build numerator and denominator as separate metrics first.\n- **Use fully qualified column names.** `orders.amount`, not just `amount`.\n- **Ignore grouping requests.** Build the aggregation; users add dimensions later.\n\n---\n\n## MANDATORY: Validate After Creating\n\n**After creating ANY metric, you MUST invoke the `validation` skill to test and validate results.**\n\nSee `validation` skill for:\n\n- How to execute metrics via `get_data_from_fields`\n- Sanity checks (magnitude, sign, consistency)\n- When to alert the user about suspicious results\n- Cross-validation with related metrics\n\n**Quick validation:**\n\nCall `get_data_from_fields` with:\n\n- `metrics`: `[\"\u003Centity>.\u003Cmetric_name>\"]`\n\n---\n\n## Common Pitfalls to Avoid\n\n- **Using `COUNT(*)`** — use the entity's built-in count metric if available, or `COUNT(entity.key_field)` on a specific key.\n- **Repeating logic that already exists** — if a calculated attribute or metric already exists, reference it by name instead of duplicating its SQL.\n- **Using window functions** — only aggregations allowed in metrics.\n- **Using joins or subqueries** — simple expressions only.\n- **Unqualified column references** — always prefix with entity name.\n",{"name":5,"description":7},"main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002Fhoneydew-ai\u002Fhoneydew-ai-coding-agents-plugins\u002Fskills\u002Fmetric-creation",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":8,"skillName":5,"commands":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill metric-creation",{"tool":59,"command":60},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill metric-creation",{"tool":62,"command":63},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill metric-creation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fhoneydew-ai\u002Fhoneydew-ai-coding-agents-plugins\u002Fskills\u002Fmetric-creation\u002FSKILL.md",true,[67,73],{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"examples.md","REFERENCE","参考文档",3252,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fhoneydew-ai\u002Fhoneydew-ai-coding-agents-plugins\u002Fskills\u002Fmetric-creation\u002Fexamples.md",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"reference.md",4327,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fhoneydew-ai\u002Fhoneydew-ai-coding-agents-plugins\u002Fskills\u002Fmetric-creation\u002Freference.md",[78,88,96,104,112,120],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":83,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":87},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":92,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":87},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":100,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":87},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":108,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":87},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":116,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":87},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":82,"licenseFileUrl":124,"sourceHtmlUrl":125,"categories":126,"keywords":127,"publishedAt":87},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]