/cja-segment-performance-comparator
Compares the performance of two or more audience segments across key metrics side by side. Use this skill when someone wants to compare audiences, cohorts, or groups — for example, "how do mobile users compare to desktop users on conversion," "compare new vs. returning
$ npx -y skills add adobe/skills --skill cja-segment-performance-comparator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/cja-segment-performance-comparator
Context preview
The summary Claude sees to decide when to auto-load this skill.
Compares the performance of two or more audience segments across key metrics side by side. Use this skill when someone wants to compare audiences, cohorts, or groups — for example, "how do mobile users compare to desktop users on conversion," "compare new vs. returning
SKILL.md
cja-segment-performance-comparator.SKILL.mdname: cja-segment-performance-comparator
description: >
Compares the performance of two or more audience segments across key metrics
side by side. Use this skill when someone wants to compare audiences, cohorts,
or groups — for example, "how do mobile users compare to desktop users on
conversion," "compare new vs. returning visitors," "show me the difference
between these two segments," "compare these audiences on our KPIs," or
"which segment performs better." Also trigger for "segment comparison,"
"audience comparison," or "cohort comparison."
license: Apache-2.0
metadata:
author: Adobe
version: "1.0"
Segment Performance Comparator (Customer Journey Analytics)
Compare 2–5 audience segments across a set of key metrics in a side-by-side matrix. The output tells the user not just what each segment looks like in isolation, but which segment wins or loses on each metric — and which differences are large enough to act on.
This skill answers the question "which audience should we focus on?" with data. Segment comparisons drive product decisions, personalization strategy, and budget allocation — so clarity and actionability matter more than exhaustive data.
---
CJA MCP Tools Used
- `findSegments` — search for segments by name or keyword
- `describeSegment` — understand the logic of candidate segments before using them
- `findMetrics` — resolve base metric IDs
- `findCalculatedMetrics` — include custom KPIs in the comparison
- `listComponentUsage` — identify the most-used metrics as default comparison set
- `runReport` (with `segmentIds` or `adhocSegments`) — pull metric values per segment
---
Phase 0 — Setup
1. Call `findDataViews` to list available data views. 2. If the user hasn't specified a data view, present the list and ask which to use. 3. Call `setDefaultSessionDataViewId` with the chosen ID. 4. Ask the user which segments to compare if not already specified. Confirm the metrics to compare them on.
---
Phase 1 — Identify Segments to Compare
1.1 From user description
If the user named specific segments, resolve them:
findSegments(search: "<segment name>")
For each match, call `describeSegment` to verify it is the correct one:
describeSegment(segmentId: "<id>")
Show the segment definition summary to the user if there is ambiguity: > "I found two segments matching 'mobile users': **Mobile Visitors (All Devices)** > and **Mobile App Users**. Which do you want to compare?"
1.2 From plain-English descriptions
If the user says "compare mobile vs desktop users" but there are no matching segments, offer to create ad hoc segments inline for the comparison: > "I don't see pre-built segments for mobile and desktop. I can create > temporary ad hoc segments for this comparison using device type. Should I > proceed with ad hoc segments, or would you like to create permanent segments > first?"
Ad hoc segments are constructed using `adhocSegments` in `runReport` — no save required for the comparison itself.
1.3 Segment count limit
Maximum 5 segments for a single comparison. More than 5 creates a matrix that is too wide to read meaningfully. If the user requests more, say: > "I'll limit to the 5 most relevant segments for readability. Would you like > me to prioritize by usage count or stick with your list order?"
---
Phase 2 — Identify Metrics to Compare
2.1 From user specification
Resolve named metrics via `findMetrics` and `findCalculatedMetrics`.
2.2 Default metric discovery
If the user did not specify metrics, pull the top metrics by usage. The `listComponentUsage` tool does not support a `limit` parameter — it returns all components ranked by usage count; take the top 6–8 from the result:
listComponentUsage(componentType: "metric")
listComponentUsage(componentType: "calculatedMetric")
Prefer calculated metrics over raw base metrics when they measure the same thing — calculated metrics reflect intentional KPI definitions.
2.3 Metric selection for a comparison
Good comparison metrics should be meaningful across all segments. For example, "Revenue" is meaningful for both mobile and desktop users; "App Installs" is only meaningful for mobile. Remove metrics that would be trivially zero for one segment.
If unsure, ask: "Should I use your standard KPI set, or focus on specific metrics like conversion rate, revenue, and engagement?"
---
Phase 3 — Run the Comparison
For each segment, run a `runReport` with that segment applied and all comparison metrics included. Note that `runReport` takes `metricIds` as a comma-separated string, `startDate`/`endDate` (not `dateRange`), and a `dimensionIds` (required even for summary-only reports — use a low-cardinality dimension like `variables/daterangeday` or `variables/web.webPageDetails.name`). The summary totals for all metrics are in `summaryData.filteredTotals`:
runReport(
dimensionIds: "variables/web.webPageDetails.name",
metricIds: "metrics/visits,metrics/revenue_1,metrics/orders_1_1",
startDate: "<period start>T00:00:00",
endDate: "<period end>T23:59:59",
page: 0,
limit: 1,
segmentIds: "<segment id>"
)
For ad hoc segments, use the full CJA segment definition object:
runReport(
dimensionIds: "variables/web.webPageDetails.name",
metricIds: "metrics/visits,metrics/orders_1_1",
startDate: "<period start>T00:00:00",
endDate: "<period end>T23:59:59",
page: 0,
limit: 1,
adhocSegments: [{
"func": "segment",
"version": [1, 0, 0],
"container": {
"func": "container",
"context": "visitors",
"pred": {
"func": "streq",
"val": { "func": "attr", "name": "variables/device_type" },
"str": "Mobile Phone"
}
}
}]
)Read metric totals from `summaryData.filteredTotals[i]` where `i` is the 0-based index of the metric in the `metricIds` string.
Run one report per segment. Collect all results into a matrix:
- Rows = metrics
- Columns = segments
---
##
Read more
name: cja-segment-performance-comparator description: > Compares the performance of two or more audience segments across key metrics side by side. Use this skill when someone wants to compare audiences, cohorts, or groups — for example, "how do mobile users compare to desktop users on conversion," "compare new vs. returning visitors," "show me the difference between these two segments," "compare these audiences on our KPIs," or "which segment performs better." Also trigger for "segment comparison," "audience comparison," or "cohort comparison." license: Apache-2.0 metadata: author: Adobe version: "1.0"
Segment Performance Comparator (Customer Journey Analytics)
Compare 2–5 audience segments across a set of key metrics in a side-by-side matrix. The output tells the user not just what each segment looks like in isolation, but which segment wins or loses on each metric — and which differences are large enough to act on.
This skill answers the question "which audience should we focus on?" with data. Segment comparisons drive product decisions, personalization strategy, and budget allocation — so clarity and actionability matter more than exhaustive data.
---
CJA MCP Tools Used
- `findSegments` — search for segments by name or keyword
- `describeSegment` — understand the logic of candidate segments before using them
- `findMetrics` — resolve base metric IDs
- `findCalculatedMetrics` — include custom KPIs in the comparison
- `listComponentUsage` — identify the most-used metrics as default comparison set
- `runReport` (with `segmentIds` or `adhocSegments`) — pull metric values per segment
---
Phase 0 — Setup
1. Call `findDataViews` to list available data views. 2. If the user hasn't specified a data view, present the list and ask which to use. 3. Call `setDefaultSessionDataViewId` with the chosen ID. 4. Ask the user which segments to compare if not already specified. Confirm the metrics to compare them on.
---
Phase 1 — Identify Segments to Compare
1.1 From user description
If the user named specific segments, resolve them:
findSegments(search: "<segment name>")
For each match, call `describeSegment` to verify it is the correct one:
describeSegment(segmentId: "<id>")
Show the segment definition summary to the user if there is ambiguity: > "I found two segments matching 'mobile users': **Mobile Visitors (All Devices)** > and **Mobile App Users**. Which do you want to compare?"
1.2 From plain-English descriptions
If the user says "compare mobile vs desktop users" but there are no matching segments, offer to create ad hoc segments inline for the comparison: > "I don't see pre-built segments for mobile and desktop. I can create > temporary ad hoc segments for this comparison using device type. Should I > proceed with ad hoc segments, or would you like to create permanent segments > first?"
Ad hoc segments are constructed using `adhocSegments` in `runReport` — no save required for the comparison itself.
1.3 Segment count limit
Maximum 5 segments for a single comparison. More than 5 creates a matrix that is too wide to read meaningfully. If the user requests more, say: > "I'll limit to the 5 most relevant segments for readability. Would you like > me to prioritize by usage count or stick with your list order?"
---
Phase 2 — Identify Metrics to Compare
2.1 From user specification
Resolve named metrics via `findMetrics` and `findCalculatedMetrics`.
2.2 Default metric discovery
If the user did not specify metrics, pull the top metrics by usage. The `listComponentUsage` tool does not support a `limit` parameter — it returns all components ranked by usage count; take the top 6–8 from the result:
listComponentUsage(componentType: "metric") listComponentUsage(componentType: "calculatedMetric")
Prefer calculated metrics over raw base metrics when they measure the same thing — calculated metrics reflect intentional KPI definitions.
2.3 Metric selection for a comparison
Good comparison metrics should be meaningful across all segments. For example, "Revenue" is meaningful for both mobile and desktop users; "App Installs" is only meaningful for mobile. Remove metrics that would be trivially zero for one segment.
If unsure, ask: "Should I use your standard KPI set, or focus on specific metrics like conversion rate, revenue, and engagement?"
---
Phase 3 — Run the Comparison
For each segment, run a `runReport` with that segment applied and all comparison metrics included. Note that `runReport` takes `metricIds` as a comma-separated string, `startDate`/`endDate` (not `dateRange`), and a `dimensionIds` (required even for summary-only reports — use a low-cardinality dimension like `variables/daterangeday` or `variables/web.webPageDetails.name`). The summary totals for all metrics are in `summaryData.filteredTotals`:
runReport( dimensionIds: "variables/web.webPageDetails.name", metricIds: "metrics/visits,metrics/revenue_1,metrics/orders_1_1", startDate: "<period start>T00:00:00", endDate: "<period end>T23:59:59", page: 0, limit: 1, segmentIds: "<segment id>" )
For ad hoc segments, use the full CJA segment definition object:
runReport(
dimensionIds: "variables/web.webPageDetails.name",
metricIds: "metrics/visits,metrics/orders_1_1",
startDate: "<period start>T00:00:00",
endDate: "<period end>T23:59:59",
page: 0,
limit: 1,
adhocSegments: [{
"func": "segment",
"version": [1, 0, 0],
"container": {
"func": "container",
"context": "visitors",
"pred": {
"func": "streq",
"val": { "func": "attr", "name": "variables/device_type" },
"str": "Mobile Phone"
}
}
}]
)Read metric totals from `summaryData.filteredTotals[i]` where `i` is the 0-based index of the metric in the `metricIds` string.
Run one report per segment. Collect all results into a matrix:
- Rows = metrics
- Columns = segments
---
##
Repo: adobe/skills
Other skills on adobe-skills.
- /aa-conversion-funnel-analysis
Analyzes a multi-step conversion funnel to find where visitors drop off and which steps have the worst leakage. Use this skill when someone describes a journey and asks about conversion rates, drop-off, fallout, or step completion. Trigger for "analyze our checkout funnel,"
Open skill - /aa-executive-briefing
Generates a concise, executive-ready performance summary covering key metrics, trends, and what's driving movement. Use this skill when someone needs to produce a briefing, executive summary, performance narrative, or stakeholder readout — for example, "write an exec summary of
Open skill - /aa-kpi-pulse
Produces a compact KPI digest showing how key metrics changed over a period and what's driving the movement. Use this skill when someone asks for a performance summary, a weekly recap, a morning briefing, a KPI update, or any variation of "how did we do this week/month." Also
Open skill - /aa-segment-performance-comparator
Compares the performance of two or more audience segments across key metrics side by side. Use this skill when someone wants to compare audiences or visitor groups — for example, "how do mobile visitors compare to desktop on conversion," "compare new vs. returning visitors,"
Open skill - /aa-top-movers-watchlist
Identifies which items (pages, campaigns, products, channels, regions) had the biggest increases or decreases for a key metric between two time periods. Use this skill when someone asks "what's up and what's down," "which campaigns moved the most," "top gainers and losers,"
Open skill - /cja-dimension-analysis
Comprehensive dimension analysis and reporting for CJA. Use this skill whenever the user wants to analyze one or more dimensions — including cardinality, distribution/skew, trends, anomalies, data quality errors, comparisons, and forecasting. Also trigger when someone asks "what
Open skill

