Skip to main content
skill CX Codex

derive-metric — Claude Code skill: metrics and installation

derive-metric is a Claude Code skill for resolving missing business measures in process data. It checks existing metrics before using a saved definition or a temporary calculation.

MIT ★ 1,167 updated 2026-10-29

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add microsoft/power-platform-skills
/plugin install process-intelligence@power-platform-skills
Open on GitHub

What derive-metric does

derive-metric looks for an existing measure or enabled custom metric before calculating anything. If neither fits, it can derive a local scalar from compatible totals or run a temporary formula through Process Intelligence MCP tools.

A business measure needs a confirmed case or event entity, outcome definition, units, time basis, and aggregation. Snapshot amounts cannot be summed or ordered without rules for their meaning. When definitions are incomplete, the skill asks before calculating. Formula validation is capped at three attempts, and the result is reported as ephemeral: there is no tool to create or save a metric.

What it helps with

  • find an existing measure with the right scope and aggregation
  • reuse a saved custom metric for a process query
  • derive a temporary scalar from compatible totals
  • validate a custom metric formula before running it

Example prompts for the agent

  • Find the case-duration measure and count cases lasting more than one day.
  • Use the saved metric to count cases whose Boolean value is true.
  • Validate this metric formula and run it as a temporary calculation.

How to install derive-metric

1Plugin marketplace

/plugin marketplace add microsoft/power-platform-skills
/plugin install process-intelligence@power-platform-skills

This installs the whole process-intelligence plugin with all its skills

2Skills CLI (Vercel)

npx skills add microsoft/power-platform-skills --skill derive-metric -a claude-code

3Manually: put the files in place

~/.claude/skills/derive-metric/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/derive-metric/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about derive-metric

How do I install derive-metric in Claude Code?

Add the marketplace with /plugin marketplace add microsoft/power-platform-skills, then install it with /plugin install process-intelligence@power-platform-skills.

What does derive-metric do?

It resolves a missing process measure by using a native metric, reusing a saved custom metric, or running a temporary calculation. New formulas are validated first, and the result is reported as unsaved.

What does derive-metric need to run?

It needs Process Intelligence MCP tools and current process and metric details. Formula execution also requires an available validator; the skill will not run an unvalidated formula.

Source text

SKILL.md · MIT
---
name: derive-metric
description: Use when a requested measure is missing, a saved custom metric needs reuse, or an ephemeral formula or derived scalar is needed.
allowed-tools: Read, AskUserQuestion
---

# Resolve a metric gap without saving definitions

Use the [shared contract](../../references/analysis-contract.md) and
[filters/units](../../references/filters-and-units.md). Follow this order; stop at the first sufficient option.

For a business-derived measure, confirm case/event entity, outcome definition/provenance,
units, time basis and aggregation. Are amounts incremental transactions or cumulative snapshots?
Never assume sum, latest or maximum: nonmonotonic snapshots require authoritative ordering and
refund/correction semantics. Missing definitions mean **inconclusive**; ask before computing.
Do not infer formula grammar from an example name or business description.

1. **Native output first.** Use the existing metric and its correct scope/aggregation.
   For cases over one day append
   `{metric:"CaseDuration",comparisonOperator:"GreaterThan",values:["1.00:00:00"],isInclusive:true}`
   to F's `caseMetricConditionFilters`, then
   `get_cases_with_metrics_v2 {S,filterOptions:Fplus,itemsPerPage:5,itemsToSkip:0}`.
   No formula is needed for ordinary duration/waiting/counts; use native grouped statistics
   instead of summing a truncated cases page.
