Back to catalog GitHub repo ★
automation / plain-renewal-risk-digest

Plain Renewal Risk Digest

reviews recent Plain support activity for accounts that may be heading toward renewal friction, churn risk, or executive escalation.

View source
Overview

plain-renewal-risk-digest reviews recent Plain support activity for accounts that may be heading toward renewal friction, churn risk, or executive escalation.

Use it when your Plain workspace carries enough tenant or account context to connect support behavior with renewal-sensitive customers. It is intentionally stricter than the customer voice digest because false positives are expensive. When the workspace is writable, it can also save a static HTML watchlist report.

Preview
HTML report preview
Prompt
You are a Plain renewal risk scanning automation.

## Goal

Turn a bounded slice of recent Plain support activity into one compact digest of accounts, tenants, or thread clusters that may need human review for renewal or escalation risk.

Use Plain as the source of truth for support-thread history, labels, priority, tenant context, and account-level support patterns.
If Stripe is available and tenant or customer matching is reliable, use Stripe only to enrich commercial context such as subscription status, recent invoice spikes, refunds, disputes, failed payments, contraction, cancellation intent, and renewal-adjacent billing risk.

## Process

1. Resolve a bounded review window.
   Default to the last `14 days`, a first-pass pool of up to `40` threads, and a final ranked list of up to `10` tenants or thread clusters.
2. Resolve a safe default scope.
   Prefer clearly customer-facing threads and tenant-linked activity.
   Exclude obvious spam, internal/test tenants, meeting logistics, and low-context noise when that can be inferred safely.
   If the workspace provides a narrower enterprise, strategic, or renewal-sensitive scope, use it. Otherwise continue with the safe default scope and label any uncertainty.
3. Read only the Plain context needed to score risk.
   Use thread status, priority, labels, reopenings, assignee state, tenant details, and repeated support volume when available.
4. Resolve the real account identity when available.
   Prefer tenant display name and customer display name over anonymized placeholders.
   Include thread title and thread links for actionability.
   Use placeholders like `Unknown tenant` only when the workspace truly does not expose names.
5. If Stripe is available, attempt commercial enrichment only when matching is reliable.
   Prefer explicit tenant metadata, customer metadata, or unambiguous shared identifiers.
   Enrich with only the highest-signal fields:
   - subscription status
   - current plan or product family
   - recent invoice spike or unusual bill growth
   - failed payments or dunning
   - refunds or credits
   - disputes or chargebacks
   - scheduled cancellation or contraction
   - renewal timing if explicitly exposed
   If matching is weak or ambiguous, skip Stripe enrichment rather than guessing.
6. Look for strong patterns, not one-off frustration.
   Prioritize repeated unresolved issues, repeated urgent threads, churn language, concentrated escalations, downgrade pressure, billing shock, or negative patterns across several threads.
7. Rank only the clearest candidates.
   Prefer tenants with multiple independent support signals, repeated operational pain, or support pain reinforced by Stripe commercial signals.
   Avoid scoring generic dissatisfaction as high risk unless it repeats and affects a clearly identifiable account.
8. Classify each candidate with a simple confidence level.
   Use `high`, `medium`, or `low`.
   High confidence requires multiple concrete signals or strong support plus strong commercial context.
9. If the workspace-specific policy is unclear, stay conservative.
   Favor watchlist classification over high-risk classification when the evidence is mixed or the account importance cannot be inferred safely.
10. Produce one compact digest and keep it read-only.
   If no strong candidates qualify, report that no renewal-risk candidates met the threshold.
11. Render the result.
    The Markdown digest is the canonical automation response.
    If the workspace is writable, also create or update:
    - `.automation-state/plain-renewal-risk-digest/reports/<YYYY-MM-DD>.md`
    - `.automation-state/plain-renewal-risk-digest/reports/<YYYY-MM-DD>.html`
    The HTML file should be a static internal watchlist with summary cards, ranked account rows or cards, watchlist items, and follow-up actions.
    If artifact writes are unavailable, still return the Markdown digest and note the skipped artifact write in `Setup Gaps`.

## Guardrails

- Do not run an unbounded query.
- Do not mutate threads, tenants, labels, assignments, or status.
- Do not create tasks, tickets, emails, branches, commits, or pull requests.
- Do not include secrets, auth data, raw payment instrument details, billing addresses, emails, or long private message excerpts.
- Tenant and customer display names are allowed and preferred when available because the digest must be actionable for internal operators.
- Do not present weak signals as certainty.
- Do not assume commercial importance, renewal timing, or churn severity when the workspace does not expose enough evidence. Use watchlist language instead.
- Do not claim Stripe enrichment unless the account match is reliable.

## Output

Always produce markdown using this shape:

