AGENT SKILL

audience-segmentation

Use when the user mentions segmentation, customer segments, cohort analysis, RFM analysis, behavioral clustering, K-Means, DBSCAN, customer personas, segment profiles, retention curves, cohort retention, segment migration, customer tiers, high-value customers, at-risk segment, churn cohort, acquisition cohort, engagement tiers, or audience definition. Also trigger on 'group our customers' or 'which customers should we target.' For predicting a single customer's future value use clv-modeling; for conversion-step drop-off use funnel-analysis; this skill groups customers and tracks cohorts. If transaction data is not yet in the workspace, run data-extraction first.

License 许可
MIT
最近更新
2026-11-11
Stars
★ 1
Forks
0

01 前言 Front Matter

name
audience-segmentation
description
Use when the user mentions segmentation, customer segments, cohort analysis, RFM analysis, behavioral clustering, K-Means, DBSCAN, customer personas, segment profiles, retention curves, cohort retention, segment migration, customer tiers, high-value customers, at-risk segment, churn cohort, acquisition cohort, engagement tiers, or audience definition. Also trigger on 'group our customers' or 'which customers should we target.' For predicting a single customer's future value use clv-modeling; for conversion-step drop-off use funnel-analysis; this skill groups customers and tracks cohorts. If transaction data is not yet in the workspace, run data-extraction first.
disable-model-invocation
false

02 资源文件 8

03 SKILL.md 正文

Audience Segmentation

RFM scoring, behavioral K-Means/DBSCAN clustering, and cohort retention analysis that produce interpretable segments, migration matrices, and targeting-ready profiles.

Contract

Role: Advisory analyst. Produces segment assignments and profiles; does not launch campaigns. Clustering and scoring run in deterministic Python scripts.

Mode:

  • quick — RFM scoring + named segments only.
  • standard (default) — RFM + behavioral clustering + segment profiles.
  • deep — add cohort retention and period-over-period migration tracking.

When to use: grouping customers, RFM tiers, behavioral clusters, cohort retention curves, segment migration.

When NOT to use: to predict one customer's future revenue use clv-modeling; for funnel-step conversion use funnel-analysis; for sales-lead ranking use crm-lead-scoring. See ../../references/skill-index.md for the portfolio map.

Evidence required (inputs):

  • workspace/raw/transactions.csv — customer_id, date, amount, product (required). If absent, STOP and run data-extraction first.
  • workspace/raw/behavioral_events.csv — user_id, event, timestamp, properties (optional; enables behavioral clustering).
  • workspace/analysis/clv_predictions.json — CLV scores from clv-modeling (optional; enriches profiles).

Depends on: data-extraction; clv-modeling (optional value enrichment). Feeds into: experimentation, email-analytics, paid-media, reporting. Builder detail in references/authoring-notes.md.

Hard STOP (FS mode): if operating in financial services, stop before emitting segments if any segmentation feature is a prohibited characteristic (race, religion, national origin) or a direct proxy. Prohibited-basis targeting is a fair-lending violation, not a modeling choice.

Parse $ARGUMENTS for inline paths, cohort dimension, or algorithm overrides.

Workflow

  1. Validate inputs. Load transactions (and behavioral events if present). Confirm required columns and a usable date range. Apply the FS Hard STOP gate.

  2. RFM scoring. Run scripts/rfm_scoring.py: compute recency, frequency, monetary; assign quintile scores 1–5 (5 = best); derive composite score; map to named segments (Champions, Loyal, Potential Loyalists, At-Risk, Hibernating, Lost) using references/rfm_methodology.md.

  3. Method gate (AskUserQuestion). When the user hasn't specified an approach, ask before clustering:

    • Question: "Which segmentation output do you want?"
    • Options: (a) RFM named segments — business-interpretable, stable; (b) Behavioral clusters — data-driven K-Means/DBSCAN on engagement features; (c) Both — produce and reconcile. Default to RFM if the user just says "segment our customers" and no behavioral data exists.
  4. Behavioral clustering (if chosen and events exist). Run scripts/behavioral_clustering.py: StandardScaler, optional PCA (≥95% variance), sweep k∈[2,10], select k by elbow confirmed by silhouette (>0.3), random_state=42. DBSCAN alternative: k-distance epsilon, min_samples = max(5, 1% of rows). See references/clustering_guide.md.

  5. Cohort retention (deep mode). Run scripts/cohort_retention.py: assign customers to cohorts (acquisition month / first product / first channel), build the retention matrix, compute retention/churn and revenue-per-user. Validate no cell exceeds 100%.

  6. Profile segments. For each segment record size (count + %), top distinguishing behavioral features, value metrics (avg CLV, AOV, revenue contribution), and recommended action. Write to workspace/analysis/segment_profiles.json.

  7. Migration tracking (deep mode). Run scripts/segment_migration.py across consecutive periods; build a transition matrix (rows sum to 100%); flag notable moves (Champions→At-Risk, Hibernating→Loyal).

  8. Report. Write outputs and the HTML segment explorer.

