Churn rca

From t0ddc3by/claude-for-customer-success · View interactive version

Churn rca is an AI agent skill from the GitHub repository t0ddc3by/claude-for-customer-success. Root cause analysis for individual customer churn events and cohort-level churn pattern analysis. Produces structured RCA with root cause taxonomy, contributing factors, timeline reconstruction, and remediation pathway. Scoped to full cancellation — contract contraction redirected to renewals:downgr

How to use this skill

Skill file

/renewals:churn-rca [VALIDATED]

Overview

renewals:churn-rca performs structured Root Cause Analysis on confirmed customer churn events (full contract cancellations). It supports three operations:

Use when:

Do NOT use for:

Scope boundary — contraction redirect:

If the scenario involves a customer reducing (not cancelling) their contract, respond with:

Scope redirect: This request describes a contract contraction, not full churn.
Please use renewals:downgrade-analysis for downgrade analysis.

Contraction signals: "reduce," "downgrade," "fewer seats," "smaller tier," "partial cancellation."

Typical Activation

/renewals:churn-rca analyze "Acme Corp" — full RCA on a single churned account with root cause taxonomy, timeline reconstruction, and win-back assessment

/renewals:churn-rca cohort — multi-account pattern analysis to detect systemic churn drivers; triggers portfolio-level escalation if cohort churn rate ≥ 25%

/renewals:churn-rca export "Acme Corp" — retrieve and format an existing RCA record for stakeholder reporting or portfolio review


Use When

Do NOT Use For

Typical Activation

/renewals:churn-rca analyze "Acme Corp" — full RCA on a single churned account with root cause taxonomy, timeline reconstruction, and win-back assessment

/renewals:churn-rca cohort — multi-account pattern analysis to detect systemic churn drivers; triggers portfolio-level escalation if cohort churn rate ≥ 25%

/renewals:churn-rca export "Acme Corp" — retrieve and format an existing RCA record for stakeholder reporting or portfolio review


Pre-flight

G-code dependency: All G-code guardrails referenced in this skill (G1–G9) are defined in the CLAUDE.md config loaded above. If Pre-flight halts or config is missing, G-codes are undefined — do not proceed with partial config.


Operations

Operation: `analyze` — Individual Churn RCA

Performs root cause analysis on a single churned account. Produces a structured RCA document written to context/rca-[safe_account]-[YYYY-MM-DD].md.

Inputs:

| Field | Type | Required | Description |

|-------|------|----------|-------------|

| operation | string | Yes | "analyze" |

| account_name | string | Yes | Account name |

| csm_name | string | Yes | CSM who owned the account |

| churn_reason | string | Yes | Customer-stated or CSM-assessed churn reason |

| churn_date | string | No | ISO date of confirmed churn (YYYY-MM-DD); defaults to today |

| account_stage | string | No | Lifecycle stage at time of churn |

| contract_value | string | No | ARR or contract value for impact sizing |

| tenure_months | integer | No | Months as customer |

| ocv_snapshot | string | No | OCV outcome data — advisory signal for value delivery analysis |

| early_warning_signals | list | No | List of pre-churn signals observed |

| notes | string | No | CSM freeform notes |

Scope redirect — check first:

Before any analysis, scan churn_reason and notes for contraction signals ("reduce," "downgrade," "fewer seats," "smaller tier"). If found, return the scope redirect message and stop.

Auto-generated fields (immutable after creation):

safe_account derivation (for file path only):

  1. Lowercase account_name
  2. Replace all non-alphanumeric characters with -
  3. Collapse consecutive hyphens to a single hyphen
  4. Trim to 30 characters maximum

Output file: context/rca-[safe_account]-[YYYY-MM-DD].md

Output structure:

---
rca_id: [RCA-ID]
account_name: [account_name]
churn_date: [churn_date]
csm_name: [csm_name]
created_at: [ISO datetime]
created_by: [session user]
---

## Churn RCA: [Account Name]
### RCA ID: [RCA-ID]
### Churn Date: [date]
### Contract Value: [if provided; omit section if not]

## Root Cause Classification
### Primary Root Cause: [taxonomy category from the 7-category taxonomy]
### Contributing Factors: [list of secondary factors from available signals]
### Value Chain Position: [where in the value delivery chain the failure occurred]

## Timeline Reconstruction
[Key events and signals leading to churn, synthesized from: early_warning_signals,
account_stage, tenure_months, churn_date, and churn_reason. State assumptions when
fields are absent.]

## OCV Delivery Analysis
[If ocv_snapshot provided: analysis of outcome delivery status and gaps correlated
with churn timing. If not provided: omit this section entirely.]

## Remediation Pathway
### Preventable: [Yes / Possibly / No]
### Primary Prevention Lever: [what should have been done differently]
### Systemic Recommendation: [pattern recommendation for future accounts at similar stage/profile]

## Win-Back Assessment
### Win-Back Viability: [High / Medium / Low / Not viable]
### Recommended Timing: [when to re-engage]
### Win-Back Approach: [summary of recommended approach]

Operation: `cohort` — Cohort Churn Pattern Analysis