2. **Enabled saved metric.** Reuse fresh details' `CustomMetrics` ID/name/type/dataType.
   Details is not a generic metric catalog and contains no saved formula text.
   Match Case/Event/Edge scope and scalar type. For a Boolean Case metric C append
   `{metric:"CustomMetric",customMetricId:C,comparisonOperator:"EqualTo",values:[true],isInclusive:true}`
   to `caseMetricConditionFilters`; query `get_process_overall_metrics_v2 {S,filterOptions:Fplus}`
   for a count. An ID filter needs no formula validation.
   A saved-name output expression, e.g. synthetic `EscalatedCase()`, **does** require
   the validation/column path below; do not guess escaping or missing dependencies.
3. **Exact local scalar.** Reuse complete, definition-compatible, same-scope totals with a nonzero
   denominator. Label the result derived, not saved. Never average averages or use overlapping
   groups/top-N samples as population totals.
4. **Ephemeral formula only if necessary.** Load [formula execution](../../references/formulas.md).
   Reuse PV/PMV from current details, not process/view IDs; refresh when stale.
   Fetch needed targeted reference pages without a lookup quota; then validate:
   `validate_custom_metric_formula {processVersionId:PV,processExtendedMetadataVersionId:PMV,formula:Fexpr}`.
   For a candidate and its repairs, allow **three validation attempts total**, not endless retries.
   Repair only from structured errors/definitions; stop early on an unavailable prerequisite.
   Require `isValid:true`, a compatible `dataType` and the **exact target context in types**.
   Validation alone neither executes nor saves anything.
5. Execute the smallest matching filter/query or default page-five column query.
   For cases: `get_cases_with_metrics_v2 {S,filterOptions:F,itemsPerPage:5,itemsToSkip:0,formulaMetricInput:{name:N,formula:Fexpr}}`.
   N must not collide with returned built-ins. Never invent `computedColumns` or `metrics`.

Continue necessary pages or distinct evidence queries without ordinary-call or total-row quotas.
Reuse completed results; stop when answered or no new evidence is available.
Missing validator forbids unvalidated execution even if the output field is advertised.
Column and formula-filter capabilities are independent; stop after an explicit gate rejection.
No create/save metric tool exists. If a prerequisite cannot be inlined, explain creation/enablement
outside MCP, then refresh metadata and revalidate after the user's action.

Report definition/formula, units/context, validation state, at most five headline rows and **ephemeral/not saved**.
Retain definition provenance and scoped evidence/status using the [investigation method](../../references/investigation-method.md).

© Microsoft · MIT · microsoft/power-platform-skills

Similar skills

All skills for Data and databases →

From the same set157

The whole set →
analyze-drivers analyze-drivers — a skill to identify what drives differences in process duration, wait times, resource utilization, and rework. Frames testable hypotheses and distinguishes competing explanations through attribute correlation. CX Codex +1 ★ 1,167repo stars compare-cohorts compare-cohorts — a skill for comparing process cohorts, departments, periods or before-and-after results under matched metric definitions. CX Codex +1 ★ 1,167repo stars add-azuredevops add-azuredevops attaches the Azure DevOps connector to a Power Apps code app to query work items, create bugs, and trigger build pipelines. CX Codex +1 ★ 1,167repo stars analyze-objects analyze-objects is a Claude Code skill for studying processes with interacting object types and delays across objects. It activates for questions about leading-object executions or process paths. CX Codex +1 ★ 1,167repo stars add-mcscopilot add-mcscopilot attaches the Microsoft Copilot Studio connector to Power Apps code apps, configures agent invocation, and handles responses. CX Codex +1 ★ 1,167repo stars canvas-create-layout canvas-create-layout is a Claude Code subagent that plans Canvas app screen layouts before control selection. It joins work on new screens or layout revisions. CX Codex ★ 1,167repo stars add-data-source add-data-source is a Claude Code skill that guides you through adding a data source or connector in Power Apps Studio and verifies the result over MCP. CX Codex +1 ★ 1,167repo stars list-connections list-connections finds or provisions Power Platform connections and references for Expo and React Native apps. Handy when linking data sources via CLI. CX Codex +1 ★ 1,167repo stars

Project sponsors

Companies that keep this analytics open