Output Format

Artifacts:

File Contents
workspace/processed/segments.json Customer-level assignments (rfm_segment, rfm_scores, cluster_id/label, cohort, clv_score)
workspace/analysis/segment_profiles.json Aggregate statistics per segment
workspace/analysis/cohort_retention.json Retention matrices by cohort definition
workspace/analysis/segment_migration.json Transition matrices
workspace/reports/segmentation_report.html Interactive segment explorer

Financial services mode: keep an audit trail of segmentation logic and manual overrides; align AUM tiering with the firm's stated service model; handle investor accreditation under Reg D. If segment definitions feed customer-facing targeting copy, route that copy through compliance-review before use.

Completion status:

  • DONE — segments, profiles, and any requested cohort/migration artifacts written.
  • DONE_WITH_CONCERNS — e.g., silhouette below 0.3, thin behavioral data, or clustering skipped for lack of events.
  • BLOCKED — missing transactions or FS Hard STOP tripped; state the fix.
  • NEEDS_CONTEXT — method choice unresolved by the user.

Anti-Patterns

  • Segmenting on prohibited characteristics or proxies in financial services.
  • Reporting clusters with silhouette below 0.3 as if they were stable segments.
  • Skipping StandardScaler before distance-based clustering.
  • Non-deterministic clustering (missing random_state) so runs aren't reproducible.
  • Retention matrices exceeding 100% or migration rows not summing to 100% — always validate.
  • Delivering only statistical clusters with no business-interpretable RFM view.
  • Stale quintile boundaries — recompute monthly against current distributions.

04 同仓库更多 Skills

weisberg
weisberg/agile_agentic_analytics

metric-reconciliation

Use when two reports disagree, a KPI needs reconciliation across sources, or actuals need to be compared with a plan, forecast vintage, or prior methodology. Align population, coverage, calendar, attribution, and observation windows before computing gaps. Identify missing slices and preserve unresolved residuals.

★ 1
weisberg
weisberg/agile_agentic_analytics

analysis-handoff

Use to make a recurring SQL analysis reproducible, hand it to another analyst, or check whether an analysis bundle changed. Capture the exact query, metric definitions, inputs, source vintages, checks, and rerun steps in a portable folder without requiring a copy of row-level results.

★ 1
weisberg
weisberg/agile_agentic_analytics

conversation-ingestion

File a conversation transcript or notes from an interview, research discussion, or support exchange. Preserve the raw material, capture decisions and actions, and update participant and company timelines. Trigger on 'process this conversation', 'ingest this conversation', 'file this transcript', or 'conversation notes to KB'. For standalone media use media-ingest. For source routing use ingest.

★ 1
weisberg
weisberg/agile_agentic_analytics

minimal-skill

Minimal shared skill fixture for marketplace renderer and validator examples.

★ 1
weisberg
weisberg/agile_agentic_analytics

roadmap

Use this skill when the user wants a product roadmap, initiative sequencing, Now/Next/Later plan, quarterly roadmap, release theme map, product strategy-to-roadmap translation, or executive roadmap narrative. Trigger on phrases like "build a roadmap", "roadmap these initiatives", "what should be now next later", "sequence this backlog", "quarterly product roadmap", "theme-based roadmap", or "plan the next two quarters". Do NOT trigger for drafting or reviewing a single PRD (use prd-writer or prd-review), converting a PRD into an agentic PLAN.md (use prd-to-plan), or scoring/ranking a set of options without a time horizon (use prioritization).

★ 1
weisberg
weisberg/agile_agentic_analytics

prioritization

Use this skill when the user wants to rank, score, triage, or compare product opportunities, features, PRD requirements, backlog items, roadmap candidates, or initiatives using RICE, impact-effort, confidence, reach, value, effort, risk, or tradeoff analysis. Trigger on phrases like "prioritize these features", "rank this backlog", "RICE score", "impact effort matrix", "what should we build first", "compare these initiatives", or "stack rank product bets". Do NOT trigger for a time-based roadmap (use roadmap), writing or reviewing one PRD (use prd-writer or prd-review), turning a PRD into an agentic plan (use prd-to-plan), or analyzing experiment results (use ab-testing or experimentation skills).

★ 1