Skip to main content
skill CX Codex

compare-cohorts — Claude Code skill: process cohort comparison

compare-cohorts — a skill for comparing process cohorts, departments, periods or before-and-after results under matched metric definitions.

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 compare-cohorts does

The skill fixes outcome definition, metric, aggregation and units, then copies the baseline filter set twice and changes only one cohort condition. For attributes it appends value A to one filter and B to the other, then calls get_process_overall_metrics_v2 with each set. If grouping is needed, it requests get_attribute_statistics with the same filters.

For periods it changes one timeframeFilters pair; case windows are interpreted as Contained. If the process version changed between requests, the skill marks the result as **inconclusive** and stops or reruns both calls. The skill relies on the Process Intelligence API and has no external dependencies beyond that.

It reports case counts, mean metrics, absolute delta and relative change for a nonzero baseline. An empty cohort means insufficient evidence, not zero duration.

What it helps with

  • compare departments by mean case duration
  • check the effect of process changes across two periods
  • spot metric differences between attribute cohorts

Example prompts for the agent

  • Compare case duration for department A and department B in the last quarter
  • Show the difference in waiting time before and after the rollout
  • Match the top five Region groups by TotalDuration for two cohorts

How to install compare-cohorts

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 compare-cohorts -a claude-code

3Manually: put the files in place

~/.claude/skills/compare-cohorts/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/compare-cohorts/

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

Questions about compare-cohorts

How to install compare-cohorts in Claude Code?

Run /plugin marketplace add microsoft/power-platform-skills, then /plugin install process-intelligence@power-platform-skills, then npx skills add microsoft/power-platform-skills --skill compare-cohorts -a claude-code. The skill file appears at ~/.claude/skills/compare-cohorts/SKILL.md.

What does compare-cohorts do?

The skill compares process cohorts, periods or departments under fixed metric definitions by copying the baseline filter set and changing one cohort condition per request.

What does inconclusive mean in compare-cohorts?

If the process version changed between the two cohort requests, the skill marks the comparison as inconclusive because the data is no longer aligned.

Source text

SKILL.md · MIT
---
name: compare-cohorts
description: Use when comparing process cohorts, departments, periods or before-and-after results under matched definitions.
allowed-tools: Read, AskUserQuestion
---

# Matched cohort comparisons

Use the [shared contract](../../references/analysis-contract.md) and
[filters/units](../../references/filters-and-units.md).
Fix the outcome definition/provenance, metric, aggregation, units, timezone and one selector S.
Freeze the user's agreed baseline F, separately from current exploratory filters.
Reuse metadata versions and exact typed cohort values. Use the
[investigation method](../../references/investigation-method.md) for findings/status.

## Ordered trace

1. Copy baseline F twice. For attribute cohorts append
   `{attributeName:A,dataType:T,attributeValues:[X],isInclusive:true}` to
   `attributeValueFilters` for A's cohort value, and the same shape with Y for B.
   Preserve other agreed baseline conditions; retain rework restrictions only if part of that
   baseline. Do not leak an exploratory/outcome-only subset into a full-population comparison.
   Change only the intended cohort condition. If values are unknown, request
   `get_attribute_values_v2 {S,attributeName:A,itemsPerPage:20,itemsToSkip:0,filterOptions:F}`;
   it returns values, not frequencies.
2. `get_process_overall_metrics_v2 {S,filterOptions:F_A}` ->
   `get_process_overall_metrics_v2 {S,filterOptions:F_B}`.
   No `metrics`, `groupBy` or aggregation parameter exists. Use the same returned metric definitions;
   native `CaseDuration`/`CaseWaitingTime` are means.
3. Only if a grouped explanation is needed and statistics is advertised, make a **matched pair**:
   `get_attribute_statistics {S,attributeName:A,filterOptions:F_A,itemsPerPage:5,itemsToSkip:0,metricToSortBy:"TotalDuration",sortOrder:"Descending"}`,
   then exactly the same call with F_B. Do not treat independent top-five pages as a complete aligned population.

Continue relevant value/group pages or matched follow-ups when needed, without fixed call quotas.
Stop at sufficient evidence, no new information or a capability/error boundary; no blind sweeps.
Do not create views or use two inclusive timeframes in one query as an A/B comparison.

## Time and reproducibility

For periods, change only one explicit `timeframeFilters` start/end pair in each copied F.
Case windows mean **Contained**, not cases Started/Completed/Intersecting or all events during the period.
If completed-only membership including earlier starts is essential, stop/reframe or route
to derive-metric/a user-confirmed existing matching view. Never invent a date-mode field
or promise unknown end-boundary behavior.

If refresh is reported or reproducibility is at risk, recheck details.
Changed PV/PMV invalidates the pair: mark **inconclusive**, stop or deliberately rerun both,
not just the second.
Process selection resolves latest; no direct version selector or atomic comparison snapshot exists.
Views pin version context but their configuration is mutable/cached.

Report A/B counts, mean metrics, absolute delta and relative change only for a nonzero baseline.
Empty cohorts mean insufficient evidence, not zero duration/infinite improvement.
State scope/version and unmatched-group coverage; at most five headline rows.
Recorded means do not establish closure, equal maturity or complete lifecycles. Report those
as unknown unless supported; qualify the comparison, not an assumed causal improvement.
Retain baseline/cohort filters, evidence references, status and alternatives. Overlapping groups
cannot be added as unique-case totals.
Object-centric comparisons belong in analyze-objects, not case-filter fallbacks.

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

Similar skills

All skills for Data and databases →

From the same set157

The whole set →
investigate-process investigate-process investigates broad Process Mining questions through hypotheses, comparisons, and specialist analysis. Use it when one metric cannot explain the finding. CX Codex +1 ★ 1,167repo stars analyze-variants analyze-variants — a skill for investigating business process execution variants: common and slow paths, rework cases, specific instances. CX Codex +1 ★ 1,167repo stars analyze-performance analyze-performance guides analysis of slow process activities, handoff delays, waiting times, and total workload without distorting statistical metrics. CX Codex +1 ★ 1,167repo stars 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 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 derive-metric 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. 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

Project sponsors

Companies that keep this analytics open