task icon Task

Analyze Segment Performance

Requirements
CSV file with segment/category column and performance metric column
1

If the CSV path was not already provided, ask the user for it.
Common sources: Business intelligence exports, ERP data, regional reports.

Establish for the subtask:

  • Output path: uiParsed Executive Data
  • Column types to detect: segments/categories, metrics/values, dates, comparisons
5

Analyze the data for segment performance:

  1. Identify the segment/category column (regions, products, customers, etc.)
  2. Identify the key performance metric column
  3. If multiple options exist, ask the user which to use
  4. Calculate average performance across all segments
  5. Rank segments from top to bottom
  6. Calculate each segment's variance from average (%)
  7. Identify top quartile (over-performers) and bottom quartile (under-performers)
  8. Look for patterns—what do top performers have in common?

Present results following the Segment Performance Analysis template.
Include the actual ranked table with numbers.

6

Provide 2-3 actionable recommendations based on the segment analysis.
Consider: segments to invest in, segments to investigate, segments to potentially divest.

                    To run this task you must have the following required information:

> CSV file with segment/category column and performance metric column

If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.

---

You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).

Add all steps to your todo list now and begin executing.

## Steps

1. If the CSV path was not already provided, ask the user for it.
Common sources: Business intelligence exports, ERP data, regional reports.

Establish for the subtask:
- Output path: `./documents/tmp/executive-data.json`
- Column types to detect: segments/categories, metrics/values, dates, comparisons


2. [Gather Requirements for Parse and Interpret CSV] The next step has the following requirements: "CSV file path to parse. Column type hints (e.g., "scores, customers, dates, categories"). Output file path for the interpreted data.". Search the user's data for this information or ask them directly if needed. Do not proceed until you have this information.

3. [Execute Parse and Interpret CSV Task]: Spawn a subagent and provide it with the requirements gathered above and instructions to read `./skills/sauna/[skill_id]/references/recipes/stdlib.csv.interpret.md` for its task list

4. [Read Parsed Executive Data]: Read the file at `./documents/tmp/executive-data.json` and analyze its contents (Load the parsed and interpreted CSV data)

5. [Read Executive Analytics Guide]: Read the documentation in: `./skills/sauna/[skill_id]/references/executive.analytics.guide.md` (Segment performance output format)

6. Analyze the data for segment performance:

1. Identify the segment/category column (regions, products, customers, etc.)
2. Identify the key performance metric column
3. If multiple options exist, ask the user which to use
4. Calculate average performance across all segments
5. Rank segments from top to bottom
6. Calculate each segment's variance from average (%)
7. Identify top quartile (over-performers) and bottom quartile (under-performers)
8. Look for patterns—what do top performers have in common?

Present results following the Segment Performance Analysis template.
Include the actual ranked table with numbers.


7. Provide 2-3 actionable recommendations based on the segment analysis.
Consider: segments to invest in, segments to investigate, segments to potentially divest.