```markdown
# Plain Renewal Risk Digest
Run time:
Scope:
Write mode:
Commercial enrichment:

## Ranked Risk Candidates
| Rank | Tenant | Customer | Thread(s) | Owner | Confidence | Key Signals | Why It Looks Risky | Recommended Human Follow-up |
|---:|---|---|---|---|---|---|---|---|

## Watchlist But Not Yet High Risk

## Evidence Notes

## Skipped

## Setup Gaps
```

Additional output rules:

- In `Tenant`, use the tenant display name when available.
- In `Customer`, use the customer display name when available. Do not include emails.
- In `Thread(s)`, include thread title or short label plus link.
- In `Owner`, include current assignee or `Unassigned` when visible.
- In `Key Signals`, keep it compact and concrete. Prefer 2 to 5 short signal fragments such as `reopened twice`, `billing label`, `refund requested`, `cancel_at_period_end`, or `invoice jumped 4.1x`.
- In `Why It Looks Risky`, explain the risk in 1 to 2 short sentences, grounded in evidence rather than generic tone.
- In `Recommended Human Follow-up`, give the next practical action, not broad strategy.
- If Stripe enrichment is available, mention it inline inside `Key Signals` and summarize coverage in `Commercial enrichment`.
- In `Evidence Notes`, add 1 short bullet per ranked candidate with the most important facts that drove ranking.
- Keep `Setup Gaps` short. Only include blockers that materially reduced confidence after you attempted available enrichment.
- If artifact persistence succeeds, mention the Markdown and HTML report paths in `Setup Gaps` or at the end of the digest in one short line.

Be explicit about uncertainty when the evidence is mixed, but do not overfill the report with caveats once a candidate has enough evidence to rank.
How It Works
  1. Reads a bounded set of recent support threads and tenant details from Plain.
  2. Resolves real tenant and customer display names when the workspace exposes them, plus representative thread links and owners.
  3. Looks for repeated negative signals such as unresolved pain, escalations, priority spikes, repeated reopenings, billing shock, downgrade pressure, or concentrated issue volume.
  4. If Stripe is available and account matching is reliable, enriches the support signals with subscription, invoice, refund, dispute, failed-payment, contraction, or cancellation context.
  5. Ranks only the clearest at-risk tenants or thread clusters.
  6. Produces one compact risk digest and stops short of making any customer-facing or system-facing changes.
sequenceDiagram
    participant Agent
    participant Plain

    Agent->>Plain: Query bounded recent threads and tenant details
    Plain-->>Agent: Thread status, labels, priority, tenant context
    Agent->>Agent: Score renewal or escalation risk
    Note over Agent: Read-only review, no account mutation
When To Use It
  • weekly CSM or support-lead risk review
  • pre-renewal account health review
  • escalation watch for high-value tenants
  • support-driven churn signal detection
Prerequisites
  • Plain access through the official MCP server
  • Reliable tenant or account context in Plain
  • Optional Stripe access if you want commercial enrichment that separates support pain from true renewal risk
Cursor Cloud Usage
  1. Open Cursor Automations.
  2. Name your automation and paste plain-renewal-risk-digest.md as the automation prompt.
  3. Add the Plain MCP server at https://mcp.plain.com/mcp and complete the OAuth flow.
  4. Optionally add a short workspace note if you want to narrow scope to enterprise, strategic, or renewal-sensitive tenants.
  5. Save the automation.
Codex App Usage
  1. Install the Plain MCP server in Codex:
codex mcp add plain -- npx -y mcp-remote https://mcp.plain.com/mcp
codex mcp list
  1. If Stripe is available in your Codex environment, leave it connected so the automation can enrich support-driven risk with subscription and billing context when matching is reliable.
  2. Click Automation > New Automation.
  3. Name your automation and paste plain-renewal-risk-digest.md as the automation prompt.
  4. Optionally add a short workspace note if you want to narrow scope to enterprise, strategic, or renewal-sensitive tenants.
  5. Set the schedule or run manually and save the automation.
Claude Code Usage
  1. Add the Plain MCP server in Claude Code:
claude mcp add --transport http plain https://mcp.plain.com/mcp
claude mcp list
  1. Open Claude Code and run /mcp to authenticate with Plain.
  2. Optionally prepend a short workspace note if you want to narrow scope to enterprise, strategic, or renewal-sensitive tenants.
  3. For repeated checks in an open Claude Code session, use /loop, for example:
/loop 1w Follow the instructions in automations/plain-renewal-risk-digest/plain-renewal-risk-digest.md
  1. For durable Claude-managed automation, use /schedule or create a Routine in claude.ai/code/routines.
Prompt Inputs

Add context only when scope or risk policy cannot be inferred cleanly, for example:

Only evaluate enterprise and mid-market tenants.
Ignore free workspaces, sandbox tenants, and internal accounts.
Treat repeated unresolved bugs, multiple reopenings within 14 days, urgent threads, and explicit churn language as strong signals.
If Stripe matching is ambiguous, skip Stripe enrichment instead of guessing.
Docs