Analyzes a batch of churn events for pattern identification and systemic root cause. Writes to context/rca-cohort-[YYYYMMDD]-[SEQ].md.

Inputs:

| Field | Type | Required | Description |

|-------|------|----------|-------------|

| operation | string | Yes | "cohort" |

| cohort_name | string | Yes | Descriptive name (e.g., "Q1-2026 Enterprise Churn") |

| csm_name | string | Yes | CSM or analyst running the cohort analysis |

| rca_ids | list | No | List of existing RCA IDs to include (prior individual RCAs) |

| churn_events | list | No | Inline churn event objects: {account_name, churn_reason, churn_date, contract_value, account_stage} — for events without prior individual RCAs |

| analysis_period | string | No | ISO date range YYYY-MM-DD/YYYY-MM-DD |

| portfolio_size | integer | No | Total accounts in the defined portfolio. Must be a positive integer > 0 |

| notes | string | No | Additional context |

Validation — enforce before any analysis or file write:

portfolio_size = 0 or negative:

Validation error: portfolio_size must be a positive integer greater than zero. Received: [value]. Provide the total number of accounts in the defined portfolio.

Churn rate calculation (when portfolio_size provided):

churn_rate = count(churn_events + rca_ids) / portfolio_size × 100
systemic_threshold_met = churn_rate >= 25.0

Auto-generated fields (immutable after creation):

Output file: context/rca-cohort-[YYYYMMDD]-[SEQ].md

Output structure:

---
cohort_id: [cohort_id]
cohort_name: [cohort_name]
portfolio_size: [N or "not provided"]
churn_rate: [X.X% or "not calculated — portfolio_size not provided"]
analysis_period: [period or "not specified"]
created_at: [ISO datetime]
created_by: [session user]
---

## Cohort Churn Analysis: [cohort_name]
### Cohort ID: [cohort_id]
### Analysis Period: [period]
### Churn Rate: [N/portfolio_size]% [⚠ Above threshold — systemic pattern] if >= 25%

## Pattern Analysis
### Primary Churn Drivers (ranked by frequency)
| Driver Category | Count | % of Cohort |
|----------------|-------|-------------|
| [category]     | [N]   | [%]         |

### Common Contributing Factors
[Cross-account themes identified from churn_reason signals]

### Lifecycle Stage Concentration
[Which stages have highest churn concentration; any stage-specific patterns]

## Systemic Recommendations
[Portfolio-level interventions based on pattern analysis. Produced for all cohorts;
escalation intensity increases when churn_rate >= 25%.]
[If churn_rate >= 25%: prefix section with ⚠ and address to CS Leadership and Product.]

Operation: `export`

Retrieves and formats an existing RCA or cohort record for external use. Does not write to the filesystem — content returned in response only.

Inputs:

| Field | Type | Required | Description |

|-------|------|----------|-------------|

| operation | string | Yes | "export" |

| rca_id | string | No | Single RCA ID to export |

| cohort_id | string | No | Cohort ID to export |

| format | string | No | "markdown" (default) or "summary" |

Validation:

```

Export error: At least one of rca_id or cohort_id is required.

```

Not-found errors:

Export error: RCA record not found for rca_id [rca_id]. Verify the ID is correct and confirm the rca operation completed successfully.
Export error: RCA record not found for cohort_id [cohort_id]. Verify the ID is correct and confirm the cohort operation completed successfully.

Locate source file: Scan context/rca-* for a file whose frontmatter rca_id or cohort_id matches the provided value. The identifier is a match predicate against file frontmatter — never interpolated into a file path.

Format behavior:


Output Format

Individual RCA file naming:

context/rca-[safe_account]-[YYYY-MM-DD].md

Examples:

Cohort RCA file naming:

context/rca-cohort-[YYYYMMDD]-[SEQ].md

Examples:

Auto-ID examples:

Date in filename: Date of the operation (creation date). Never updated.

YAML frontmatter fields — individual RCA:

rca_id: [RCA-ID]
account_name: [verbatim from input]
churn_date: [YYYY-MM-DD]
csm_name: [verbatim from input]
created_at: [ISO datetime]
created_by: [session user email]

YAML frontmatter fields — cohort RCA:

cohort_id: [RCA-COHORT-ID]
cohort_name: [verbatim from input]
portfolio_size: [integer or "not provided"]
churn_rate: [decimal or "not calculated"]
analysis_period: [range or "not specified"]
created_at: [ISO datetime]
created_by: [session user email]

Export output: Returned in response only. No file written.


Reasoning Protocol

Before generating output, apply these primers:

  1. CLASSIFY: What type of churn analysis request is this?
  1. CONSTRAINTS: What limits the solution space?
  1. EXPERT CHECK: What would a veteran CS analyst verify first?
  1. ANTI-PATTERNS: Common mistakes to avoid:

After execution, verify:


Execute in this order for each operation:

