intelligems-segment-spotlight
/segment-spotlight
Revenue-opportunity-ranked segment analysis for any A/B test. Shows per-segment dollar values, verdicts, and rollout recommendations across device type, visitor type, and traffic source.
Works with both active and ended tests.
Step 0: Workspace Check
Check if the shared workspace exists and is ready:
test -d ~/intelligems-analytics/venv && test -f ~/intelligems-analytics/ig_client.py && echo "READY" || echo "NEEDS_SETUP"
If NEEDS_SETUP: Run the /intelligems-core skill first to set up the workspace.
Step 1: Get API Key
Check if an API key is already configured:
source ~/intelligems-analytics/venv/bin/activate && python3 -c "
from dotenv import load_dotenv; import os
load_dotenv(os.path.expanduser('~/intelligems-analytics/.env'))
key = os.getenv('INTELLIGEMS_API_KEY', '')
print('HAS_KEY' if key and key != 'your_api_key_here' else 'NO_KEY')
"
If NO_KEY: Ask the user for their API key and save it.
Never hardcode or assume an API key.
Step 2: Copy Spotlight Script
cp references/spotlight.py ~/intelligems-analytics/spotlight.py
Step 3: Select Test
The script accepts an optional test ID as an argument.
If the user already specified a test ID: Pass it directly. If no test was specified: The script lists active experiments for selection.
Step 4: Run Analysis
cd ~/intelligems-analytics && source venv/bin/activate && python3 spotlight.py [optional_test_id]
The script will:
- Fetch overview analytics + all 3 segment types
- Calculate revenue opportunity per segment
- Rank segments by dollar value
- Generate rollout recommendations
Step 5: Present Results
Read the script output and present conversationally:
1. Quick Summary
One-line takeaway on segment uniformity or divergence.
2. Revenue Opportunity Table
Ranked by annual dollar opportunity:
| Segment | Type | Verdict | Lift | Confidence | Annual Value |
|---|---|---|---|---|---|
| Desktop | Device | WINNER | +15% | 92% | $47,000 |
| ... | ... | ... | ... | ... | ... |
3. Rollout Recommendation
- Roll out everywhere — If all major segments win
- Segment-specific — If some win, some lose
- Hold — If mixed or insufficient data
4. Contradictions
Highlight any segments that contradict the overall result.
Step 6: Set Up Slack Automation (Optional)
Same pattern as other skills — use --slack <webhook_url> flag.
cd ~/intelligems-analytics && source venv/bin/activate && python3 spotlight.py <test_id> --slack "<webhook_url>"
Notes
- Revenue opportunity = segment daily visitors × RPV lift × 365. This is the annualized dollar value of the lift in that segment.
- All 3 segment types are analyzed: device type, visitor type, traffic source.
- Low-data segments show "Low data" for confidence instead of a percentage.
- COGS awareness: Uses Gross Profit per Visitor when COGS data exists.
More from victorpay1/intelligems-analytics
intelligems-profit-impact
Translate A/B test lift percentages into annualized dollar projections. Shows conservative and optimistic revenue impact, break-even analysis, and opportunity cost of waiting.
10intelligems-morning-brief
Get a prioritized morning summary of all your active Intelligems tests. Shows health status, action items, emerging winners, and daily run rates — designed for daily use.
9intelligems-core
Shared Python library for Intelligems Analytics skills. Sets up the workspace, API client, metric helpers, and configuration. Run this before using any other Intelligems Analytics skill.
8intelligems-test-verdict
Analyze any Intelligems A/B test and get a plain-English verdict — should you roll it out, keep running, or kill it? Includes risk assessment, segment nuance, and profit impact.
8intelligems-api
Load Intelligems External API context before building API integrations. Use when starting to build any API use case for Intelligems.
7intelligems-test-debrief
Post-mortem analysis for any Intelligems A/B test. Extracts learnings from funnel data, segment patterns, and customer behavior — then suggests what to test next based on findings.
7