For analyze:

  1. Check churn_reason and notes for contraction signals — if found, return scope redirect and stop
  2. Derive safe_account from account_name (lowercase → replace non-alphanumeric with - → collapse hyphens → trim to 30 chars)
  3. Derive churn_date: use provided value or today's date in ISO format
  4. Classify primary root cause from churn_reason using the 7-category taxonomy in reference/churn-rca-taxonomy.md — load on demand
  5. Identify contributing factors from secondary signals in churn_reason, early_warning_signals, notes, and ocv_snapshot
  6. Reconstruct timeline from early_warning_signals, account_stage, tenure_months, and churn_date; state assumptions for absent fields
  7. Render OCV Delivery Analysis only if ocv_snapshot is provided; omit the section entirely if not
  8. Assess win-back viability per root cause category using reference/remediation-playbook.md — load on demand
  9. Derive rca_id: scan context/rca-[safe_account]-*.md for same date; set SEQ to highest found + 1, defaulting to 001
  10. Write the RCA file to context/rca-[safe_account]-[churn_date].md

For cohort:

  1. Validate portfolio_size > 0 if provided; return validation error and stop if zero or negative
  2. Collect all churn events: combine inline churn_events entries with any rca_ids references
  3. Calculate churn_rate if portfolio_size provided: count(events) / portfolio_size × 100; flag systemic pattern if churn_rate >= 25.0
  4. Load reference/churn-rca-taxonomy.md — classify each event's primary root cause
  5. Build frequency table: rank drivers by count descending; alpha-sort ties
  6. Identify cross-account themes from signal language in churn_reason fields
  7. Identify lifecycle stage concentration from account_stage fields
  8. Load reference/cohort-analysis-framework.md for pattern interpretation guidance — load on demand
  9. Generate systemic recommendations scaled to churn rate severity; use reference/remediation-playbook.md — load on demand
  10. Derive cohort_id: scan context/rca-cohort-*.md for same date; set SEQ to highest found + 1, defaulting to 001
  11. Write cohort file to context/rca-cohort-[YYYYMMDD]-[SEQ].md

For export:

  1. Validate that at least one of rca_id or cohort_id is provided; return error if neither
  2. Scan context/rca-* for a file whose frontmatter rca_id or cohort_id matches the provided value
  3. If not found, return the not-found error message; stop
  4. Apply format: markdown = return full document; summary = return key sections only
  5. Return content in response; do not write any file

Security & Permissions


Trust & Verification

Input sanitization:

Validation — portfolio_size:

```

Validation error: portfolio_size must be a positive integer greater than zero. Received: [value]. Provide the total number of accounts in the defined portfolio.

```

Immutable fields — locked at creation; no update operation exists:

Root cause taxonomy validation:

Export ID resolution:

Display-only fields:


Reference Files

The following reference files are loaded on-demand. They are not front-loaded.

| File | Purpose |

|------|---------|

| reference/reasoning-blueprint.md | Reasoning framework for this skill — D1 cognitive stance, constraints, and expert orientation |

| reference/churn-rca-taxonomy.md | 7-category root cause taxonomy with definitions, signal vocabulary, classification heuristics, value chain position mapping, and win-back viability assessment rules per category |

| reference/cohort-analysis-framework.md | Cohort construction methods, pattern identification algorithm, churn rate threshold logic, lifecycle stage concentration analysis, systemic recommendation generation, and portfolio_size validation |

| reference/remediation-playbook.md | Prevention lever per root cause category, systemic recommendation templates, win-back timing guidance and approach templates per root cause, and escalation guidance |

Load reference/churn-rca-taxonomy.md when classifying root causes during analyze or cohort.

Load reference/cohort-analysis-framework.md when executing cohort pattern analysis.

Load reference/remediation-playbook.md when generating remediation recommendations or win-back assessments.


Examples

Example 1 — Individual Analyze

Input:

{
  "operation": "analyze",
  "account_name": "Meridian Health",
  "csm_name": "Sarah Chen",
  "churn_reason": "The product never integrated with their EHR system. IT gave up after 4 months of failed attempts. Exec sponsor left and no champion replaced her.",
  "churn_date": "2026-05-01",
  "account_stage": "adoption",
  "contract_value": "$48,000 ARR",
  "tenure_months": 8,
  "ocv_snapshot": "3 of 5 target outcomes partially met; integration milestone never completed; last active session 2026-03-15",
  "early_warning_signals": ["no login activity for 45 days", "IT escalation ticket opened 2026-02-01", "champion Sarah Torres promoted to new division 2026-03-01"]
}

Behavior:


Example 2 — Cohort Analysis (Systemic Threshold Met)

Input:

{
  "operation": "cohort",
  "cohort_name": "Q1-2026 Enterprise Churn",
  "csm_name": "Tom Liu",
  "churn_events": [
    {"account_name": "Acme Corp", "churn_reason": "ROI not demonstrated to CFO", "churn_date": "2026-01-15", "account_stage": "renewal"},
    {"account_name": "Beta Solutions", "churn_reason": "Value unclear after renewal conversation", "churn_date": "2026-02-01", "account_stage": "renewal"},
    {"account_name": "Gamma Industries", "churn_reason": "Could not show business impact to board", "churn_date": "2026-03-10", "account_stage": "maturity"}
  ],
  "portfolio_size": 10,
  "analysis_period": "2026-01-01/2026-03-31"
}

Behavior:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.